// girlimpact sitewide javascript

/*
* Generic
*/

/* Validate */
function fncGirlImpact_Validate(element) {
	new Validation(element); 
}



/*
* Login 
*/

function frmUserLogin_Validate(element) {
	new Validation(element); 
}

/* show forgot pwd */
function frmUserLogin_ForgotPass(){
	$('divUserLogin_Inputs').hide();
	$('divUserLogin_Forgot').show();
}

/* cancel pwd retrieval */
function frmUserLogin_ForgotPassCancel(){
	$('divUserLogin_Forgot').hide();
	$('divUserLogin_Inputs').show();
	$('advice-required-strUserName_UserLogin').hide();
	$('advice-required-strPass1_UserLogin').hide();	
	if($('loginerrors')) { $('loginerrors').hide(); }
	if($('successmsg')) { $('successmsg').hide(); }	
}

/* cancel logging in */
function frmUserLogin_Cancel() {
	$('advice-required-strUserName_UserLogin').hide();
	$('advice-required-strPass1_UserLogin').hide();
	if($('loginerrors')) { $('loginerrors').hide(); }
	if($('successmsg')) { $('successmsg').hide(); }
}




/*
* Auto Hide Events
*/

// to after dom has loaded
// has to be at the end of file, otherwise any other function doesnt load
Event.observe(window, 'load', function() {
	// hide successmsg if it exists
	if($('successmsg')) {
		setTimeout("Effect.Fade('successmsg', { duration: 10.0 });", 10000);
	}
	if($('loginerrors')) {
		setTimeout("Effect.Fade('loginerrors', { duration: 10.0 });", 10000);
	}

});
