// JAVASCRIPT STANDARDS

function searchProds(val) { 
	document.getElementById('ajaxquicksearch').style.visibility = 'visible';
	xajax_searchproducts(val); 
} 

function jump(tid) { 
	window.open('/out.php?tid='+tid); 
} 

function showProduct(tid) { 
	window.open('/prodotti.php?tid='+tid); 
} 

function ricerca(val) { 
	window.location.href = '/ricerca.php?q='+val; 
} 

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

function clearField(fld) { 
  	if ( fld.value == "trovalo..." ) 
  	fld.value = ""; 
} 

function initiateSearch(fld) { 
  	if ( fld.value == "trovalo..." ) { fld.value = ""; } 
	ajaxsearch = document.getElementById('ajaxquicksearch');
	ajaxsearch.style.visibility = 'visible';
	if ( fld.value != "trovalo..." && fld.value != "" ) { searchProds(fld.value); } 
} 

function showSearch() { 
	document.getElementById('ajaxquicksearch').style.visibility = 'visible';
} 

function hideSearch() { 
	document.getElementById('ajaxquicksearch').style.visibility = 'hidden';
} 

function showBrands() { 
	document.getElementById('brands').style.visibility = 'visible';
} 

function hideBrands() { 
	document.getElementById('brands').style.visibility = 'hidden';
} 

function productInfo(layer) { 
	document.getElementById(layer).style.visibility = 'visible';
} 

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

function button(id,file) { 
	document.getElementById(id).src = '/images/'+file; 
} 

function preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

xajax.callback.global.onRequest = function() {xajax.$('loadpallet').style.display='block';} 
xajax.callback.global.beforeResponseProcessing = function() {xajax.$('loadpallet').style.display='none';} 

