// JavaScript Document

function validatephone(phoneNumber) {
	var maintainplus = '';
 	var numval = phoneNumber.value
 	if ( numval.charAt(0)=='+' ){ var maintainplus = '+';}
 	curphonevar = numval.replace(/[\\A-Za-z!"£$%^&*+_={};:'@()#~,.¦\/<>?|`¬\]\[]/g,'');
 	phoneNumber.value = maintainplus + curphonevar;
 	var maintainplus = '';
 	phoneNumber.focus;
}


function validate_form_callMe() {

    if ( document.orderKit.firstName.value == "" ) {
        alert ( "Please complete the 'First Name' field." ); return false}
		
	else if ( document.orderKit.lastName.value == "" ) {
        alert ( "Please complete the 'Last Name' field." ); return false}
	
	else if ( document.orderKit.gender.value == "" ) {
        alert ( "Please complete the 'Gender' field." ); return false}
	
	else if (( document.orderKit.DOB1.value == "" ) || ( document.orderKit.DOB2.value == "" ) || ( document.orderKit.DOB3.value == "" )) {
        alert ( "Please complete all the 'Date of Birth' fields." ); return false}

	else if ( document.orderKit.Street.value == "" ) {
        alert ( "Please complete the 'Street Number' field." ); return false}
	
	else if ( document.orderKit.StreetName.value == "" ) {
        alert ( "Please complete the 'Street Name' field." ); return false}
    
	else if ( document.orderKit.Town.value == "" ) {
        alert ( "Please complete the 'Town/Suburb' field." ); return false}
	
	else if ( document.orderKit.State.value == "" ) {
        alert ( "Please complete the 'State' field." ); return false}
	
	else if ( document.orderKit.pCode.value == "" ) {
        alert ( "Please complete the 'Postcode' field." ); return false}
		
	else if ( document.orderKit.phone.value == "" ) {
        alert ( "Please complete the 'Phone' field." ); return false}
		
	else if ( document.orderKit.mobile.value == "" ) {
        alert ( "Please complete the 'Mobile Phone' field." ); return false}
	
	else if ( document.orderKit.Language.value == "" ) {
        alert ( "Please complete the 'Other Language' field." ); return false}
	
	else {
	return true;}
	
}


function getObj(name) {
		//alert(name);
		if (document.getElementById) {
			this.obj = document.getElementById(name);
			this.style = document.getElementById(name).style;
		} else if (document.all) {
			this.obj = document.all[name];
			this.style = document.all[name].style;
		} else if (document.layers) {
			this.obj = document.layers[name];
			this.style = document.layers[name];
		}
	}

function addLoadEvent(func) {
		   var oldonload = window.onload;
		   if (typeof window.onload != 'function') {
		       window.onload = func;
		   }
		   else {
		       window.onload = function() {
		           oldonload();
		           func();
		       }
		   }
		}