    NewWindow=null;
	function ShowItem(src, w, h, title){
		if(NewWindow){NewWindow.close();}
		if(NewWindow==null || NewWindow.closed){
		if (typeof(title)=="undefined") title="Galéria";
			var top = screen.height/2 - h/2;
			var left = screen.width/2 - w/2;
			settings=
				 "left=" + left + "px,"
				 +"top=" + top + "px,"
				 +"width=" + w + "px,"
				 +"height=" + h + "px,"
				 +"toolbar=no,"
				 +"location=no,"
				 +"directories=no,"
				 +"status=no,"
				 +"menubar=no,"
				 +"scrollbars=no,"
				 +"resizable=no";
			NewWindow = window.open("",'Klose',settings);
            NewWindow.resizeTo(w,h);
		}
		NewWindow.document.open();
		NewWindow.document.clear();
		NewWindow.document.write(
			"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1250\">"
			+"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1250\"><title>"
			+ title +"</title></head>\n"
			+"<body topmargin=0 leftmargin=0 onclick=window.close(); onblur=\"window.close();\" bgcolor=#FFFFFF>\n"
			+"<table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=0><tr><td align=\"center\" valign=\"middle\"><img src=" + src + " border=1></td></tr></table>\n"
			+"</body>\n"
			+"</html>"
		);
		NewWindow.document.close();
		NewWindow.focus();
	}

	NewWindow1 = null;
	function ShowWin(href, w, h){
		if(NewWindow1){ NewWindow1.close(); }
		if(NewWindow1==null || NewWindow1.closed){
			var top = screen.height/2 - h/2;
			var left = screen.width/2 - w/2;
			var settings =
		 		"left=" + left + "px,"
				+"top=" + top + "px,"
				+"width=" + w + "px,"
				+"height=" + h + "px,"
				+"toolbar=no,"
				+"location=no,"
				+"directories=no,"
				+"status=yes,"
				+"menubar=no,"
				+"scrollbars=yes,"
				+"resizable=no";
			NewWindow1 = window.open(href,'okno',settings);
            NewWindow1.resizeTo(w,h);
		}
		NewWindow1.focus();
	}
    
    NewWindow3 = null;
    function ShowWebPage(href){
		if(NewWindow3){ NewWindow3.close(); }
		if(NewWindow3==null || NewWindow3.closed){
			var settings =
		 		"left=" + screen.left + "px,"
				+"top=" + screen.top + "px,"
				+"width=" + screen.width + "px,"
				+"height=" + screen.height + "px,"
				+"toolbar=yes,"
				+"location=yes,"
				+"directories=yes,"
				+"status=yes,"
				+"menubar=yes,"
				+"scrollbars=yes,"
				+"resizable=yes";
			NewWindow3 = window.open(href,'okno',settings);
		}
		NewWindow3.focus();
	}
	
	NewWindow2 = null;
	function PrintDetails(content,w,h) {
		if(NewWindow2){NewWindow2.close();}
		if(NewWindow2==null || NewWindow2.closed){
			var top = screen.height/2 - h/2;
			var left = screen.width/2 - w/2;
		 	settings = "left="+left+",top="+top+",width="+w+"px,height="+h+"px,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes"
	 		NewWindow2 = window.open("",'Detaily',settings);
            NewWindow2.resizeTo(w,h);
		}
		NewWindow2.document.open();
		NewWindow2.document.clear();
		NewWindow2.document.write(
			"<html><head><title>Tlač</title></head><style>table {font-size:11px;}</style>\n"
			+"<body topmargin=10 leftmargin=10 onload=\"window.print();\" bgcolor=#FFFFFF style=\"font-family:Verdana,Arial;font-size:10px;\">\n"
			+ content
			+"</body>\n"
			+"</html>"
		);
		NewWindow2.document.close();
		NewWindow2.focus();
	}
	
	function changeMenuImage(id,type){
		document.getElementById('m'+id).src = 'files/images/menu/m'+id+''+type+'.gif';
	}
	
	function setMenuDefaultClass(){
		window.parent.document.getElementById('main-page').className = 'menu';
		window.parent.document.getElementById('o-nas').className = 'menu';
		window.parent.document.getElementById('ponuka').className = 'menu';
		window.parent.document.getElementById('ponuka').className = 'menu';
		window.parent.document.getElementById('podpora').className = 'menu';
		window.parent.document.getElementById('podmienky').className = 'menu';
		window.parent.document.getElementById('referencie').className = 'menu';
		window.parent.document.getElementById('links').className = 'menu';
		window.parent.document.getElementById('kontakt').className = 'menu';
	}
    
    function setMenuClass(idItem){
		setMenuDefaultClass();
		switch(idItem){
			case "":
			case "main-page":
				window.parent.document.getElementById('main-page').className = 'menu_over';
				break;
			case "o-nas":
				window.parent.document.getElementById('o-nas').className = 'menu_over';
				break;
			case "ponuka":
				window.parent.document.getElementById('ponuka').className = 'menu_over';
				break;
			case "ponuka":
				window.parent.document.getElementById('ponuka').className = 'menu_over';
				break;
			case "podpora":
			case "klientom":
			case "radime":
			case "faq": 
			case "download":
				window.parent.document.getElementById('podpora').className = 'menu_over';
				break;
			case "podmienky":
				window.parent.document.getElementById('podmienky').className = 'menu_over';
				break;
			case "referencie":
				window.parent.document.getElementById('referencie').className = 'menu_over';
				break;
			case "links":
				window.parent.document.getElementById('links').className = 'menu_over';
				break;
			case "kontakt":
				window.parent.parent.document.getElementById('kontakt').className = 'menu_over';
				break;
		}
    }    
	
	
    function check_faq(f){
		if(f.idK.value == ""){
	    	alert("Nezvolili ste kategóriu!");
		    f.idK.focus();
    		return false;
    	} else {
	    	if(f.faq_email.value == ""){
		    	alert("Nezadali ste E-Mailovú adresu!");
			    f.faq_email.focus();
    			return false;
	    	} else {
		    	if (f.faq_msg.value == ""){
				    alert("Text správy musíte vyplniť!");
		    		f.faq_msg.focus();
	    			return false;
	    		} else {
				    if (window.RegExp){
			    		re = new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$");
	    				if (!re.test(f.faq_email.value)){
    						alert("Zadaná e-mailová adresa je neplatná!");
						    f.faq_email.focus();
				    		return false;
				    	} else {
			    			return true;
	    				}
    				} else {
					    return true;
					}
			    }
		    }
	    }
    }
	
    function check_order_form(){
        if(document.getElementById('meno').value == ""){
	    	alert("Nezadali ste Vaše meno!");
		    document.getElementById('meno').focus();
    		return false;
    	} else {
            if(document.getElementById('priezvisko').value == ""){
    	    	alert("Nezadali ste Vaše priezvisko!");
		        document.getElementById('priezvisko').focus();
        		return false;
        	} else {
                if(document.getElementById('order_email').value == ""){
                    alert("Nezadali ste Vašu e-mailovú adresu!");
                    document.getElementById('order_email').focus();
                    return false;
                } else {
					if (window.RegExp){
                		re = new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$");
						if (!re.test(document.getElementById('order_email').value)){
							alert("Zadaná e-mailová adresa je neplatná!");
				            document.getElementById('order_email').focus();
							return false;
						} else {
	    		          	return true;
                    	}
                	} else {
                    	return true;
                    }
                }
            }
        }
    }
    
    function showAktualizaciu(id,top,left){
        if(document.body.clientWidth >= 780){
        	document.getElementById(id).style.top = top + 'px';
	        document.getElementById(id).style.left = (document.body.clientWidth/2 + left) + 'px';
        } else {
        	document.getElementById(id).style.top = top + 'px';
	        document.getElementById(id).style.left = (780/2 + left) + 'px';
        }
        document.getElementById(id).style.display = 'block';
    }
    
    function hideAktualizaciu(id,top,left){
        if(document.body.clientWidth >= 780){
        	document.getElementById(id).style.top = top + 'px';
	        document.getElementById(id).style.left = (document.body.clientWidth/2 + left) + 'px';
        } else {
        	document.getElementById(id).style.top = top + 'px';
	        document.getElementById(id).style.left = (780/2 + left) + 'px';
        }
        document.getElementById(id).style.display = 'none';
    }
	
	function navigate(value){
		var data = value.split("#");
		setMenuClass(data[1]);
		window.location.href = data[0];
	}
