var error_msg = new Array();
error_msg['name'] = 'Enter Your Name'; //Enter Your Name
error_msg['phone'] = 'Your Phone Number'; //Your Phone Number
error_msg['subject'] = 'Enter the Subject'; //Enter the Subject
error_msg['first_name'] = 'Enter Your first name'; //Enter Your first name
error_msg['email'] = 'Enter Your Email'; //Enter Your Email
error_msg['subject'] = 'Enter the Subject'; //Enter the Subject
error_msg['message'] = 'Enter the Message'; //Enter the Message
error_msg['error_msg'] = 'Correct the following errors'; //Correct the following errors

/*************************** DONT EDIT BELOW *****************************/

function validate_form () {
    var error = 0, errors = '';
    if( document.contact_form.name.value == "" ) {
    	error++;
    	errors += error_msg['name']+"\n";
    }
    if( document.contact_form.phone.value == "" ) {
    	error++;
    	errors += error_msg['phone']+"\n";
    }
    if( document.contact_form.subject.value == "" ) {
    	error++;
    	errors += error_msg['subject']+"\n";
    }
    if(error > 0) {
    	alert(error_msg['error_msg']+"\n\n"+errors);
    	return false;
    }
    else
    	return true;
}

function validate_contact_page () {
    var error = 0, errors = '';
    if( document.contact_page_form.first_name.value == "" ) {
    	error++;
    	errors += error_msg['first_name']+"\n";
    }
    if( document.contact_page_form.phone.value == "" ) {
    	error++;
    	errors += error_msg['phone']+"\n";
    }
    if( document.contact_page_form.email.value == "" ) {
    	error++;
    	errors += error_msg['email']+"\n";
    }
    if( document.contact_page_form.subject.value == "" ) {
    	error++;
    	errors += error_msg['subject']+"\n";
    }
    if( document.contact_page_form.message.value == "" ) {
    	error++;
    	errors += error_msg['message']+"\n";
    }
    if(error > 0) {
    	alert(error_msg['error_msg']+"\n\n"+errors);
    	return false;
    }
    else
    	return true;
}
