var z_index = 5;
function show_hyde(id) {
	if(document.getElementById(id).style.visibility == 'hidden' || document.getElementById(id).style.visibility == ''){
	 document.getElementById(id).style.zIndex = z_index.toString();
	 z_index++;
	 document.getElementById(id).style.visibility = 'visible';
	}
	else{
		document.getElementById(id).style.visibility = 'hidden';
	}
}
function show(id) {
	document.getElementById(id).style.zIndex = z_index.toString();
	z_index++;
	document.getElementById(id).style.visibility = 'visible';
}
function hyde(id) {
	document.getElementById(id).style.visibility = 'hidden';
}
function rePosition(id) {
	document.getElementById(id).style.left = ( Math.round((window.screen.width/2)-(document.getElementById(id).offsetWidth/2)) )+"px";
	document.getElementById(id).style.top = ( Math.round(document.body.parentNode.scrollTop+(window.screen.height/2)-(document.getElementById(id).offsetHeight/2)-130) )+"px";
}
/*function setSndPrivForm( fromid, toid, subject, tonome, mode ) {
	document.getElementById('snd_priv_fromid').value = fromid;
	document.getElementById('snd_priv_toid').value = toid;
	document.getElementById('snd_priv_subject').value = subject;
	document.getElementById('snd_priv_toname').value = tonome;
	document.getElementById('snd_priv_toname').readOnly = true;
	document.getElementById('snd_priv_mode').value = mode;
	if( mode == 'mail' ) {
		document.getElementById('send_priv_titolo').firstChild.data = ". . : INVIA UNA NUOVA E-MAIL : . .";
	}
	else {
		if( mode == 'mexpriv') {
			document.getElementById('send_priv_titolo').firstChild.data = ". . : INVIA UN MESSAGGIO PRIVATO : . .";
		}
	}
}
function setContact(who,icq,msn,yim,aim,fromid,toid,subject)
{
	var regexp = /'/;
	who = who.replace(regexp,"\\'");
	subject = subject.replace(regexp,"\\'");
	
	document.getElementById('contact_titolo').firstChild.data = ". . : CONTATTA '"+who.toUpperCase()+"' : . ."; 
	document.getElementById('a_mexpriv').href = "javascript:show('send_priv');setSndPrivForm("+fromid+","+toid+",'"+subject+"','"+who+"','mexpriv');";
	document.getElementById('a_mail').href = "javascript:show('send_priv');setSndPrivForm("+fromid+","+toid+",'"+subject+"','"+who+"','mail');";
	if( icq == '' )	{
		document.getElementById('a_icq').style.display = 'none';
	}
	else {
		document.getElementById('a_icq').style.display = 'inline';
		document.getElementById('a_icq').href = "http://wwp.icq.com/scripts/search.dll?to="+icq;
	}
	if( msn == '' ) {
		document.getElementById('a_msn').style.display = 'none';
	}
	else {
		document.getElementById('a_msn').style.display = 'inline';
		document.getElementById('a_msn').href = "javascript:window.alert('"+msn+"')";
	}
	if( yim == '' ) {
		document.getElementById('a_yim').style.display = 'none';
	}
	else {
		document.getElementById('a_yim').style.display = 'inline';
		document.getElementById('a_yim').href = "http://edit.yahoo.com/config/send_webmesg?.target="+yim+"&.src=pg";
	}
	if( aim == '' ) {
		document.getElementById('a_aim').style.display = 'none';
	}
	else {
		document.getElementById('a_aim').style.display = 'inline';
		document.getElementById('a_aim').href = "aim:goim?screenname="+aim+"&message=Hello+Are+you+there?";
	}
}*/
function openclose(id)
{
	if(document.getElementById(id).style.display == 'none' || document.getElementById(id).style.display == ''){
	 document.getElementById(id).style.display = 'block';
	}
	else{
		document.getElementById(id).style.display = 'none';
	}
}
/*function baz_sort(ordina_per, direzione){
	document.sort_frm.ordina_per.value = ordina_per;
	document.sort_frm.direzione.value = direzione;
	document.sort_frm.submit();
}
function open_zeroprices(frm_name)
{
	var regexp = /\blibri\W\d+\W\Wprezzo\W/;
	var regexp2 = /\W\W/;
	var frm_elements = document.forms[frm_name].elements;
	for(var i = 0; i < frm_elements.length; i++)
	{
		if( regexp.test( frm_elements[i].name) )
		{
			if( frm_elements[i].value == 0 ){
				openclose('dettagli_'+ frm_elements[i].name.substring(6,frm_elements[i].name.search(regexp2)) );
			}
		}
	}
}
var arr = new Array();
function check(id)
{
	var chkb = document.getElementById('chkb_'+id);
	var tr = document.getElementById('tr_'+id);
	if( arr[id] == undefined ){ arr[id] = tr.style.backgroundColor; }
	if( chkb.checked )
	{
		chkb.checked = false;
		tr.style.backgroundColor = arr[id];
	}
	else
	{
		chkb.checked = true;
		tr.style.backgroundColor = '#9999FF';
	}
}*/