<!--
// Menu functions
var submitted = false;
function submitCheck() {
	if (submitted) {
        	alert("You have already pressed the submit button. Please wait...");
                return false;
	} else {
        	submitted = true;
                return true;
	}
}

// Client Login Form functions
function OpenWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function goFocus() {
	document.ClientLogin.username.focus();
}

// Search Form functions
function doClear(theText) {
    if (theText.value == theText.defaultValue) {
        theText.value = "";
    }
}

function unClear(theText) {
    if (theText.value == "") {
        theText.value = theText.defaultValue;
    }
}

// Contact form functions
// Variables
var emptySubject	= "Error:\n- Please choose a Subject.";
var emptyName		= "Error:\n- Please enter your Name.";
var emptyEmail		= "Error:\n- Please enter your Email.";
var emptyMessage	= "Error:\n- Please enter your Message.";
var emptyPassword	= "Error:\n- Please enter your Password.";
var errorEmail		= "Error:\n- Please enter a correct Email address.";

// Form validation
function warnEmpty (theField, s)
{   theField.focus();
    alert(s);
    return false;
}

function validate() {
	if (document.contact.subject.value.length < 1) {
		warnEmpty(document.contact.subject, emptySubject);
	    return false;
	}
	else if ((document.contact.name.value=="name") || (document.contact.name.value.length < 1)) {
		warnEmpty(document.contact.name, emptyName);
	    return false;
	}
	else if ((document.contact.email.value=="email") || (document.contact.email.value.length < 1)) {
		warnEmpty(document.contact.email, emptyEmail);
	    return false;
	}
	// validate email
	else if (document.contact.email.value.search("@") == -1 || document.contact.email.value.search("[.*]") == -1) {
		warnEmpty(document.contact.email, errorEmail);
	    return false;
	}
	else if ((document.contact.messege.value=="Please type your message here") || (document.contact.message.value.length < 1)) {
		warnEmpty(document.contact.messege, emptyMessage);
	    return false;
	}
}

function validateClientLogin(){
	if (document.ClientLogin.username.value.length < 1) {
		warnEmpty(document.ClientLogin.username, emptyEmail);
	    return false;
	}
	// validate email
	else if (document.ClientLogin.username.value.search("@") == -1 || document.ClientLogin.username.value.search("[.*]") == -1) {
		warnEmpty(document.ClientLogin.username, errorEmail);
	    return false;
	}
	else if (document.ClientLogin.password.value.length < 1) {
		warnEmpty(document.ClientLogin.password, emptyPassword);
	    return false;
	}
}

// Form focus onload
function placeFocus() {
	if (document.forms.length > 0) {
		var field = document.forms[0];
		for (i = 0; i < field.length; i++) {
			if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
				document.forms[0].elements[i].focus();
				break;
    	     }
      	}
   	}
}

// No right click
function tmp() { return false; }
document.oncontextmenu = tmp;

// -->