function isNumberKey(evt)
{
 var charCode = (evt.which) ? evt.which : event.keyCode
 if (charCode > 31 && (charCode < 48 || charCode > 57))
 {
     alert("Please enter only numbers");
    return false;
}
return true;
}

function radio_button_checker()
{

var s = document.sell_vehicles;

if(s.vehicle_type[0].checked == false && s.vehicle_type[1].checked == false && s.vehicle_type[2].checked == false){
       alert("Please select Vehicle Type");
       return false;}
//here if we select commercial type means this below javasript functions, to validate whether the user has selected Vehicle-commercial type like bus, truck, van 
if(s.vehicle_type[2].checked)
{ 
       if(s.com_type_id.selectedIndex == 0){
       alert("Please select Commercial Type");
       return false;}
}

if (s.make_id.selectedIndex == 0 ) {	
	alert ( "Please select your Make." ); 
	return false; } 
if (s.model_id.selectedIndex == 0 ) {	
	alert ( "Please select your Model." ); 
	return false;}
if (s.variant_id.selectedIndex == 0 ) {	
	alert ( "Please select your Variant." ); 
	return false; }

if (s.yom_date.selectedIndex == 0 ) {	
	alert ( "Please select the Year of vehicle manufactured." ); 
	return false; }

if(s.rc_book[0].checked == false && s.rc_book[1].checked == false){
     alert("Please select Registeration Book availablity[RC book]");
	   s.rc_book[0].focus();
     return false;}

if(s.registration_number.value=="")
{
  alert(" Please Enter Your vehicle Registration Number");
  s.registration_number.focus();
	return false;}

if(s.registration_state.selectedIndex=="0") {	
	 alert ( "Please select your Registration State"); 
   s.registration_state.focus();
	 return false; } 

if(s.registration_city.selectedIndex == 0 ) {	
	 alert ( "Please select your City." ); 
   	s.registration_city.focus()
    return false; } 

if(s.kms_runned.value==""){
	alert("Please Enter Your vehicle Overall Mileage");
  s.kms_runned.focus();
    return false;}

if(s.no_of_owners.selectedIndex == 0 ) {	
    alert ( "Please select Number of owners holding the vehicle." ); 
	  s.no_of_owners.focus()
    return false; } 

if(s.hypothecated[0].checked == false && s.hypothecated[1].checked == false){
    alert("Please choose whether the Vehicle is Hypothecated ");
  	s.hypothecated[1].focus();
return false;}

if(s.price_negotiable[0].checked == false && s.price_negotiable[1].checked == false){
    alert("Please select Price negotiable");
  	s.price_negotiable[0].focus();
return false;}

if(s.insurance_paid_upto_date[0].checked == false && s.insurance_paid_upto_date[1].checked == false){
    alert("Please select Insurance ");
  	s.insurance_paid_upto_date[0].focus();
    return false;}


if(s.insur_from_date.value==""){
	alert(" Please Enter insurance from date");
  	s.insur_from_date.focus()
	return false;}


if(s.insur_to_date.value==""){
	alert(" Please Enter Insurance to date");
  	s.insur_to_date.focus()
	return false;}



if(s.advertisement_title.value==""){
alert(" Please Enter Advertisement Title");
s.advertisement_title.focus();
	return false;}

if(s.asking_price.value==""){
alert(" Please Enter Vehicle Asking Price");
  	s.asking_price.focus();
	return false;}


if(s.color.value==""){
alert(" Please Enter Color of your Vehicle");
  	s.color.focus();
	return false;}


if(true)
{
answer = confirm("Are you sure you want to go ahead?") 
if(answer==0)
return false;
}

  
    return true;
}

function display(){	 
	 if(document.sell_vehicles.vehicle_type[2].checked){
	   
	   document.getElementById('select').style.display= '' ;
	   document.getElementById('label').style.display= '' ;
	 }
	 else{
	   document.getElementById('select').style.display =  'none';
	  document.getElementById('label').style.display= 'none' ;
     }
	
	
}






