// JavaScript Document

//Mouse-Over
{
alt0 = new Image();
alt0.src = "../../images/mappa/img_reg_empty.gif";

alt1 = new Image();
alt1.src = "../../images/mappa/img_reg_lazio.gif";

alt2 = new Image();
alt2.src = "../../images/mappa/img_reg_puglia.gif";

alt3 = new Image();
alt3.src = "../../images/mappa/img_reg_sicilia.gif";

alt4 = new Image();
alt4.src = "../../images/mappa/img_reg_sardegna.gif";

alt5 = new Image();
alt5.src = "../../images/mappa/img_reg_toscana.gif";

alt6 = new Image();
alt6.src = "../../images/mappa/img_reg_campania.gif";

alt7 = new Image();
alt7.src = "../../images/mappa/img_reg_molise.gif";

alt8 = new Image();
alt8.src = "../../images/mappa/img_reg_abruzzo.gif";

alt9 = new Image();
alt9.src = "../../images/mappa/img_reg_marche.gif";

alt10 = new Image();
alt10.src = "../../images/mappa/img_reg_emilia.gif";

alt11 = new Image();
alt11.src = "../../images/mappa/img_reg_calabria.gif";

alt12 = new Image();
alt12.src = "../../images/mappa/img_reg_liguria.gif";

alt13 = new Image();
alt13.src = "../../images/mappa/img_reg_veneto.gif";

alt14 = new Image();
alt14.src = "../../images/mappa/img_reg_basilicata.gif";

alt15 = new Image();
alt15.src = "../../images/mappa/img_reg_umbria.gif";

alt16 = new Image();
alt16.src = "../../images/mappa/img_reg_friuli.gif";

alt17 = new Image();
alt17.src = "../../images/mappa/img_reg_piemonte.gif";

alt18 = new Image();
alt18.src = "../../images/mappa/img_reg_valdaosta.gif";

alt19 = new Image();
alt19.src = "../../images/mappa/img_reg_lombardia.gif";

alt20 = new Image();
alt20.src = "../../images/mappa/img_reg_trentino.gif";

graphic1= new Image();
graphic1.src = "../../images/mappa/img_ita_empty.gif";
graphic1on = new Image();
graphic1on.src = "../../images/mappa/img_ita_lazio.gif";

graphic2= new Image();
graphic2.src = "../../images/mappa/img_ita_empty.gif";
graphic2on = new Image();
graphic2on.src = "../../images/mappa/img_ita_puglia.gif";

graphic3= new Image();
graphic3.src = "../../images/mappa/img_ita_empty.gif";
graphic3on = new Image();
graphic3on.src = "../../images/mappa/img_ita_sicilia.gif";

graphic4= new Image();
graphic4.src = "../../images/mappa/img_ita_empty.gif";
graphic4on = new Image();
graphic4on.src = "../../images/mappa/img_ita_sardegna.gif";

graphic5= new Image();
graphic5.src = "../../images/mappa/img_ita_empty.gif";
graphic5on = new Image();
graphic5on.src = "../../images/mappa/img_ita_toscana.gif";

graphic6= new Image();
graphic6.src = "../../images/mappa/img_ita_empty.gif";
graphic6on = new Image();
graphic6on.src = "../../images/mappa/img_ita_campania.gif";

graphic7= new Image();
graphic7.src = "../../images/mappa/img_ita_empty.gif";
graphic7on = new Image();
graphic7on.src = "../../images/mappa/img_ita_molise.gif";

graphic8= new Image();
graphic8.src = "../../images/mappa/img_ita_empty.gif";
graphic8on = new Image();
graphic8on.src = "../../images/mappa/img_ita_abruzzo.gif";

graphic9= new Image();
graphic9.src = "../../images/mappa/img_ita_empty.gif";
graphic9on = new Image();
graphic9on.src = "../../images/mappa/img_ita_marche.gif";

graphic10= new Image();
graphic10.src = "../../images/mappa/img_ita_empty.gif";
graphic10on = new Image();
graphic10on.src = "../../images/mappa/img_ita_emilia.gif";

graphic11= new Image();
graphic11.src = "../../images/mappa/img_ita_empty.gif";
graphic11on = new Image();
graphic11on.src = "../../images/mappa/img_ita_calabria.gif";

graphic12= new Image();
graphic12.src = "../../images/mappa/img_ita_empty.gif";
graphic12on = new Image();
graphic12on.src = "../../images/mappa/img_ita_liguria.gif";

graphic13= new Image();
graphic13.src = "../../images/mappa/img_ita_empty.gif";
graphic13on = new Image();
graphic13on.src = "../../images/mappa/img_ita_veneto.gif";

graphic14= new Image();
graphic14.src = "../../images/mappa/img_ita_empty.gif";
graphic14on = new Image();
graphic14on.src = "../../images/mappa/img_ita_basilicata.gif";

graphic15= new Image();
graphic15.src = "../../images/mappa/img_ita_empty.gif";
graphic15on = new Image();
graphic15on.src = "../../images/mappa/img_ita_umbria.gif";

graphic16= new Image();
graphic16.src = "../../images/mappa/img_ita_empty.gif";
graphic16on = new Image();
graphic16on.src = "../../images/mappa/img_ita_friuli.gif";

graphic17= new Image();
graphic17.src = "../../images/mappa/img_ita_empty.gif";
graphic17on = new Image();
graphic17on.src = "../../images/mappa/img_ita_piemonte.gif";

graphic18= new Image();
graphic18.src = "../../images/mappa/img_ita_empty.gif";
graphic18on = new Image();
graphic18on.src = "../../images/mappa/img_ita_valdaosta.gif";

graphic19= new Image();
graphic19.src = "../../images/mappa/img_ita_empty.gif";
graphic19on = new Image();
graphic19on.src = "../../images/mappa/img_ita_lombardia.gif";

graphic20= new Image();
graphic20.src = "../../images/mappa/img_ita_empty.gif";
graphic20on = new Image();
graphic20on.src = "../../images/mappa/img_ita_trentino.gif";

}
function imageChange(imageID,imageName) {


{
document.images[imageID].src = eval(imageName + ".src");
//document.images[imageID2].src = eval(imageName2 + ".src");
}

}



//BRUX

function setConfezione(){
 ind = document.fmMod.cons.selectedIndex;
 conserva = document.fmMod.cons.options[ind].value;
 if (conserva == brux) return;
 brux = conserva;	 
 while (document.fmMod.conf.options.length > 0) {
	document.fmMod.conf.options[0] = null;	
 }
 if ((conserva == "conserve - olio di semi") || (conserva == "conserve - olio d'oliva")) {
     addConfezione("lattina o latta","lattina o latta");
     addConfezione("----------------------");
     addConfezione("lattina o latta","lattina o latta");
     addConfezione("vasetto","vasetto");
     addConfezione("secchiello","secchiello");
     addConfezione("vaschetta","vaschetta");
     addConfezione("busta normale","busta normale");
 }
 if (conserva == "marinati") {
     addConfezione("vassoio","vassoio");
     addConfezione("----------------------");		
     addConfezione("vassoio","vassoio");
     addConfezione("latta","latta");
     addConfezione("vasetto","vasetto");
     addConfezione("blistati","blistati");
 }	

 if (conserva == "sotto sale") {
     addConfezione("latta","latta");
     addConfezione("----------------------");
     addConfezione("latta","latta");
     addConfezione("busta normale","busta normale");
 }

 if ((conserva == "affumicati - filetti") || (conserva == "affumicati - tranci") || (conserva == "affumicati - affettato")) {
     addConfezione("busta sottovuoto","busta sottovuoto");	
 }
	
 if (conserva == "secchi") {
     addConfezione("busta normale","busta normale");
     addConfezione("----------------------");
     addConfezione("busta normale","busta normale");
     addConfezione("busta sottovuoto","busta sottovuoto");
 }

 if (conserva == "altro") {
     addConfezione("vassoio 1 (skin)","vassoio 1 (skin)");
     addConfezione("----------------------");
     addConfezione("vassoio 1 (skin)","vassoio 1 (skin)");
     addConfezione("vassoio 2","vassoio 2");
     addConfezione("busta normale","busta normale");
     addConfezione("busta sottovuoto","busta sottovuoto");
     addConfezione("cartone","cartone");
     addConfezione("termo","termo");
     addConfezione("sacchetto","sacchetto");
     addConfezione("latta","latta");
     addConfezione("vasetto","vasetto");
     addConfezione("altro","altro");		
 }

 document.fmMod.conf.selectedIndex = 0;
}

function addConfezione(txt,val) {
     free = document.fmMod.conf.options.length;
     var opt = new Option (txt,val);
     document.fmMod.conf.options[free] = opt;
}

function variabile() 
{
	ind = document.fmMod.cons.selectedIndex;
        brux = document.fmMod.cons.options[ind].value;
	ind2 = document.fmMod.conf.selectedIndex;
	confdb = document.fmMod.conf.options[ind2].value;
}

//FINE BRUX

// Alessio

function ActionNewAccount() {
  var v2 = GetCookie ('PK');
  window.open("../../bin/upmercman.exe/NewAccount?PK="+v2+"","_parent","");
}

function UserEdit(id, id1, id2) {
  window.open("../../bin/upmercman.exe/edituser?pk="+id+"&userid="+id1+"&sCode="+id2+"","_parent","");
}
function SaveNewUser()
 {
   if      (document.formNewAccount.sUserid.value=="")    {alert ('Campo "User-Name" valore obbligatorio !') }  
   else    {
   if      (document.formNewAccount.sCode.value=="")    {alert ('Campo "Terminal-ID" valore obbligatorio !') }  
   else    {		
		document.formNewAccount.method='POST';		
	        document.formNewAccount.action='../../bin/Upmercman.exe/SaveNewUser';
		document.formNewAccount.submit();
	   }
	   }
 }
 
 function ModUser()
 {   
   if      (document.editAc.sCode.value=="")    {alert ('Campo "Terminal-ID" valore obbligatorio !') }  
   else    {		
		document.editAc.method='POST';		
	    document.editAc.action='../../bin/Upmercman.exe/Editsave';
		document.editAc.submit();
	   }
	   
 }  
   
function UserDelete(id, id1){
  if (!confirm("Attenzione."+"Lei sta per cancellare irreversibilmente utente "+id1+". Continua ?"))
   { }
  else {window.open("../../bin/upmercman.exe/deleteuser?pk="+id+"&userid="+id1+"","_parent","")};  
}
function ActionbackAccount(id) {
  window.open("../../bin/upmercman.exe/entermanager?pk="+id+"","_parent","");
}
// Fine Alessio

//Antonio
var precedente="agg";
  function Mos(value1,value2){
		if (document.layers){		
		 document.layers[value1].visibility='show';
                 document.layers[value2].visibility='show';
		 }
		else {		 
		 document.all[value1].style.visibility='visible';
                 document.all[value2].style.visibility='visible';
		}
		precedente=value1; 
   }   

function ActionLinkPKEXE(v1, l1)
 {
  var v2 = GetCookie ('PK');
  document.location.href='../../bin/'+ l1 +'.exe/' + v1 + '?PK=' + v2 + ''; 
 }

function Carat(parola,numero){    
   var pas=parola.length; 
   var app=parola;      
   if (pas>1)
    {  
	 app=parola.charAt(pas-1);	  
	}	
   if (!((app==",")||(app==".")||(app=="0")||(app=="1")||(app=="2")||(app=="3")||(app=="4")||(app=="5")||(app=="6")||(app=="7")||(app=="8")||(app=="9")))
    { 
	  document.all["Aum"].value="0"; 
    }
}

var setAct = '';

function SetActions(id) {
	if (id == "add")
	 {(setAct="pre")}
    else {setAct="reg"};
}

function openActions() {
    document.fmMod.action="/bin/upesp.exe/"+setAct+"";
}

function ins1() {
   	if (document.fmMod.codp.value=="")
	{ alert ('Attenzione!! Inserire il codice azienda') }	
	else {
	      if (document.fmMod.Pezz.value=="") 	  
		     {alert ('Attenzione!! Inserire il nome azienda') } 
	else {
	      if (document.fmMod.cons.value=="") 	  
		     {alert ('Attenzione!! Inserire la provincia') } 	
	else
	     {
		 document.fmMod.action="/bin/upesp.exe/reg";				 
		 }
		 
		 } 
		 }
		 		 		 		 		 		          		 
}

function ins1Asp() {
   	if (document.fmMod.codp.value=="")
	{ alert ('Attenzione!! Inserire il codice azienda') }	
	else {
	      if (document.fmMod.Pezz.value=="") 	  
		     {alert ('Attenzione!! Inserire il nome azienda') } 
	else {
	      if (document.fmMod.cons.value=="") 	  
		     {alert ('Attenzione!! Inserire la provincia') } 
	else {
	      if (document.fmMod.conf.value=="") 	  
		     {alert ('Attenzione!! Inserire la citt') } 	
	else
	     {
		 document.fmMod.action="/espo/actionEspo.asp?OPE=ins";				 
		 }
		 
		 } 
		 }
		 }
		 		 		 		 		 		          		 
}


function ins2() {
   	if (document.fmMod.Pezz.value=="")
	{ alert ('Attenzione!! Inserire il nome azienda') }		
	else {
	      if (document.fmMod.cons.value=="") 	  
		     {alert ('Attenzione!! Inserire la provincia') } 	
	else
	     {
		 document.fmMod.action="/bin/upesp.exe/modifica";				 
		 }
		 
		 
		 }
		 		 		 		 		 		          		 
}


function ins2Asp() {
   	if (document.fmMod.Pezz.value=="")
	{ alert ('Attenzione!! Inserire il nome azienda') }		
	else {
	      if (document.fmMod.cons.value=="") 	  
		     {alert ('Attenzione!! Inserire la provincia') } 	
	else
	     {
		 document.fmMod.action="/espo/actionEspo.asp?OPE=mod";				 
		 }
		 
		 
		 }
		 		 		 		 		 		          		 
}


function ActionLinkPK2(v1, l1,v3)
 {
  document.location.href='' + l1  + v1 + '?PK=' + v3 + '';
 }

function openCanc(id,id2,id3,id4){
 var mom =("../upesp.exe/canc?pk="+id+"&Prod="+id2+"&Status="+id3+"&Desc="+id4);
  if (!confirm("Attenzione."+"Lei sta per cancellare irreversibilmente un prodotto. Desidera continure?"))
   { }
  else { window.open(mom,"_parent","")}; 
  
}

function openCancAsp(id){

  var mom =('/espo/actionEspo.asp?OPE=can&id='+id+'');
  if (!confirm("Attenzione."+"Lei sta per cancellare irreversibilmente l''azienda. Desidera continure?"))
   { }
  else { window.open(mom,"_parent","")}; 
}

//Fine Antonio

// Max
var TipoPrgMercato = '.exe/'
var TipoPrgUnipmsg = '.exe/'

function ActionMsg()
{
 //document.location.href='../../bin/' + v1 + TipoPrgUnipmsg + v2 + '?NR='+ v3 + '&PR=' + v4 + '';
 document.location.href='/messaggi/msgview.asp?n=0';
}

function Action2(v1)
 {
   document.formIns.method='POST';
   document.formIns.action='../../bin/mercato' + TipoPrgMercato + v1 + '';
   document.formIns.submit();
 }

function Action3(v3)
 {
  	var v1 = GetCookie ('LI');  
  	var v2 = GetCookie ('PK');
  	document.location.href='../../bin/mercato' + TipoPrgMercato + v1 + '?PK=' + v2 + '&AZ=' + v3 + ''; 
 }

function ActionLink(v1)
 {
  	document.location.href='../../bin/mercato' + TipoPrgMercato + v1 + '';
 }

function ActionLinkPK(v1, l1) 
{
  	var v2 = GetCookie ('PK');
   	document.location.href='../../bin/'+ l1 + TipoPrgMercato + v1 + '?PK=' + v2 + '';
    //* document.location.href='../../bin/'+ l1 +'.exe/' + v1 + '?PK=' + v2 + ''; 
}

function ActionLinkPK1(v1, l1)
 {
  	var v2 = GetCookie ('PK');
  	document.location.href='' + l1  + v1 + '?PK=' + v2 + '';
 }

function Action2LinkPK(v1,v3)
 {
	var v2 = GetCookie ('PK');
  	document.location.href='../../bin/mercato' + TipoPrgMercato + v1 + '?PK=' + v2 +  v3 + '';
 }

function Action5(v1)
 { 
	var v2 = GetCookie ('PK');
	document.formIns.method='POST';		
    document.formIns.action='../../bin/mercato' + TipoPrgMercato + v1 + '?PK=' + v2 + '';
	document.formIns.submit();
 }

function CtrIns(v1,v2)
 {
        var vstato ='';
	if (v2== 'anains' || v2== 'accedit' || v2== 'anains2' || v2== 'accedit2' || v2== 'anains3' || v2== 'accedit3' || v2== 'accedit4')
        {
		if (document.formIns.FirstText.value=="") 	  {alert ('Campo "Nome" valore obbligatorio ! - The "First field"  it is compulsory !') ; vstato='N';}
		if (document.formIns.LastText.value=="")     {alert ('Campo "Cognome" valore obbligatorio ! - The "Last field"  it is compulsory !')  ; vstato='N';}
		if (document.formIns.CityText.value=="")     {alert ('Campo "Citt" valore obbligatorio ! - The "City field"  it is compulsory !') ; vstato='N';}
		if (document.formIns.PhoneText.value=="")    {alert ('Campo "Telefono" valore obbligatorio ! - The "Phone field"  it is compulsory !') ; vstato='N';}
		}
	if (v2== 'anains' || v2== 'anains2' || v2== 'anains3')
    	{if (document.formIns.UserIDText.value=="")   {alert ('Campo "Utente" valore obbligatorio ! - The "User field"  it is compulsory !') ; vstato='N';}}
	if (v2== 'anains' || v2== 'anains2' || v2== 'anains3' || v2== 'accepwd')
		{
		if (document.formIns.PassText.value=="")     {alert ('Campo "Password" valore obbligatorio ! - The "Password field"  it is compulsory !') ; vstato='N';}
		if (document.formIns.PassText2.value=="")    {alert ('Campo "Conferma password" valore obbligatorio ! - The "Confirmation password field"  it is compulsory !') ; vstato='N';}
		if (document.formIns.PassText.value!=document.formIns.PassText2.value) {alert  ('Il campo "Conferma password" non  uguale al campo Password ! - The field "Confirmation password" is not the same as the Password field !') ; vstato='N';}
		}
	if (v2== 'anains' || v2== 'accedit' || v2== 'anains2' || v2== 'anains3' || v2== 'accedit3' || v2== 'accedit4')
		{if (document.formIns.MailText.value=="")     {alert ('Campo "E-Mail" valore obbligatorio ! - The "Password field"  it is compulsory !') ; vstato='N';}}
	if (v2== 'anains2' || v2== 'accedit2' || v2== 'anains3' || v2== 'accedit3' || v2== 'accedit4')
		{
		if (document.formIns.AddrText.value=="")    {alert ('Campo "Via" valore obbligatorio ! - The "Address field"  it is compulsory !') ; vstato='N';}
		if (document.formIns.ZipText.value=="")    {alert ('Campo "CAP" valore obbligatorio ! - The "Zip field"  it is compulsory !') ; vstato='N';}
		if (document.formIns.StateText.value=="")    {alert ('Campo "Provincia" valore obbligatorio ! - The "State field"  it is compulsory !') ; vstato='N';}
		if (document.formIns.CountryText.value=="")    {alert ('Campo "Paese" valore obbligatorio ! - The "Country field"  it is compulsory !') ; vstato='N';}
		}
	if (v2== 'msgins' || v2== 'msgedit')
		{
		if (document.formIns.ProdText.value=="")    {alert ('Campo "Categoria prodotto" valore obbligatorio ! - The "Product category field"  it is compulsory !') ; vstato='N';}
		if (document.formIns.DescText.value=="")     {alert ('Campo "Oggetto" valore obbligatorio ! - The "Object field"  it is compulsory !') ; vstato='N';}
		if (document.formIns.TestoTextarea.value=="")     {alert ('Campo "Testo del Messaggio" valore obbligatorio ! - The "Text of the message field"  it is compulsory !') ; vstato='N';}
		}

	/*if (v2== 'anains3' || v2== 'accedit3' || v2== 'accedit4')
		{
		if (document.formIns.PivaText.value=="")     {alert ('Campo "Partita IVA" valore obbligatorio ! - The "Partita IVA field"  it is compulsory !') ; vstato='N';}
		if (document.formIns.RagsocText.value=="")     {alert ('Campo "Ragione Sociale" valore obbligatorio ! - The "Name field"  it is compulsory !') ; vstato='N';}
		if (document.formIns.ShipMode1Text.value=="")     {alert ('Campo "Tipo spedizione n 1" valore obbligatorio ! - The "Kind of shipment n 1 field"  it is compulsory !') ; vstato='N';}
		if (document.formIns.ShipValue1Text.value=="")     {alert ('Campo "Costo spedizione n 1" valore obbligatorio ! - The "Cost of the shipment n 1 field"  it is compulsory !') ; vstato='N';}
		}*/
	if (v2== 'anains2' || v2== 'accedit2')
		{
		if (document.formIns.ShipModeText.value=="")     {alert ('Campo "Tipo spedizione" valore obbligatorio ! - The "Kind of shipment field"  it is compulsory !') ; vstato='N';}
		}
	
	if (v2== 'datapay'){vstato='Pay'}
	
	if( vstato=='')
		{
			var vcheck1 = '';
			var vcheck2 = '';
			var vcheck3 = '';
			if (v2== 'anains' || v2== 'anains2' || v2== 'anains3' || v2== 'accedit2' || v2== 'accedit3')
				{
				vcheck1='no';
				if (document.formIns.radio1[0].checked==true)	{vcheck1= 'ok';}
				}
				
			if (v2== 'anains' || v2== 'anains2' || v2== 'anains3')
				{
				vcheck2='no';
				if (document.formIns.radio2[0].checked==true)	{vcheck2= 'ok';}
				}
			
			/*if (v2== 'anains2' || v2== 'anains3')
				{
				vcheck3='no';	
				if (document.formIns.radio3[0].checked==true)	{vcheck3= 'ok';}
				}*/
			
			if  (vcheck1== 'no' || vcheck2== 'no' || vcheck3== 'no')
			 	{
				var truthBeTold = window.confirm("Condizioni non accettate. Premere 'OK' per rimanere nella scheda registrazione; 'Annulla' per uscire definitivamente dalla registrazione; Conditions are not accepted. 'OK' for remain recording form; 'Annulla' for END;");
	     		if (truthBeTold) 	{}	
				else				{document.location.href='../../';}
				}	
			else 	
				{
        		document.formIns.method='POST';		
       			document.formIns.action='../../bin/mercato' + TipoPrgMercato + v1 + '';				
				document.formIns.submit();
				}
		}

	if(	vstato=='Pay')
		{
		document.formIns.method='POST';
		document.formIns.target='_blank ';
		document.formIns.action='../../bin/mercato' + TipoPrgMercato + v1 + '';
		document.formIns.submit();
		}
	if(	vstato=='/msggest')
		{
		document.formIns.method='POST';
		document.formIns.target='_blank ';
		document.formIns.action='../../bin/mercato' + TipoPrgMercato + v1 + '';
		document.formIns.submit();
		}
 } 

var LoginAZ= '';
var LoginPRO= '';
var LoginTOT= '';
var LoginCAR= ''; 
function CtrLogin(v1)
 {
   if      (document.formLogin.UserIDText.value=="")   {alert ('Campo "User" valore obbligatorio !') }
   else if (document.formLogin.PassText.value=="")     {alert ('Campo "Password" valore obbligatorio !') }
   else    
   		{
		document.formLogin.method='POST';
		document.formLogin.AZ.value=LoginAZ;
		document.formLogin.PRO.value=LoginPRO;
		document.formLogin.TOT.value=LoginTOT;
		document.formLogin.CAR.value=LoginCAR;
		document.formLogin.action='/bin/mercato' + TipoPrgMercato + v1 + '';
		//document.formLogin.action='admuni.asp';
		document.formLogin.submit();
	   	}
 } 

function ReOpenTo(id,id1,id2,id3)
 {
	LoginPRO=id;
	LoginTOT=id1;
	LoginCAR=id2;
	LoginAZ=id3;	
 } 

function openToPayment(id,id1,id2)
{    
	if (GetCookie ('ID') == 'YES') 
    	{
		if (GetCookie ('PK') == null)
	   		{
			var truthBeTold = window.confirm("Attenzione lei  un utente gi registrato per proseguire  necessario immettere UserName e Password nell' apposito box ed inviare i dati. Premere 'OK' per continuare nell'acquisto;   'Annulla' per sospendere temporaneamente");
	  		if (truthBeTold)
				{
				LoginAZ='Pay';
				LoginPRO=id;
				LoginTOT=id1;
				LoginCAR=id2;
				}	 
			}  
	  	else
	  		{
  			var Lival = GetCookie ('LI');
		    var Pkval = GetCookie ('PK');	    
			document.location.href='../../bin/mercato'+TipoPrgMercato+Lival+'?PK='+Pkval+'&AZ=Pay&PRO='+id+'&TOT='+id1+'&CAR='+id2+'';
		    }    	
         }
    else
    	{
		document.location.href='../../bin/mercato'+TipoPrgMercato+'utereg2?AZ=Pay&PRO='+id+'&TOT='+id1+'&CAR='+id2+'';
    	}
}

function OpenAccExpo()
{
    if (GetCookie ('ID') == 'YES') 
    	{
		if (GetCookie ('PK') == null)
				{
				var truthBeTold = window.confirm("Attenzione lei  un utente gi registrato per proseguire  necessario immettere UserName e Password nell' apposito box ed inviare i dati. Premere 'OK' per continuare;   'Annulla' per sospendere temporaneamente");
	     	    if (truthBeTold) 
		        	{
					LoginAZ='Expo';
					}
	        	}
         else
	        	{
		        var Lival = GetCookie ('LI');
		        var Pkval = GetCookie ('PK');	
				if (Lival=='admexpo')
					{alert ('Attenzione Espositore gi registrato!!!');}
				else
					{document.location.href='../../bin/mercato'+TipoPrgMercato+Lival+'?PK='+Pkval+'&AZ=Expo';}
	        	}
       	}
	else
       	{
  		document.location.href='../../bin/mercato'+TipoPrgMercato+'utereg2?AZ=Expo';
    	}
}
function OpenMsgText(v1,v3) 
 {
	window.open('../../bin/unipmsg' + TipoPrgUnipmsg + v1 + '?AZ=' + v3 + '','','height=300,width=265,menubar=0,resizable=0,scrollbars=1,status=0');
 }

function OpenMsgCont(v1,v2) 
 {
 	window.open('../../bin/unipmsg' + TipoPrgUnipmsg + v1 + '?AZ=' + v2 + '','','height=220,width=250,menubar=0,resizable=0,scrollbars=0,status=0'); 
 }

function CloseMsgText() 
 {
  window.close();
 }
// fine max

// Pubbliche
function getCookieVal (offset)
{
  var endstr = document.cookie.indexOf (';', offset );
  if (endstr == -1) endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}
  
function GetCookie (nomeCookie)
{
  var arg = nomeCookie + '=';
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen)
  {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg) return getCookieVal (j);
    i = document.cookie.indexOf(' ', i) + 1;
    if (i == 0) break;
  }
  return null;
}   

function SetCookie (name, value) 
   {
   var argv = SetCookie.arguments;
   var argc = SetCookie.arguments.length;
   var expires = (2 < argc) ? argv[2] : null;
   var path = (3 < argc) ? argv[3] : null;
   var domain = (4 < argc) ? argv[4] : null;
   var secure = (5 < argc) ? argv[5] : false;
   document.cookie = name + "=" + escape (value) +
     ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
     ((path == null) ? "" : ("; path=" + path)) +
     ((domain == null) ? "" : ("; domain=" + domain)) +
     ((secure == true) ? "; secure" : "");
   }

function SetCookie2 (name, value) 
   {
   var argv = SetCookie2.arguments;
   var argc = SetCookie2.arguments.length;
   var expires = (2 < argc) ? argv[2] : null;
   var path = (3 < argc) ? argv[3] : null;
   var domain = (4 < argc) ? argv[4] : null;
   var secure = (5 < argc) ? argv[5] : false;
   document.cookie = name + "=" + escape (value) +
     ((expires == null) ? "" : ("; expires=" +  (24 * 60 * 60 * 1000 * 365))) +
     ((path == null) ? "" : ("; path=" + path)) +
     ((domain == null) ? "" : ("; domain=" + domain)) +
     ((secure == true) ? "; secure" : "");
   }

function DisplayInfo() 
 {
 if (GetCookie ('PK') == null)
  { 	
   document.write('<table width="317" height="69" border="0" cellpadding="0" cellspacing="0" background="../../images/bg_login.jpg">');
   document.write('<form  action=javascript:CtrLogin('+'"login"'+') name=formLogin>');
   document.write('<tr>');
   document.write('<td align="right" class=login>UserName&nbsp;&nbsp;</td>');
   document.write('<td width="70" align="right"><input class="logsearch" name="UserIDText" autocomplete="off" maxlenght="64" type="text" size="17"></td>');
   document.write('<td align="right">&nbsp;</td>');
   document.write('</tr>');
   document.write('<tr>');
   document.write('<td align="right" class="login">Password&nbsp;&nbsp;</td>');
   document.write('<td align="right"><input class="logsearch" type="Password" name="PassText" maxlenght="64" size="17"></td>');
   document.write('<input type=hidden name=AZ>');
   document.write('<input type=hidden name=PRO>');
   document.write('<input type=hidden name=TOT>');
   document.write('<input type=hidden name=CAR>');
   document.write('<td width="40" align="right"><input type="image" border="0" name="imageField" src="../../images/bt_login.gif"></td>');
   document.write('</tr>');
   document.write('<tr>');
   document.write('<td align="right"><a href='+'javascript:ActionLink('+'"utereg"'+')'+' class=forgot>Registrati ora&nbsp;&nbsp;</a><font color="#FFFFFF"><strong>/</strong></font></td>');
   document.write('<td width="140" colspan="2" align="left">&nbsp;<a href="javascript:ForgotMyPassword()" class=forgot>Non ricordi la password?</a></td>');
   document.write('</tr>');
   document.write('</form>');  
   document.write('</table>');        
  }
	else
  {
   document.write('<table width="317" height="69" border="0" cellpadding="0" cellspacing="0" background="../../images/bg_login.jpg">');
   document.write('<tr>');
   document.write('<td align="right" class=login><img src="../../images/bt_login.gif"></td>');  
   document.write('<td align="left" class=login><a href="javascript:ReLogin()" class=menuA>la mia HOME</a></td>');
   document.write('<td align="right">&nbsp;</td>');     
   document.write('</tr>');
   document.write('<tr>');
   document.write('<td align="right" class="login"><img src="../../images/bt_login.gif">'); 
   document.write('<td width="100" align="left" class="login"><a href='+'javascript:ActionLinkPK('+'"logout"'+',"mercato")'+' class="menuA">Chiudi sessione</a></td>');
   document.write('<td align="right">&nbsp;</td>');  
   document.write('</tr>');
   document.write('</table>'); 
 } 
}


function DisplayInfo2(v1) 
 {
  document.write('<table width=50 border=0 cellpadding=0 cellspacing=0 >');
  document.write('<tr>');
  if (v1=='')
   {
    document.write('<td><a href="javascript:DisplayInfo2()">Come funziona...</a></td>');

   }
  document.write('</tr>');
  document.write('</table>');
  document.location.reload;
}

function Logout() 
 {
   var expdate = new Date();
   expdate.setTime(expdate.getTime());
   SetCookie("PK", '', expdate, "/", null, false);
   SetCookie("AZ", '', expdate, "/", null, false);
   document.location.href = 'http://www.pescaturismo.uniprom.it';
}

function ReLogin() 
 {
   	var expdate = new Date();
   	expdate.setTime(expdate.getTime());
	var Lival = GetCookie ('LI');
   	var Pkval = GetCookie ('PK');
	document.location.href='../../bin/mercato'+TipoPrgMercato+Lival+'?PK='+Pkval+''+LoginAZ+'';
 }

function IndexGo()
 {
  document.location.href='http://www.pescaturismo.uniprom.it'; 
 }

// fine pubbliche



function ForgotMyPassword(id) {
  if (id == null )
    {window.open("http://www.pescaturismo.uniprom.it/invpass.htm","ForgotMyPassword","height=200,width=300,menubar=0,resizable=0,scrollbars=0,status=0");}
  else
    {document.MyPassword.action="http://www.pescaturismo.uniprom.it/bin/upfmail.exe/viamail";}
} 

function openVideo() {
  window.open("video/64_144.wmv","video"," height=425 ,width=450, top=20, left=20 menubar=0,resizable=0,scrollbars=0,status=0");
}



// STEFANO		STEFANO		STEFANO		STEFANO		STEFANO		STEFANO		STEFANO		STEFANO		STEFANO
var OggCookie = GetCookie('NumOgg');
var SpeCookie = GetCookie('TotSpe');

function Character(parola,numero) {    
   var pasN = parola.length;
   var appN = parola.charAt(pasN-1);	  
   if (!((appN=='0')||(appN=='1')||(appN=='2')||(appN=='3')||(appN=='4')||
   (appN=='5')||(appN=='6')||(appN=='7')||(appN=='8')||(appN=='9')))
    { 
	  document.all['textfield' + numero].value='1'; 
    }	
}

/*function MostraNeg(nom,pro,qua) {
	if (nom == 'HOME') {
		window.open('../../bin/negozio.exe/neg','_parent','');
	}

	if (nom == 'CARR') {
		window.open('../../bin/negozio.exe/AddCar?Pro='+pro+'&Qua='+qua+'','_parent','');
	}

	if (!((nom=='HOME')||(nom=='CARR'))) {
    		window.open('../../bin/negozio.exe/start?Cons='+nom+'&Reg='+pro+'','_parent','');
	}

}*/

function MostraNeg(nom,pro)
{
	window.open('../../negozio/CorNeg.asp?Cons='+nom+'&Reg='+pro+'','_parent','');
}

function Controllo(valor,valorecam,num,pro){  
  if (valor == -1) {
  		if (valorecam<=0) {
			alert('Valore non valido');
			document.all['textfield' + num].value='1';
		}
		else {
			MostraNeg('CARR',pro,valorecam);
		}
  }
  else {
   		if (valorecam > valor) {
      		alert('Valore non valido');
	   		document.all['textfield' + num].value='1';
		}
		else { 
				if (valorecam<=0) {
					alert('Valore non valido');
	   				document.all['textfield' + num].value='1';
				}
				else {
					MostraNeg('CARR',pro,valorecam);
				}
  		} 	        
  } 
}

function CancellaProd(cod) {
     window.open('../../bin/negozio.exe/canc?Cod='+cod+'','_parent','');	
}

function Carrello(val) {
	document.write('<table width="147" border="0" height="76" cellpadding="0" cellspacing="0" align="center">');
	document.write('<FORM method="post" action="../../bin/negozio.exe/VediCar">');
	document.write('  <tr> ');
	document.write('    <td colspan="2" background="../../images/carr_bgu.gif" height="11"></td>');
	document.write('  </tr>');
	document.write('  <tr> ');
	document.write('    <td width="121" background="../../images/carr_bg.gif" height="46" align="right" > ');
	document.write('      <img src="../../images/Neg_qua.gif" width="16" height="16" vspace="0" hspace="0">&nbsp; ');
	document.write('      <input type="text" name="Ogg" value="'+OggCookie+'" border=0 style="width:60pt;text-align:right" disabled>');
	document.write('	  <br>');
	document.write('	  <img src="../../images/Neg_euro.gif" width="16" height="16" vspace="0" hspace="0">&nbsp;');
	document.write('	  <input type="text" name="Spe" value="'+SpeCookie+'" border=0 style="width:60pt;text-align:right" disabled>');
	document.write('    </td>');
	document.write('    <td rowspan="2" width="26" background="../../images/carr_bgr.gif" valign="bottom"> ');
	document.write('      <input type="image" border="0" name="carre" src="../../images/carr_submit.gif" width="25" height="25" align="absbottom">  ');
	document.write('    </td>');
	document.write('  </tr>');
	document.write('  <tr>');
	document.write('    <td width="122" height="19" background="../../images/carr_bgd.gif">&nbsp;</td>');
	document.write('  </tr>');
	document.write('</FORM>');	
	document.write('</table>');	
}

function prod(val,reg) {
	//window.open('../../bin/negozio.exe/prodotto?pro='+val+'&regione='+reg+'','_parent','');
	window.open('../../negozio/prodotto.asp?pro='+val+'&regione='+reg+'','_parent','');
}

function Vendi() {
	window.open('../../bin/negozio.exe/vendi','_parent','');
}

function OpenTab() {
	document.write('<table width="538" align="center" border=0 cellpadding=1 cellspacing=1>');
	document.write('<tr align="center">');
	document.write('    <td bgcolor="#BFC8E3" width="344"><b>&nbsp;Descrizione&nbsp;</b></td>');
	document.write('    <td bgcolor="#BFC8E3" width="76"><b>&nbsp;Produttore&nbsp;</b></td>');
	document.write('    <td bgcolor="#BFC8E3" width="50"><b>&nbsp;Prezzo&nbsp;</b></td>');
	document.write('    <td bgcolor="#BFC8E3" width="40"><b>&nbsp;Disp.&nbsp;</b></td>');
	document.write('	<td bgcolor="#BFC8E3" width="28"><b>&nbsp;Q.t&nbsp;</b></td>');
	document.write('</tr>');	
}

function CloseTab() {
	document.write('</table>');
	document.write('<br><br>');	
}

function Cerca(v1) {
	window.open('../../bin/negozio.exe/cerca?Des=' + v1 + '','_parent','');
}

function  Produttore(v1) {
	window.open('../../bin/negozio.exe/prodre?Des=' + v1 + '','_parent','');
}


function Ric(v1) {
	var wdt = 538;
	if(v1=='H') { wdt = 450; }

    document.write('<table border="0" cellpadding="0" cellspacing="1" width="'+wdt+'" height="30" bgcolor="#000000" align="center">');
	document.write('<tr><td>');
	document.write('	<table border="0" cellpadding="0" cellspacing="1" width="'+(wdt-2)+'" height="28" bgcolor="#FFFFFF">');
	document.write('	<tr>');
	document.write('		<td valign="middle" width="100"> ');
	document.write('			&nbsp;<b>Ricerca prodotti:</b> ');
	document.write('		</td>');
	document.write('		<td width="78">');
	document.write('			&nbsp;<input type="text" name="ricerca" border=0 style="width:74px">');
	document.write('		</td>');
	document.write('		<td width="30">');
	document.write('			<a href="javascript:Cerca(ricerca.value)"> ');
	document.write('			<img src="../../images/search.gif" border="0" vspace="0" hspace="0" > ');
	document.write('			</a>');
	document.write('		</td>');
	document.write('		<td>');
	document.write('			Per ricercare un prodotto inserire la parola chiave relativa alla denominazione del prodotto.');
	document.write('		</td>');
	document.write('	</tr>');
	document.write('	</table>');
	document.write('</td></tr>');
	document.write('</table> ');
}
// fine STEFANO

































