function changelanguage(str1){
		http.open("POST", "http://www.tamilulakam.com/car/changelanguage.php", true);
http.onreadystatechange = changelanguageHttpRes;
var params = "str1=" + encodeURI(str1);
  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http.setRequestHeader("Content-length", params.length);
  http.setRequestHeader("Connection", "close");

  http.send(params);

}
function logchk(str1,str2) {  // This function does the AJAX request

  //  Set our destination PHP page "ajaxpost.php"…
//alert (str1);
if (str1!="" && str2!="")
{
//if (str1.indexOf(".") > 0 && str1.indexOf("@") > 0)
//{
  http.open("POST", "http://www.tamilulakam.com/car/loginpost.php", true);
  http.onreadystatechange = loginHttpRes;

  // Make our POST parameters string…
  //var params = "userid1=" + encodeURI(str1);

var params = "userid1=" + encodeURI(str1)+
	"&pwd1=" + encodeURI(str2);
  // Set our POST header correctly…
  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http.setRequestHeader("Content-length", params.length);
  http.setRequestHeader("Connection", "close");

  // Send the parms data…
  http.send(params);
//}
//else
//{
//document.getElementById("infotxt").innerHTML="<font face='Tahoma' size='2' color='#FF0000'>Incorrect UserID</font>";
					//document.getElementById('useridtxt').focus();
//setTimeout(function(){useridtxt.focus();useridtxt.select();},10);
//}
}
else
{
//alert("Enter UserID");
document.getElementById("infotxt").innerHTML="<font face='Tahoma' size='2' color='#FF0000'>Enter UserID/Password</font>";
//document.getElementById('useridtxt').focus();
setTimeout(function(){useridtxt.focus();useridtxt.select();},10);
}
}


function search(str1,str2,str3,str4,str5,str6,str7,str8,str9,str10,str11) {  // This function does the AJAX request
var str12;
alert (str1);
if (document.getElementById("sall").checked)
{
str12 = "1";
}
if (document.getElementById("simg").checked)
{
str12 = "2";
}

  http.open("POST", "http://www.tamilulakam.com/car/searchphp.php", true);
  http.onreadystatechange = searchHttpRes;
var params = "str1=" + encodeURI(str1)+
	"&str2=" + encodeURI(str2)+
"&str3=" + encodeURI(str3)+
"&str4=" + encodeURI(str4)+
"&str5=" + encodeURI(str5)+
"&str6=" + encodeURI(str6)+
"&str7=" + encodeURI(str7)+
"&str8=" + encodeURI(str8)+
"&str9=" + encodeURI(str9)+
"&str10=" + encodeURI(str10)+
"&str11=" + encodeURI(str11)+
"&str12=" + encodeURI(str12);

  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http.setRequestHeader("Content-length", params.length);
  http.setRequestHeader("Connection", "close");

  http.send(params);

}



function priceload(str1) {  // This function does the AJAX request

  http.open("POST", "http://www.tamilulakam.com/car/pricephp.php", true);
  http.onreadystatechange = priceHttpRes;
var params = "str1=" + encodeURI(str1);
  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http.setRequestHeader("Content-length", params.length);
  http.setRequestHeader("Connection", "close");

  http.send(params);

}

function priceload1(str1) {  // This function does the AJAX request

  http.open("POST", "http://www.tamilulakam.com/car/pricephp1.php", true);
  http.onreadystatechange = priceHttpRes1;
var params = "str1=" + encodeURI(str1);
  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http.setRequestHeader("Content-length", params.length);
  http.setRequestHeader("Connection", "close");

  http.send(params);

}


function checkeng(str1) {  // This function does the AJAX request

  //  Set our destination PHP page "ajaxpost.php"…
//alert (str1);
if (str1!="")
{
//if (str1.indexOf(".") > 0 && str1.indexOf("@") > 0)
//{
  http.open("POST", "http://www.tamilulakam.com/car/checkpost.php", true);
  http.onreadystatechange = getHttpRes1;

  // Make our POST parameters string…
  var params = "userid1=" + encodeURI(str1);
  // Set our POST header correctly…
  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http.setRequestHeader("Content-length", params.length);
  http.setRequestHeader("Connection", "close");

  // Send the parms data…
  http.send(params);
//}
//else
//{
//document.getElementById("ctxt").innerHTML="<font face='Tahoma' size='2' color='#FF0000'>Incorrect UserID</font>";
					//document.getElementById('useridtxt').focus();
//setTimeout(function(){useridtxt.focus();useridtxt.select();},10);
//}
}
//else
//{
//alert("Enter UserID");
//document.getElementById("utxt").innerHTML="<font face='Tahoma' size='2' color='#FF0000'>Enter UserID</font>";
//document.getElementById('useridtxt').focus();
//setTimeout(function(){userid.focus();userid.select();},10);
//}
}


function checkeng1(str1) {  // This function does the AJAX request

if (str1!="")
{
if (str1.indexOf(".") <= 0 || str1.indexOf("@") <= 0)
{
document.getElementById("etxt").innerHTML="<font face='Tahoma' size='2' color='#FF0000'>Incorrect E-Mail</font>";
					//document.getElementById('useridtxt').focus();
setTimeout(function(){email.focus();email.select();},10); 
}
else
{
document.getElementById("etxt").innerHTML="";
http.open("POST", "http://www.tamilulakam.com/car/checkemail.php", true);
  http.onreadystatechange = mailHttpRes;

  // Make our POST parameters string…
  var params = "userid1=" + encodeURI(str1);
  // Set our POST header correctly…
  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http.setRequestHeader("Content-length", params.length);
  http.setRequestHeader("Connection", "close");

  // Send the parms data…
  http.send(params);
}

}

}



function checkeng2(str1,str2) {  // This function does the AJAX request
if (str2!="")
{
if (str1!=str2)
{
document.getElementById("ectxt").innerHTML="<font face='Tahoma' size='2' color='#FF0000'>Not match Email and Confirm Email</font>";
					//document.getElementById('useridtxt').focus();
setTimeout(function(){cemail.focus();cemail.select();},10); 
}
else
{
document.getElementById("ectxt").innerHTML="";
}

}

}


function checkeng3(str1,str2) {  // This function does the AJAX request

if (str2!="")
{
if (str1!=str2)
{
document.getElementById("ptxt").innerHTML="<font face='Tahoma' size='2' color='#FF0000'>Not match Password and Confirm Password</font>";
					//document.getElementById('useridtxt').focus();
setTimeout(function(){cpassword.focus();cpassword.select();},10); 
}
else
{
document.getElementById("ptxt").innerHTML="";
}

}

}

function p()
{
alert ("ssd");
}

function getHttpRes1( ) {
  if (http.readyState == 4 && http.status == 200) { 
    res = http.responseText;  // These following lines get the response and update the page

    //document.getElementById('ctxt').innerHTML = res;
document.getElementById('utxt').innerHTML = "."
var data=res;
var data1=data.split("|");
//document.getElementById("ctxt").innerHTML=data1[0];
var v = data1[1];

if ( v=="2")
{
document.getElementById("utxt").innerHTML=data1[0];
//document.getElementById('useridtxt').focus();
setTimeout(function(){userid.focus();userid.select();},10);
}

  }
else
{
document.getElementById('utxt').innerHTML = "<div align='center'><img src='flower.gif'></div>";
//document.getElementById('english1').focus();
}
}

function mailHttpRes( ) {
  if (http.readyState == 4 && http.status == 200) { 
    res = http.responseText;  // These following lines get the response and update the page

    //document.getElementById('ctxt').innerHTML = res;
document.getElementById('etxt').innerHTML = "."
var data=res;
var data1=data.split("|");
//document.getElementById("ctxt").innerHTML=data1[0];
var v = data1[1];

if ( v=="2")
{
document.getElementById("etxt").innerHTML=data1[0];
//document.getElementById('useridtxt').focus();
setTimeout(function(){email.focus();email.select();},10);
}

  }
else
{
document.getElementById('etxt').innerHTML = "<div align='center'><img src='flower.gif'></div>";
//document.getElementById('english1').focus();
}
}



function getHttpRes( ) {
  if (http.readyState == 4 && http.status == 200) { 
    res = http.responseText;  // These following lines get the response and update the page
var data1=res;
var data1=data1.split("|");
//document.getElementById("ctxt").innerHTML=data1[0];
    document.getElementById('txt').innerHTML = data1[0];
var v = data1[1];

if ( v=1)
{
document.getElementById("usrfrm").innerHTML="";
//document.getElementById('useridtxt').focus();
}



  }
else
{
document.getElementById('txt').innerHTML = "<div align='center'><img src='bar.gif'></div>";
}
}



function reset()
{
alert ("shan");
document.getElementById('mname').value = '0';
document.getElementById('model').value = '0';
document.getElementById('bstyle').value = '0';
document.getElementById('years').value = '0';
document.getElementById('fuel').value = '0';
document.getElementById('milage').value = '0';
document.getElementById('country').value = '0';
document.getElementById('price').value = '0';
document.getElementById('pincode').value = '';
document.getElementById('vcolor').value = '0';
document.getElementById('transmission').value = '0';
document.getElementById("simg").checked=false;
document.getElementById("sall").checked=false;
}


function loginHttpRes( ) {
  if (http.readyState == 4 && http.status == 200) { 
    res = http.responseText;  // These following lines get the response and update the page
//    document.getElementById('ltxt').innerHTML = res;


var data=res;
var data=data.split("|");
var v = data[1];
//document.getElementById("infotxt").innerHTML=data[0];



if ( v=="2")
{
//document.getElementById("ctxt").innerHTML=data1[0];
//document.getElementById('useridtxt').focus();
//setTimeout(function(){useridtxt.focus();useridtxt.select();},10);
//window.open = 'services.php';
//window.location.href='upload.php';
window.location.href=data[0];
}
else
{
document.getElementById('infotxt').innerHTML=data[0];	
}

  }
else
{
document.getElementById('infotxt').innerHTML = "<div align='center'><img src='flower.gif'></div>";
//document.getElementById('english1').focus();
}
}

function searchHttpRes( ) {
  if (http.readyState == 4 && http.status == 200) { 
    res = http.responseText;  // These following lines get the response and update the page
    document.getElementById('stxt').innerHTML = res;


  }
else
{
document.getElementById('infotxt').innerHTML = "<div align='center'><img src='flower.gif'></div>";
//document.getElementById('english1').focus();
}
}

function priceHttpRes( ) {
  if (http.readyState == 4 && http.status == 200) { 
    res = http.responseText;  // These following lines get the response and update the page
//alert (res);
    document.getElementById('pricetxt').innerHTML = res;


  }
else
{
//document.getElementById('pricetxt').innerHTML = "<div align='center'><img src='flower.gif'></div>";
//document.getElementById('english1').focus();
}
}


function priceHttpRes1( ) {
  if (http.readyState == 4 && http.status == 200) { 
    res = http.responseText;  // These following lines get the response and update the page
//alert (res);
    document.getElementById('modeltxt123').innerHTML = res;


  }
else
{
//document.getElementById('modeltxt123').innerHTML = "<div align='center'><img src='flower.gif'></div>";
//document.getElementById('english1').focus();
}
}

function changelanguageHttpRes( ) {
  if (http.readyState == 4 && http.status == 200) { 
    res = http.responseText;  // These following lines get the response and update the page
    window.location.href='index.php';
  }
else
{
//document.getElementById('estateresult').innerHTML = "<div align='center'><img src='flower.gif'></div>";
//document.getElementById('english1').focus();
}
}

function getXHTTP( ) {
  var xhttp;
   try {   // The following "try" blocks get the XMLHTTP object for various browsers…
      xhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e2) {
 		 // This block handles Mozilla/Firefox browsers...
	    try {
	      xhttp = new XMLHttpRequest();
	    } catch (e3) {
	      xhttp = false;
	    }
      }
    }
  return xhttp; // Return the XMLHTTP object
}

var http = getXHTTP(); // This executes when the page first loads.