function auf() {
    if (document.getElementById) {
        document.getElementById("start_movie").style.display = "none";
        document.getElementById("Layer1A").style.display = "inline";
    }
}

function zu() {
    if (document.getElementById) {
    document.getElementById("Layer1A").style.display = "none";
    document.getElementById("start_movie").style.display = "inline";
    }
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function popup(ort,x,y) {
  win = window.open(ort, 'Fenster','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+x+',height='+y);
  win.focus();
}

function popupNoScroll(ort,x,y) {
  win = window.open(ort, 'Fenster','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+x+',height='+y);
  win.focus();
}


function winopen(url, w, h) {
if (typeof w=="undefined"){w=640;}
if (typeof h=="undefined"){h=480;}
 if(navigator.userAgent.indexOf("Mac") != -1) {
  newwindow = window.open(url,'viewer_win','directories=0,location=1,menubar=1,scrollbars=1,status=0,toolbar=1,resizable=1,width='+w+',height='+h+',screenx=0,screeny=0');
  if(navigator.appName == "Netscape" && parseInt(navigator.appVersion.substring(0,1)) >= 3) {newwindow.focus()}
 }
 else {
  newurl = url;
  newwindow = window.open(newurl,'viewer_win','directories=0,location=1,menubar=1,scrollbars=1,status=0,toolbar=1,resizable=1,width='+w+',height='+h+',screenx=0,screeny=0');
  newwindow.focus();
 }
}

// Start Variablen und Funktionen fuer Startseiten- und Favoriten-Knopf //
    var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")==-1) );
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")==-1) && (agt.indexOf("msie 6")==-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );

function setHomePage(homepage,la_url_es) {
 if (is_win && is_ie5up) {
        document.body.style.behavior='url(#default#homepage)';
        document.body.setHomePage(homepage);
    }
}

function addToFavorite(favTitle){
  if ((navigator.appVersion.indexOf("MSIE") > 0) && (parseInt(navigator.appVersion) >= 4)) {
    window.external.AddFavorite(location.href, unescape(favTitle));
  }
}
// Ende Variablen und Funktionen fuer Startseiten- und Favoriten-Knopf //

// Start Newsletter Validierung
function bestelleNewsletter() {
    if (document.orderForm.salutation.value == "") {
        window.alert("Keine Auswahl: Anrede\nBitte wählen Sie eine Anrede aus.");
    }
    else if (document.orderForm.firstname.value == "") {
        window.alert("Keine Eingabe: Vorname\nBitte geben Sie einen Vornamen ein.");
    }
    else if (document.orderForm.lastname.value == "") {
        window.alert("Keine Eingabe: Name\nBitte geben Sie einen Namen ein.");
    }
    else if (document.orderForm.email.value == "") {
        window.alert("Keine Eingabe: Email\nBitte geben Sie eine Email-Adresse ein.");
    }
    else if (document.orderForm.email.value.indexOf("@") == -1) {
        window.alert("Falsche Eingabe: Email\nBitte geben Sie eine korrekte Email-Adresse ein.");
    }
    else if (document.orderForm.emailrepeat.value == "") {
        window.alert("Keine Eingabe: Email wiederholen\nBitte wiederholen Sie die Email-Adresse.");
    }
    else if (document.orderForm.emailrepeat.value != document.orderForm.email.value) {
        window.alert("Falsche Eingabe: Email wiederholen\nDie Email-Adressen stimmen nicht \u00fcberein.");
    }
    else {
        document.orderForm.submit();
    }
}
function bestelleCastellMiquelNewsletter() {
    if (document.orderForm.lastname.value == "") {
        window.alert("Keine Eingabe: Name\nBitte geben Sie einen Namen ein.");
    }
    else if (document.orderForm.email.value == "") {
        window.alert("Keine Eingabe: Email\nBitte geben Sie eine Email-Adresse ein.");
    }
    else if (document.orderForm.email.value.indexOf("@") == -1) {
        window.alert("Falsche Eingabe: Email\nBitte geben Sie eine korrekte Email-Adresse ein.");
    }
    else {
        document.orderForm.submit();
    }
}
function abbestelleNewsletter() {
    if (document.cancelForm.noService.value == "") {
        window.alert("Keine Eingabe: Email\nBitte geben Sie eine Email-Adresse ein.");
    }
    else if (document.cancelForm.noService.value.indexOf("@") == -1) {
        window.alert("Falsche Eingabe: Email\nBitte geben Sie eine korrekte Email-Adresse ein.");
    }
    else {
        document.cancelForm.submit();
    }
}
function orderNewsletter() {
    if (document.orderForm.salutation.value == "") {
        window.alert("No selection: Salutation\nPlease select a salutation.");
    }
    else if (document.orderForm.firstname.value == "") {
        window.alert("Blank input: Firstname\nPlease enter a first name.");
    }
    else if (document.orderForm.lastname.value == "") {
        window.alert("Blank input: Name\nPlease enter a name.");
    }
    else if (document.orderForm.email.value == "") {
        window.alert("Blank input: Email\nPlease enter a email adress.");
    }
    else if (document.orderForm.email.value.indexOf("@") == -1) {
        window.alert("Invalid input: Email\nPlease enter a valid email adress.");
    }
    else if (document.orderForm.emailrepeat.value == "") {
        window.alert("Blank input: Repeat email\nPlease repeat the email adress.");
    }
    else if (document.orderForm.emailrepeat.value != document.orderForm.email.value) {
        window.alert("Invalid input: Repeat Email\nThe second email adress doesn't match the first one.");
    }
    else {
        document.orderForm.submit();
    }
}
function cancelNewsletter() {
    if (document.cancelForm.noService.value == "") {
        window.alert("Blank input: Email\nPlease enter a email adress.");
    }
    else if (document.cancelForm.noService.value.indexOf("@") == -1) {
        window.alert("Invalid input: Email\nPlease enter a valid email adress.");
    }
    else {
        document.cancelForm.submit();
    }
}
// Ende Newsletter Validierung

/** Open dialog.
  * @param iFile   file to open
  * @param iId     dialog ID
  * @param iModal  flag to indicate if dialog should be modal or not
  * @param iHeight height
  * @param iWidth  width
  */
function openDialog(iFile, iId, iModal, iHeight, iWidth, iPosXOffset, iPosYOffset) {

  var vWidth = 550, vHeight = 320;
  if(iWidth)
    vWidth = iWidth;
  if(iHeight)
    vHeight = iHeight;

  var vPosX = screen.width*.5-vWidth*.5, vPosY = screen.height*.5-vHeight*.5;
  if(iPosXOffset)
    vPosX = vPosX+iPosXOffset;
  if(iPosYOffset)
    vPosY = vPosY+iPosYOffset;

  var vAttributes = "width="+vWidth+",height="+vHeight+",left="+vPosX+",top="+
                    vPosY+",dependent="+ iModal +",resizable=yes,scrollbars=yes,"+
                    "location=no,menubar=no,status=no,toolbar=no";

//  var vDlg = window.open(iFile, iId, vAttributes);
//  vDlg.focus();
  win = window.open(iFile, iId,  vAttributes);
  win.focus();
}
