function checkNewsletter() {
  //var el=document.newsletter, err;
  var el = document.newsletter, err="";
    if (el.rs1.value.length < 3) {
     err = " - Emailovú adresu\n";
    }
    else if (window.RegExp) {
     re = new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}");
     if (!re.test(el.rs1.value)) {
      err = " - Správny tvar emailovej adresy\n";
     }
    }
    
    if(err != "") {
     err = "Nezadali ste:\n" + err;
     window.alert(err);
     return false;   
    }
     else {
      return true;
     }
}

function checkLogin() {
  //var el=document.newsletter, err;
  var el = document.login, err="";
    if (el.rs1.value.length < 3) {
     err = " - Login\n";
    }
    if (el.rs2.value == "") {
      err = " - Heslo\n";
    }
    
    if(err != "") {
     err = "Nezadali ste:\n" + err;
     window.alert(err);
     return false;   
    }
     else {
      return true;
     }
}

var xmlHttp
var idecko;

/* nacitanie obsahu */
  function runScript(nazov, cesta, hodnota1, hodnota2, hodnota3) {
   xmlHttp = GetXmlHttpObject();

    idecko = nazov;

   if (xmlHttp == null) {
    alert ("Tvoj prehliadač nepodporuje AJAX!");
    return;
   }
   
   var url = cesta;
   url = url + "?sid=" + Math.random();
   url = url + "&rs1=" + hodnota1;
   url = url + "&rs2=" + hodnota2;
   url = url + "&rs3=" + hodnota3;   
   xmlHttp.onreadystatechange = stateChanged1;   
   xmlHttp.open("GET",url,true);
   xmlHttp.send(null);
  }

/* spracovanie poziadavky */
  function stateChanged1() {
   if (xmlHttp.readyState == 4) {
    document.getElementById(idecko).innerHTML = xmlHttp.responseText;
   }
  }

  function GetXmlHttpObject() {
   var xmlHttp = null;
   try {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
   }
   catch (e) {
    // Internet Explorer
    try {
     xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) {
     xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
   }
    return xmlHttp;
  }
             //<![CDATA[
            // Initialize and render the menu bar when it is available in the DOM
            YAHOO.util.Event.onContentReady("productsandservices", function () {
            var oMenuBar = new YAHOO.widget.MenuBar("productsandservices", { 
                                                            autosubmenudisplay: true, 
                                                            hidedelay: 750, 
                                                            lazyload: true });
          var oSubmenuData = [
          
{
id: "Home",
itemdata: [
]},
{
id: "History",
itemdata: [
]},
{
id: "Services",
itemdata: [
]},
{
id: "News",
itemdata: [
]},
{
id: "Links",
itemdata: [
]},
{
id: "Contacts",
itemdata: [
]},
          ];var ua = YAHOO.env.ua,
                    oAnim;  // Animation instance
                function onSubmenuBeforeShow(p_sType, p_sArgs) {
                    var oBody,
                        oElement,
                        oShadow,
                        oUL;
                    if (this.parent) {
                        oElement = this.element;
                        oShadow = oElement.lastChild;
                        oShadow.style.height = "0px";
                        if (oAnim && oAnim.isAnimated()) {
                            oAnim.stop();
                            oAnim = null;
                        }
                        oBody = this.body;
                        //  Check if the menu is a submenu of a submenu.
                        if (this.parent && 
                            !(this.parent instanceof YAHOO.widget.MenuBarItem)) {
                            if (ua.gecko) {
                                oBody.style.width = oBody.clientWidth + "px";
                            }
                            if (ua.ie == 7) {
                                oElement.style.width = oElement.clientWidth + "px";
                            }
                        }
                        oBody.style.overflow = "hidden";
                        oUL = oBody.getElementsByTagName("ul")[0];
                        oUL.style.marginTop = ("-" + oUL.offsetHeight + "px");
                    }
                }
               function onTween(p_sType, p_aArgs, p_oShadow) {
                    if (this.cfg.getProperty("iframe")) {
                        this.syncIframe();
                    }
                    if (p_oShadow) {
                        p_oShadow.style.height = this.element.offsetHeight + "px";
                    }
                }
                function onAnimationComplete(p_sType, p_aArgs, p_oShadow) {
                    var oBody = this.body,
                        oUL = oBody.getElementsByTagName("ul")[0];
                    if (p_oShadow) {
                        p_oShadow.style.height = this.element.offsetHeight + "px";
                    }
                    oUL.style.marginTop = "";
                    oBody.style.overflow = "";
                    //  Check if the menu is a submenu of a submenu.
                    if (this.parent && 
                        !(this.parent instanceof YAHOO.widget.MenuBarItem)) {
                        // Clear widths set by the "beforeshow" event handler
                        if (ua.gecko) {
                            oBody.style.width = "";
                        }
                        if (ua.ie == 7) {
                            this.element.style.width = "";
                        }
                    }
                }
                function onSubmenuShow(p_sType, p_sArgs) {
                    var oElement,
                        oShadow,
                        oUL;
                    if (this.parent) {
                        oElement = this.element;
                        oShadow = oElement.lastChild;
                        oUL = this.body.getElementsByTagName("ul")[0];
                        oAnim = new YAHOO.util.Anim(oUL, 
                            { marginTop: { to: 0 } },
                            .5, YAHOO.util.Easing.easeOut);
                        oAnim.onStart.subscribe(function () {
                            oShadow.style.height = "100%";
                        });
                        oAnim.animate();
                        if (YAHOO.env.ua.ie) {
                            oShadow.style.height = oElement.offsetHeight + "px";
                            oAnim.onTween.subscribe(onTween, oShadow, this);
                        }
                        oAnim.onComplete.subscribe(onAnimationComplete, oShadow, this);
                    }
                }oMenuBar.subscribe("beforeRender", function () {
                    if (this.getRoot() == this) {this.getItem(2).cfg.setProperty("submenu", oSubmenuData[2]);
}}); oMenuBar.subscribe("beforeShow", onSubmenuBeforeShow);
                oMenuBar.subscribe("show", onSubmenuShow);
oMenuBar.render();            
            });
            //]]>
