var message="Copyright (c) 2008 Needacar.com.au WARNING ! All content contained within this site is protected by copyright laws. Unauthorized use of our material is strictly prohibited.";
function click(e) {
if (document.all) {
if (event.button==2||event.button==3) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 2) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//For Login Page Starts Here
function check2()
{
	if(document.frm_login.username.value.length<1)
	{
		alert("Please enter Username");
		document.frm_login.username.focus();
		return false;
	}
	if(document.frm_login.password.value.length<1)
	{
		alert("Please enter password");
		document.frm_login.password.focus();
		return false;
	}	

}

// For Home page starts here 
function arreindex()
{
	document.seller_search.file.value='used_carpro';
}

function checkindex()
{
	if(document.seller_search.car_cat.value=="Select Car Category")
	{
		alert("Please select car category");
		document.seller_search.car_cat.focus();
		return false;
	}

}


// For Home Page Ends Here

//For Home Page section Ad Starts here
function adindex()
{
	<!-- 
	_m1SecID="000000202-001";
	_m1IsActive=1;
	_m1PosV=1;
	_m1PosH=2;
	_m1PosX=0;
	_m1PosY=20;
	// -->
}

// For Home Page Section Ad Ends here

function showmenu(elmnt)
{
document.getElementById(elmnt).style.visibility="visible"
}
function hidemenu(elmnt)
{
	document.getElementById(elmnt).style.visibility="hidden"
}


// For Login Page Ends Here


function abcuser()
{
	document.seller_search.file.value='used_car';
	document.seller_search.submit();
}


function checkuser()
{	
	//alert("hello" + document.seller_search.car_cat.value);
	if(document.seller_search.car_cat.value=="Select Car Category")
	{
		alert("Please select car category");
		document.seller_search.car_cat.focus();
		return false;
	}
}
function arreuser()
{
	//document.frm_login.action = 'index.php?file=edit_buyer_profile_a';
	//alert(document.seller_search.file.value);
	document.seller_search.file.value='used_carpro';
	//document.seller_search.submit();
}

function arreadvuser()
{
	//document.frm_login.action = 'index.php?file=edit_buyer_profile_a';
	//alert(document.seller_search.file.value);
	document.seller_search.file.value='advused_result';
	//document.seller_search.submit();
}



//For AUtopart Enquiry starts here
function checkaenq()
{
	if (document.reg.fname.value.length <1) 
	{
		alert("please Fill your first name");
		document.reg.fname.focus();
	    return false;
	}
	
    if(document.reg.email.value.length<1)
	{
		alert("Please Fill Your Email Address");
		document.reg.email.focus();
		return false;
	 }
	if(document.reg.email.value != "")
    {
		apos=reg.email.value.indexOf("@");
		dotpos=reg.email.value.lastIndexOf(".");
		lastpos=reg.email.value.length-1;
		if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) 
		{
		  	alert("Please Enter valid Email Address");
			reg.email.focus();
			return(false);
	    } 
	}
	if (document.reg.phone.value.length <1) 
	{
		alert("please enter your phone number..!!");
		document.reg.phone.focus();
	    return false;
	}
}
//For Auto PArt Enquiry Ends here

//For Car Detail Page Starts Here
function carcar1()
{
	document.reg.file.value='carpreview';
}


function checkcar()
{

if(document.reg.username.value.length<1)
{
alert("Please enter your full name");
document.reg.username.focus();
return false;
}
if(document.reg.type11.value.length<1 || document.reg.type11.value=="Please Select")
{
	alert("please select Car Type");
	document.reg.type11.focus();
	return false;
}

if(document.reg.dealer_ad.value.length>1 && document.reg.private_ad.checked)
   {
   alert("Please select either Dealer ad or Private ad");
   document.reg.dealer_ad.focus();
   return false;
   }    
else if(document.reg.dealer_ad.value.length<1 && !(document.reg.private_ad.checked))   
   {
   alert("Please select atleast one ad type");
   document.reg.dealer_ad.focus();
   return false;
   }    


if(document.reg.e_email.value.length<1)
{
alert("Please enter your E-Mail Address");
document.reg.e_email.focus();
return false;
}
if(document.reg.e_email.value!="")
{
	apos=document.reg.e_email.value.indexOf("@");
	dotpos=document.reg.e_email.value.lastIndexOf(".");
	lastpos=document.reg.e_email.value.length-1;
if(apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2)
{
	alert("please enter a Valid E-Mail Address");
	document.reg.e_email.focus();
	return false;
}
}
if(document.reg.zipcode.value.length<1)
{
	alert("Please enter Postcode");
	document.reg.zipcode.focus();
	return false;
}

if(document.reg.make1.value.length<1 || document.reg.make1.value=="Please Select")
{
	alert("please select Manufacturer Name..!!");
	document.reg.make1.focus();
	return false;
}
if(document.reg.year2.value.length<1)
{
	alert("please select Year..!!");
	document.reg.year2.focus();
	return false;
}
if(document.reg.trans.value.length<1 || document.reg.trans.value=="Please select")
{
	alert("Please Select Transmission..!!");
	document.reg.trans.focus();
	return false;
}
if(document.reg.body.value.length<1 || document.reg.body.value=="Please select")
{
	alert("please select your Car Body ..!!");
	document.reg.body.focus();
	return false;
}
if(document.reg.series.value.length<1 || document.reg.series.value=="Please select")
{
	alert("please select Series");
	document.reg.series.focus();
	return false;
}
if(document.reg.state123.value.length<1 || document.reg.state123.value=="Please select")
{
	alert("please select Car Location");
	document.reg.state123.focus();
	return false;
}
if(document.reg.price.value.length<1)
{
	alert("Please enter Price ??");
	document.reg.price.focus();
	return false;
}
if(document.reg.sdesc.value.length<1)
{
	alert("Please enter a Short Description");
	document.reg.sdesc.focus();
	return false;
}
if(document.reg.desc.value.length<1)
{
	alert("Please enter a Long Description");
	document.reg.desc.focus();
	return false;
}

if(document.reg.reg_no.value.length<1 && document.reg.eng_no.value.length<1)
{
	alert("Either insert Engine no or registration no and Expiry Date");
	document.reg.reg_no.focus();
	return false;
}
else if(document.reg.reg_no.value.length>1 && (document.reg.day.value=="" || document.reg.day.value=="Select" || document.reg.mon.value=="" || document.reg.mon.value=="Select"  || document.reg.yr.value=="" || document.reg.yr.value=="Select") && document.reg.eng_no.value.length<1 )
{
	alert("Either insert Expiry Date ");
	document.reg.day.focus();
	return false;

}

if((document.reg.reg_no.value.length>1) && ((document.reg.day.value=="") || (document.reg.mon.value=="")  || (document.reg.yr.value=="")))
{
	alert("Please select Expiry date");
	document.reg.day.focus();
	return false;

}
}
//For Car Detail Page Ends Here


//For Car Dealer Page Starts Here
function checkdealer()
{
	if(document.deal.name.value.length<1)
	{
		alert("Please Fill your Name");
		document.deal.name.focus();
		return false;
	}
	if(document.deal.phone.value.length<1)
	{
		alert("Please Fill your Phone No.");
		document.deal.phone.focus();
		return false;
	}
    if(document.deal.email.value.length<1)
	{
	 	alert("Please Fill Your Email Address");
		document.deal.email.focus();
	 	return false;
	}
	if(document.deal.email.value != "")
    {
		apos=deal.email.value.indexOf("@");
		dotpos=deal.email.value.lastIndexOf(".");
		lastpos=deal.email.value.length-1;
		if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) 
		{
			alert("Please Enter valid Email Address");
		  	deal.email.focus();
			return false;
		} 
	}	

	if(document.deal.dealer.value.length<1)
	{
		alert("Please Fill Your Dealership name.");
		document.deal.dealer.focus();
		return false;
	}
	if(document.deal.comment.value.length<1)
	{
		alert("Please Enter your Comment..!!");
		document.deal.comment.focus();
		return false;
	}
	if(document.deal.userstring.value.length<1)
	{
		alert("please enter value Shown In Image");
		document.deal.userstring.focus();
		return false;
	}
}

//For Car Dealer Page Ends Here

// For Car Preview Detail Page Starts here

function checkpre()
{
	if(document.reg.username.value.length<1)
{
alert("Please enter Contactname");
document.reg.username.focus();
return false;
}
/*if(document.reg.e_email.value.length<1)
{
alert("Please enter your E-Mail Address");
document.reg.e_email.focus();
return false;
}
if(document.reg.e_email.value!="")
{
	apos=document.reg.e_email.value.indexOf("@");
	dotpos=document.reg.e_email.value.lastIndexOf(".");
	lastpos=document.reg.e_email.value.length-1;
if(apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2)
{
	alert("please enter a Valid E-Mail Address");
	document.reg.e_email.focus();
	return false;
}
}
if(document.reg.zipcode.value.length<1)
{
	alert("Please enter Postcode");
	document.reg.zipcode.focus();
	return false;
}*/

if(document.reg.atitle.value.length<1)
{
	alert("please enter Autopart Title");
	document.reg.atitle.focus();
	return false;
}

if(document.reg.make.value.length<1)
{
	alert("please Enter Manufacturer for autoparts");
	document.reg.make.focus();
	return false;
}

if(document.reg.model.value.length<1)
{
	alert("please Enter model for autoparts");
	document.reg.model.focus();
	return false;
}


if(document.reg.year.value.length<1)
{
	alert("please Enter year for autoparts");
	document.reg.year.focus();
	return false;
}




if(document.reg.state123.value.length<1)
{
	alert("please select State name");
	document.reg.state123.focus();
	return false;
}
if(document.reg.region.value.length<1)
{
	alert("please select Region");
	document.reg.region.focus();
	return false;
}
if(document.reg.price.value.length<1)
{
	alert("please Enter Price");
	document.reg.price.focus();
	return false;
}
if(document.reg.sdesc.value.length<1)
{
	alert("please enter a short Description");
	document.reg.sdesc.focus();
	return false;
}
if(document.reg.comment.value.length<1)
{
	alert("please enter Description");
	document.reg.comment.focus();
	return false;
}
/*
if(document.reg.userfile1.value.length<1)
{
	alert("Please insert an image");
	document.reg.userfile.focus();
	return false;
}*/
}


//For Car Preview Detail Page Ends here


//For CarPreview Edit Page Starts here
function caredit()
{
	document.reg.file.value='carpreview_edit_a';
}

function caredit1()
{
	document.reg.file.value='carpreview_back';
}


function carpre()
{
	document.reg.file.value='preview_edit_a';
}

function carpre1()
{
	document.reg.file.value='preview_back';
}




function checkpedit()
{


if(document.reg.username.value.length<1)
{
alert("Please enter your full name");
document.reg.username.focus();
return false;
}



if(document.reg.e_email.value.length<1)
{
alert("Please enter your E-Mail Address");
document.reg.e_email.focus();
return false;
}
if(document.reg.e_email.value!="")
{
	apos=document.reg.e_email.value.indexOf("@");
	dotpos=document.reg.e_email.value.lastIndexOf(".");
	lastpos=document.reg.e_email.value.length-1;
if(apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2)
{
	alert("please enter a Valid E-Mail Address");
	document.reg.e_email.focus();
	return false;
}
}
if(document.reg.zipcode.value.length<1)
{
	alert("Please enter Postcode");
	document.reg.zipcode.focus();
	return false;
}
if(document.reg.car_type.value.length<1 || document.reg.car_type.value=="Please Select")
{
	alert("please select Car Type");
	document.reg.car_type.focus();
	return false;
}
if(document.reg.car_cat.value.length<1 || document.reg.car_cat.value=="Please Select")
{
	alert("please select Category");
	document.reg.car_cat.focus();
	return false;
}
if(document.reg.dealer_ad.value.length>1 && document.reg.eprivate_ad.checked)
   {
   alert("Please select either Dealer ad or Private ad");
   document.reg.dealer_ad.focus();
   return false;
   }    
else if(document.reg.dealer_ad.value.length<1 && !(document.reg.eprivate_ad.checked))   
   {
   alert("Please select atleast one ad type");
   document.reg.dealer_ad.focus();
   return false;
   }    
if(document.reg.make1.value.length<1 || document.reg.make1.value=="Please Select")
{
	alert("please select Manufacturer Name..!!");
	document.reg.make1.focus();
	return false;
}
if(document.reg.model1.value.length<1 || document.reg.model1.value=="Select Model")
{
	alert("please select Model..!!");
	document.reg.model1.focus();
	return false;
}
if(document.reg.year.value=="" || document.reg.year.value=="Please Select")
{
	alert("Please Select Year..!!");
	document.reg.year.focus();
	return false;
}
if(document.reg.trans.value.length<1 || document.reg.trans.value=="Please select")
{
	alert("Please Select Transmission..!!");
	document.reg.trans.focus();
	return false;
}
if(document.reg.body.value.length<1 || document.reg.body.value=="Please select")
{
	alert("please select  your Car Body ..!!");
	document.reg.body.focus();
	return false;
}
if(document.reg.series.value.length<1 || document.reg.series.value=="Please select")
{
	alert("please select Series");
	document.reg.series.focus();
	return false;
}
if(document.reg.state123.value=="" || document.reg.state123.value=="Please select")
{
	alert("please select Car Location");
	document.reg.state123.focus();
	return false;
}
if(document.reg.region.value=="" || document.reg.region.value=="Select Region")
{
	alert("please select region of the selected car location..!!");
	document.reg.region.focus();
	return false;
}
if(document.reg.price.value.length<1)
{
	alert("Please enter Price ??");
	document.reg.price.focus();
	return false;
}
if(document.reg.sdesc.value.length<1)
{
	alert("Please enter a Short Description");
	document.reg.sdesc.focus();
	return false;
}
if(document.reg.desc.value.length<1)
{
	alert("Please enter a Long Description");
	document.reg.desc.focus();
	return false;
}


if(document.reg.reg_no.value.length<1 && document.reg.eng_no.value.length<1)
{
	alert("Either insert Engine no or Engine registration no ");
	document.reg.reg_no.focus();
	return false;
}
else if(document.reg.reg_no.value.length>1 && (document.reg.day.value=="" || document.reg.mon.value==""  || document.reg.yr.value=="") && document.reg.eng_no.value.length<1 )
{
	alert("Either insert registration number and expiry date or Engine number ");
	document.reg.day.focus();
	return false;

}
else if((document.reg.reg_no.value.length>1) && (document.reg.day.value=="" || document.reg.mon.value==""  || document.reg.yr.value==""))
{
	alert("Please select Expiry date");
	document.reg.day.focus();
	return false;

}
}


//For CarPreview Page Ends here

//For Dealer Page Starts here
function abcdel()
{
	document.dealer.file.value='dealer_profile';
}

function checkdel()
{
	/*if(document.dealer_search.car_cat.value=="Select Car Category")
	{
		alert("Please select car category");
		document.dealer_search.car_cat.focus();
		return false;
	}*/
	/*if(document.dealer.search_make.value.length<1)
	{
		alert("Please select Manufacturer");
		document.dealer.search_make.focus();
		return false;
	}
	if(document.dealer.sea_model.value.length<1)
	{
		alert("Please select Car Model");
		document.dealer.sea_model.focus();
		return false;
	}

	if(document.dealer.state123.value.length>1)
	{
		if(document.dealer.region.value.length<1)
		{
			alert("Please select Region");
			document.dealer.region.focus();
			return false;
		}
	}
*/
}
//For Dealer Page Ends Here


// For Edit Autodetails page starts here
function aeditcar()
{
	document.reg.file.value='edit_autodetails_a';
}
function aeditcheck()
{
	if(document.reg.username.value.length<1)
	{
		alert("Please enter Contactname");
		document.reg.username.focus();
		return false;
	}
	if(document.reg.atitle.value.length<1)
	{
		alert("please enter Autopart Title");
		document.reg.atitle.focus();
		return false;
	}

	if(document.reg.make.value.length<1)
	{
		alert("please Enter Manufacturer for autoparts");
		document.reg.make.focus();
		return false;
	}
	if(document.reg.model.value.length<1)
	{
		alert("please Enter model for autoparts");
		document.reg.model.focus();
		return false;
	}


	if(document.reg.year.value.length<1)
	{
		alert("please Enter year for autoparts");
		document.reg.year.focus();
		return false;
	}
	if(document.reg.state123.value.length<1)
	{
		alert("please select State name");
		document.reg.state123.focus();
		return false;
	}
	if(document.reg.region.value.length<1)
	{
		alert("please select Region");
		document.reg.region.focus();
		return false;
	}
	if(document.reg.price.value.length<1)
	{
		alert("please Enter Price");
		document.reg.price.focus();
		return false;
	}
	if(document.reg.sdesc.value.length<1)
	{
		alert("please enter a short Description");
		document.reg.sdesc.focus();
		return false;
	}
	if(document.reg.comment.value.length<1)
	{
		alert("please enter Description");
		document.reg.comment.focus();
		return false;
	}
}


//For Edit AutoDetails Page Ends Here

// For Edit Car Details Page Starts Here


function ceditvalidate()
{
	if((document.reg.dealer_ad.value.length>1) && (document.reg.eprivate_ad.checked))
	{
		
		alert("Please select either Dealer ad or Private ad");
		document.reg.dealer_ad.focus();
		return false;
	}
	else if((document.reg.dealer_ad.value.length<1) && !(document.reg.eprivate_ad.checked))
	{
		alert("Please select atleast one ad type");
		document.reg.dealer_ad.focus();
		return false;
		
	}
	
	if((document.reg.type11.value.length<1) || (document.reg.type11.value=="Please Select"))
	{
		alert("please select Car Type");
		document.reg.type11.focus();
		return false;
	}
	if(document.reg.category1.value.length<1 || document.reg.category1.value=="Please Select")
	{
		alert("please select Category");
		document.reg.category1.focus();
		return false;
	}
	if(document.reg.make1.value.length<1 || document.reg.make1.value=="Please Select")
	{
		alert("please select Manufacturer Name..!!");
		document.reg.make1.focus();
		return false;
	}
	if(document.reg.model1.value.length<1 || document.reg.model1.value=="Select Model")
	{
		alert("please select Model..!!");
		document.reg.model1.focus();
		return false;
	}
	if(document.reg.year.value.length<1 || document.reg.year.value=="Please Select")
	{
		alert("Please Select Year..!!");
		document.reg.year.focus();
		return false;
	}
	if(document.reg.trans.value.length<1 || document.reg.trans.value=="Please select")
	{
		alert("Please Select Transmission..!!");
		document.reg.trans.focus();
		return false;
	}
	if(document.reg.body.value.length<1 || document.reg.body.value=="Please select")
	{
		alert("please select  your Car Body ..!!");
		document.reg.body.focus();
		return false;
	}
	if(document.reg.series.value.length<1)
	{
		alert("Please Enter Series..!!");
		document.reg.series.focus();
		return false;
	}

	if(document.reg.state123.value.length<1 || document.reg.state123.value=="Please select")
	{
		alert("please select Car Location");
		document.reg.state123.focus();
		return false;
	}
	if(document.reg.region.value=="" || document.reg.region.value=="Select Region")
	{
		alert("please select region of the selected car location..!!");
		document.reg.region.focus();
		return false;
	}
	if(document.reg.price.value.length<1)
	{
		alert("Please enter Price ??");
		document.reg.price.focus();
		return false;
	}
	if(document.reg.sdesc.value.length<1)
	{
		alert("Please enter a Short Description");
		document.reg.sdesc.focus();
		return false;
	}
	if(document.reg.desc.value.length<1)
	{
		alert("Please enter a Long Description");
		document.reg.desc.focus();
		return false;
	}
	if(document.reg.reg_no.value.length<1 && document.reg.eng_no.value.length<1)
	{
		alert("Either insert Engine no or registration no ");
		document.reg.reg_no.focus();
		return false;
	}
	else if(document.reg.reg_no.value.length>1 && (document.reg.day.value=="" || document.reg.day.value=="Select" || document.reg.mon.value=="" || document.reg.mon.value=="Select"  || document.reg.yr.value=="" || document.reg.yr.value=="Select") && document.reg.eng_no.value.length<1 )
	{
		alert("Either insert Expiry Date ");
		document.reg.day.focus();
		return false;
	}

	if((document.reg.reg_no.value.length>1) && (document.reg.day.value=="" || document.reg.mon.value==""  || document.reg.yr.value==""))
	{
		alert("Please select Expiry date");
		document.reg.day.focus();
		return false;
	}
}

function ceditcar()
{
	
	document.reg.file.value='edit_cardetails_a';
	
}


//For Edit Car Details Page Ends Here

// For Edit Ad Page Starts here
function editcaradd()
{
	document.vijay.file.value='editad_a';
	if (document.vijay.firstname.value.length <1) 
	{
		alert("please Fill your contact name");
		document.vijay.firstname.focus();
	     return false;
	}
	if(document.vijay.suburb.value.length<1)
	{
		alert("please Fill your Suburb");
		document.vijay.suburb.focus();
return false;
}
	
if(document.vijay.zip.value.length<1)
{
alert("Please fill your Postcode");
document.vijay.zip.focus();
return false;
}
	if (document.vijay.e_state.value.length <1 ) 
	{
		alert("Please Choose your State name!");
		document.vijay.e_state.focus();
	     return false;
	}
				
if(document.vijay.e_engno.value.length<1)
{
alert("Please enter your engine number");
document.vijay.e_engno.focus();
return false;
}
if(document.vijay.e_price1.value.length<1)
{
alert("Please enter your price");
document.vijay.e_price1.focus();
return false;
}
if(document.vijay.e_km2.value.length<1)
{
alert("Please enter the KM");
document.vijay.e_km2.focus();
return false;
}
if(document.vijay.e_croad.value.length<1)
{
alert("Please enter the Roadworthy certificate");
document.vijay.e_croad.focus();
return false;
}
if(document.vijay.i_color2.value.length<1)
{
alert("Please Fill the Interior color");
document.vijay.i_color2.focus();
return false;
}



}

// For Edit Ad Page Ends here


//For EditProfile Page Starts Here
function checkeditp()
{
	
	if (document.reg.fname.value.length <1) 
	{
		alert("please Fill your first name");
		document.reg.fname.focus();
	    return false;
	}
    if(document.reg.email.value.length<1)
	{
		alert("Please Fill Your Email Address");
		document.reg.email.focus();
		return false;
	}
	if(document.reg.email.value != "")
    {
		apos=reg.email.value.indexOf("@");
		dotpos=reg.email.value.lastIndexOf(".");
		lastpos=reg.email.value.length-1;
		if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) 
	    {
		  	alert("Please Enter valid Email Address");
	  		reg.email.focus();
			return(false);
		} 
	}

	if(document.reg.zip.value.length<1)
	{
		alert("Please enter your postal code");
		document.reg.zip.focus();
		return false;
	}

	if(document.reg.hphone.value.length<1)
	{
		alert("Please enter your residential phone number..!!");
		document.reg.hphone.focus();
		return false;
	}
}


//For EditProfile Page Ends Here

//For Car Enquiry Page Starts Here
function checkinqc()
{
	if (document.reg.fname.value.length <1) 
	{
		alert("please Fill your first name");
		document.reg.fname.focus();
	     return false;
	}
    if(document.reg.email.value.length<1)
	{
		alert("Please Fill Your Email Address");
		document.reg.email.focus();
		return false;
	}
	if(document.reg.email.value != "")
    {
		apos=reg.email.value.indexOf("@");
		dotpos=reg.email.value.lastIndexOf(".");
		lastpos=reg.email.value.length-1;
		if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) 
		{
		  	alert("Please Enter valid Email Address");
		  	reg.email.focus();
			return(false);
		} 
	}
}


// For Car Enquiry Page Ends Here

//For New Demo Page Starts here
function abcdemo()
{
	document.new_demo.file.value='demo_profile';
	//document.dealer_search.submit();
}

// For New Demo Page Ends Here

// For Newcar Page Starts here
function arrencar()
{
	document.seller_search.file.value='new_carpro';
}

function checkncar()
{
	if(document.seller_search.car_cat.value=="Select Car Category")
	{
		alert("Please select car category");
		document.seller_search.car_cat.focus();
		return false;
	}
}

// For NewCar Page Ends Here

//For Photo_gallery Page Starts Here
function photogal1()
{
	document.reg.file.value='register';
}

function photogal2()
{
	document.reg.file.value='login';
}
//For Photo_gallery Page Ends Here

// For Photo_gallery1 Page Starts here
function placeph()
{
	document.reg.file.value='place_photo';
}

function editph()
{
	document.reg.file.value='photo_edit';
	document.reg.submit();
}

// For Photo_galletry1 Page Ends here

// For Place Car Ad Starts Here
function plcar1()
{
	document.reg.file.value='preview';
}

function plcheck()
{
	if(document.reg.username.value.length<1)
	{
		alert("Please enter Contactname");
		document.reg.username.focus();
		return false;
	}
	if(document.reg.e_email.value.length<1)
	{
		alert("Please enter your E-Mail Address");
		document.reg.e_email.focus();
		return false;
	}
	if(document.reg.e_email.value!="")
	{
		apos=document.reg.e_email.value.indexOf("@");
		dotpos=document.reg.e_email.value.lastIndexOf(".");
		lastpos=document.reg.e_email.value.length-1;
		if(apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2)
		{
			alert("please enter a Valid E-Mail Address");
			document.reg.e_email.focus();
			return false;
		}
	}
	if(document.reg.zipcode.value.length<1)
	{
		alert("Please enter Postcode");
		document.reg.zipcode.focus();
		return false;
	}
	if(document.reg.state123.value.length<1 || document.reg.state123.value=="Please select")
	{
		alert("please select State name");
		document.reg.state123.focus();
		return false;
	}
	if(document.reg.region.value.length<1 || document.reg.region.value=="Select Region")
	{
		alert("Please Select Region");
		document.reg.region.focus();
		return false;
	}
	if(document.reg.atitle.value.length<1 || document.reg.atitle.value=="Select Autoparts")
	{
		alert("please select Autopart type..!!");
		document.reg.atitle.focus();
		return false;
	}
	if(document.reg.make.value.length<1)
	{
		alert("please Enter Manufacturer for autoparts");
		document.reg.make.focus();
		return false;
	}

	if(document.reg.model.value.length<1)
	{
		alert("please Enter model for autoparts");
		document.reg.model.focus();
		return false;
	}
	if(document.reg.year.value.length<1)
	{
		alert("please Enter year for autoparts");
		document.reg.year.focus();
		return false;
	}

	if(document.reg.price.value.length<1)
	{
		alert("please Enter Price");
		document.reg.price.focus();
		return false;
	}
	if(document.reg.sdesc.value.length<1)
	{	
		alert("please enter a short Description");
		document.reg.sdesc.focus();
		return false;
	}
	if(document.reg.comment.value.length<1)
	{
		alert("please enter Description");
		document.reg.comment.focus();
		return false;
	}
	if(document.reg.userfile1.value.length<1)
	{
		alert("Please insert an image");
		document.reg.userfile1.focus();
		return false;
	}
}

// For Place Car Ad Ends Here

// For Photo Place Page Starts here
function phoedit()
{
	document.reg.file.value='photo_edit';
	document.reg.submit();
	//window.reset();
}

// For Photo Place PAge Ends here
// For Preview_detail12 Page Starts here
function checkpr()
{
	if(document.reg.username.value.length<1)
	{
		alert("Please enter Contactname");
		document.reg.username.focus();
		return false;
	}
	
	if(document.reg.atitle.value.length<1)
	{
		alert("please enter Autopart Title");
		document.reg.atitle.focus();
		return false;
	}
	
	if(document.reg.make.value.length<1)
	{
		alert("please Enter Manufacturer for autoparts");
		document.reg.make.focus();
		return false;
	}
	
	if(document.reg.model.value.length<1)
	{
		alert("please Enter model for autoparts");
		document.reg.model.focus();
		return false;
	}
	
	
	if(document.reg.year.value.length<1)
	{
		alert("please Enter year for autoparts");
		document.reg.year.focus();
		return false;
	}
	if(document.reg.state123.value.length<1)
	{
		alert("please select State name");
		document.reg.state123.focus();
		return false;
	}
	if(document.reg.region.value.length<1)
	{
		alert("please select Region");
		document.reg.region.focus();
		return false;
	}
	if(document.reg.price.value.length<1)
	{
		alert("please Enter Price");
		document.reg.price.focus();
		return false;
	}
	if(document.reg.sdesc.value.length<1)
	{
		alert("please enter a short Description");
		document.reg.sdesc.focus();
		return false;
	}
	if(document.reg.comment.value.length<1)
	{
		alert("please enter Description");
		document.reg.comment.focus();
		return false;
	}
}


// For Preview _Detail12 Page Ends here

// For Preview_edit Page Starts Here
function car()
{
	document.reg.file.value='preview_edit_a';
}

function car1()
{
	document.reg.file.value='preview_back';
}
function check()
{
	if(document.reg.username.value.length<1)
	{
		alert("Please enter Contactname");
		document.reg.username.focus();
		return false;
	}
	if(document.reg.atitle.value.length<1)
	{
		alert("please enter Autopart Title");
		document.reg.atitle.focus();
		return false;
	}
	
	if(document.reg.make.value.length<1)
	{
		alert("please Enter Manufacturer for autoparts");
		document.reg.make.focus();
		return false;
	}
	
	if(document.reg.model.value.length<1)
	{
		alert("please Enter model for autoparts");
		document.reg.model.focus();
		return false;
	}
	
	
	if(document.reg.year.value.length<1)
	{
		alert("please Enter year for autoparts");
		document.reg.year.focus();
		return false;
	}
	if(document.reg.state123.value.length<1)
	{
		alert("please select State name");
		document.reg.state123.focus();
		return false;
	}
	if(document.reg.region.value.length<1)
	{
		alert("please select Region");
		document.reg.region.focus();
		return false;
	}
	if(document.reg.price.value.length<1)
	{
		alert("please Enter Price");
		document.reg.price.focus();
		return false;
	}
	if(document.reg.sdesc.value.length<1)
	{
		alert("please enter a short Description");
		document.reg.sdesc.focus();
		return false;
	}
	if(document.reg.comment.value.length<1)
	{
		alert("please enter Description");
		document.reg.comment.focus();
		return false;
	}
	
}

// For Preview_edit Page Ends here

// For Private Page Starts here
function abcprivate()
{
	document.private.file.value='private_profile';
}

// For Privare Page Ends here

// For Reply Page Starts Here
function repvalidate()
{
	if(document.frmadminlist.from.value.length<1)
	{
		alert("Please enter your From!");
		document.frmadminlist.from.focus();
		return false;
	}
	
	if(document.frmadminlist.to.value.length<1)
	{
		alert("Please enter your To!");
		document.frmadminlist.to.focus();
		return false;
	}
	
	if(document.frmadminlist.subject.value.length<1)
	{
		alert("please enter Subject");
		document.frmadminlist.subject.focus();
		return false;
	}
	if(document.frmadminlist.matter.value.length<1)
	{
		alert("please enter Message");
		document.frmadminlist.matter.focus();
		return false;
	}
}

// For Replay Page Ends here

// For Search Autoparts Page Starts Here
function sautoarre()
{
	document.seller_search.file.value='search_autoparts_a';
}
function sautocheck()
{
	if(document.seller_search.key.value.length<1 || document.seller_search.key.value=="Select Autoparts")
	{
		alert("please select Autopart type..!!");
		document.seller_search.key.focus();
		return false;
	}

}


// For Search Autoparts Page Ends Here

// For Search_new Page Starts here
function snewabc()
{
	document.search_new.file.value='new_profile';
}

// For Search_new Page Ends Here

// For Searchnewcar Page Starts here
function newcararre()
{
	//document.frm_login.action = 'index.php?file=edit_buyer_profile_a';
	document.seller_search.file.value='new_carpro';
}
function newcarcheck()
{
	if(document.seller_search.car_cat.value=="Select Car Category")
	{
		alert("Please select car category");
		document.seller_search.car_cat.focus();
		return false;
	}
	if(document.seller_search.state123.value.length>1)
	{
		if(document.seller_search.region.value.length<1)
		{
			alert("Please select Region");
			document.seller_search.region.focus();
			return false;
		}
	}

}

// For Searchnewcar Page Ends Here

// For Register Page Starts here
function checkregi()
{
if(document.reg.username.value.length<1)
{
	alert("Please enter Username");
	document.reg.username.focus();
	return false;
}
if(document.reg.username.value.length<6)
{
	alert("your username must be atleast 6 characters");
	document.reg.username.focus();
	return false;
}

	if(document.reg.password.value.length<1)
{
	alert("Please enter Password");
	document.reg.password.focus();
	return false;
}
if(document.reg.password.value.length<6)
{
	alert("your password must be atleast 6 characters");
	document.reg.password.focus();
	return false;
}

if(document.reg.username.value==document.reg.password.value)
    {
	  alert("The username and password should not be same.");
	  document.reg.password.focus();
	  return false;
    }


if(document.reg.password.value!=document.reg.password1.value)
    {
	  alert("The passwords you entered do not match.");
	  document.reg.password1.focus();
	  return false;
    }
if (document.reg.fname.value.length <1) 
{
	alert("please Fill your name");
	document.reg.fname.focus();
	return false;
	}
	
    if(document.reg.email.value.length<1)
	 {
	  alert("Please Fill Your Email Address");
	  document.reg.email.focus();
	  return false;
	 }
	if(document.reg.email.value != "")

    {

		apos=reg.email.value.indexOf("@");

	dotpos=reg.email.value.lastIndexOf(".");

	lastpos=reg.email.value.length-1;



  if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) 

  {

  	alert("Please Enter valid Email Address");

  	reg.email.focus();

	return false;

  } 

}	
if(document.reg.zip.value.length<1)
{
alert("Please enter your Postcode");
document.reg.zip.focus();
return false;
}


if(document.reg.hphone.value.length<1)
{
alert("Please enter your residential phone number..!!");
document.reg.hphone.focus();
return false;
}

	if(!document.reg.tandc.checked)
	{
		alert("You need to agree terms and condition of needacar.com.au.");
		return false;
}
	
}


function advancedsea()
{
	//alert("hi");
	if(document.seller_search.search_make.value.length<1)
	{
		alert("please Enter Manufacturer for used car.");
		document.seller_search.search_make.focus();
		return false;
	}
	
	if(document.seller_search.sea_model.value.length<1)
	{
		alert("please Enter model for used car.");
		document.seller_search.sea_model.focus();
		return false;
	}	
	
	if(document.seller_search.state123.value.length<1)
	{
		alert("please select State name");
		document.seller_search.state123.focus();
		return false;
	}
	if(document.seller_search.region.value.length<1)
	{
		alert("please select Region");
		document.seller_search.region.focus();
		return false;
	}
		
}


// For Register Page Ends Here


// For Used_car Form onload Page starts here
function usedadc()
{
<!-- 
	_m1SecID="000000202-002";
	_m1IsActive=1;
	_m1PosV=1;
	_m1PosH=2;
	_m1PosX=0;
	_m1PosY=20;
}


// For Used_car Form Onload Page Ends here


//




//



