$( function() {

	// Login form
	/*
	$( "#user_name_top" ).focus( function(){ if( this.value == 'Username' ){ this.value = ''; }});
	$( "#user_name_top" ).blur( function(){ if( this.value == '' ){ this.value = 'Username'; }});
	$( "#password_top" ).focus( function(){ if( this.value == 'Password' ){ this.value = ''; this.type='password'; }});
	$( "#password_top" ).blur( function(){ if( this.value == '' ){ this.value = 'Password'; this.type='text'; }});*/

	// Banners
	$( ".banner" ).fadeIn( 5000 );


	// ActionButton support
	$( ".actionBtn" ).mouseover( function(){ $(this).attr( 'src', getMouseImage( this, "over" )); });
	$( ".actionBtn" ).mousedown( function(){ $(this).attr( 'src', getMouseImage( this, "down" )); });
	$( ".actionBtn" ).mouseout( function(){ $(this).attr( 'src', getMouseImage( this, "out" )); });

});


function getMouseImage( objInstance, strType )
{
	strButtonSrc = $(objInstance).attr( 'src' );
	arrButtonExt = strButtonSrc.split( '.' );
	arrButtonName = arrButtonExt[ 0 ].split( '/' );

	strImageExt = '.' + arrButtonExt[ 1 ];
	strImageName = arrButtonName[ arrButtonName.length-1 ];
	strImagePath = strButtonSrc.substring( 0, strButtonSrc.length - ( strImageName.length + strImageExt.length ));

	strImageNameCheck = strImageName.split( '_' );
	if( strImageNameCheck.length > 1 )
	{
		strImageName = strImageNameCheck[0];
	}

	switch( strType )
	{
		case "over":
			strReturn = strImagePath + strImageName + '_over' + strImageExt;
			break;

		case "down":
			strReturn = strImagePath + strImageName + '_down' + strImageExt;
			break;

		default:
			strReturn = strImagePath + strImageName + strImageExt;
			break;
	}

	return strReturn;
}
