
function checkData()
{

if (document.classic.residence.value == "")
{
 alert("Please select your country of residence.")
document.classic.residence.focus()
return false;
}

if (document.classic.age.value == "")
{
 alert("Please enter the age of the driver.")
document.classic.age.focus()
return false;
}

if (document.classic.cc.value == "")
{
 alert("Please select a currency for your quotation.")
document.classic.age.focus()
return false;
}

if (document.classic.firstname.value == "")
{
 alert("Please enter your firstname.")
document.classic.firstname.focus()
return false;
}

if (document.classic.lastname.value == "")
{
 alert("Please enter your lastname.")
document.classic.lastname.focus()
return false;
}
if (document.classic.emailaddress.value == "")
{
 alert("Please enter your emailaddress.")
document.classic.emailaddress.focus()
return false;
}

}


function AjaxFunction(country)
{
var httpxml;
for(j=document.classic.subcat.options.length-1;j>=0;j--)
{
document.classic.subcat.remove(j);
}
var optn2 = document.createElement("OPTION");
optn2.text = 'Loading......';
optn2.value = '';
document.classic.subcat.options.add(optn2);
try
  {
  // Firefox, Opera 8.0+, Safari
  httpxml=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
		  try
   			 		{
   				 httpxml=new ActiveXObject("Msxml2.XMLHTTP");
    				}
  			catch (e)
    				{
    			try
      		{
      		httpxml=new ActiveXObject("Microsoft.XMLHTTP");
     		 }
    			catch (e)
      		{
      		alert("Your browser does not support AJAX!");
      		return false;
      		}
    		}
  }
function stateck() 
    {
    if(httpxml.readyState==4)
      {

var myarray=eval(httpxml.responseText);

for(j=document.classic.subcat.options.length-1;j>=0;j--)
{
document.classic.subcat.remove(j);
}



for (i=0;i<myarray.length;i++)
{
var optn = document.createElement("OPTION");
optn.text = myarray[i];
optn.value = myarray[i];
document.classic.subcat.options.add(optn);

} 
      }
    }
var url="/dd2.php";
url=url+"?country="+country;
url=url+"&sid="+Math.random();
httpxml.onreadystatechange=stateck;
httpxml.open("GET",url,true);
httpxml.send(null);
  }
