

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 ()
	{
	var myWidth = 0, myHeight = 0;
	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-199;
		document.write('<br><img border=0 src="/images/pt.gif" width="1" height="'+$sizer+'">');
		//document.getElementById("hoehenspacer").style.height = $sizer+"px";
		}
	}



function delcheck($link,$frage)
	{
	if ($frage=='') $frage='Sind Sie sicher?';
	if (confirm ($frage))	
		{
		top.location.href=$link;		
		}
	}


function makebild(bild,width,height)
	{
	var leftpos = (screen.width) ? (screen.width-width)/2 : 0;
	var toppos = (screen.height) ? (screen.height-height)/2 : 0;
        picwin = window.open("/images/pics/popup.php3?image="+bild,"bild","resizable=no,width="+width+",height="+height+",status=0,menubar=0,scrollbars=0,left="+leftpos+",top="+toppos+"");
        }
        
function writemaillink (mailIndex)
{
	mails = new Array("siddhalepa|web#xxcom#de", "siddalep|slt#xxcom#lk");
	mailIndex = mailIndex | 0;
	document.write("<a href=\"javascript:void(0)\" onclick=\"makemail('" + mails[mailIndex] + "'); return false;\"><script type=\"text/javascript\">document.write(maildecode('" + mails[mailIndex] + "'));</script></a>");
}

function maildecode (input)
{
	var output = input;
	output = output.replace(/\|/, '@');
	output = output.replace("#xxcom#", ".");
	return (output);
}

function makemail($link)
{
	$link = maildecode($link);
	this.location.href = "mailto:" + $link;
}


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

// ===============================================================================================================================

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


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)
{
	var d = document.getElementById(idDiv);
	d.style.background = '#F3F5F8';
	// IMPORTANT, CAUSE OF IE DON'T USE d.style..border = ''
	d.style.borderWidth = '';
	d.style.borderStyle = '';
	d.style.borderColor = '';
	
	$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';
	d.style.border = '1px solid #CC0000';
	
	mylabel='labelfor_'+idDiv;
	if (document.getElementById(mylabel))
	{
		document.getElementById(mylabel).style.color = '#CC0000';
	}	
}