// JavaScript Document

function clearField(fld) { 
  if ( (fld.value == "Zona...") || (fld.value == "CAP") || (fld.value == "Negozio...") || (fld.value == "Prodotto...") ) 
  fld.value = ""; 
} 

function ProdSFPI(theURL,winName,features) { 
  window.open(theURL,winName,features);
} 

function ShopSFPI(theURL,winName,features) { 
  window.open(theURL,winName,features);
} 

function SetSFPI(URL) { 
opener.location.href = URL; 
window.close(); 
} 


function tab(tabid) {  
	if (tabid == 'tab1') { 
		document.getElementById('tab1').className = 'tab_active';
		document.getElementById('tab2').className = 'tab_passive';
		// document.joinus.nick.focus;
		document.getElementById('tlayer2').style.visibility = 'hidden'; 
		document.getElementById('tlayer1').style.visibility = 'visible'; 
	} 
	if (tabid == 'tab2') { 
		document.getElementById('tab2').className = 'tab_active';
		document.getElementById('tab1').className = 'tab_passive';
		document.getElementById('tlayer1').style.visibility = 'hidden'; 
		document.getElementById('tlayer2').style.visibility = 'visible'; 
	} 
} 

function jump(url) { 
	window.location.href = url; 
} 

function setresults(url) { 
	numofsets = document.getElementById('sets').value; 
	window.location.href = url+numofsets; 
} 

function changeLocation() { 
	if (document.getElementById('geoselectlayer').style.visibility == 'visible') { 
		document.getElementById('geoselectlayer').style.visibility = 'hidden';
	}
	else { 
		document.getElementById('geoselectlayer').style.visibility = 'visible';
	} 
} 

function changeCompareLocation() { 
	if (document.getElementById('compareplaceselectlayer').style.visibility == 'visible') { 
		document.getElementById('compareplaceselectlayer').style.visibility = 'hidden';
	}
	else { 
		document.getElementById('compareplaceselectlayer').style.visibility = 'visible';
	} 
} 

function setLocation(commune,currentpage,language) { 
	if (document.getElementById('geoselectlayer').style.visibility == 'visible') { 
		document.getElementById('geoselectlayer').style.visibility = 'hidden'; 
		// document.change_location.newplace.value = commune; 
		// document.change_location.submit(); 
		window.location.href = currentpage+'&place='+commune;
	}
} 

function hideLayer(layerid) { 
	document.getElementById(layerid).style.visibility = 'hidden'; 
} 

function show(layerid) { 
	document.getElementById(layerid).style.visibility = 'visible'; 
} 

function hide(layerid) { 
	document.getElementById(layerid).style.visibility = 'hidden'; 
} 

function hideLayerAndUpdatePage(thelayer,theurl) { 
	document.getElementById(thelayer).style.visibility = 'hidden'; 
	window.location.href = theurl; 
} 

function explain(layer,cell,what) { 
	document.getElementById(layer).style.visibility = 'visible';
	document.getElementById(cell).innerHTML = what;
} 

function hideexplain(layer) { 
	document.getElementById(layer).style.visibility = 'hidden';
} 
