//Utility function to find element by id Cross Browser
function findElementById(id){return ( document.all+"" != "undefined" ? document.all[id] : document.getElementById(id) );}

// Display instruction text [str] if field is blank
// Clear instruction text if field is clicked
function resetField(obj,str){
	if(obj.value.length==0){obj.value=str;return;}
	if(obj.value==str){obj.value="";}
}

function openPdvHome(sel){var ind = sel.options[sel.selectedIndex].value;if(ind != 0){window.location = "http://www.iper.it/home-punto-vendita.php?id="+ind;}}

function openPopupCenter(url,name,ww,hh){
	var oWin;
	var pars=",top="+Math.floor((screen.height-hh)/2)+",left="+Math.floor((screen.width-ww)/2);
	oWin=window.open(url,name,'width='+ww+',height='+hh+',scrollbars=yes,toolbar=0,menubar=0,resizable=0'+pars);
	return oWin;
}
