
//popup
function popup(URL,NOME,WIDTH,HEIGHT,PROPRIETA) {
	
	//alert(PROPRIETA);
	if(PROPRIETA == ''){
		PROPRIETA = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0';
	}
	win = window.open(URL,NOME,PROPRIETA + ',width=' + WIDTH + ',height=' + HEIGHT + '');
	
	//qui ridimensiono il popup...così se lo stesso popup è già aperto gli cambio le dimensioni...
	H = parseInt(HEIGHT) + 81; 
	W = parseInt(WIDTH) + 10;
	win.resizeTo(W,H);
	win.focus();
}


// show/hide box in Home page
var elem = new Array('boxNotizie','boxOfferte','boxFineSerie');
var voci = new Array('bhm1','bhm2','bhm3');
function show(obj,obj2){
for(i = 0; i < 3; i++){
  document.getElementById(elem[i]).style.display="none";
  document.getElementById(voci[i]).style.color="FFFFFF";
 }
  document.getElementById(obj).style.display="block";
  document.getElementById(obj2).style.color="0069D4";
}


// show/hide form modifica indirizzo spedizione in carrello
function showHide(obj){
	if(document.getElementById(obj).style.display == "none"){
		document.getElementById(obj).style.display = "block";
	} else {
		document.getElementById(obj).style.display = "none";
	}
}

function set_pointer(ID,COLORE){
	//i nomi dei colori vanno scritti in minuscolo!!!!
	document.getElementById(ID).style.backgroundColor = COLORE;
}

function cleanFilter(target)
{
	//Funzione ad hoc per la pulizia dei filtri di ricerca
	document.getElementById('ricercaLibera').value = '';
	document.getElementById('cercaMarca').selectedIndex = 0;
	document.getElementById('cercaCategoria').selectedIndex = 0;
	document.getElementById('cercaFamiglia').selectedIndex = 0;
	document.getElementById('chkOfferte').checked = "";
	document.getElementById('chkNovita').checked = "";	
	
	if (target == 'home')
	{
		//document.formRicercaHome.submit();
	}
	
	if (target == 'ricerca')
	{
		document.formRicerca.submit();
	}	
}

function swapCheck(obj)
{
	if (obj.name == "chkOfferte")
	{
		if (obj.checked == "checked")
		{
			document.getElementById("chkNovita").checked = "checked";
		}else
		{
			document.getElementById("chkNovita").checked = "";		
		}
	}
	
	if (obj.name == "chkNovita")
	{
		if (obj.checked == "checked")
		{
			document.getElementById("chkOfferte").checked = "checked";
		}else
		{
			document.getElementById("chkOfferte").checked = "";		
		}
	}	
}

function condizioniAcquisto()
{
	if (document.getElementById("chkCondizioni").checked == "")
	{	
		document.getElementById("divCondizioni").style.display = "block";
	}else
	{
		document.getElementById("divCondizioni").style.display = "none";	
		document.getElementById("formSpedizione").submit();		
	}

}

