$(document).ready(function(){

    $('#nav-global > ul').superfish({
        delay: 0
    });

    $('div#nav-global ul li:first a').css('background','none');

    $('input:text').setMask();

    $('input.mark').each(function(){
        var inputId = $(this).attr('id');
        var form = $(this).parents('form').attr('id');
        var label = $('#'+form+' label[for='+inputId+']');
        if(inputId != 'undefined'){
            label.hide();
            $('#'+form+' #'+inputId).Watermark(label.html());
        }
    });

    $('.box, .bindhover').hover(function(){
        $(this).addClass('hover');
    },function(){
        $(this).removeClass('hover');
    });

    $('img.fancy').parent('a').fancybox();

    //scroll the message box to the top offset of browser's scrool bar
    $('.info_div, .message').animate({"width": "99%"}, {duration: 1000});
    $(window).scroll(function(){
        $('.info_div, .message').animate({top:$(window).scrollTop()+"px" },{queue: false, duration: 350});
    });
    $('.info_div, .message').click(function(){
        $(this).animate({ top:"+=15px",opacity:0 }, "slow", function(){
            $(this).remove();
        });
    });

    $('#banners').cycle('fade');
    
    //document.getElementById('ClienteLoginForm').action = '';
});

function redirLogin()
{
	if(document.getElementById('email').value.indexOf("#") == -1)
	{
		document.getElementById('ClienteLoginForm').action = 'http://www.pro-analise.com.br/usuarios/login';
	}
	else
	{
		document.getElementById('ClienteLoginForm').action = 'http://web3c.com.br/projetos/pro-analise/sistema/login'
	}
	
	document.getElementById('ClienteLoginForm').submit();
	return true;
}
