// mouseover topnavigation
var act = 1;
function over01(x){
	if(document.all) x.style.cursor = "hand";
	else x.style.cursor = "pointer";

	if(x.className=="high"){
		act = 0;
		return;
	}
	else{
		act = 1;
	}
	if(!x.childNodes) return;

	if(x.childNodes[0].innerHTML) x.innerHTML=x.childNodes[0].innerHTML;

	x.style.backgroundPosition = "0px -34px";
	x.style.color="#000000";
}

function out01(x){
	if(act==0) return;
	x.style.backgroundPosition = "0px 0px";
	x.style.color="#ffffff";
}



// mouseover leftnavigation
function over02(x){
	if(document.all) x.style.cursor = "hand";
	else x.style.cursor = "pointer";


	if(!x.style) return;
	oldcolor = x.style.backgroundColor;
	x.style.backgroundColor="#FCD116";
}

function out02(x){
	if(!x.style) return;
	x.style.backgroundColor=oldcolor;
}

//topnavigation & leftnavigation
function linkme(x){
if(x) document.location.href = x;
else document.location.href = "#";
}


//sitemap
function openSitemap(url) {
	satellit =window.open(url,"SiteMap","location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes");
	satellit.window.focus();
}
//kontakt
if(document.layers){
height00 = 730;
}
else{
height00 = 700;
}
function openKontakt(url) {
	satellit =eval('window.open(url,"Form","location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,width=661,height='+height00+'")');
	satellit.window.focus();
}
function openProduktKontakt(url) {
	satellit =eval('window.open(url,"ProduktForm","location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,width=661,height='+height00+'")');
	satellit.window.focus();
}
//Gebrauchtwagen-Anfrage-Formular
function openCHFormular(url) {
	satellit =eval('window.open(url,"Form","location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width=700,height='+height00+'")');
	satellit.window.focus();
}
//hotbutton
if(document.layers){
height01 = 680;
}
else{
height01 = 650;
}
function openHotbutton(url) {
	satellit =eval('window.open(url,"Form","location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,width=661,height='+height01+'")');
	satellit.window.focus();
}
//zoom
function zoomOLD(img,w,h)
{
	if (!w)
		w = 700;
	if (!h)
		h = 500;

	var features = "location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width=" + w + ",height=" + h;
	satellit = window.open(img, "Form", features);
	satellit.window.focus();

}

function zoom(img,w,h)
{
	//alert('img:' + img  + ', w=' + w + ', h=' + h);
	var scrollbars = 'no';

	var useDoc = (w > 0 && h > 0);

	if (!w || w < 0) {
		w = 700;
		scrollbars = 'yes';
	}
	if (!h || h < 0) {
		h = 500;
		scrollbars = 'yes';
	}

	var padding;
   (navigator.appName == "Microsoft Internet Explorer") ? (padding = 10) : (padding = 0);


   var screenw = screen.availWidth;
   var screenh = screen.availHeight;

   var maxW = screenw / 100 * 90;
   var maxH = screenh / 100 * 90;

   if ( w > maxW) {
	   scrollbars = 'yes';
	   w = maxW;
   }

   if (h > maxH) {
	   scrollbars = 'yes';
	   h = maxH;
   }


   var winw = (w + 15 + padding);
   var winh = (h + 15 + padding);
   var posx = (screenw / 2) - (winw / 2);
   var posy = (screenh / 2) - (winh / 2);


    if (useDoc) {

    	var features = "top="+posy+",left="+posx+",location=no,menubar=no,resizable=yes,scrollbars=" + scrollbars + ",status=no,toolbar=no,width=" + w + ",height=" + h;
		satellit = window.open("about:blank", "Form", features);
		satellit.window.focus();
		satellit.document.open();
		satellit.document.write("<style>body {margin: 0px}</style><img src='" + img + "' />");
		satellit.document.close();
	} else {
  // -- padding
	  w += 20;
	  h += 20;

	var features = "top="+posy+",left="+posx+",location=no,menubar=no,resizable=yes,scrollbars=" + scrollbars + ",status=no,toolbar=no,width=" + w + ",height=" + h;

		satellit = window.open(img, "Form", features);
		satellit.window.focus();
	}

}

//printview
function openPrint(url) {
	satellit =eval('window.open(url,"Printwindow","location=no,menubar=yes,resizable=yes,scrollbars=yes,status=no,toolbar=yes,width=661,height=600")');
	satellit.window.focus();
}

//language selector
function portme(){
var x = document.man_portals.portals.options;
	if (x[x.selectedIndex].value != '') {
		document.location.href=x[x.selectedIndex].value;
		//x.selectedIndex = 0;
	}
}

//remove label text in input fields
function clearInitValue(el, initString)
{
	// clear text input value when input field is gaining focus for the first time
	if (el && initString && el.value == initString)
		el.value = "";
}

/*neue Funktionen Produkt Relaunch*/

//Tabelle chassis einblenden
function chassis(){
	document.getElementById("chassis").style.visibility = "visible";
	document.getElementById("sattel").style.visibility = "hidden";
	document.getElementById("sattel_tab").className = "prodtable_remote_inactive_l";
	document.getElementById("chassis_tab").className = "prodtable_remote_active";
}

//Tabelle sattel einblenden
function sattel(){
	document.getElementById("chassis").style.visibility = "hidden";
	document.getElementById("sattel").style.visibility = "visible";
	document.getElementById("sattel_tab").className = "prodtable_remote_active";
	document.getElementById("chassis_tab").className = "prodtable_remote_inactive_r";
}

//Radformel Grafik auf mouseover einblenden
function radformel(url, formel){
	document.getElementById("radformel").innerHTML = '<div class="radformel_head"><strong>'+formel+'</strong></div><div class="radformel_img"><img src="'+url+'" alt="" border="0" /></div>';
}

//Radformel Grafik auf mouseout ausblenden
function radformelHelp(txt,touch,show,klick,pick ){
	var img_radformel_help = /*VIPURL*/ "/mn-prod-neu/man2/global/datapool/images/radformel_help.gif";
	var radformelHTML = '<div class="radformel_titel"><strong>'+txt+'</strong></div><div><img src="' + img_radformel_help + '" alt="" width="223" height="84" border="0" /></div><div class="radformel_txt"><table border="0" cellpadding="0" cellspacing="0"><tr><td class="radformel_legende_r"><strong>'+touch+'</strong></td><td class="radformel_legende">'+show+'</td></tr><tr><td class="radformel_legende_r"><strong>'+klick+'</strong></td><td class="radformel_legende">'+pick+'</td></tr></table></div>';
	document.getElementById("radformel").innerHTML = radformelHTML;
}


//Achsenlegende ausklappen
function mehr_2(legend2) {
	var img_minus = /*VIPURL*/ "/mn-prod-neu/man2/global/datapool/images/minus.gif";
	document.getElementById("box_2").style.overflow="visible";
	document.getElementById("box_2").style.height="100%";
	document.getElementById("switch_small").innerHTML="<a href=\"javascript:weniger_2('"+legend2+"')\"><img src="+ img_minus +" alt=\"\" width=\"12\" height=\"12\" border=\"0\"></a>&nbsp;&nbsp;<a href=\"javascript:weniger_2('"+legend2+"')\">"+legend2+"</a>";
}

//Achsenlegende einklappen
function weniger_2(legend2) {
	var img_plus = /*VIPURL*/ "/mn-prod-neu/man2/global/datapool/images/plus.gif";
	document.getElementById("box_2").style.overflow="hidden";
	document.getElementById("box_2").style.height="34px";
	document.getElementById("switch_small").innerHTML="<a href=\"javascript:mehr_2('"+legend2+"')\"><img src="+ img_plus +" alt=\"\" width=\"12\" height=\"12\" border=\"0\"></a>&nbsp;&nbsp;<a href=\"javascript:mehr_2('"+legend2+"')\">"+legend2+"</a>";
}

//Player einblenden
function showPlayer(){
	if (document.getElementById("popupfeld").className=="zu") {
		document.getElementById("popupfeld").style.visibility = "visible";
	}
	else {
		document.getElementById("popupfeld").style.visibility = "visible";
		player_iframe.preload();
	}

}

//-- rw 20070802 begin
//Popup fuer Produkt-Detail, evtl. noch zu modifizieren
function openProductDetailWindow(url) {
	//satellit =eval('window.open(url,"ProductDetail","location=no,menubar=yes,resizable=yes,scrollbars=yes,status=no,toolbar=yes,width=661,height=600")');
	satellit = window.open(url,"ProductDetail","location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width=435,height=650");
	satellit.window.focus();
}
//-- rw 20070802 end

//-- rw 2007-12-12 begin
function openPopupWindow(url) {

	satellit = window.open(url,"","location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width=435,height=650");
	satellit.window.focus();
}
//-- rw 2007-12-12 end

// TopUsed Top-5-Flash
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
	newWindow=window.open(URLtoOpen, windowName, windowFeatures);
	newWindow.focus();
 }
