// ajax code by webdream.ie

var ua = navigator.userAgent.toLowerCase();

if (document.getElementById || document.all) 
 {document.write('<div id="wd_div1"></div><div id="wd_div2" style="height:45px;">&nbsp;</div>');}
	
function initSubmit(elid)
 {

 document.getElementById(elid).value='retrieving price';
   document.getElementById(elid).disabled=true;
document.getElementById(elid).style.display='inline';
 }
function initSubmit2(elid)
 {

 document.getElementById(elid).value='Create Account';
   document.getElementById(elid).disabled=false;

 }	 
function initDIDs()
 {
 
  requestAJAX('http://'+window.location.hostname+'/ajax/get_dids_1.php','wd_div2'); 
  return false;
 }
function initDIDs2(ac,cc)
 {
 
  requestAJAX('http://'+window.location.hostname+'/ajax/get_dids_1.php?cc='+cc+'&ac='+ac,'wd_div2'); 
  return false;
 } 
function getDIDs(cc,Obj)
 {
 	    var ac = Obj.options[Obj.selectedIndex].value;
	    requestAJAX('http://'+window.location.hostname+'/ajax/get_dids_1.php?cc='+cc+'&ac='+ac,'wd_div2');
	 return false;
 }	
	
function initDIDArea()
 {
  requestAJAX('http://'+window.location.hostname+'/ajax/get_areas_1.php?wait','wd_div1'); 
  return false;
 }
function initDIDArea2(ac,cc)
 {
  requestAJAX('http://'+window.location.hostname+'/ajax/get_areas_1.php?ac='+ac+'&cc='+cc,'wd_div1'); 
  return false;
 } 
function getDIDArea(Obj)
 {
 	    var cc = Obj.options[Obj.selectedIndex].value;
	    requestAJAX('http://'+window.location.hostname+'/ajax/get_areas_1.php?cc='+cc,'wd_div1');
	 return false;
 }
	
	
 function requestAJAX(query,elid)
	{ 
	var result = '-1';
	var req = null; 
	if (window.XMLHttpRequest){req = new XMLHttpRequest();} 
	else if (window.ActiveXObject) {try {req = new ActiveXObject("Msxml2.XMLHTTP");}catch (e){try {req = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}}
	req.onreadystatechange = function()
		{ 
			if(req.readyState == 4)
				{
						if(req.status == 200)
							{
							  document.getElementById(elid).innerHTML = req.responseText;
	                          
							}	
						else	
							{
							document.getElementById(elid).innerHTML = "Error";
							}	
				} 
		}; 
	req.open("GET", query, true); 
	req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
	req.send(null); 
	} 
	
