/* --------------------------------------------
 * initLogin(u,p)
 * Initialize the login hint message to the user
 * u = Username hint
 * p = Password hint   
 * -------------------------------------------- */

function initLogin(hint_username, hint_password) {

    /* If Username value is not specified, we will show hint*/
	if($('#username').val()==""){
		$('#username').val(hint_username);
	}	
	/* Clear hint when user focus */
	$('#username').focus(function(){
		if($('#username').val()== hint_username){
			$('#username').val("");
		}	
	/* When user out, fill in the hint */
	}).blur(function(){
		if($('#username').val()==""){
			$('#username').val(hint_username);
		}	
	});

    /* Default password text */
    $('#password-clear').show();
    $('#password').hide();

    /* When password value is not specified, show password-clear and fill in hint */
	if($('#password-clear').val()==""){
		$('#password-clear').val(hint_password);
        $('#password-clear').show();
        $('#password').hide();
	}	
	
	/* When user want to key in password, turn around password fill in text */ 
	$('#password-clear').focus(function(){
        $('#password-clear').hide();
        $('#password').show();
        $('#password').focus();
        if ($('#password-clear').val()==hint_password) {
            $('#password-clear').val("");
        }	
	})
	
	/* When user out, fill in password hint */
    $('#password').blur(function(){
		if($('#password').val()==""){
			$('#password-clear').val(hint_password);
            $('#password-clear').show();
            $('#password').hide();
		}	
    });

}

function enSelect() {
$(function(){  
    $("#language_en").click(function() {
        $("lang").val("EN");
        $("#language_form").submit();
        return false;
    });
}); 
}

function thSelect() {
    $("#language_th").click(function() {
        $("lang").val("TH");
        $("#language_form").submit();
        return false;
    });    
}


/*
 * --------------------------------------------
 * yesSubmit() 
 * --------------------------------------------
 */
function yesSubmit() {
	document.forms[0].submit();
}

/* --------------------------------------------
 *
 * page.js
 *
 * --------------------------------------------
 * 
 * THIS  SOURCE CODE   AND  DOCUMENTATION   IS   PROVIDED "AS IS," 
 * AND COPYRIGHT  HOLDERS MAKE NO REPRESENTATIONS  OR  WARRANTIES, 
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT  LIMITED TO,  WARRANTIES 
 * OF MERCHANTABILITY   OR   FITNESS  FOR  ANY PARTICULAR PURPOSE 
 * OR  THAT THE USE OF THE SOFTWARE   OR   DOCUMENTATION WILL NOT 
 * INFRINGE  ANY   THIRD PARTY   PATENTS, COPYRIGHTS,  TRADEMARKS 
 * OR OTHER RIGHTS.
 * 
 * COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, 
 * SPECIAL OR CONSEQUENTIAL  DAMAGES  ARISING  OUT OF  ANY USE OF 
 * THE SOFTWARE OR DOCUMENTATION.
 *
 * The name and trademarks of copyright holders may NOT be used in 
 * advertising or publicity pertaining to the software without 
 * specific, written prior permission. Title to copyright in this 
 * software and any associated
 *
 * --------------------------------------------
 *
 */

