window.status = 'FASHION DISTRICT - Il piu\' grande Network Italiano di Outlet';
vTesti = new Object;

function createMailto(name,domain,text,style){
	var STYLE="";
	EMAIL=name+"@"+domain;
	if( text )
		TESTO=text;
	else
		TESTO=EMAIL;
	if( style )
		STYLE="style=\""+style+"\"";
	document.write("<a href=\"mailto:"+EMAIL+"\""+STYLE+">"+TESTO+"</a>");
}

function GID(id){
	return document.getElementById(id);
}

function show(id){
	GID(id).style.display="block";
}

function hide(id){
	GID(id).style.display="none";
}

function toggleDiv(id){
	if( GID(id).style.display=="block" )
		hide(id);
	else
		show(id);
}



/*
##############################################################
#                    VECCHI JAVASCRIPT                       #
##############################################################
*/

function SpecialEvent(link)
{
	var winLocation, winName, winParam, winObj;
	var winPos, winPosTop, winPosLeft, winWidth, winHeight;
	
	winWidth = 650;
	winHeight = 510;
	
	winPosTop = (screen.height / 2) - winHeight / 2;
	winPosLeft = (screen.width / 2) - winWidth / 2;
	winPos = ',top=' + winPosTop + ',left=' + winPosLeft;
	
	winLocation='specialevent/'+link;
	winName = 'SpecialEvent';

	winParam = 'status=0,toolbars=0,menubar=0,scrollbars=yes,history=0,resizable=0,width=' + winWidth + ',height=' + winHeight + winPos;
	winObj = window.open(winLocation, winName, winParam);
	winObj.focus();
}


function PopUp(file){
	var winLocation, winName, winParam, winObj;
	var winPos, winPosTop, winPosLeft, winWidth, winHeight;

	winWidth = 800;
	winHeight = 500;

	winPosTop = (screen.height / 2) - winHeight / 2;
	winPosLeft = (screen.width / 2) - winWidth / 2;
	winPos = ',top=' + winPosTop + ',left=' + winPosLeft;

	winLocation =file;
	winName = 'Popup';

	winParam = 'status=0,toolbars=0,scrollbars=yes,menubar=0,history=0,resizable=0,width=' + winWidth + ',height=' + winHeight + winPos;
	winObj = window.open(winLocation, winName, winParam);
	winObj.focus();
}

function PopupPers(file,width,height){
	var winLocation, winName, winParam, winObj;
	var winPos, winPosTop, winPosLeft, winWidth, winHeight;

	winWidth = width;
	winHeight = height;

	winPosTop = (screen.height / 2) - winHeight / 2;
	winPosLeft = (screen.width / 2) - winWidth / 2;
	winPos = ',top=' + winPosTop + ',left=' + winPosLeft;

	winLocation =file;
	winName = 'PopupPers';

	winParam = 'status=0,toolbars=0,scrollbars=yes,menubar=0,history=0,resizable=0,width=' + winWidth + ',height=' + winHeight + winPos;
	winObj = window.open(winLocation, winName, winParam);
	winObj.focus();
}

function PopupNews(file){
	var winLocation, winName, winParam, winObj;
	var winPos, winPosTop, winPosLeft, winWidth, winHeight;

	winWidth = 800;
	winHeight = 600;

	winPosTop = (screen.height / 2) - winHeight / 2;
	winPosLeft = (screen.width / 2) - winWidth / 2;
	winPos = ',top=' + winPosTop + ',left=' + winPosLeft;

	winLocation =file;
	winName = 'Popup';

	winParam = 'status=0,toolbars=0,scrollbars=yes,menubar=0,history=0,resizable=0,width=' + winWidth + ',height=' + winHeight + winPos;
	winObj = window.open(winLocation, winName, winParam);
	winObj.focus();
}

function PopUpBANNER(tipo,id){
	var winLocation, winName, winParam, winObj;
	var winPos, winPosTop, winPosLeft, winWidth, winHeight;

	winWidth = 800;
	winHeight = 400;

	winPosTop = (screen.height / 2) - winHeight / 2;
	winPosLeft = (screen.width / 2) - winWidth / 2;
	winPos = ',top=' + winPosTop + ',left=' + winPosLeft;

	winLocation='banner.asp?'+tipo+'='+id;
	winName = 'PopupOFFERTE';

	winParam = 'status=0,toolbars=0,menubar=0,scrollbars=yes,history=0,resizable=0,width=' + winWidth + ',height=' + winHeight + winPos;
	winObj = window.open(winLocation, winName, winParam);
	winObj.focus();
}

function PopUpZoom(file){
	var winLocation, winName, winParam, winObj;
	var winPos, winPosTop, winPosLeft, winWidth, winHeight;
	
	winWidth = 515;
	winHeight = 346;
	
	winPosTop = (screen.height / 2) - winHeight / 2;
	winPosLeft = (screen.width / 2) - winWidth / 2;
	winPos = ',top=' + winPosTop + ',left=' + winPosLeft;
	
	winLocation =file;
	winName = 'Popup2';

	winParam = 'status=0,toolbars=0,menubar=0,scrollbars=yes,history=0,resizable=0,width=' + winWidth + ',height=' + winHeight + winPos;
	winObj = window.open(winLocation, winName, winParam);
	winObj.focus();
}

function PopUpCV(idoutlet){
	var winLocation, winName, winParam, winObj;
	var winPos, winPosTop, winPosLeft, winWidth, winHeight;
	
	winWidth = 600;
	winHeight = 350;
	
	winPosTop = (screen.height / 2) - winHeight / 2;
	winPosLeft = (screen.width / 2) - winWidth / 2;
	winPos = ',top=' + winPosTop + ',left=' + winPosLeft;
	
	winLocation = 'inviaCV.asp?idoutlet='+idoutlet;
	winName = 'INVIACV';

	winParam = 'status=0,toolbars=0,menubar=0,scrollbars=yes,history=0,resizable=0,width=' + winWidth + ',height=' + winHeight + winPos;
	winObj = window.open(winLocation, winName, winParam);
	winObj.focus();
}

function PopUpREGISTRATI(outlet){
	var winLocation, winName, winParam, winObj;
	var winPos, winPosTop, winPosLeft, winWidth, winHeight;
	
	winWidth = 600;
	winHeight = 600;
	
	//winPosTop = (screen.height / 2) - winHeight / 2;
	winPosTop = 30;
	winPosLeft = (screen.width / 2) - winWidth / 2;
	winPos = ',top=' + winPosTop + ',left=' + winPosLeft;
	
	winLocation = 'registrati.asp?outlet='+outlet;
	winName = 'REGISTRATIFD';

	winParam = 'status=0,toolbars=0,menubar=0,scrollbars=yes,history=0,resizable=0,width=' + winWidth + ',height=' + winHeight + winPos;
	winObj = window.open(winLocation, winName, winParam);
	winObj.focus();
}

function CreaVettore(lang){
	if(lang == "it"){
		vTesti[0]="Controlla l'indirizzo E-Mail inserito!";
		vTesti[1]="Devi accettare il trattamento dei Dati Personali per effettuare un'iscrizione!";
		vTesti[2]="Il campo Nome è obbligatorio!";
		vTesti[3]="Il campo Cognome è obbligatorio!";
		vTesti[4]="Devi Selezionare l\'OUTLET di interesse!";
		vTesti[5]="Il campo Settore è obbligatorio!";
		vTesti[6]="Il campo Ufficio è obbligatorio!";
		vTesti[7]="Il campo Nazione è obbligatorio!";
		vTesti[8]="Il campo Telefono è obbligatorio!";
		vTesti[9]="Il campo Ragione Sociale è obbligatorio!";
	}
	else{
		vTesti[0]="Check the written E-Mail address!";
		vTesti[1]="You have to accept the handling of your personal data , in order to register you!";
		vTesti[2]="The field Name is compulsory!";
		vTesti[3]="The field Surname is compulsory!";
		vTesti[4]="The field Company Name is compulsory!";
		vTesti[5]="The field Sector is compulsory!";
		vTesti[6]="The field Department is compulsory!";
		vTesti[7]="The field Nation is compulsory!";
		vTesti[8]="The field Phone Number is compulsory!";
		vTesti[9]="The field Company Name is compulsory!";
	}
}


function UnsubscribeMail(lang){
	CreaVettore(lang);
	
	var lung=null;
	var stringa=null;
	
	Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
	
	   //Email = document.SuperForm.email.value;
	   Email = document.getElementById('mailcancellati').value;
	   if( !Filtro.test(Email) ){
	      alert(vTesti[0]);
	      document.SuperForm.email.focus();
	      return false;
	   }
}


function ControllaDati(TipoForm,lang){
   CreaVettore(lang);

   var lung=null;
   var stringa=null;

   if (TipoForm == 'new')
   {
     if (document.SuperForm.acce[0].checked==false){
       alert(vTesti[1]);
       document.SuperForm.acce[0].focus();
       return false;
    }
   }

	stringa=document.SuperForm.ragione_sociale.value;
	lung=stringa.length;
	if (lung<=0){ 
	  alert(vTesti[9]);
	  document.SuperForm.ragione_sociale.focus();
	  return false; 
	}

   stringa=document.SuperForm.nome.value;
   lung=stringa.length;
   if (lung<=0)
   { 
     alert(vTesti[2]);
     document.SuperForm.nome.focus();
     return false; 
   }

   stringa=document.SuperForm.cognome.value;
   lung=stringa.length;
   if (lung<=0)
   { 
     alert(vTesti[3]);
     document.SuperForm.cognome.focus();
     return false; 
   }

   Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

   Email = document.SuperForm.email.value;
   if (Filtro.test(Email))
   {  }
   else
   {
      alert(vTesti[0]);
      document.SuperForm.email.focus();
      return false;
   }

   if (document.SuperForm.outlet.value==0)
   { 
     alert(vTesti[4]);
     document.SuperForm.outlet.focus();
     return false; 
   }


   return true;
}

function ControllaEmailCanc(lingua){
CreaVettore(lingua);
	str=document.SuperForm.email.value;
	lung=str.length;

	if(lung<=0){
		alert(vTesti[0]);
		return false;
	}
	return true;
}

function ControllaUpload(nomefile){
	if( nomefile.length<=0 ){
		alert("Prima devi Selezionare un File tramite il Tasto \"Sfoglia\" !!");
		return false;
	}
	return true;
}

function CreaPercorso(outlet){
	var winLocation, winName, winParam, winObj;
	var winPos, winPosTop, winPosLeft, winWidth, winHeight;

	winWidth = 270;
	winHeight = 400;

	winPosTop = (screen.height / 2) - winHeight / 2;
	winPosLeft = (screen.width / 2) - winWidth / 2;
	winPos = ',top=' + winPosTop + ',left=' + winPosLeft;

	winLocation ="percorso.asp?outlet="+outlet;
	winName = 'PopupPercorso';

	winParam = 'status=0,toolbars=0,scrollbars=no,menubar=0,history=0,resizable=0,width=' + winWidth + ',height=' + winHeight + winPos;
	winObj = window.open(winLocation, winName, winParam);
	winObj.focus();
}




/*
da togliere dopo il concorso della crociera
*/
function vinciMN(){
	var winLocation, winName, winParam, winObj;
	var winPos, winPosTop, winPosLeft, winWidth, winHeight;

	winWidth = "600";
	winHeight = "750";

	winPosTop = (screen.height / 2) - winHeight / 2;
	winPosLeft = (screen.width / 2) - winWidth / 2;
	winPos = ',top=' + winPosTop + ',left=' + winPosLeft;

	winLocation ="banner/crocieraMN2.html";
	winName = 'PopupMN';

	winParam = 'status=0,toolbars=0,scrollbars=yes,menubar=0,history=0,resizable=0,width=' + winWidth + ',height=' + winHeight + winPos;
	winObj = window.open(winLocation, winName, winParam);
	winObj.focus();
}

function vinciVM(){
	var winLocation, winName, winParam, winObj;
	var winPos, winPosTop, winPosLeft, winWidth, winHeight;

	winWidth = "600";
	winHeight = "750";

	winPosTop = (screen.height / 2) - winHeight / 2;
	winPosLeft = (screen.width / 2) - winWidth / 2;
	winPos = ',top=' + winPosTop + ',left=' + winPosLeft;

	winLocation ="banner/crocieraVM2.html";
	winName = 'PopupVM';

	winParam = 'status=0,toolbars=0,scrollbars=yes,menubar=0,history=0,resizable=0,width=' + winWidth + ',height=' + winHeight + winPos;
	winObj = window.open(winLocation, winName, winParam);
	winObj.focus();
}

function vinciMF(){
	var winLocation, winName, winParam, winObj;
	var winPos, winPosTop, winPosLeft, winWidth, winHeight;

	winWidth = "600";
	winHeight = "750";

	winPosTop = (screen.height / 2) - winHeight / 2;
	winPosLeft = (screen.width / 2) - winWidth / 2;
	winPos = ',top=' + winPosTop + ',left=' + winPosLeft;

	winLocation ="banner/crocieraMF2.html";
	winName = 'PopupMF';

	winParam = 'status=0,toolbars=0,scrollbars=yes,menubar=0,history=0,resizable=0,width=' + winWidth + ',height=' + winHeight + winPos;
	winObj = window.open(winLocation, winName, winParam);
	winObj.focus();
}

function toggleDiv(iddiv){
	obj=document.getElementById(iddiv);
	if( obj.style.display=="none" )
		obj.style.display="block";
	else
		obj.style.display="none";

}

function RadioFD( lang ){
	var winLocation, winName, winParam, winObj;
	var winPos, winPosTop, winPosLeft, winWidth, winHeight;

	winWidth = 340;
	winHeight = 300;

	//winPosTop = (screen.height / 2) - winHeight / 2;
	winPosTop = 30;
	winPosLeft = (screen.width / 2) - winWidth / 2;
	winPos = ',top=' + winPosTop + ',left=' + winPosLeft;

	winLocation = 'outlet/radiofashiondistrict.asp?lang='+lang;
	winName = 'RadioFD';

	winParam = 'status=0,toolbars=0,menubar=0,scrollbars=no,history=0,resizable=0,width=' + winWidth + ',height=' + winHeight + winPos;
	winObj = window.open(winLocation, winName, winParam);
	winObj.focus();
}
