var xmlHttp
function getCombo(str,field,argurl)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url=argurl
url=url+"?selectId="+str
url=url+"&item="+field
url=url+"&sid="+Math.random()

if(field=='fill_region_left_search')
	xmlHttp.onreadystatechange=fill_region_left_search;
else if(field=='fill_state_left_search')
	xmlHttp.onreadystatechange=fill_state_left_search;
else if(field=='search_manage_dentist_region')
	xmlHttp.onreadystatechange=search_manage_dentist_region;
else if(field=='search_manage_dentist_state')
	xmlHttp.onreadystatechange=search_manage_dentist_state;
else if(field=='fill_state_quick_search')
	xmlHttp.onreadystatechange=fill_state_quick_search;
else if(field=='fill_region_quick_search')
	xmlHttp.onreadystatechange=fill_region_quick_search;
else if(field=='fill_state_preferred')
	xmlHttp.onreadystatechange=fill_state_preferred;
else if(field=='fill_region_preferred')
	xmlHttp.onreadystatechange=fill_region_preferred;
else if(field=='fill_state_basic')
	xmlHttp.onreadystatechange=fill_state_basic;
else if(field=='fill_region_basic')
	xmlHttp.onreadystatechange=fill_region_basic;
else if(field=='fill_state_contact')
	xmlHttp.onreadystatechange=fill_state_contact;
else if(field=='fill_region_contact')
	xmlHttp.onreadystatechange=fill_region_contact;
else if(field=='fill_state_contact_admin')
	xmlHttp.onreadystatechange=fill_state_contact_admin;
else if(field=='fill_region_contact_admin')
	xmlHttp.onreadystatechange=fill_region_contact_admin;
else if(field=='add_region')
	xmlHttp.onreadystatechange=add_region;
else if(field=='fill_state_admin')
	xmlHttp.onreadystatechange=fill_state_admin;
else if(field=='fill_state_admin_basic')
	xmlHttp.onreadystatechange=fill_state_admin_basic;
else if(field=='fill_state_user')
	xmlHttp.onreadystatechange=fill_state_user;
else if(field=='fill_region_admin')
	xmlHttp.onreadystatechange=fill_region_admin;
	else if(field=='fill_region_admin_basic')
	xmlHttp.onreadystatechange=fill_region_admin_basic;
else if(field=='fill_secRegion')
	xmlHttp.onreadystatechange=fill_secRegion;
xmlHttp.open("POST",url,true)
xmlHttp.send(null)
}


function getSecondCombo(strSec,fieldSec,argurlSec)
{ 
xmlSecHttp=GetSecondXmlHttpObject()
if (xmlSecHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var urlSec=argurlSec
urlSec=urlSec+"?selectId="+strSec
urlSec=urlSec+"&item="+fieldSec
urlSec=urlSec+"&sid="+Math.random()
if(fieldSec=='fill_secRegion')
	xmlSecHttp.onreadystatechange=fill_secRegion;
xmlSecHttp.open("POST",urlSec,true)
xmlSecHttp.send(null)
}

function add_region() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		alert('asdsad');
		document.getElementById("add_region").innerHTML=xmlHttp.responseText 
	} 
}


function search_manage_dentist_region() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("search_manage_dentist_region").innerHTML=xmlHttp.responseText 
	} 
}

function search_manage_dentist_state() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("search_manage_dentist_state").innerHTML=xmlHttp.responseText 
	} 
}

function fill_state_user() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_state_user").innerHTML=xmlHttp.responseText 
	} 
} 

function fill_region_contact() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_region_contact").innerHTML=xmlHttp.responseText 
	} 
} 

function fill_state_contact() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_state_contact").innerHTML=xmlHttp.responseText 
	} 
} 

function fill_region_contact_admin() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_region_contact_admin").innerHTML=xmlHttp.responseText 
	} 
} 

function fill_state_contact_admin() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_state_contact_admin").innerHTML=xmlHttp.responseText 
	} 
} 

function fill_state_basic() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_state_basic").innerHTML=xmlHttp.responseText 
	} 
} 

function fill_region_basic() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_region_basic").innerHTML=xmlHttp.responseText 
	} 
} 

function fill_region_preferred() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_region_preferred").innerHTML=xmlHttp.responseText 
	} 
} 

function fill_state_preferred() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_state_preferred").innerHTML=xmlHttp.responseText 
	} 
} 

function fill_region_left_search() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_region_left_search").innerHTML=xmlHttp.responseText 
	} 
} 

function fill_state_quick_search() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_state_quick_search").innerHTML=xmlHttp.responseText 
	} 
}

function fill_state_left_search() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_state_left_search").innerHTML=xmlHttp.responseText 
	} 
} 

function fill_region_quick_search() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_region_quick_search").innerHTML=xmlHttp.responseText 
	} 
} 

function fill_state_admin() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_state_admin").innerHTML=xmlHttp.responseText
	} 
} 
function fill_state_admin_basic() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_state_admin_basic").innerHTML=xmlHttp.responseText
	} 
} 
function fill_region_admin() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_region_admin").innerHTML=xmlHttp.responseText
	} 
} 
function fill_region_admin_basic() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("fill_region_admin_basic").innerHTML=xmlHttp.responseText
	} 
} 

function fill_secRegion() 
{ 
	if (xmlSecHttp.readyState==4 || xmlSecHttp.readyState=="complete")
	{ 
		document.getElementById("fill_secRegion").innerHTML=xmlSecHttp.responseText
	} 
} 

function GetSecondXmlHttpObject()
{ 
	var objSecXMLHttp=null
if (window.XMLHttpRequest)
{
	objSecXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
	objSecXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
	return objSecXMLHttp
}

function GetXmlHttpObject()
{ 
	var objXMLHttp=null
if (window.XMLHttpRequest)
{
	objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
	return objXMLHttp
}

function validatestate(thisfrm)
{
	if(thisfrm.country.value=='')
	{
		alert("Please select a country");
		thisfrm.country.focus();
		return false;
	}

	if(thisfrm.state.value=='')
	{
		alert("Please select a State / Province");
		thisfrm.state.focus();
		return false;
	}

	if(thisfrm.state.value!='' && thisfrm.region.value!='')
	{
		thisfrm.action=thisfrm.action+'Dentistry/'+thisfrm.state.options[thisfrm.state.options.selectedIndex].text+'/'+thisfrm.region.options[thisfrm.region.options.selectedIndex].text+'/';
		thisfrm.submit();		
	}else if(thisfrm.region.value=='')
	{
		thisfrm.action=thisfrm.action+'Dentistry/'+thisfrm.state.options[thisfrm.state.options.selectedIndex].text+'/';
		thisfrm.submit();
	}
	return true;
}

function load_values(argCombo)
{
	argCombo.options.length=0;
	var opt = new Option();
	opt.value="";
	opt.text="Loading..........";
	opt.selected=true;
	argCombo.options[argCombo.options.length] = opt;
}

function clear_region(argCombo,argVal)
{
	argCombo.options.length=0;
	var opt = new Option();
	opt.value="";
	opt.text=argVal;	
	opt.selected=true;
	argCombo.options[argCombo.options.length] = opt;
}