$().ready( function() {

	webmail();

	newsHighlights();

	searchGoogle();

});

function searchGoogle(){

	$('.search input[name=meta]').click(function() {
		
		if( '' == $(this).val() ) $(this).parent().parent().parent().find('form').attr('action', 'http://www.google.com.br/search');
		else if( 'lr=lang_pt' == $(this).val() ) $(this).parent().parent().parent().find('form').attr('action', 'http://www.google.com.br/search');
		else if( 'tab=wi' == $(this).val() ) $(this).parent().parent().parent().find('form').attr('action', 'http://www.google.com.br/images');

		$(this).parent().parent().parent().find('form').attr('action');
		//alert( $(this).parent().parent().parent().find('form').attr('action') );

	});

}

function webmail(){
	$('input[name=meta]').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
	});
}
