JSItem = Array();
var ende;
var last = false;
function mbitchkanm () {
	msg = "";
	if (document.getElementById('vorname').value == "") {
		msg = msg + "Vorname ist ein Pflichtfeld und muss ausgefüllt werden!\n";
	}
	if (document.getElementById('nachname').value == "") {
		msg = msg + "Nachname ist ein Pflichtfeld und muss ausgefüllt werden!\n";
	}
	if (document.getElementById('firma').value == "") {
		msg = msg + "Firma ist ein Pflichtfeld und muss ausgefüllt werden!\n";
	}
	if (document.getElementById('email').value.length==0 || document.getElementById('email').value.indexOf("@")==-1 || document.getElementById('email').value.indexOf(".")==-1) {
		msg = msg + "Geben Sie eine gültige E-Mailadresse ein!\n";
	}
	if (document.getElementById('rechnungsadresse').value == "") {
		msg = msg + "Rechnungsadresse ist ein Pflichtfeld und muss ausgefüllt werden!\n";
	}
	if (msg == "") {
		return true;
	} else {
		alert(msg);
		return false;
	}
}
function mbitgetlaypos(layer) {
	if (document.all) {
		element = document.all[layer];
	} else if (document.getElementById) {
		element = document.getElementById(layer);
	}
	var coords = {x: 0, y: 0};
	while (element) {
		coords.x += element.offsetLeft;
		coords.y += element.offsetTop;
		element = element.offsetParent;
	}
	return coords.x;
} 
function mbit_over(logo, layer, logoort) {
	if (last) {
		if (last != layer) {
			mbit_do_out(last);
		}
	}
	clearTimeout(ende);
	mbit_do_over(logo, layer, logoort);
	last = layer;
}
function mbit_out(layer) {
	clearTimeout(ende);
	ende = setTimeout("mbit_do_out('" + layer + "')",20);
}
function mbit_do_out(layer) {
	document.getElementById(layer).style.visibility = 'hidden';
	mbit_hideImage();
}
function mbit_do_over(logo, layer, logoort) {
//	document.getElementById(layer).style.top = mCoord['y'] - 15;
//	document.getElementById(layer).style.left = mCoord['x'];
	document.getElementById(layer).style.visibility = 'visible';
	mbit_showImage(logo, logoort);
}
function mbit_over_layer(logo, layer, logoort) {
	clearTimeout(ende);
	document.getElementById(layer).style.visibility = 'visible';
	mbit_showImage(logo, logoort);
}
function mbit_showImage(logo, logoort) {
	if (logo != "") {
		MM_swapImage('overimg','','fileadmin/' + logoort + '/' + logo,1);
		document.getElementById('canvas0').style.visibility = 'hidden';
		document.getElementById('canvas1').style.visibility = 'hidden';
		document.getElementById('canvasover').style.visibility = 'visible';
	}
}
function mbit_hideImage() {
	document.getElementById('canvas0').style.visibility = 'visible';
	document.getElementById('canvas1').style.visibility = 'visible';
	document.getElementById('canvasover').style.visibility = 'hidden';
}

var cbclose = false;
var subnavtimer;
var subnavlast = 'subnavangebot';

function cbsettop(what) {
	document.getElementById("cbtoptext").childNodes[0].nodeValue = document.getElementById(what).childNodes[0].nodeValue;
	document.getElementById("cbbox").style.display = "none";
}
function cbshow() {
	if (document.getElementById("cbbox").style.display == "inline") {
		document.getElementById("cbbox").style.display = "none";
	} else {
		document.getElementById("cbbox").style.display = "inline";
		cbclose = false;
	}
}
function cbhide() {
	if (cbclose == true) {
		document.getElementById("cbbox").style.display = "none";
		cbclose = false;
	} else {
		cbclose = true;
	}
}
function navhide(what) {
	MM_showHideLayers(what,'','hide');
	MM_swapImgRestore();
}
function navover(what, id, pic) {
	clearTimeout(subnavtimer);
	MM_swapImgRestore();
	MM_showHideLayers(subnavlast,'','hide');
	MM_showHideLayers(what,'','show');
	MM_swapImage(id,'',pic,1);
}
function navout(what) {
	subnavtimer = window.setTimeout("navhide('" + what + "')",100);
	subnavlast = what;
}

/* Kundenlogos Animation */
function getslidehtml(theslide){
	var slidehtml=""
	if (theslide[1]!="")
		slidehtml='<a href="'+theslide[1]+'" target="'+theslide[2]+'">'
	slidehtml+='<img src="'+theslide[0]+'" border="0">'
	if (theslide[1]!="")
		slidehtml+='</a>'
	return slidehtml
}

function moveslide(){
	if (curpos<0){
		curpos=Math.min(curpos+degree,0)
		tempobj.style.left=curpos+"px"
	}
	else{
		clearInterval(dropslide)
		if (crossobj.filters)
			crossobj.filters.alpha.opacity=100
		else if (crossobj.style.MozOpacity)
			crossobj.style.MozOpacity=1
		nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
		tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
		tempobj.innerHTML=getslidehtml(slideshowcontent[curindex])
		nextindex=(nextindex<slideshowcontent.length-1)? nextindex+1 : 0
		setTimeout("rotateslide()",pause)
	}
}

function rotateslide(){
	if (ie4||dom){
		resetit(curcanvas)
		crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
		crossobj.style.zIndex++
		if (crossobj.filters)
			document.all.canvas0.filters.alpha.opacity=document.all.canvas1.filters.alpha.opacity=20
		else if (crossobj.style.MozOpacity)
			document.getElementById("canvas0").style.MozOpacity=document.getElementById("canvas1").style.MozOpacity=0.2
		var temp='setInterval("moveslide()",50)'
		dropslide=eval(temp)
		curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
	}
		else if (document.layers){
		crossobj.document.write(getslidehtml(slideshowcontent[curindex]))
		crossobj.document.close()
	}
	curindex=(curindex<slideshowcontent.length-1)? curindex+1 : 0
}

function jumptoslide(which){
	curindex=which
	rotateslide()
}

function resetit(what){
	curpos=parseInt(trans_width)*(-1)
	var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
	crossobj.style.left=curpos+"px"
}

function startit(){
	crossobj=ie4? eval("document.all."+curcanvas) : dom? document.getElementById(curcanvas) : document.tickernsmain.document.tickernssub
	if (ie4||dom){
		crossobj.innerHTML=getslidehtml(slideshowcontent[curindex])
		rotateslide()
	}
	else{
		document.tickernsmain.visibility='show'
		curindex++
		setInterval("rotateslide()",pause)
	}
}

/* Macromedia */
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_preloadImages() { //v3.0
  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];}}
}
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 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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function wopen(url, w, h) {
	if (document.cookie && document.cookie.indexOf("besuch") > -1) {
	} else {
		var jetzt = new Date();
		var Verfallszeit = 1000 * 60 * 60 * 24 * 365;
		Auszeit = new Date(jetzt.getTime() + Verfallszeit);
		document.cookie = "besuch=1; expires=" + Auszeit.toGMTString() + ";";
		w += 32;
		h += 96;
		window.open(url, 'popup', 'width=' + w + ', height=' + h + ', ' + 'location=no, menubar=no, ' + 'status=no, toolbar=no, scrollbars=yes, resizable=yes');
	}
}
function popopen(url, w, h) {
		window.open(url, 'popup', 'width=' + w + ', height=' + h + ', ' + 'location=no, menubar=no, ' + 'status=no, toolbar=no, scrollbars=yes, resizable=yes');
}

// Flashdetection 
var flashinstalled = 0;
var flashversion = 0;
MSDetect = "false";
if (navigator.plugins && navigator.plugins.length) {
	x = navigator.plugins["Shockwave Flash"];
	if (x) {
		flashinstalled = 2;
		if (x.description) {
			y = x.description;
			flashversion = y.charAt(y.indexOf('.')-1);
		}
	} else {
		flashinstalled = 1;
	}
	if (navigator.plugins["Shockwave Flash 2.0"]) {
		flashinstalled = 2;
		flashversion = 2;
	}
}
else if (navigator.mimeTypes && navigator.mimeTypes.length) {
	x = navigator.mimeTypes['application/x-shockwave-flash'];
	if (x && x.enabledPlugin) {
		flashinstalled = 2;
	} else {
		flashinstalled = 1;
	}
} else {
	MSDetect = "true";
}
