// JavaScript Document



/****************************************************************************************************************************************************************/

function show_div()

{

	show_login();

document.getElementById("message").innerHTML = "<a href=# class=sub_menu onclick=hide_div()>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/call_back.gif' width='136' height='33' border='0'></a>";

document.getElementById("query_div").style.visibility="visible";

}

function hide_div()

{

document.getElementById("message").innerHTML = "<a href=# class='sub_menu' onclick=show_div()>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/call_back.gif' width='136' height='33' border='0'></a>";

document.getElementById("query_div").style.visibility="hidden";

}



function show_login()

{

var count_value="hai";



	xmlHttp5=GetXmlHttpObject2();

	if (xmlHttp5==null)

	 {

	 alert ("Browser does not support HTTP Request");

	 return;

	 }

	var url5="login.html";

	url5=url5+"?count_value="+count_value;

	url5=url5+"&sid="+Math.random();

	xmlHttp5.onreadystatechange=stateChanged5;

	xmlHttp5.open("GET",url5,true);

	xmlHttp5.send(null);

}



function stateChanged5() 

 { 

if (xmlHttp5.readyState==4 || xmlHttp5.readyState=="complete")

 { 

document.getElementById("query_div").innerHTML=xmlHttp5.responseText;

 } 

 }

/****************************************************************************************************************************************************************/



function GetXmlHttpObject2()

{

var xmlHttp2=null;

try

 {

 // Firefox, Opera 8.0+, Safari

 xmlHttp2=new XMLHttpRequest();

 }

catch (e)

 {

 //Internet Explorer

 try

  {

  xmlHttp2=new ActiveXObject("Msxml2.XMLHTTP");

  }

 catch (e)

  {

  xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP");

  }

 }

return xmlHttp2;

}



<!--

function MM_validateForm() { //v4.0

  if (document.getElementById){

    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;

    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);

      if (val) { nm=val.name; if ((val=val.value)!="") {

        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');

          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';

        } else if (test!='R') { num = parseFloat(val);

          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';

          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');

            min=test.substring(8,p); max=test.substring(p+1);

            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';

      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }

    } if (errors) alert('The following error(s) occurred:\n'+errors);

    document.MM_returnValue = (errors == '');

} }

//-->

function Validate_form()

{

    valid = true;



	if ( document.form2.make.value == "" )

    {

        alert ( "Please Enter Your Car Make" );

		document.form2.make.focus(); 

        return false;

    }

	

	if ( document.form2.model.value == "" )

    {

        alert ( "Please Enter Car Model" );

		document.form2.model.focus(); 

        return false;

    }



	if ( document.form2.reg_year.value == "" )

    {

        alert ( "Please Enter Registration year of car" );

		document.form2.reg_year.focus(); 

        return false;

    }	

		if ( document.form2.reg_num.value == "" )

    {

        alert ( "Please Enter Registration Number" );

		document.form2.reg_num.focus(); 

        return false;

    }

}

<!--

function MM_validateForm() { //v4.0

  if (document.getElementById){

    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;

    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);

      if (val) { nm=val.name; if ((val=val.value)!="") {

        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');

          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';

        } else if (test!='R') { num = parseFloat(val);

          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';

          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');

            min=test.substring(8,p); max=test.substring(p+1);

            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';

      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }

    } if (errors) alert('The following error(s) occurred:\n'+errors);

    document.MM_returnValue = (errors == '');

} }

//-->





 