jQuery(document).ready(function() {

    $("#maingraphic-image").cycle({
        fx: 'fade',
        delay: -2500,
        speed: 1300,
        timeout: 50,
        autostop: 2
    });
});

function ValidateContactForm(form){
	var msg = "";
	var focusorder = 0;
	var focusname = "";
	var check = 1;

	if(IsEmpty(form.Name)) { 
		msg = msg + "Please enter a valid first and last name...\n"; 
		check = 0;
		focusorder = 9;
		focusname = form.Name;
	}

	if(form.Name != "" && (IsEmpty(form.Phone) && IsEmpty(form.Email))) { 
		msg = msg + "Please enter either a valid phone number or email...\n";
		check = 0;

		if(focusorder >= 0 && focusorder < 8){
			focusorder = 8;
			focusname = form.Phone;
		}
	}

	if(check == 1) {
		return true;
	} else {
		alert(msg);
		focusname.focus(); 
		return false;
	}
}

function ValidateQuickForm(form){
	var msg = "";
	var check = 1;

	if(IsEmpty(form.Name)) { 
		msg = msg + "Please enter a valid first and last name...\n"; 
		check = 0;
	}

	if(IsEmpty(form.Phone) && IsEmpty(form.Email)) { 
		msg = msg + "Please enter a valid phone number and email...\n"; 
		check = 0;
	}

	if(check == 1) {
		return true;
	} else {
		alert(msg); 
		return false;
	}
}

function IsEmpty(aTextField) {
	if((aTextField.value.length == 0) || (aTextField.value == null))
		return true;
	else
		return false;
}

function IsEmptyRadio(radioBox) {
	var check = 0;

	for(i=0;i<radioBox.length;i++){
		if((radioBox[i].checked))
			return false;
		else
			check = 1;
	}

	if(check == 1)
		return true;
	else
		return false;
}
