 var _cbx_ip, _err_div_id;
 function getAPIIC_IPs_by_zone(cbx_zone, cbx_ip, err_div_id)
  {
  	_cbx_ip = cbx_ip;
  	_err_div_id = err_div_id;
	var cbx_zone = document.getElementById(cbx_zone);
	var cbx_ip = document.getElementById(cbx_ip);
	
	var zone = cbx_zone.options[cbx_zone.selectedIndex].value;
		
	if(zone != '' && zone != '-select-')
	{
		var _action = "GetIPsByZone?zone="+zone;
		ajax_get_ips_by_zone(_action);
	}
	else
	{
		cbx_ip.options.length=1;
		cbx_ip.options[0].selected="selected";
	}
	
}

 function ajax_get_ips_by_zone(action)
  {
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
	    {
	    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	    }
	  catch (e)
	    {
	    try
	      {
	      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	      }
	    catch (e)
	      {
	      alert("Your browser does not support AJAX!");
	      return false;
	      }
	    }
	  }
	  
	xmlHttp.onreadystatechange=function()
	 {
	    document.getElementById(_err_div_id).style.color = "RED";
	    document.getElementById(_err_div_id).innerHTML = "loading...";
	    
     if(xmlHttp.readyState==4)
      {
      document.getElementById(_err_div_id).innerHTML = '';
    
      	var resp = xmlHttp.responseText;
      	
      	if(resp=='')
      	{
      	 	var ips = document.getElementById(_cbx_ip);
      		document.getElementById(_err_div_id).style.color = "RED";
      		document.getElementById(_err_div_id).innerHTML = 'No Industrial Parks !!';
      		ips.options.length=1;
      		
      	}
      	else if(resp=='EX')
      	{
      		document.getElementById(_err_div_id).innerHTML = 'Could not Retrieve IP names!!';
      	}
      	else
      	{
      		var temp1 = resp.split('$$$');
      		var ips = document.getElementById(_cbx_ip);
      		ips.options.length=1;
      		var j=1;
      		for(var i=0;i<(temp1.length-1);i++)
      		{
      			ips.options[j] = new Option(temp1[i],temp1[i]);
      			j++;
      		}
      	}
      }
    }
    
  xmlHttp.open("POST",action,true);
  xmlHttp.send(null);
  			
 }