
	//-- Funzione per la validazione dei campi della FORM
	function ricercaparola(){
		document.forms['generale'].action="http://www.renacoitalia.com/"+"prodotti.php?parola="+document.forms['generale'].search.value;
		document.forms['generale'].submit();
		return true;
	}
	function fattichiamare(){
    numerotel=document.generale.numerotel.value;
    if ((isSingle(numerotel) == false)|| (numerotel == "")) {
    	alert('Il campo Deve essere numerico Ridigitare')
      document.generale.numerotel.focus();
    	return false;
    }else{
      document.forms['generale'].action="http://www.renacoitalia.com/"+"mailrichiamami.php?numero="+document.forms['generale'].numerotel.value;
  		document.forms['generale'].submit();
  		return true;
    }
	}
	function isSingle(s){
    var i;
    var first;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if ((c >= "0") && (c <= "9") || (c==",")){}else{return false;}
    }
    // All characters are numbers.
    return true;
  }
  function popupform(){
    var w=500;
    var h=600;
    var l = Math.floor((screen.width-w)/2);
    var t = Math.floor((screen.height-h)/2);
	  window.open("http://www.renacoitalia.com/page/form.php",'',"width="+w+",height="+h+",top="+t+",left="+l)
  }  
function setStyle(obj,style,value){
		getRef(obj).style[style]= value;
}
function getRef(obj){
		return (typeof obj == "string") ?
			 document.getElementById(obj) : obj;
}
function submitforminterno(nomeform){
  document.generale.action="http://www.renacoitalia.com/"+nomeform;
  document.generale.submit();
  }
function submitformRU(nomeform){
  document.generale.action="http://www.renacoitalia.com/"+nomeform;
  document.generale.submit();
}
function submitformPrivacy(nomeform){
	if (document.generale.privacy.checked!=true) {
		alert("Non e stata accettata la privacy")
		return false;
	}
  document.generale.action="http://www.renacoitalia.com/"+nomeform;
  document.generale.submit();
}
 
function miapopup(thumb,w,h) {
  if (thumb!=""){
    var l = Math.floor((screen.width-w)/2);
    var t = Math.floor((screen.height-h)/2);
	  window.open("http://www.renacoitalia.com/page/foto.php?img="+thumb,'',"width="+w+",height="+h+",top="+t+",left="+l+",scrollbars=1")
  }
}
	function ricaricapagina(i,oper){
		switch (oper){
		case "P":
/*			document.forms["generale"].action="<?php echo $direxternal?>"+"prodotti.php";*/
			document.forms["generale"].pagina.value=i;
			document.forms["generale"].submit();
			break;		
    }
		return true;
	}
  function submitForm(type,IDProdotto,name) {
    switch (type){
  	case 'CC':
  		document.generale.action="http://www.renacoitalia.com/addCartECom.php";
  		document.generale.IDProdotto.value=IDProdotto;
  		document.generale.quantita.value=document.generale.elements['qta'+name].value;
  		//alert(document.generale.quantita.value);
  		document.generale.submit();
  		return true;
  		break;
  	case 'VC':
  		location.href = "http://www.renacoitalia.com/viewcartECom.php";
  		return true;
  		break;
  	}
  }
function confirmorder() {
    document.generale.action="http://www.renacoitalia.com/registrazioneECom.php";
		document.generale.submit();
}
function gotocart() {
    document.generale.action="http://www.renacoitalia.com/viewcartECom.php";
		document.generale.submit();
}
function payment() {
    document.generale.action="http://www.renacoitalia.com/paymentECom.php";
		document.generale.submit();
}


function VisualizzaDiv(div){
  if( document.getElementById(div).style.display == "block"){
    document.getElementById(div).style.display = "none";
  }else{
    document.getElementById(div).style.display = "block";
  }
} 

