function LeftNavHeight() {
	//bh = parseInt(window.document.getElementById("LayoutHeight").offsetHeight) - 80;
	bh = parseInt(window.document.getElementsByTagName("Body")[0].offsetHeight) * 1,05;
	document.getElementById("left-nav").style.height = bh+'px';
}

function PreLoadTopNav() {
	var BildArray = new Array();
	BildArray[0] = "/WebRoot/Grau/Grau/head-menu/hund_ico_active.png";
	BildArray[1] = "/WebRoot/Grau/Grau/head-menu/katze_ico_active.png";
	BildArray[2] = "/WebRoot/Grau/Grau/head-menu/kleintier_ico_active.png";

	var Bild = new Array();
  for (i=0; i < BildArray.length; i++) {
    Bild[i] = new Image();
    Bild[i].src = BildArray[i];
  }
}

function bookmark()
{
   var url="http://www.grau-gmbh.de/";
   var title="Grau GmbH - Spezialtiernahrung";
   if(document.all)
   {
      window.external.AddFavorite(url,title);
   }
   else
   {
      alert('D'+String.fromCharCode("0252")+'cken Sie bitte STRG+D, um den Shop zu Ihren Favoriten hinzuzuf'+String.fromCharCode("0252")+'gen');
   }
}


function isInteger(s){
    var i;
    for (i = 0; i < s.length; i++)
    {
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    return true;
}


function popup(url, name) {
      var left = (screen.width/2)-(390/2);
      var top = (screen.height/2)-(160/2);
      wkorb = window.open(url, name ,"width=390,height=160,top ="+top+",left="+left+",toolbar=no,location=no,scrolling=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
}

function formSubmit(formular){
	bform=FIND(formular);
	bform.submit();
}


function openWindow(URL,windowName,features) {
  if(features=="PopUp") {
    features="width=790, height=580, toolbar=no, status=no, resizable=yes, menubar=no, location=no, scrollbars=yes";
  }
  if(features=="PopUpPrint") {
    features="width=790, height=580, toolbar=yes, status=no, resizable=yes, menubar=yes, location=no, scrollbars=yes";
  }
  if(features=="RTE" || windowName=="RTE") {
    features="width=864, height=580, toolbar=no, status=no, resizable=yes, menubar=no, location=no, scrollbars=yes";
  }
  if(features=="DetailedImageView") {
    features="width=800, height=800, toolbar=no, status=no, resizable=yes, menubar=no, location=no, scrollbars=yes";
    windowName="StylePreview";
   }
  if(features=="CheckLink") {
    splittedString = URL.split('//');
    if(splittedString[0].toLowerCase() != "http:") {
      URL ="http://"+URL;
    }
    features="toolbar=yes, status=yes, resizable=yes, menubar=yes, location=yes, scrollbars=yes";
  }

  newwin=window.open(URL,windowName,features);
  newwin.focus();
}

/* menu start */
function suchen(item) {
  if (document.all) return(document.all[item]);
  if (document.getElementById) return(document.getElementById(item));
  return(false);
}
function parentsuchen(item) {
	if (document.all) return(opener.document.all[item]);
	if (document.getElementById) return(opener.document.getElementById(item));
	return(false);
}


function gotoURL(url){
  self.location.href=url;
}

function navclick(id) {
  if(suchen("Nav_"+id).className!='ContextBoxBody'){
     suchen("Nav_"+id).className='ContextBoxBody';
     suchen("Nav_"+id).style.display='block';
  } else {
     suchen("Nav_"+id).className='';
     suchen("Nav_"+id).style.display='none';
  }
}

/* menu end */


function toggle( id ) {
    var element = document.getElementById( id );
    if( element.style.display == 'none' )
        element.style.display = '';
    else
        element.style.display = 'none';
}
