var screenx = 0;
var oldScreenx = 0;
var menContent="";
var winXSize = VentanaX();
function showgrafic(pageurl,winwidth,winheight) {
         graficshow=window.open (
             "showgrafic.html?pic="+pageurl,
             "OttYachtImage",
             "toolbar=no,"
            +"scrollbars=no,"
            +"location=no,"
            +"resizable=no,"
            +"width="+winwidth
            +",height="+winheight
         );
}
function VentanaX() {
         if (window.innerWidth) {
            return window.innerWidth;
         } else if (document.body && document.body.offsetWidth) {
            return document.body.offsetWidth;
         } else {
            return screen.width;
         }
}
function VentanaY() {
         if (window.innerHeight) {
            return window.innerHeight;
         } else if (document.body && document.body.offsetHeight) {
            return document.body.offsetHeight;
         } else {
            return screen.Height;
         }
}
function init() {
         screenx = VentanaX()-20;
         if (screenx < 800) screenx=800;
         if (screenx != oldScreenx) {
            widthsaver.location.href = "guardarsize.html?size=" + VentanaX();
            oldScreenx = screenx;
         }
         document.getElementById("ott-yacht-head").style.left = screenx/2 - 400 + "px";
         document.getElementById("ott-yacht-content").style.left = screenx/2 - 400 + "px";
         document.getElementById("ott-yacht-pulldown").style.left = screenx/2 - 400 + "px";
         document.getElementById("ott-yacht-smallinks").style.left = screenx/2 - 400 + "px";
         document.getElementById("ott-yacht-MenuMain").style.left = screenx/2 - 401 + "px";
         document.getElementById("ott-yacht-MenuProducts").style.left = screenx/2 - 344 + "px";
         document.getElementById("ott-yacht-MenuProductsSub").style.left = screenx/2 - 185 + "px";
         document.getElementById("ott-yacht-Menu2ndHand").style.left = screenx/2 - 238 + "px";
         document.getElementById("ott-yacht-MenuService").style.left = screenx/2 - 114 + "px";
         document.getElementById("ott-yacht-MenuShop").style.left = screenx/2 - 16 + "px";
         document.getElementById("ott-yacht-MenuContact").style.left = screenx/2 + 53 + "px";
         window.setTimeout("init()",333);
}
function closeMenus() {
         closeProductsSub();
         document.getElementById("closer").style.width = "1px";
         document.getElementById("closer").style.height = "1px";
         document.getElementById("ott-yacht-MenuMain").style.top="-500px";
         document.getElementById("ott-yacht-MenuProducts").style.top="-500px";
         document.getElementById("ott-yacht-MenuService").style.top="-500px";
         document.getElementById("ott-yacht-Menu2ndHand").style.top="-500px";
         document.getElementById("ott-yacht-MenuShop").style.top="-500px";
         document.getElementById("ott-yacht-MenuContact").style.top="-500px";
}
function closeProductsSub() {
         document.getElementById("ott-yacht-MenuProductsSub").style.top = "-500px";
}
function showCloser() {
         document.getElementById("closer").style.width = VentanaX() - 50 + "px";
         document.getElementById("closer").style.height = VentanaY() - 215 + "px";
}
function showMain() {
         closeMenus();
         showCloser();
         document.getElementById("ott-yacht-MenuMain").style.top="164px";
}
function showProducts() {
         closeMenus();
         showCloser();
         document.getElementById("ott-yacht-MenuProducts").style.top="164px";
}
function showProductsSub(boatName,boatDir,verticalPos) {
         var boeteliName = boatName;
         if (boeteliName == "le H - Boat") {
            boeteliName = "du H - Boat";
         } else {
            boeteliName = "de " + boeteliName;
         }
         menContent  = "<a class='menuPulldown' style='width:210px' href='../" + boatDir + "/'><b><nobr>Au sujet " + boeteliName + "</nobr></b></a><br>";
         menContent += "<a class='menuPulldown' style='width:210px' href='../" + boatDir + "/segeln.html'>Sur l´eau</a><br>";
         menContent += "<a class='menuPulldown' style='width:210px' href='../" + boatDir + "/interior.html'>Sous le pont / la cabine</a><br>";
         menContent += "<a class='menuPulldown' style='width:210px' href='../" + boatDir + "/riss.html'>Dessin / données techniques</a><br>";
         menContent += "<a class='menuPulldown' style='width:210px' href='../main/fotogalerie.html?source=";
         menContent += boatDir + "&titel=" + boeteliName.replace("/ /","%20") + "'>Galerie de photo</a><br>";
         menContent += "<a class='menuPulldown' style='width:210px' href='../" + boatDir + "/preis.html'>Prix / Demande</a><br>";
         document.getElementById("ott-yacht-MenuProductsSub").innerHTML = menContent;
         document.getElementById("ott-yacht-MenuProductsSub").style.top = verticalPos + "px";
}
function showService() {
         closeMenus();
         showCloser();
         document.getElementById("ott-yacht-MenuService").style.top="164px";
}
function show2ndHand() {
         closeMenus();
         showCloser();
         document.getElementById("ott-yacht-Menu2ndHand").style.top="164px";
}
function showShop() {
         closeMenus();
         showCloser();
         document.getElementById("ott-yacht-MenuShop").style.top="164px";
}
function showContact() {
         closeMenus();
         showCloser();
         document.getElementById("ott-yacht-MenuContact").style.top="164px";
}
function ChkKontaktform() {
         if (document.kontaktform.absender.value == "") {
            alert("Merci de bien vouloir entrer votre nom!");
            document.kontaktform.absender.focus();
            return false;
         }
         if (  (document.kontaktform.email.value.indexOf('@') == -1)
             ||(document.kontaktform.email.value.indexOf('.') == -1)  ) {
            alert("Vous n´avez pas entrez d´adresse\nélectronique ou celle-ci n´est pas valable!");
            document.kontaktform.email.focus();
            return false;
         }
         if (document.kontaktform.message.value == "") {
            alert("Vous avez oublié d´entrer votre message!");
            document.kontaktform.message.focus();
            return false;
         }
}
function takeinbasket (artnumber,artgroup1,size) {
         basketshow=window.open (
             "takeinbasket.html?artnumber="+artnumber+"&artgroup1="+artgroup1+"&size="+size,
             "Warenkorb",
             "toolbar=no,"
            +"scrollbars=yes,"
            +"location=no,"
            +"resizable=no,"
            +"width=400,height=300"
         );
}
