// JavaScript Document

/*$(document).ready(function(){
	$('.headerBottom .image').cycle({
		fx: 'fade',
		speed: 3000
	});
});*/

$(document).ready(function(){
	$('.header .image').cycle({
		fx: 'fade',
		speed: 3000,
		before: onBefore,
		after: onAfter
	});
});

function onBefore() {
    $('#imageText').addClass('nodisplay');
}
function onAfter() {
    $('#imageText').removeClass('nodisplay').html( this.title );
}


function setFieldBehaviour( fieldReference ) {
    $( fieldReference ).focus( function() {
        if ( $( this ).attr( 'value' ) == $( this ).attr( 'defaultValue' ) ) {
            $( this ).attr( 'value', '' );
        }
        return;
    });
    $( fieldReference ).blur( function() {
        if ( $( this ).attr( 'value' ) == '' ) {
            $( this ).attr( 'value', $( this ).attr( 'defaultValue' ) );
        }
        return;
    });
    return;
}

$( document ).ready( function() {
    setFieldBehaviour( '#username' );
    setFieldBehaviour( '#password' );
    return;
});
