// Script fr die Bildvergr�erung mit normalem <a href> Link
PositionX = 20;
PositionY = 20;
defaultWidth  = 630;
defaultHeight = 410;
var AutoClose = true;

function grossesBild(bildURL,bildTitel){
	var bildWin = window.open('','_blank','scrollbars=no,resizable=0,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY);
	if( !bildWin ) { return true; }
	bildWin.document.write('<html><head><title>'+bildTitel+'<\/title><script type="text\/javascript">\n'+

		'function BildAnpassen() {\n'+
		'if( !document.images.length ) { document.images[0] = document.layers[0].images[0]; }'+
		'var oH = document.images[0].height, oW = document.images[0].width;\n'+
		'if( !oH || window.doneAlready ) { return; }\n'+
		'window.doneAlready = true;\n'+
		'var x = window; x.resizeTo( oW + 200, oH + 200 );\n'+
		'var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;\n'+
		'if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }\n'+
		'else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }\n'+
		'else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }\n'+
		'if( window.opera && !document.childNodes ) { myW += 16; }\n'+
		'x.resizeTo( oW + ( ( oW + 200 ) - myW ), oH + ( (oH + 200 ) - myH ) );\n'+
		'x.resizeTo( oW = oW + ( ( oW + 200 ) - myW ), oH = oH + ( (oH + 200 ) - myH ) );\n'+
		'var scW = screen.availWidth ? screen.availWidth : screen.width;\n'+
		'var scH = screen.availHeight ? screen.availHeight : screen.height;\n'+
		'if( !window.opera ) { /*x.moveTo(Math.round((scW-oW)/2),Math.round((scH-oH)/2)); */}\n'+
		'}\n'+
		'<\/script>'+
		'<\/head><body onload="BildAnpassen();"'+(AutoClose?' onblur="self.close();"':'')+'>'+
		(document.layers?('<layer left="0" top="0" onclick="self.close();">'):('<div style="position:absolute;left:0px;top:0px;display:table;" onclick="self.close();">'))+
		'<img src='+bildURL+' alt="Bild wird geladen ..." title="" onload="BildAnpassen();">'+
		(document.layers?'<\/layer>':'<\/div>')+'<\/body><\/html>');
	bildWin.document.close();
	if( bildWin.focus ) { bildWin.focus(); }
	return false;}


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 popup(datei,name,b,h,scroll){
	AUSWidth=(screen.width)?(screen.width-b)/2:0;
	AUSHeight=(screen.height)?(screen.height-h)/2:0;
	window.open(''+datei+'',''+name+'','location=0,scrollbars='+scroll+',resizable=yes,menubar=0,left='+AUSWidth+',top='+AUSHeight+',width='+b+',height='+h+'');}

function MM_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText; }


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 MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}







function subnav(wo,Klasse){
wo.className=Klasse;
}

function subnavout(wo,Klasse){
wo.className=Klasse;
}


wmtt = null;


function updateWMTT(e) {
	if (wmtt != null) {
		var x, y, xscroll, yscroll, wwidth, wheight;
		if (document.all) {
			x = window.event.x + document.body.scrollLeft;
			y = window.event.y + document.body.scrollTop;
			xscroll = document.body.scrollTop;
			yscroll = document.body.scrollLeft;
			wwidth  = document.body.clientWidth;
			wheight = document.body.clientHeight;
		} else {
			x = e.pageX;
			y = e.pageY;
			xscroll = window.pageXOffset;
			yscroll = window.pageYOffset;
			wwidth  = window.innerWidth;
			wheight = window.innerHeight;
		}
		if (x + wmtt.useWidth + 20 >= wwidth + xscroll) {
			x -= wmtt.useWidth + 40;
		}
		if (y + wmtt.useHeight + 40 >= wheight + yscroll) {
//			alert("y="+y+" + wmtt.useHeight="+wmtt.useHeight+" >= wheight="+wheight+" + yscroll="+yscroll);
			y = wheight + yscroll - wmtt.useHeight - 40;
//			y -= wmtt.useHeight + 20;
		}
		wmtt.style.left = (x + 20) + "px";
		wmtt.style.top  = (y + 20) + "px";
	}
}

function showWMTT(id) {
	wmtt = document.getElementById(id);
	if (!wmtt.useWidth) {
		if (wmtt.offsetWidth) {
			wmtt.useWidth = wmtt.offsetWidth;
			wmtt.useHeight = wmtt.offsetHeight;
		} else {
			wmtt.useWidth = 300;
			wmtt.useHeight = 300;
		}
		if (!(wmtt.useWidth > 0 && wmtt.useHeight > 0))
			alert("wmtt.useWidth = "+wmtt.useWidth+" wmtt.useHeight = "+wmtt.useHeight);
	}
	wmtt.style.visibility = "visible";
	document.onmousemove = updateWMTT;
}


function hideWMTT() {
	document.onmousemove = null;
	wmtt.style.visibility = "hidden";
	wmtt = null;
}


function saveScroll() {
	var x=0, y=0;
	if (self.pageYOffset) { // all except Explorer
		x = self.pageXOffset;
		y = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		// Explorer 6 Strict
		x = document.documentElement.scrollLeft;
		y = document.documentElement.scrollTop;
	}
	else if (document.body) { // all other Explorers
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
	}
	parent.CarConfTopFrame.scrollX = x;
	parent.CarConfTopFrame.scrollY = y;
}

function changeText(spanid, neuerText){
	document.getElementById(spanid).innerHTML = neuerText;
}

var XMLHTTP = null;

if(window.XMLHttpRequest){
    XMLHTTP = new XMLHttpRequest();
} else if(window.ActiveXObject){
    try{
        XMLHTTP= new ActiveXObject("Msxml2.XMLHTTP");
    } catch(ex){
        try{
            XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
        } catch(ex){

        }
    }
}
