function setElement(theRow, thePointerColor)
{
    theRow.style.backgroundColor = thePointerColor;
    return true;
}

function setColor(theRow, thePointerColor)
{
    theRow.style.color = thePointerColor;
    return true;
}

function open_w(what,name,width,height,vars) 
{
	if(vars==undefined) vars='';
	var fenster = window.open(what+vars,name,'toolbar=no, location=no, directories=no, menubar=no, scrollbars=yes, resizable=yes, width=' + width + ', height=' + height + ', top=50, left=50');
}

function check_telefon(what) 
{
 	var Aussage = what.value;
 	var Ergebnis = Aussage.search("^\\+([0-9]{1,2})\\.([0-9]{5,})$");
 
	 if(Ergebnis != -1) 
	 {
		document.temp.checktel.value="j";
	 } else 
	 {
		while(Aussage.search(" ")>=0) 
		{
			Aussage = Aussage.replace(" ","");
		}
		while(Aussage.search("/")>=0) 
		{
			Aussage = Aussage.replace("/","");
		}
		while(Aussage.search("-")>=0) 
		{
			Aussage = Aussage.replace("-","");
		}
		while(Aussage.search("\\(")>=0) 
		{
			Aussage = Aussage.replace("(","");
		}
		while(Aussage.search("\\)")>=0) 
		{
			Aussage = Aussage.replace(")","");
		}
		if(Aussage.search("\\.")==-1) 
		{
			len = Aussage.length;
			temp1 = Aussage.slice(0,3);
			temp2 = Aussage.slice(3,len);
			Aussage = temp1 + "." + temp2;
		} 
		else 
		{
			ste = Aussage.indexOf("\\.");
			if(ste!=3) 
			{
				while(Aussage.search("\\.")>=0) 
				{
					Aussage = Aussage.replace(".","");
				}
				len = Aussage.length;
				temp1 = Aussage.slice(0,3);
				temp2 = Aussage.slice(3,len);
				Aussage = temp1 + "." + temp2;
			}
		}
		what.value = Aussage;
		document.temp.checktel.value="j";
	 }
}

function domainsplit(what) 
{
 	var Aussage = what.value;
	var Ergebnis = Aussage.search("^([A-Za-z0-9\\-\ä\ü\ö]{2,})\\.([A-Za-z]{2,})(\\.([A-Za-z]{2,}))?$");
	var Found = false;
	var DNSid = 0;
	
	if(Ergebnis == -1) 
	{
		;
	} 
	else 
	{
		len = Aussage.length;
		end = Aussage.slice(Aussage.indexOf('.'),len);
		arrlen = parseInt(document.getElementById('gtld').length)-1;
		i = 0;
		
		if(document.getElementById('gtld').options[document.getElementById('gtld').selectedIndex].text!="DNS")
		{
			while(i<=arrlen) 
			{
				arrend = document.getElementById('gtld').options[i].text;
				if(arrend=="DNS") 
				{
					DNSid=i;
					break;
				}
				
				if(arrend==end && arrend!='DNS') 
				{
					document.getElementById('gtld').options[i].selected=true;
					what.value = Aussage.slice(0,Aussage.indexOf('.'));
					Found = true;
					i = arrlen + 1;
				}
				i = i + 1;
			}
			
			
			if(!Found)
				document.getElementById('gtld').options[DNSid].selected=true;
		}
		//what.value = Aussage.slice(0,Aussage.indexOf('.'));
		//alert(document.getElementById('gtld').options[arrlen].text);
		//alert(temp);
	}

}

function open_info_window(titel,text) 
{
	var info = window.open("","Infofenster","width=300,height=300");
	with(info.document) 
	{
		write("<html><head>");
		write("<title>"+titel+"</title>");
		write("</head><body>");
		write(text);
		write("</body></html>");
	}
}

function submitAlternativeDomain(domain, gtld) 
{
	var i=0;
	document.domainForm.domain.value = domain;
	while(i<document.domainForm.gtld.length) 
	{
		if(document.domainForm.gtld.options[i].text==gtld) 
		{
			document.domainForm.gtld.options[i].selected = true;
		}
		i = i + 1;
	}
	document.domainForm.Submit.click();
}
