/*--------------------------------------------------------------------------*/
/* Haueter JavaScript														*/
/*--------------------------------------------------------------------------*/
var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)? 
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee () {
	if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
		cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+'px'
	else  
		cross_marquee.style.top=parseInt(marqueeheight)+8+'px' 
}

function initializemarquee(){ 
	cross_marquee=document.getElementById('vmarquee')
	if (cross_marquee == null) {
		return
	}
	cross_marquee.style.top=0
	marqueeheight=document.getElementById('marqueecontainer').offsetHeight
	actualheight=cross_marquee.offsetHeight
	//if Opera or Netscape 7x, add scrollbars to scroll and exit cross_marquee.style.height=marqueeheight+'px' 
	if (window.opera || navigator.userAgent.indexOf('Netscape/7')!=-1){ 
		cross_marquee.style.overflow='scroll' 
		return
	}
	setTimeout('lefttime=setInterval("scrollmarquee()",40)', delayb4scroll) 
}

if (window.addEventListener) 
	window.addEventListener('load', initializemarquee, false)
else if (window.attachEvent) 
	window.attachEvent('onload', initializemarquee)
else if (document.getElementById)
	window.onload=initializemarquee


/****************************************************************************/
function MakeArray(n) {
	for (var i = 0; i < n; i++) {
		this[i] = 0;
	}
	this.length = n;
}

/****************************************************************************/
function getImage(auswahl) {
	if(auswahl.Value != 0) {
//		document.imgKranModell.style.visibility = "visible";
		//	Datei fuer auswahl.value = "1820_K5" .gif
//		document.imgKranModell.src = "images/" +auswahl.value +".png";
		window.open(auswahl.value +".php",'neu','target = _self');
//		window.open("images/" +auswahl.value +".htm");
	} else {
//		document.imgKranModell.style.visibility = "hidden";
	}
}

/****************************************************************************/
function mitMontage(auswahl, tag) {
	var f = document.forms[0];
	var i;	
	if(auswahl.selectedIndex == 6) {
		tag.style.display = "block";
	} else {
		tag.style.display = "none";
	}
}

/****************************************************************************/
function changeAchsen(auswahl) {
	var f = document.forms[0];
	var val = "images/Lastwagen";

		f.mass_A.style.display = "none";
		f.mass_B.style.display = "none";
		f.mass_C.style.display = "none";
		f.mass_D.style.display = "none";
		f.mass_E.style.display = "none";
		
		f.img_mass_A.style.display = "none";
		f.img_mass_B.style.display = "none";
		f.img_mass_C.style.display = "none";
		f.img_mass_D.style.display = "none";
		f.img_mass_E.style.display = "none";
	
	if(auswahl.selectedIndex != 0) {
		f.imgKranmontage.style.display = "block";
		f.imgKranmontage.src = val +f.achsenAnz.value +".gif";
		
		if(3 < auswahl.selectedIndex) {
			f.img_mass_E.style.display = "block";
			f.mass_E.style.display = "block";
		}
		if(2 < auswahl.selectedIndex) {
			f.img_mass_D.style.display = "block";
			f.mass_D.style.display = "block";
		}
		if(1 < auswahl.selectedIndex) {
			f.img_mass_C.style.display = "block";
			f.mass_C.style.display = "block";
		}
		if(0 < auswahl.selectedIndex) {
			f.img_mass_B.style.display = "block";
			f.mass_B.style.display = "block";
		}
		f.img_mass_A.style.display = "block";
		f.mass_A.style.display = "block";
	} else {
		f.imgKranmontage.src = "spacer.gif";
		f.imgKranmontage.style.display = "none";
	}
}

/****************************************************************************/
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;
}

/****************************************************************************/
/* Cookies																	*/
/****************************************************************************/
function setCookie(name, wert, domain, expires, path, secure){
   var cook = name + "=" + unescape(wert);
   cook += (domain) ? "; domain="+ domain : "";
   cook += (expires) ? "; expires="+expires : "";
   cook += (path) ? "; path="+path : "";
   cook += (secure) ? "; secure" : "";
   document.cookie = cook;
}
/****************************************************************************/
function eraseCookie(name, domain, path){
   var cook="name=; expires=Thu, 01-Jan-70 00:00:01 GMT";
   cook += (domain) ? "domain="+domain : "";
   cook += (path) ? "path="+path : "";
   document.cookie = cook;
}
/****************************************************************************/
function getCookie(name){
   var i=0;  //Suchposition im Cookie
   var suche = name+"=";
   while (i<document.cookie.length){
      if (document.cookie.substring(i, i+suche.length)==suche){
         var ende = document.cookie.indexOf(";", i+suche.length)
         ende = (ende>-1) ? ende : document.cookie.length;
         var cook = document.cookie.substring(i+suche.length, ende);
         return unescape(cook);
      }
      i++;
   }
   return "";
}
/****************************************************************************/
function checkCookie(){
   setCookie("CookieTest", "OK")
   if (!getCookie("CookieTest"))
      return false
   else{
      eraseCookie("CookieTest")
      return true
   }
}


