///////////////////////////////////////////////////////////////////////////////////////////////
// login.js																		 		     //
///////////////////////////////////////////////////////////////////////////////////////////////
// 																							 //
// Company Name: Dreamwave Sdn Bhd                                                           //
// Author: Tan Hiang Tiang                                                                   //
// Version: 1.0																			     //
// Creation Date: 04 March 2008                                                              //
// 																						     //
// Usage: 																				     //
//    load_page()        						 											 //
//    bool validate_credential()							        						 //
//    bool validate_registration()							        						 //
//																						     //
// Description:                                                                              //
// 	load_page() - initialize page and set focus on primary input	 					     //
// 	validate_credential() - validation of login credentials                                  //
// 	validate_registration() - validation of registration credentials                         //
//																						     //
// Remarks:																				     //
//    												     									 //
//																							 //
// Version: 1.1		  By: Httan		Search Key: -	Date Modified: -			  			 //
//																							 //
///////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2008 Dreamwave Sdn Bhd. 													 //
///////////////////////////////////////////////////////////////////////////////////////////////

function load_page() {
	if(trim(document.login.login_id.value) == "") {
		if (! document.login.login_id.disabled)
			document.login.login_id.focus();
	} else {
		if (! document.login.login_pwd.disabled)
			document.login.login_pwd.focus();
	}
}

function validate_credential() {
	if(trim(document.login.login_id.value) == "") {
		if (! document.login.login_id.disabled)
			document.login.login_id.focus();
		return false;
	
	} else if(trim(document.login.login_pwd.value) == "") {
		if (! document.login.login_pwd.disabled)
			document.login.login_pwd.focus();
		return false;
	}
	return true;	
}

function validate_registration() {
	if (trim(document.register.email.value) != "" && valid_email(document.register.email.value)) {
		return true;
	}
	alert("Please input a valid email address! ");
	document.register.email.focus();
	return false;	
}

/* function browser_detect() {
	var browser=navigator.appName;
	if(browser!="Microsoft Internet Explorer") {
		alert('Please take note!\nMYwave Application Suite works best in 1024 x 768 on Microsoft Internet Explorer browser.\nKindly use IE browser to launch MYwave Application Suite.\nSorry for any inconvenience caused.\nThank you :)');
	}
}
*/
