
function changeModel()
{tb_remove();
	if (document.getElementById('noMobile').checked)
	window.location = 'index.php?mid=0';
	else
	window.location = 'index.php?mid='+document.getElementById('modelsList').value;
}


function populateListMobile(val,divid,mode)
  	{
  		//window.alert(val);
	var url="AjaxGetListMobile.php?mode="+mode+"&id="+val;
	postRequest(url,divid);
 	}

	function updatepage(str,divId)
  	{
	document.getElementById(divId).innerHTML = str;
   	}
   	
   	
function populateList(val,divid,mode)
  	{
  		//window.alert(val);
	var url="AjaxGetList.php?mode="+mode+"&id="+val;
	postRequest(url,divid);
 	}

	function updatepage(str,divId)
  	{
	document.getElementById(divId).innerHTML = str;
   	}

   	
function validateUserid(value,divId){
//var obj=document.getElementById('username_reg');
var url='user_validation.php?type=username&id=' + value;
postRequest(url,divId);

		function check_login(t){
			var area=document.getElementById('user_id_check')
			with (area){
				if (t=='1'){
				area.style.background="#F8BABA";
				area.style.border="1px solid red";
				area.innerHTML="Not Available";}
				else{
				area.style.background="#CBF8BA";
				area.style.border="1px solid green";
				area.innerHTML="Available";}
			}
			
		}
}

function postRequest(strURL,divId) 
{
	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;
      		 }
    	 }
  	}

//window.alert(strURL);
   		//xmlHttp.open('POST', strURL, true);
   		xmlHttp.open('GET', strURL, true);
		//xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		xmlHttp.onreadystatechange = function() 
		{
			if (xmlHttp.readyState == 4) 
			{
				updatepage(xmlHttp.responseText,divId);
			}
   		}

    xmlHttp.send(null);

}