/*
Posjetite www.autostaklo.com
korak-po-korak upute za ne programere
 */
var ron="#c00000"; // MouseOver boja
var roff="#000000"; // Default boja
var leftmargin=170; // Udaljenost od lijevog ruba stranice
var topmargin=100; // Udaljenost od gornjeg ruba stranice
var largo=180; // sirina layera

/* */
var voci=new Array();
	voci[0]=new Array("About us","Abaut us","Working hours","Where to find us ?","Gallery");
	voci[1]=new Array("Offer","Special Offer");
	voci[2]=new Array("Services","Services","Questions and answers","Autoglass  offer ONLINE");
	voci[3]=new Array("Contacts","Damir: +385989180657","Mladen: +385989016811","Telfax: +38513451694","autostaklo@autostaklo.com");

/* */
var links=new Array();
	links[0]=new Array("en_abaut_us.htm","en_abaut_us.htm","en_working_hours.htm","en_where_to_find_us.htm","en_gallery.htm")
	links[1]=new Array("Offer.htm","en_special_offer.htm")
	links[2]=new Array("en_services.htm","en_services.htm","en_questions_and_answers.htm","en_autoglass_offer_ONLINE.htm")
	links[3]=new Array("en_contacts.htm","en_contacts.htm","en_contacts.htm","en_contacts.htm","en_contacts.htm")

/* */
var wst=new Array();
	wst[0]=new Array("About us","History","Working hours <<<For urgent cases, we work at weekends>>>","Where to find us ? <<<Here is a map showing our precise location>>>","Gallery pictures <<<Look at our huge collection of pictures>>>");
	wst[1]=new Array("<<<There are just windscreens, although we have others in the warehouse!!!>>>","<<<There are just windscreens, although we have others in the warehouse!!!>>>");
	wst[2]=new Array("Services","Services","<<<Ask questions, answer, start new topics. . .>>>","Carwindowglass offer ONLINE <<<There in one application to be fullfilled or the data about the glass whould be sent to our address>>>");
	wst[3]=new Array("Contacts","Contacts","Contacts","Contacts","Contacts");

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 * DALJE NE MIJENJAJTE NISTA
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var nn=document.layers?true:false,N6=navigator.userAgent.toLowerCase().indexOf("gecko")!=-1?true:false,conta=0,last=0;
var MenuLength=50+largo*voci.length;
var BrowserWidth=nn?window.innerWidth:N6?document.width:document.body.clientWidth;
leftmargin=parseInt((BrowserWidth-MenuLength)/2);

if (nn)
	{
	document.write("<LAYER NAME=mtop. position=absolute left="+leftmargin+" top="+topmargin+" width=50 height=15 clip=0,0,50,15 bgColor="+roff+" visibility=visible onMouseOver=showdeps(last,false);mroll('mtop.') onMouseOut=unmroll('mtop.')>&nbsp;<A HREF='http://www.autostaklo.com' CLASS=menuNNb><I>Home</I></A></LAYER>");
	for (i=0;i<voci.length;i++)
		{
		var n=i;
		document.writeln("<LAYER NAME=mtop"+n+". position=absolute left="+eval(leftmargin+50+largo*i)+" top="+topmargin+" width="+largo+" height=15 clip=0,0,"+largo+",15 bgColor="+roff+" visibility=visible onMouseOver=MostraMenu("+i+");mroll('mtop"+i+".');conta++ onMouseOut=last="+i+";unmroll('mtop"+i+".');conta--><DIV ALIGN=center>&nbsp;<A HREF=javascript:mroll('mtop"+i+".') CLASS=menuNNb><I>"+voci[i][0]+"</I></A></DIV></LAYER>");
		for (l=1;l<voci[i].length;l++)
			document.writeln("<LAYER NAME=mdep"+i+"."+l+" position=absolute left="+eval(leftmargin+50+largo*i)+" top="+eval(topmargin+15*l)+" width="+largo+" height=15 clip=0,0,"+largo+",15 bgColor="+roff+" visibility=hidden onMouseOver=mroll('mdep"+n+"."+l+"');conta++ onMouseOut=unmroll('mdep"+n+"."+l+"');conta-->&nbsp;<A HREF=javascript:mroll('mdep"+n+"."+l+"') onClick=vai('"+links[i][l]+"',"+i+","+l+") CLASS=menuNN>"+voci[i][l]+"</A></LAYER>");
		}
	}
	else
	{
	document.write("<DIV ID=mtop. STYLE=\"position:absolute;left:"+leftmargin+";top:"+topmargin+";width:50;height:15;background:"+roff+";visibility:visible;cursor:hand\" onMouseOver=showdeps(last,false);mroll('mtop.') onMouseOut=unmroll('mtop.')><A HREF='http://www.autostaklo.com' CLASS=menuIEb onFocus=this.blur()>&nbsp;<I>Home</I></A></DIV>");
	for (i=0;i<voci.length;i++)
		{
		var n=i;
		document.writeln("<DIV ID=mtop"+n+". STYLE=\"position:absolute;left:"+eval(leftmargin+50+largo*i)+";top:"+topmargin+";width:"+largo+";height:15;background:"+roff+";visibility:visible;cursor:hand\" onMouseOver=MostraMenu("+n+");mroll('mtop"+n+".');conta++ onMouseOut=last="+n+";unmroll('mtop"+n+".');conta--><DIV ALIGN=center CLASS=menuIEb>&nbsp;<I>"+voci[i][0]+"</I></DIV></DIV>");
		for (l=1;l<voci[i].length;l++)
			document.writeln("<DIV ID=mdep"+i+"."+l+" STYLE=\"position:absolute;left:"+eval(leftmargin+50+largo*i)+";top:"+eval(topmargin+15*l)+";width:"+largo+";height:15;background:"+roff+";visibility:hidden;cursor:hand\" onMouseOver=;mroll('mdep"+n+"."+l+"');conta++ onMouseOut=unmroll('mdep"+n+"."+l+"');conta-- CLASS=menuIE onClick=vai('"+links[i][l]+"',"+i+","+l+")>&nbsp;"+voci[i][l]+"</DIV>");
		}
	}

timer=setInterval("NascondiMenu()",1000)

function NascondiMenu()
	{
	if (conta==0)
		{
		coloratutti(true)
		timer=setTimeout("coloratutti(false)",200);
		timer=setTimeout("showdeps(last,false)",250);
		}
	}

function coloratutti(col)
	{
	colore=col?ron:roff;
	for (i=0;i<voci.length;i++)
		for (j=1;j<voci[i].length;j++)
			{
		if (nn)
			document.layers["mdep"+i+"."+j].bgColor=colore;
		else
			if(document.all)
				document.all["mdep"+i+"."+j].style.background=colore;
				else
				document.getElementById('mdep'+i+"."+j).style.background=colore;
			}
	}

function MostraMenu(n)
	{
	showdeps(last,false);
	showdeps(n,true);
	last=n;
	}

function showdeps(n,act)
	{
	if (conta==0)
		{
		act?stat="visible":stat="hidden";
	if (nn)
		for (i=1;i<voci[n].length;i++)
			document.layers["mdep"+n+"."+i].visibility=stat;
	else
		for (i=1;i<voci[n].length;i++)
			if(document.all)
				document.all["mdep"+n+"."+i].style.visibility=stat;
				else
				document.getElementById('mdep'+n+"."+i).style.visibility=stat;
		}
	}


function vai(dove,r,c)
	{
	lev=nn?document.layers["mdep"+r+"."+c]:(document.all)?document.all["mdep"+r+"."+c].style:document.getElementById("mdep"+r+"."+c).style;
	if (nn)
		{
		lev.bgColor=roff;
		timer=setTimeout("lev.bgColor=ron",50)
		timer=setTimeout("lev.bgColor=roff",100)
		timer=setTimeout("lev.bgColor=ron",150)
		timer=setTimeout("lev.bgColor=roff",200)
		timer=setTimeout("lev.bgColor=ron",250)
		}
		else
		{
		lev.background=roff;
		timer=setTimeout("lev.background=ron",50)
		timer=setTimeout("lev.background=roff",100)
		timer=setTimeout("lev.background=ron",150)
		timer=setTimeout("lev.background=roff",200)
		timer=setTimeout("lev.background=ron",250)
		}
	timer=setTimeout("self.location.href='"+dove+"'",350)
	}

function mroll(l)
	{
	nn?document.layers[l].bgColor=ron:(document.all)?document.all[l].style.background=ron:document.getElementById(l).style.background=ron;
	document.getElementById?document.getElementById(l).style.cursor=document.all?'hand':'pointer':'void(0)';
	if (l.substr(0,4)=="mdep")
		stringa=wst[l.substr(4,l.indexOf(".")-4)][l.substring(l.indexOf(".")+1,l.length)];
			else if (l.length>5)
			stringa=wst[l.substr(4,l.indexOf(".")-4)][0];
				else stringa="Home Page";		
	window.status=stringa;
	timer=setTimeout("window.status=stringa",20);
	}

function unmroll(l)
	{
	nn?document.layers[l].bgColor=roff:(document.all)?document.all[l].style.background=roff:document.getElementById(l).style.background=roff;
	window.status="";
	}
