
//Validates the contact form /////////////////////////////////
function validate_contact1()
{
	valid = true;

        if ( document.finder_form.contactName.value == "" )
        {
                alert ( "Please fill in your name" );
                valid = false;
        }
		 if ( document.finder_form.fromAddress.value == "" )
        {
                alert ( "Please fill in your email address" );
                valid = false;
        }
		 if ( document.finder_form.telephone.value == "" )
        {
                alert ( "Please fill in your contact number" );
                valid = false;
        }

		 if ( document.finder_form.message.value == "" )
        {
                alert ( "Please leave us a message" );
                valid = false;
        }

        return valid;
}

//Validates finance form /////////////////////////////////
function validate_finance()
{
	valid = true;
        if ( document.finder_form.contactName.value == "" )
        {
                alert ( "Please fill in your name" );
                valid = false;
        }
		
		 if ( document.finder_form.fromAddress.value == "" )
        {
                alert ( "Please fill in your email address" );
                valid = false;
        }
		 if ( document.finder_form.telephone.value == "" )
        {
                alert ( "Please fill in your contact number" );
                valid = false;
        }
		 if ( document.finder_form.message.value == "" )
        {
                alert ( "Please give details of your finance enquiry" );
                valid = false;
        }

        return valid;
}

//Validates vehicle locator form /////////////////////////////////
function validate_locate()
{
	valid = true;

        if ( document.finder_form.contactName.value == "" )
        {
                alert ( "Please fill in your name" );
                valid = false;
        }
		
		 if ( document.finder_form.fromAddress.value == "" )
        {
                alert ( "Please fill in your email address" );
                valid = false;
        }
		 if ( document.finder_form.telephone.value == "" )
        {
                alert ( "Please fill in your contact number" );
                valid = false;
        }
		 if ( document.finder_form.vehicleDetails.value == "" )
        {
                alert ( "Please give details of the vehicle required" );
                valid = false;
        }

        return valid;
}


//Validates contact 2 form /////////////////////////////////
function validate_contact2()
{
	valid = true;

        if ( document.finder_form.contactName.value == "" )
        {
                alert ( "Please fill in your name" );
                valid = false;
        }
		
		 if ( document.finder_form.fromAddress.value == "" )
        {
                alert ( "Please fill in your email address" );
                valid = false;
        }
		 if ( document.finder_form.telephone.value == "" )
        {
                alert ( "Please fill in your contact number" );
                valid = false;
        }
		if ( document.finder_form.telephone.value == "" )
        {
                alert ( "Please fill in the vehicle you're interested in" );
                valid = false;
        }
		 if ( document.finder_form.message.value == "" )
        {
                alert ( "Please leave us a message" );
                valid = false;
        }

        return valid;
}


//Validates sell your vehicle form /////////////////////////////////
function validate_sell()
{
	valid = true;

        if ( document.finder_form.contactName.value == "" )
        {
                alert ( "Please fill in your name" );
                valid = false;
        }
		
		 if ( document.finder_form.fromAddress.value == "" )
        {
                alert ( "Please fill in your email address" );
                valid = false;
        }
		 if ( document.finder_form.telephone.value == "" )
        {
                alert ( "Please fill in your contact number" );
                valid = false;
        }
		 if ( document.finder_form.vehicleDetails.value == "" )
        {
                alert ( "Please give details of the vehicle for sale" );
                valid = false;
        }

        return valid;
}


//Validates book service form /////////////////////////////////
function validate_service()
{
	valid = true;

        if ( document.book_form.contactName.value == "" )
        {
                alert ( "Please fill in your name" );
                valid = false;
        }
		
		 if ( document.book_form.fromAddress.value == "" )
        {
                alert ( "Please fill in your email address" );
                valid = false;
        }
		 if ( document.book_form.telephone.value == "" )
        {
                alert ( "Please fill in your contact number" );
                valid = false;
        }
		 if ( document.book_form.additionalDetails.value == "" )
        {
                alert ( "Please give details of the work required" );
                valid = false;
        }

        return valid;
}



//Validates part exchange 1 form /////////////////////////////////
function validate_part1()
{
	valid = true;

        if ( document.finder_form.contactName.value == "" )
        {
                alert ( "Please fill in your name" );
                valid = false;
        }
		
		 if ( document.finder_form.fromAddress.value == "" )
        {
                alert ( "Please fill in your email address" );
                valid = false;
        }
		 if ( document.finder_form.telephone.value == "" )
        {
                alert ( "Please fill in your contact number" );
                valid = false;
        }
		 if ( document.finder_form.message.value == "" )
        {
                alert ( "Please leave us your part exchange details" );
                valid = false;
        }

        return valid;
}


//Validates part exchange 1 form /////////////////////////////////
function validate_part2()
{
	valid = true;

        if ( document.part_exchange.contactName.value == "" )
        {
                alert ( "Please fill in your name" );
                valid = false;
        }
		
		 if ( document.part_exchange.telephone.value == "" )
        {
                alert ( "Please fill in your contact number" );
                valid = false;
        }

        return valid;
}


//Validates book test drive form /////////////////////////////////
function validate_testdrive()
{
	valid = true;

        if ( document.book_form.contactName.value == "" )
        {
                alert ( "Please fill in your name" );
                valid = false;
        }
		
		 if ( document.book_form.fromAddress.value == "" )
        {
                alert ( "Please fill in your email address" );
                valid = false;
        }
		 if ( document.book_form.telephone.value == "" )
        {
                alert ( "Please fill in your contact number" );
                valid = false;
        }

        return valid;
}


//Validates join mailinglist form /////////////////////////////////
function validate_mailinglist()
{
	valid = true;
		
		 if ( document.mailing_form.fromAddress.value == "" )
        {
                alert ( "Please fill in your email address" );
                valid = false;
        }
	

        return valid;
}
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
