

function hideDiv(idDiv) 
	{
	document.getElementById(idDiv).style.display = 'none';
	}

function showDiv(idDiv) 
	{
	document.getElementById(idDiv).style.display = '';
	}



var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}	




function holehoehe (myValue)
	{
	var myWidth = 0, myHeight = 0;
	myValue = myValue || 275;
	if( typeof(window.innerWidth) == 'number' ) 
		{
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
		} 
	  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
		{
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
		} 
	  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
		{
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
		}


	if (myHeight>0)
		{
		$sizer=myHeight-myValue;
		document.getElementById("hoehenspacer").style.height = $sizer+"px";
		}
	}
	
function showTab(tabname, tabno, maxtabs)
{
	if (document.getElementById)
	{		
		for (var i = 1; i <= maxtabs; i++)
		{
			if (document.getElementById(tabname + i)) document.getElementById(tabname + i).style.display = (tabno == i) ? "block" : "none";
			if (document.getElementById(tabname + i + '_link')) document.getElementById(tabname + i + '_link').className = (tabno == i) ? "atablink" : "tablink";
		}
	}
}

function showHideLanguageDiv(show)
{
	if (document.getElementById)
	{
		c = document.getElementById("current-language");
		s = document.getElementById("select-language");
		if (show)
		{
			c.style.color = "#003466";
			c.getElementsByTagName("div")[1].style.color = "#003466";
			c.style.background = "#FFC333 url(/images/layout/bg-nav-main-a-current.gif) repeat-x left top";
			s.style.display = "block";
		}
		else
		{
			c.style.color = "#E1E1E1";
			c.getElementsByTagName("div")[1].style.color = "#E1E1E1";
			c.style.background = "transparent url(/images/layout/arrow-down-orange.gif) no-repeat right 4px";
			s.style.display = "none";
		}
	}
}

function showHideDealerLanguageDiv(show)
{
	if (document.getElementById)
	{
		s = document.getElementById("select-language-dealer");
		s.style.display = (show) ? "block" : "none";
	}
}

function check_email(email) 
{

 	var usr    = "([a-zA-Z0-9][a-zA-Z0-9_.-]*|\"([^\\\\\x80-\xff\015\012\"]|\\\\[^\x80-\xff])+\")";
  	var domain = "([a-zA-Z0-9][a-zA-Z0-9._-]*\\.)*[a-zA-Z0-9][a-zA-Z0-9._-]*\\.[a-zA-Z]{2,6}";
  	var regex  = "^" + usr + "\@" + domain + "$";
  	var rgx    = new RegExp(regex);
  	return rgx.exec(email) ? true : false;
}


function fieldcolor_normal(idDiv)
	{
	document.getElementById(idDiv).style.background = '#F3F5F8';
	document.getElementById(idDiv).style.border = '';
	
	$mylabel='labelfor_'+idDiv;
	if (document.getElementById($mylabel))
		{
		document.getElementById($mylabel).style.color = '';
		}
	
	}
	
function fieldcolor_error(idDiv)
	{
	var d = document.getElementById(idDiv);
	d.style.background = '#FAE7E7'; //'#FFFF00';
	d.style.border = '1px solid #CC0000';
	$mylabel='labelfor_'+idDiv;
	if (document.getElementById($mylabel))
		{
		document.getElementById($mylabel).style.color = '#CC0000';
		}	
	
	}
	
function getStyle(el,stylePropJs,stylePropCss)
	{
	var obj = document.getElementById(el);
	if (obj.currentStyle) // IE
		var styleValue = obj.currentStyle[stylePropJs];
	else if (window.getComputedStyle) // Mozilla
		var styleValue = document.defaultView.getComputedStyle(obj,null).getPropertyValue(stylePropCss);
	return styleValue;
	}


function ac24_showToolboxText(textToShow, showOffState)
{
	showOffState = showOffState | 0;
	var el = document.getElementById("toolbox-text");
	el.style.color = (showOffState == 1) ? "#B9B9B9" : "#666666";
	el.innerHTML = textToShow;
}