// JavaScript Document
var xmlHttp;

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
   {
   xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
   }
 catch (e)
   {
   xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
 }
return xmlHttp;
}


function change_project(client_id,consultant_id)
{
	
	 var xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
var url="change_project.php";
url=url+"?id="+client_id;

//xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("POST",url,true);

xmlHttp.send();
  xmlHttp.onreadystatechange = function() {  
        if (xmlHttp.readyState == 4) {
            if (xmlHttp.status == 200)
			{
				if(xmlHttp.responseText != "")
				{
					
					document.getElementById('project').innerHTML="";
               		document.getElementById('project').innerHTML=xmlHttp.responseText;
					
				}
			}
			
        }
    }
}


function getCity(state)
{
	
	 var xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
var url="getCity.php";
url=url+"?state="+state;
//alert(url);
//xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("POST",url,true);

xmlHttp.send();
  xmlHttp.onreadystatechange = function() {  
        if (xmlHttp.readyState == 4) {
            if (xmlHttp.status == 200)
			{
				if(xmlHttp.responseText != "")
				{
					//alert(xmlHttp.responseText);
					document.getElementById('city').innerHTML="";
               		document.getElementById('city').innerHTML=xmlHttp.responseText;
					
				}
			}
			
        }
    }
}

function getState(country)
{
	
	 var xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
var url="getDirectoryState.php";
url=url+"?country="+country;
//alert(url);
//xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("POST",url,true);

xmlHttp.send();
  xmlHttp.onreadystatechange = function() {  
        if (xmlHttp.readyState == 4) {
            if (xmlHttp.status == 200)
			{
				if(xmlHttp.responseText != "")
				{
					//alert(xmlHttp.responseText);
					document.getElementById('state').innerHTML="";
               		document.getElementById('state').innerHTML=xmlHttp.responseText;
					
				}
			}
			
        }
    }
}
function subForm(id)
{
	var name = document.getElementById('name').value;
	var email = document.getElementById('email').value;
	var phone = document.getElementById('phone').value;
	 var xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
if(name=='' || email=='' || phone=='') {
	alert("Please enter all details!");
	return;
}
var url="submitenq.php";
url=url+"?id="+id;
url=url+"&name="+name;
url=url+"&email="+email;
url=url+"&phone="+phone;
//alert(url);
//xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("POST",url,true);

xmlHttp.send();
  xmlHttp.onreadystatechange = function() {  
        if (xmlHttp.readyState == 4) {
            if (xmlHttp.status == 200)
			{
				if(xmlHttp.responseText != "")
				{
					//alert(xmlHttp.responseText);
					iBox.hide();
					document.getElementById('contact_'+id).style.display="";
					document.getElementById('more_'+id).style.display="none";
					
				}
			}
			
        }
    }
}


function change_origin(orig)
{
	if(orig=="Indian"){
		document.getElementById('area').style.display="block";
		document.getElementById('mine').style.display="none";
	}
	if(orig=="International"){
		document.getElementById('mine').style.display="block";
		document.getElementById('area').style.display="none";
	}
}

