$(document).ready(function () {
	$('input.rmv-dft-val').live('click',
		function() {
			if (this.value == this.defaultValue) {
				$(this).removeClass('default');
				this.value = '';		
			}
		}
	);



	$('input.rmv-dft-val').blur(
		function() {

			if (this.value == "") {
				$(this).addClass('default');
				this.value = this.defaultValue;

			}
		}
	);

	if ($('#password-clear').length!=0)
	{
		$('#password-clear').show();
		$('#password').hide();

		$('#password-clear').focus(function() {
			$('#password-clear').hide();
			$('#password').show();
			$('#password').focus();
		});
		$('#password').blur(function() {
			if($('#password').val() == '') {
				$('#password-clear').show();
				$('#password').hide();
			}
		});
	}


	$('#SignIn').click(
		function() {
			if ($('input#password').val()=="" || $('input#username').val()=="" || $('input#password').val()=="Password" || $('input#username').val()=="Username")
			{ 
				alert('Please enter your Email Address and Password to login');
				return false;		
			}		
		}
	);

});
/*
 * Clear Default Text: functions for clearing and replacing default text in
 * <input> elements.
 *
 * by Ross Shannon, http://www.yourhtmlsource.com/
 */


/*
addEvent(window, 'load', init, false);
*/
function init() {
    var formInputs = document.getElementsByTagName('input');
    for (var i = 0; i < formInputs.length; i++) {
        var theInput = formInputs[i];
        
        if (theInput.type == 'text' && theInput.className.match(/\bcleardefault\b/)) {  
            /* Add event handlers */          
            addEvent(theInput, 'focus', clearDefaultText, false);
            addEvent(theInput, 'blur', replaceDefaultText, false);
            
            /* Save the current value */
            if (theInput.value != '') {
                theInput.defaultText = theInput.value;
            }
        }
    }
}
/*
function clearDefaultText(e) {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (!target) return;
    
    if (target.value == target.defaultText) {
        target.value = '';
    }
}

function replaceDefaultText(e) {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (!target) return;
    
    if (target.value == '' && target.defaultText) {
        target.value = target.defaultText;
    }
}
*/
/*
	$(document).ready(function(){
		if ($("input#mainsearch").attr("value")=="Product Search") {$("input#mainsearch").addClass('default') }
			$("input#mainsearch").click(function(){
				$("input#mainsearch").removeClass('default'); 
				});
			});



*/
