<!--

	

	autoredirect = 0;

	checkcookies = 0;

	

	//

checkcookies = 1;



	if (checkcookies == 1) {

		document.cookie = "eDtest=test; domain="+dominio+"; path="+percorso+";";

		var tok = document.cookie.indexOf ("eDtest");

		if (tok < 0) {

			var sMsg = "Impossibile accedere ai cookies\n"; 

			sMsg = sMsg + "Il negozio non puo' essere utilizzato se non si consente l'invio di cookies!\n\n";

			sMsg = sMsg + "Unable to access cookies\n";

			sMsg = sMsg + "This shop requires your browser to accept cookies in order to work properly!\n\n";

			window.alert(sMsg);

		}

	}



	if (autoredirect == 1) {

		var myURL = document.URL;

		if ( myURL.indexOf('file://') == -1) {

			lpos = myURL.lastIndexOf('/');

			if (lpos <0) {

				lpos=0;

				myURL= "/" + myURL;

			}

			domainname=myURL.substring(0,lpos);

			pagename=myURL.substring(lpos,myURL.length);
pagename1=myURL.substring(lpos,myURL);

        	        if (domainname != "http://www.optikhouse.com" && myURL.indexOf("/edorder") < 0 && myURL.indexOf("/edsearch") < 0) {

self.location = "http://www.optikhouse.com" + pagename;

			}

		}

	}

	function mypagename(a) {
mypage = "";
		var myURL = document.URL;

		if ( myURL.indexOf('file://') == -1) {

			lpos = myURL.lastIndexOf('/');

			if (lpos <0) {

				lpos=0;

				myURL= "/" + myURL;

			}

			domainname=myURL.substring(0,lpos);

			pagename=myURL.substring(lpos,myURL.length);

if (a == 'occhiali-sole') {
mypage = "occhiali-da-sole-c-21.html";
}
if (a == 'occhiali-sole_l2') {
mypage = "sunglasses-c-21.html";
}
if (a == 'cat041') {
mypage = "specials.php";
}
if (a == 'cat041_l2') {
mypage = "specials.php";
}
if (a == 'cat042') {
mypage = "occhiali-da-sole-yves-saint-laurent-c-21_54.html";
}
if (a == 'cat042_l2') {
mypage = "sunglasses-yves-saint-laurent-c-21_54.html";
}
if (a == 'cat043') {
mypage = "occhiali-da-sole-prada-c-21_37.html";
}
if (a == 'cat043_l2') {
mypage = "sunglasses-prada-c-21_37.html";
}
if (a == 'cat044') {
mypage = "occhiali-da-sole-prada-c-21_37.html";
}
if (a == 'cat044_l2') {
mypage = "sunglasses-prada-c-21_37.html";
}
if (a == 'cat045') {
mypage = "occhiali-da-sole-moschino-c-21_36.html";
}
if (a == 'cat045_l2') {
mypage = "sunglasses-moschino-c-21_36.html";
}
if (a == 'cat046') {
mypage = "occhiali-da-sole-byblos-c-21_39.html";
}
if (a == 'cat046_l2') {
mypage = "sunglasses-byblos-c-21_39.html";
}
if (a == 'cat047') {
mypage = "occhiali-da-sole-persol-c-21_41.html";
}
if (a == 'cat047_l2') {
mypage = "sunglasses-persol-c-21_41.html";
}
if (a == 'cat048') {
mypage = "occhiali-da-sole-polo-ralph-lauren-c-21_53.html";
}
if (a == 'cat048_l2') {
mypage = "sunglasses-polo-ralph-lauren-c-21_53.html";
}
if (a == 'cat049') {
mypage = "occhiali-da-sole-vogue-c-21_43.html";
}
if (a == 'cat049_l2') {
mypage = "sunglasses-vogue-c-21_43.html";
}
if (a == 'cat050') {
mypage = "occhiali-da-sole-ray-ban-c-21_33.html";
}
if (a == 'cat050_l2') {
mypage = "sunglasses-ray-ban-c-21_33.html";
}
if (a == 'cat051') {
mypage = "occhiali-da-sole-exte-c-21_27.html";
}
if (a == 'cat051_l2') {
mypage = "sunglasses-exte-c-21_27.html";
}
if (a == 'cat068') {
mypage = "occhiali-da-sole-romeo-gigli-c-21_32.html";
}
if (a == 'cat068_l2') {
mypage = "sunglasses-romeo-gigli-c-21_32.html";
}
if (a == 'cat069') {
mypage = "occhiali-da-sole-john-richmond-c-21_22.html";
}
if (a == 'cat069_l2') {
mypage = "sunglasses-john-richmond-c-21_22.html";
}
if (a == 'cat121') {
mypage = "occhiali-da-sole-dolce-gabbana-c-21_49.html";
}
if (a == 'cat121_l2') {
mypage = "sunglasses-dolce-gabbana-c-21_49.html";
}

if (a == 'cat067') {
mypage = "occhiali-da-sole-revo-c-21_50.html";
}
if (a == 'cat067_l2') {
mypage = "sunglasses-revo-c-21_50.html";
}
if (a == 'cat119') {
mypage = "occhiali-da-sole-bikkembergs-c-21_35.html";
}
if (a == 'cat119_l2') {
mypage = "sunglasses-bikkembergs-c-21_35.html";
}
if (a == 'cat132') {
mypage = "occhiali-da-sole-iceberg-c-21_23.html";
}
if (a == 'cat132_l2') {
mypage = "sunglasses-iceberg-c-21_23.html";
}
if (a == 'cat130') {
mypage = "occhiali-da-sole-il-blasco-c-21_38.html";
}
if (a == 'cat130_l2') {
mypage = "sunglasses-il-blasco-c-21_38.html";
}
if (a == 'cat086') {
mypage = "occhiali-da-sole-ferragamo-c-21_44.html";
}
if (a == 'cat086_l2') {
mypage = "sunglasses-ferragamo-c-21_44.html";
}
if (a == 'cat120') {   //miu miu
mypage = "occhiali-da-sole-miu-miu-c-21_55.html";
}
if (a == 'cat120_l2') {
mypage = "sunglasses-miu-miu-c-21_55.html";
}




if (domainname == "http://www.optikhouse.com" && mypage != "") {
self.location = "http://www.optikhouse.com/online/" + mypage;
}
}
}

	function SubmitSearchForm(ritorna) {

		var ok = 1;

		var sleft = ",#.*"; var sright = "";

		var ucod=document.edRicerca1.searchtext.value.toLowerCase();

		ucod=TrimSpaces(ucod);

		ucodmin=MinCar();

		if (ucod.length < ucodmin) {

			window.alert("Digitare i termini della ricerca");

			ok=0;

		}

		if (ok != 0) {

			document.edRicerca2.search.value = ucod;

			if (sright == "#") {

				document.edRicerca2.match.value = "w";

			}

			document.edRicerca2.submit();

		}

		if (ritorna == 1) {

			return false;

		}

	}

	

	function TrimSpaces(testo) {

		while(testo.charAt(0) == " ") {

			lung=testo.length;

			testo = testo.substring(1,lung);

		}

		lung=testo.length;

		while(testo.charAt(lung-1) == " ") {

			testo = testo.substring(0,lung-1);

			lung=testo.length;

		}

		var n=0;

		var wasspace=0;

		var newTesto="";

		while (n < lung) {

			carattere=testo.charAt(n);

			if (carattere==" ") {

				if (wasspace==0) {

					newcar= " ";

					wasspace=1;

				}

				else {

					newcar="";

				}

			}

			else {

				wasspace=0;

				newcar=carattere;

			}

			newTesto=newTesto + newcar;

			n=n+1;

		}

		testo= newTesto;

		return testo;

	}



	function MinCar() {

		return 1;

	}



	function RepGoTo() {

		selrepnum = document.edReparti.edRepartiMenu.selectedIndex;

		selrep = document.edReparti.edRepartiMenu.options[selrepnum].value;

		self.location = selrep;

	}



	function PrescriptionGoTo() {

		selrepnum = document.edPrescription.edPrescriptionMenu.selectedIndex;

		selrep = document.edPrescription.edPrescriptionMenu.options[selrepnum].value;

		self.location = selrep;

	}



	function PopupImage(imageName, ww, wh) { 

		

		myNewWindow = window.open('', 'Dettaglio','width=' + ww +',height=' + wh + ',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0'); 

		myNewWindow.document.write("<HTML><HEAD><TITLE>Dettaglio<\/TITLE><\/HEAD>");

		myNewWindow.document.write("<BODY leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>");

		myNewWindow.document.write("<IMG SRC='" + imageName + "'><\/BODY><\/HTML>");

		myNewWindow.document.close();

		myNewWindow.focus();

		

	} 

function closed(){

apri=window.open("ferie/chiuso/closed.htm","Closed","width=500,height=375,top=100,left=300,resizable=no,scrollbars=yes,menubar=no,toolbar=no,status=no,location=no")

}

function apri(){

varname=window.open("passrec.php","PasswordRecovery","width=330,height=280,top=30,left=50,resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no")

}

function apriordini() {

finestra=window.open('faqordini.php','FaqOrdini','width=450,height=500 resizable=yes,scrollbars=yes')

}

function dett1() {

finestra=window.open('ordinare.php','Ordinare','width=800,height=600 resizable=yes,scrollbars=yes')

}

function dett2(code) {

page = "legenda.php";

query = "?code=" + code;

finestra=window.open(page + query,'Disponibilitą','width=680,height=400 resizable=yes,scrollbars=yes')

}

function numeroverde() {

finestra=window.open('images/numero-verde.htm','NumeroVerde','width=400,height=300 resizable=no,scrollbars=no')

}

function dett_spese() {

finestra=window.open('dett_spese.php','Spese','width=300,height=400 resizable=yes,scrollbars=yes')

}

function cond() {

finestra=window.open('cond_accept.php','Spese','width=380,height=400 resizable=no,scrollbars=yes')

}

function extra_eu() {

finestra=window.open('extra_eu.php','EU','width=300,height=400 resizable=no,scrollbars=yes')

}



function BrowserCheck() {

        var b = navigator.appName

        if (b=="Netscape") this.b = "ns"

        else if (b=="Microsoft Internet Explorer") this.b = "ie"

        else this.b = b

        this.version = navigator.appVersion

        this.v = parseInt(this.version)

        this.ns = (this.b=="ns" && this.v>=4)

        this.ns4 = (this.b=="ns" && this.v==4)

        this.ns5 = (this.b=="ns" && this.v==5)

        this.ie = (this.b=="ie" && this.v>=4)

        this.ie4 = (this.version.indexOf('MSIE 4')>0)

        this.ie5 = (this.version.indexOf('MSIE 5')>0)

        this.min = (this.ns||this.ie)

}

is = new BrowserCheck()



function init() {

if(document.images) {

    document.images.onmousedown = mouseDown;

    for(i=0;i<document.images.length;i++) document.images[i].onmousedown = mouseDown;

    }

}



function mouseDown(e) {

    if ((is.ns && e.which == 1) || (is.ie && event.button == 1)) {

        }

    else {

        if (is.ie) alert("Copyright OptikHouse.com © 2003 - 2006")

        else if (is.ns) setTimeout('alert("Copyright OptikHouse.com © 2003 - 2006',50)

        }

    }



DocDomain = GetDomainName(document.URL);

RefDomain = GetDomainName(document.referrer);



if ( (DocDomain != RefDomain) && (RefDomain != "") ) {

	document.cookie = "eDreferrer=" + RefDomain + ";";

}



function GetDomainName(myUrl) {

	slash = '://';

	if (myUrl.lastIndexOf(slash) > -1) {

		myDomainName = myUrl.substring(myUrl.lastIndexOf(slash) + slash.length, myUrl.length);

	}

	slash = '/';

	if (myDomainName.indexOf(slash) < 0) {

		myDomainName = myDomainName + slash;

	}

	myDomainName = myDomainName.substring(0, myDomainName.indexOf(slash));

	return myDomainName.toLowerCase();

}



function GetReferrerDomain() {

	leftmark = "eDreferrer=";

	marklength = leftmark.length;

	cookieleft = document.cookie.indexOf(leftmark);

	if (cookieleft == -1) {

		return "";

	} else {

		cookieleft = cookieleft + marklength;

		cookieright = document.cookie.indexOf(";", cookieleft);

		if (cookieright == -1) {

			cookieright = document.cookie.length;

		}

		return document.cookie.substring(cookieleft,cookieright);

	}

}



function Provenienza() {

	if (document.Ordine.edisplay_Provenienza) {

		document.Ordine.edisplay_Provenienza.value = GetReferrerDomain();

	}

}



function FP_swapImg() {//v1.0

 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;

 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;

 elm.$src=elm.src; elm.src=args[n+1]; } }

}



function FP_preloadImgs() {//v1.0

 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();

 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }

}



function FP_getObjectByID(id,o) {//v1.0

 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);

 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;

 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)

 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }

 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;

 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }

 return null;

}



	function CookieV(nome, valore, scadenza, valore1) {

	strCookie = nome + "=" + escape(valore) + "|" + escape(valore1) + "; domain="+dominio+"; path="+percorso+";";

	if (scadenza)

	   strCookie += "; expires=" + scadenza.toGMTString();

	document.cookie = strCookie;

	return "Ho impostato il cookie <strong>" + strCookie + "</strong>";

   	}



	function AddCookieV() {

			var myURL = document.URL;

			if ( myURL.indexOf('file://') == -1) {

			lpos = myURL.lastIndexOf('/');

			if (lpos <0) {

				lpos=0;

				myURL= "/" + myURL;

			}

			domainname=myURL.substring(0,lpos);

			pagename=myURL.substring(lpos,myURL.length);

			}

	dataScadenza = new Date();

   dataScadenza.setMonth(dataScadenza.getMonth()+3); // fra tre mesi

	info = CookieV(

		'optikhouse',

		upp,

		dataScadenza,

		myURL

		);

   	}



	function AddCookie(nome, moneta, valore) {

	dataScadenza = new Date();

	dataScadenza.setMinutes(dataScadenza.getMinutes()+30); // fra trenta minuti

	strCookie = nome + "=" + escape(moneta) + "|" + escape(valore) + "; domain="+dominio+"; path="+percorso+";";

	if (dataScadenza)

	strCookie += "; expires=" + dataScadenza.toGMTString();

	document.cookie = strCookie;

   	}



	function Currencies() {

 

	valore = document.currencies.currency.value;

	sep=valore.indexOf("|");

	testoval = valore.substring(0,sep);

	len = valore.length;

	testofin = valore.substring(sep+1,len);

	if (testoval == '') { 

	window.alert("Attenzione: Nessuna Valuta Selezionata!");

	} else {

	if (confirm("Valuta Selezionata: " +testoval+ " Confermi?")) {

	info = AddCookie(

		'eDenter_currencies',

		testoval,

		testofin

		);

		self.location.reload();

   	}

	}

		return testofin;

   	}



theObjects = document.getElementsByTagName("object");

for (var i = 0; i < theObjects.length; i++) {

theObjects[i].outerHTML = theObjects[i].outerHTML;}



function isBlank( cArg )

{

while ( cArg.length > 0 && cArg.charAt( cArg.length - 1 ) == " " ) {

	cArg = cArg.substring( 0, cArg.length - 1 );

	}

return cArg == "";

}





function preloadimages(){
preloadimages("images/live_support1.gif","images/live_support2.gif","logosmall.jpg","bottone_tops.gif","bottone_top.gif","bottone_on.gif","bottone_top_dx.gif")

var myimages=new Array()

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.




var nW,nH,oH,oW;
function zoomToggle(iWideSmall,iHighSmall,iWideLarge,iHighLarge,whichImage){
oW=whichImage.style.width;oH=whichImage.style.height;
if((oW==iWideLarge)||(oH==iHighLarge)){
nW=iWideSmall;nH=iHighSmall;}else{
nW=iWideLarge;nH=iHighLarge;}
whichImage.style.width=nW;whichImage.style.height=nH;
}




//-->
		var amyURL = document.URL;
		if ( amyURL.indexOf('file://') == -1) {
			alpos = amyURL.lastIndexOf('/');
			if (alpos <0) {
				alpos=0;
				amyURL= amyURL;
			}
			apagename=amyURL.substring(alpos,amyURL.length);
}
spagename = apagename.replace(".php","");
spagename = spagename.replace("?n=1","");
spagename = spagename.replace("?n=2","");
spagename = spagename.replace("/","");
//alert(spagename);
//mypagename(spagename);

