/**
 * apply form clear + re-populate to all form fields (not sure if this is a good idea ... )
 */
$(document).ready(function() {

	// fix transparency for pngs
	// $(document).pngFix();

        $("input[type='text']").bind('focus', function(e){

            if($(this).val() == $(this).attr('alt')) {
                $(this).val('');
            }
        });

        $('form input[type=text]').each(function(i){

            $(this).blur(function(e){
                if($(this).val() == '') {
                    $(this).val($(this).attr('alt'));
                }
            });

        });

	setTimeout("clearPassword()",200); 

  });
 
//run password replacement code as soon as the form is ready (dont wait for the document)
$('#login-form').ready(function() {
	
    /*$("#login-form #dummy").focus(function(theField){
        $("#login-form #Password").toggle();
		$("#login-form #dummy").toggle();
		$("#login-form #Password")[0].focus();
    });

    // Show place holder is password blurred and nothing in it
    $("#login-form #Password").blur(function() {

        if($(this).val() == '') {
            $(this).toggle();
            $("#login-form #dummy").toggle();
            $("#login-form #dummy").val($("#login-form #dummy").attr('alt'));
        }

    });*/
});

/**
 * SYNTHAWEB-540
 * @note, this is very hardcoded :(
 */
function clearPassword(){
	/*if ($("#cremail").val() == 'Password'){
		$("#cremail").val("");
	}
	if ($("#frmSecondaryLogin .login_email").val() == 'Password' || $("frmSecondaryLogin .login_email").val() == 'Email'){
        $("#frmSecondaryLogin .login_email").val("");
	}*/
}
