var stat = 0;
var polje = 0;
function stat_over(what){
	stat = 1;
	polje = what;

}
function stat_out(){
	stat = 0;

}



function GetDiv(what) {
 var div = null;
 if (document.getElementById)
   div = document.getElementById(what);
 else if (document.all) 
   div = document.all[what];
 else if (document.layers)   
   div = document.layers[what];
 return div;
}

function showMenu(what) { 
	try{
 		var div = GetDiv(what);
		
		
   	    div.style.visibility = "visible";
		document.layers["alex"].left = 2000;
	}
	catch(e){}
}


function hideMenu(what) { 
	try{
		//for(a=1; a<=1000; a++){}
		if(stat == 0 || polje != what){
			var div = GetDiv(what);
    		div.style.visibility = 'hidden';
		}
	}
	catch(e){}
}
function dubleshowMenu(what1,what2) { 
 try{
 		var div1 = GetDiv(what1);
 		var div2 = GetDiv(what2);
   		div1.style.visibility = "visible";
   		div2.style.visibility = "visible";
   }
	catch(e){}
}
function dublehideMenu(what1,what2) { 
 try{	
	var div1 = GetDiv(what1);
 	var div2 = GetDiv(what2);
    div1.style.visibility = "hidden";
    div2.style.visibility = "hidden";
	}
	catch(e){}
}

function Validator1(theForm)
{
   

  if (theForm.email.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.email.focus();
    return (false);
  }
  var good_email = theForm.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
  if (!good_email)
  {
  	alert("Prosim vpišite veljeven e-mail naslov!");
    theForm.email.focus();
    return (false);
  }
}
function Validator_mailer(theForm,text1,text2)
{
   

  if (document.form1.email.value == "" )
  {
    alert(text1);
    document.form1.email.focus();
    return (false);
  }

	  var good_email = document.form1.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	  if (!good_email)
	  {
		alert(text2);
		document.form1.email.focus();
		return (false);
	  }
 
  else {
	  	return(true);
  }




}






function Validator2(theForm)
{
   


  if (theForm.email.value == "" )
  {
    alert("Niste vpisali E-naslova!.");
    theForm.email.focus();
    return (false);
  }

  var good_email = theForm.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
  if (!good_email)
  {
  	alert("Prosim vpišite veljeven e-mail naslov!");
    theForm.email.focus();
    return (false);
  }
}
function dynawin(url, h, w, l, t) {

	var poph = h + 0;
	var popw = w + 0;
	disp = window.open("","pop","height=" + poph + ",width=" + popw + ",left=" + l + ",top=" + t + "");
	with(disp.document) {
		writeln('<HTML><HEAD>');
		writeln('<TITLE>Boutique Napoleon</TITLE>');
		writeln('</HEAD>');
		writeln('<BODY BACKGROUND="#FFFFFF" onBlur="self.close()" style="margin-top:0px; margin-left:0px">');
		writeln('<img src="' + url + '" height="' + h + '" width="' + w + '">');
		//writeln('<P ALIGN="CENTER"><font face="Verdana" size="2">' + desc + '</font></P>');
		writeln('</BODY></HTML>');
		close();
	}


	//disp.document.write(content);
	//disp.document.close();
  }
function dynawin1(url, h, w, l, t, desc) {

	var poph = h + 70;
	var popw = w + 23;
	disp = window.open("","pop","height=" + poph + ",width=" + popw + ",left=" + l + ",top=" + t + ",scrollbars=yes");
	with(disp.document) {
		writeln('<HTML><HEAD>');
		writeln('<TITLE>Boutique Napoleon</TITLE>');
		writeln('</HEAD>');
		writeln('<BODY BACKGROUND="#FFFFFF" onBlur="self.close()" style="margin-top:0px; margin-left:0px">');
		writeln('<img src="' + url + '" height="' + h + '" width="' + w + '">');
		writeln('<P ALIGN="left" style="margin-left:10px"><font face="Verdana" size="2">' + desc + '</font></P>');
		writeln('</BODY></HTML>');
		close();
	}


	//disp.document.write(content);
	//disp.document.close();
  }
  /* pozicija menujev */
function getRealLeft(el) {
	xPos = el.offsetLeft;
	tempEl = el.offsetParent;
	while (tempEl != null) {
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}
	return xPos;
}

function getRealTop(el) {
	yPos = el.offsetTop;
	tempEl = el.offsetParent;
	while (tempEl != null) {
		yPos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
	}
	return yPos;
}

function display_pos_left(id) {
	var el = document.all ? document.all(id) :
	document.getElementById ? document.getElementById(id) : null;
	if (el) {
		var trueX = getRealLeft(el);
		return trueX;
	}
}
function display_pos_top(id) {
	var el = document.all ? document.all(id) :
	document.getElementById ? document.getElementById(id) : null;
	if (el) {
		var trueY = getRealTop(el);
		return trueY;
	}
}




