$().ready( function() {

	webmail();

	newsHighlights();

	weather();

});

/////////////////////////////////* Webmail */////////////////////////////////

function webmail(){
	$('input[name=imapuser]').focus(function() {
		if( 'Usuário' == $(this).val() ) $(this).val('');
	});
	$('input[name=imapuser]').blur(function () {
         if( '' == $(this).val() ) $(this).val('Usuário');
    });
	
	$('input[name=pass]').focus(function() {
		if( 'Senha' == $(this).val() ) {
			$(this).replaceWith('<input class="pass" id="senha" name="pass" type="password" value="" />');
			$('input[name=pass]').focus();
		}
	});
}

/////////////////////////////* Highlights News */////////////////////////////

function newsHighlights() {
	$("#news-highlight").wslide({
		width: 700,
		height: 180,
		pos: 1,
		horiz: true
	});
}

/////////////////////////////* Weather IE 6 */////////////////////////////

function weather() {

	if ($.browser.msie && $.browser.version <= 6){

		$('#weather img').fadeOut();
		
		var temp = $('#weather img').attr('src');

		temp = temp.replace("/png/", "/");
		temp = temp.replace(".png", ".gif");

		$('#weather img').attr('src', temp);

		$('#weather img').fadeIn();

	}
	else{

		$('#weather img').fadeIn();
	
	}

}
