var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}
//Enter path of images to be preloaded inside parenthesis. Extend list as desired.
preloadimages("images/base/sbbody-r.png", "images/base/sbhead-r.png", "images/base/sbhead-l.png", "images/base/sbbody-l.png" , "images/base/bkg.gif", "images/base/top_1.png" ,"images/base/bkg_menu.gif")

function showInputPrompt(o, promptText)
{
	if (o)
	{
		if(o.value == '' || trim(o.value).length == 0)
		{
			o.className = 'login11gr';
			o.value = promptText;
		}
	}
}
function hideInputPrompt(o, promptText)
{
	if (o)
	{
		if(o.value == promptText)
		{
			o.className = 'login';
			o.value = '';
		}
	}
}
function Strike(strID,isStrikeout)
{
	var objSource=document.getElementById(strID);
	if(objSource)
	{
		if(isStrikeout==true)
			objSource.className='SearchStringStrike';
		else
			objSource.className='';
	}
}
function logout()
{
	url = String(location);
	var re = new RegExp("[.]asp[?]$","g");
	var re1 = new RegExp("[.]asp[?]","g");
	var re2 = new RegExp("[.]asp$","g");
	var re3 = new RegExp("[.]com/$","g");
	if (url.match(re))
		url = url + "login=exit";
	else if (url.match(re1))
		url = url + "&login=exit";
	else if (url.match(re2))
		url = url + "?login=exit";
	else if (url.match(re3))
		url = url + "default.asp?login=exit";
	else
		url = url + "&login=exit";
	location.href = url;
}
function Ricerca(form) 
{
	param = "ricerca";
	value = form.ricerca.value;
	if (value == "Testo/Codice")
		value = ""
	value1 = document.ricerca.solo_dispo.checked;
	value2 = document.ricerca.solo_promo.checked;
	value3 = document.ricerca.solo_nuovo.checked;
	trasferisci(param,value,value1,value2,value3)
}
function trasferisci(param,value,value1,value2,value3)
{
   url = String(location);
   var re = new RegExp("com/$","i");
   url = url.replace(re,'com/ecomm.asp?ricerca=value');
   if (param == "ricerca")
   		var re = new RegExp("(.com/.*)","g") //RegExp("(.com/.*?.asp)","g")
  		url = url.replace(re,'.com/ecomm.asp?ricerca=value')
   var re = new RegExp("(&solo_.....=true)","g");
   url = url.replace(re,'')
   var re = new RegExp("(&solo_.....=false)","g");
   url = url.replace(re,'')
   // controlla value
   var re = new RegExp("([?|&|/|\|_|%|<|>])","g");
   if (value.match(re))
	  value = escape(value.replace(re,''));
   else
   	   value = escape(value)
   //sotituisci parametro &x=y
   var re = new RegExp("([?|&])" + param + "=.*?(&|$)","i");
   if (url.match(re))
       linka = url.replace(re,'$1' + param + "=" + value + '$2');
   else
       linka = url + '&' + param + "=" + value;
   //check parametri ricerca
   if (param == "ricerca")
  	   linka = linka + "&solo_dispo" + "=" + value1 + "&solo_promo" + "=" + value2 + "&solo_nuovo" + "=" + value3;
   location.href = linka;
}
function gotourl(param,value,param2,value2,param3,value3,param4,value4,param5,value5,param6,value6)
{
   url = String(location.hostname);
   linka = "http://" + url + '/' + param + "_" + value;
   if (value2)
   		linka = linka + "&" + param2 + "=" + value2;
   if (value3)
   		linka = linka + "&" + param3 + "=" + value3;
   if (value4)
   		linka = linka + "&" + param4 + "=" + value4;
   if (value5)
   		linka = linka + "&" + param5 + "=" + value5;
   if (value6)
   		linka = linka + "&" + param6 + "=" + value6;
   location.href = linka;
}
function onEnter( evt, frm ) {
var keyCode = null;

if( evt.which ) {
keyCode = evt.which;
} else if( evt.keyCode ) {
keyCode = evt.keyCode;
}
if( 13 == keyCode ) {
frm.btnricerca.click();
return false;
}
return true;
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
function submitForm()

{
document.form1.submit();
}

