	var targetHeight = 0;
	var curHeight = 28;
	var curTarget;
	var interval;
	
	function setHeight() 
	{
		curTarget.style.height = curHeight + 'px';
		curHeight = curHeight + 4;
		if( targetHeight < curHeight )
		{
			window.clearInterval( interval );
		  curHeight = 28; 
		}			
	}
	function displayProduct()
	{
		var index = document.caasform.partnerid.selectedIndex;
		var radio = document.caasform.productid;
		var productID = 0;
		for(var i=0;radio[i];i++)
		{
    	if( radio[i].checked) 
				productID = radio[i].value;    		
		}
		var sdiv = document.getElementById( "choosenProduct" );
		
		if( index == 0 && productID == '0' )
			sdiv.innerHTML = "Ihre Wahl: COCUMA - Business f&uuml;r <b>33,- &euro;</b>";	
		if( index == 0 && productID == '1' )
			sdiv.innerHTML = "Ihre Wahl: COCUMA - Enterprise f&uuml;r <b>41,- &euro;</b>";	
		if( index == 1 && productID == '0' )
			sdiv.innerHTML = "Ihre Wahl: COCUMA Business f&uuml;r <b>25,- &euro;</b>";	
		if( index == 1 && productID == '1' )
			sdiv.innerHTML = "Ihre Wahl: COCUMA Enterprise f&uuml;r <b>33,- &euro;</b>";	
	}
	function openDIV( sourceName, targetName, height )
	{
		var sdiv = document.getElementById( sourceName );
		sdiv.style.height = '28px';
		curTarget = document.getElementById( targetName );
		targetHeight = height;
		interval = window.setInterval("setHeight()",10);
	}
	function toogleDIV( sourceName, height )
	{
		var sdiv = document.getElementById( sourceName );
		if( sdiv.style.height == "28px" )
		{
			sdiv.style.height = height + 'px';
		} else
		{
			sdiv.style.height = '28px';
		}
	}
	function AJAXInteraction(url, callback) 
	{
    var req = init();
    req.onreadystatechange = processRequest;

    function init() 
    {
      if (window.XMLHttpRequest) 
      {
        return new XMLHttpRequest();
      } else if (window.ActiveXObject) {
        return new ActiveXObject("Microsoft.XMLHTTP");
      }
    }

    function processRequest () {
      // readyState of 4 signifies request is complete
      if (req.readyState == 4) {
        // status of 200 signifies sucessful HTTP call
        if (req.status == 200) {
          if (callback) callback(req.responseXML);
        }
      }
    }

    this.doGet = function() {
      req.open("GET", url, true);
      req.send(null);
    }
}

function validateDomain() 
{
    var target = document.getElementById("domainid");
    var url = "<%=rootpath%>servlet/ajaxvalidation?formname=domainform&domainname=" + encodeURIComponent(target.value);
    var ajax = new AJAXInteraction(url, validateCallback);
    ajax.doGet();
}

function validateCallback(responseXML) 
{
   var msg = responseXML.getElementsByTagName("valid")[0].firstChild.nodeValue;
   if (msg == "false"){
       var mdiv = document.getElementById("domaincheck");
       // set the style on the div to invalid
       mdiv.innerHTML = "<img src=<%=rootpath%>images/notok.jpg>";
    } else {
       var mdiv = document.getElementById("domaincheck");
       // set the style on the div to valid
       mdiv.innerHTML = "<img src=<%=rootpath%>images/ok.jpg>";
    }
}

