function maus(nr,farbetd,farbetext){
//document.getElementsByTagName("a")[nr].style.color=farbetext;
document.getElementById("t"+nr).style.backgroundColor=farbetd;
}



 
function __onPrevPage (id)
{
    for (var i=1; i<10; i++) {
        if (document.getElementById (id + "_page" + i).style.display == "block") {
            document.getElementById (id + "_page" + i).style.display = "none";
            document.getElementById (id + "_page" + (i - 1)).style.display = "block";
            document.getElementById (id + "__PAGENUM").value = i - 1;
            break;
        }
    }
}

function __onNextPage (id)
{
    for (var i=0; i<9; i++) {
        if (document.getElementById (id + "_page" + i).style.display == "block") {
            document.getElementById (id + "_page" + i).style.display = "none";
            document.getElementById (id + "_page" + (i + 1)).style.display = "block";
            document.getElementById (id + "__PAGENUM").value = i + 1;
            break;
        }
    }
}

function __onGotoPage_ (id, number)
{
    for (var i=0; i<10; i++) {
        if (i == number) {
            document.getElementById (id + "_page" + i).style.display = "block";
            document.getElementById (id + "__PAGENUM").value = i;
        }
        else
            document.getElementById (id + "_page" + i).style.display = "none";
    }
}


function __onGotoPage (id, number)
{

 
}

function submitForm(sNewFormAction) 
{ 
//document.getElementById( "Region_WaitMessage").style.display = "block";
//document.getElementById( "MainBody").style.display = "none";

document.forms[0].action = sNewFormAction; 
document.forms[0].__VIEWSTATE.name = 'NEWVIEWSTATE'; 
document.forms[0].submit();

} 

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}


function popUp(url){
	window.open(url,"pop","width=550,height=400,toolbars=0,scrollbars=1")
}


	function VerifyString( str )
	{
		if (str=='')
			return false
		else
			return true
	}
	
 function addCell()
{
   var x=document.getElementById('INVTable').rows[0]
   var y=x.insertCell(0);
   y.innerHTML= "some Text";
   x.style.fontFamily = "Lucida Bright";
   x.style.backgroundColor = 'E7B898';   // brownish
 }  

function CheckEMailVal( TheInput )
	{
		var txt=TheInput.value;
		var ValidFlag=false;
		var BadFlag=true;
		
		if ((txt.value!="") && (txt.indexOf("@")>0) && (txt.indexOf(".")>0))
		{
		atCount=0;
		SpecialFlag=false;
		ValidChar=false;
		for (atLoop=0;atLoop<=txt.length-1;atLoop++)
		{
		 atChr=txt.charAt(atLoop);
		 atChr.toUpperCase;
		 if (atChr=="@") atCount++;
		 if (atChr=="@" || atChr==".") ValidChar=true;
		 if (atChr>="A" && atChr<="Z") ValidChar=true;
		 if (atChr>="0" && atChr<="9") ValidChar=true;
		 if (atChr=="-" || atChr=="_") ValidChar=true;
		 txt2=" !\"#$%&\'()*+,";
		 if (txt2.indexOf(atChr)>=0) SpecialFlag=true;
		 txt2="/`";
		 if (txt2.indexOf(atChr)>=0) SpecialFlag=true;
		 if (atChr>="{") SpecialFlag=true;
		 if (atChr>=":" && atChr<="?") SpecialFlag=true;
		 if (atChr>="[" && atChr<="^") SpecialFlag=true;
		}
		if (atCount==1 && ValidChar==true && SpecialFlag==false) 
		   { 
	   		BadFlag=false;
			tAry1=txt.split("@");
			UserName=tAry1[0];
			DomainName=tAry1[1];
			if (UserName=='' || DomainName=='') BadFlag=true;
			if (DomainName.charAt(0)==".") BadFlag=true;
			if (DomainName.charAt(DomainName.length-1)==".") BadFlag=true;
			ValidFlag=true;
		   }
		}
		if (BadFlag==true) ValidFlag=false;
		if (ValidFlag==false)
		{
	   	window.alert("Please check the syntax of your email address, which should be in the form: name@domain.com" );
		}
		return ValidFlag;		
	}


	function CheckEMailTextVal( TheInput )
	{
		var txt=TheInput; //.value;
		var ValidFlag=false;
		var BadFlag=true;
		
		if ((txt.value!="") && (txt.indexOf("@")>0) && (txt.indexOf(".")>0))
		{
		atCount=0;
		SpecialFlag=false;
		ValidChar=false;
		for (atLoop=0;atLoop<=txt.length-1;atLoop++)
		{
		 atChr=txt.charAt(atLoop);
		 atChr.toUpperCase;
		 if (atChr=="@") atCount++;
		 if (atChr=="@" || atChr==".") ValidChar=true;
		 if (atChr>="A" && atChr<="Z") ValidChar=true;
		 if (atChr>="0" && atChr<="9") ValidChar=true;
		 if (atChr=="-" || atChr=="_") ValidChar=true;
		 txt2=" !\"#$%&\'()*+,";
		 if (txt2.indexOf(atChr)>=0) SpecialFlag=true;
		 txt2="/`";
		 if (txt2.indexOf(atChr)>=0) SpecialFlag=true;
		 if (atChr>="{") SpecialFlag=true;
		 if (atChr>=":" && atChr<="?") SpecialFlag=true;
		 if (atChr>="[" && atChr<="^") SpecialFlag=true;
		}
		if (atCount==1 && ValidChar==true && SpecialFlag==false) 
		   { 
	   		BadFlag=false;
			tAry1=txt.split("@");
			UserName=tAry1[0];
			DomainName=tAry1[1];
			if (UserName=='' || DomainName=='') BadFlag=true;
			if (DomainName.charAt(0)==".") BadFlag=true;
			if (DomainName.charAt(DomainName.length-1)==".") BadFlag=true;
			ValidFlag=true;
		   }
		}
		if (BadFlag==true) ValidFlag=false;
		if (ValidFlag==false)
		{
	   	window.alert("Please check the syntax of your email address, which should be in the form: name@domain.com" );
		}
		return ValidFlag;		
	}
	
function extfield(field, page,w) {
	lastField=field;
	var p=window.open("/field/"+page,"fieldselect","width="+w+",height=450,resizable=yes,status=yes,scrollbars=yes,directories=no,location=no,menubar=no");
	if (p==null) {
		alert("Sorry, your browser does not allow popups");
	}
}
