//------------------------------------------------------------------------------
//Navigation Functions
//------------------------------------------------------------------------------
function JS_checkProducts() {
  if(document.getElementById('table_main')==null) {
    location.href='http://www.lbc-paris.de';
  }
}
function JS_changeProducts(URL,LVL) {
  var hosturl='http://'+window.location.host+'/';
  var setlogo=LVL;
  var hrefind=URL.indexOf('=')+1;
  if(hrefind>0) {
    hrefid=URL.substr(hrefind);
  }
  if(hosturl!='http://www.lbc-paris.de/') {
    hrefid='http://www.lbc-paris.de/index.php?id='+hrefid;
    JS_includeProducts('http://www.lbc-paris.de/fileadmin/lbc-paris/products.php?phrefid='+hrefid);
    if(setlogo==1) {
      document.getElementById('bannerLogo').innerHTML='<img src="'+hosturl+'fileadmin/banner_list.jpg" width="900" height="253" border="0" alt="" id="banner" usemap="#logo" />';
      setlogo=0;
    }
    else {
      document.getElementById('bannerLogo').innerHTML='<img src="'+hosturl+'fileadmin/banner.jpg" width="900" height="253" border="0" alt="" id="banner" usemap="#logo" />';
      setlogo=0;
    }
  }
  else {
    setlogo=0;
    //location.href='http://www.lbc-paris.de/index.php?id='+hrefid;
    location.href=URL;
  }
}
function JS_includeProducts(PHP) {
  var htmldoc=document.getElementsByTagName('head').item(0);
  var js=document.createElement('script');
  js.setAttribute('language','JavaScript');
  js.setAttribute('type','text/javascript');
  js.setAttribute('src',PHP);
  htmldoc.appendChild(js);
  return false;
}
//------------------------------------------------------------------------------
//Contact Functions
//------------------------------------------------------------------------------
function JS_testFormular() {
  var mail=document.Formular.email.value;
  if(document.Formular.name.value.length<3) {
    alert('Bitte geben Sie Ihren Namen ein.');
    document.Formular.name.focus();
    return false;
  }
  else if(document.Formular.phone.value.length<3) {
    alert('Bitte geben Sie Ihre Telefonnummer ein.');
    document.Formular.phone.focus();
    return false;
  }
  else if(mail.length<10||mail.indexOf('@',0)==-1||mail.indexOf('.',0)==-1) {
    alert('Bitte geben Sie eine gültige E-Mail-Adresse ein.');
    document.Formular.email.select();
    return false;
  }
  else if(document.Formular.message.value.length<10) {
    alert('Bitte geben Sie eine Nachricht ein.');
    document.Formular.message.focus();
    return false;
  }
  else
    return true;
}
//------------------------------------------------------------------------------
//Mouse Functions
//------------------------------------------------------------------------------
function MM_swapImgRestore() {
  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) {
  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 MM_swapImage() {
  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_preloadImages() {
  var d=document;
  if(d.images) {
    if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
    for(i=0; i<a.length; i++) if(a[i].indexOf('#')!=0) {
      d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
    }
  }
}
//------------------------------------------------------------------------------
//Window Functions
//------------------------------------------------------------------------------
function JS_openWindow(URL) {
  var popupSizeX=800;
  var popupSizeY=600;
  var popupLocationX=50;
  var popupLocationY=50;
  splashWin = window.open(URL,'lbc-paris','directories=0,fullscreen=1,location=0,menubar=0,resizable=0,scrollbars=no,status=0,toolbar=0');
  splashWin.blur();
  window.focus();
  splashWin.resizeTo(popupSizeX,popupSizeY);
  splashWin.moveTo(popupLocationX,popupLocationY);
  splashWin.focus();
}
//------------------------------------------------------------------------------
//Different Functions
//------------------------------------------------------------------------------
function JS_changeDomain() {
  var documentDomain=location.hostname.indexOf('.')+1;
  if (documentDomain>0) {
    document.domain=location.hostname.substr(documentDomain);
  }
}
function JS_changeBanner(SET) {
  var documentBanner=SET;
  if(documentBanner==1) {
    document.getElementById('bannerLogo').innerHTML='<img src="fileadmin/banner_list.jpg" width="900" height="253" border="0" alt="" id="banner" usemap="#logo" />';
    documentBanner=0;
  }
  else {
    document.getElementById('bannerLogo').innerHTML='<img src="fileadmin/banner.jpg" width="900" height="253" border="0" alt="" id="banner" usemap="#logo" />';
    documentBanner=0;
  }
}
function JS_resizeFrame() {
  document.getElementById('frame_main').style.height=frames['frame_main'].document.getElementById('inhalt').offsetHeight+'px';
}
function JS_resizeNavFrame() {
  document.getElementById('frame_navigation').style.height=frames['frame_navigation'].document.getElementById('navi').offsetHeight+'px';
}
//------------------------------------------------------------------------------
