function captify(){
    $(document).ready(function() {
        // Captify - plugin jquery
        $('img.captify').captify({
            // all of these options are... optional
            // ---
            // speed of the mouseover effect
            speedOver: 'fast',
            // speed of the mouseout effect
            speedOut: 'normal',
            // how long to delay the hiding of the caption after mouseout (ms)
            hideDelay: 500,
            // 'fade', 'slide', 'always-on'
            animation: 'slide',
            // text/html to be placed at the beginning of every caption
            prefix: '',
            // opacity of the caption on mouse over
            opacity: '0.7',
            // the name of the CSS class to apply to the caption box
            className: 'caption-bottom',
            // position of the caption (top or bottom)
            position: 'bottom',
            // caption span % of the image
            spanWidth: '100%'
        });
    });
}

function ajax(pagina,div,method){
    $(document).ready(function() {
					
		//alert($("#" + div).css('height'));
		if( $("#" + div).css('height') > '77px' ){
			$.ajax({
				type: method,
				url: pagina,
				dataType: "script",
				beforeSend: function(){
					$("#" + div).html("<img src='http://ribsystem.com/img/carregando.gif' />");
					$("#" + div).fadeOut("slow");
				},
				success: function(data){
						$("#" + div).html(data);
						$("#" + div).fadeIn("slow");
				}
			});
			
		} else {
		
			$.ajax({
				type: method,
				url: pagina,
				dataType: "script",
				beforeSend: function(){
					$("#" + div).html("<img src='http://ribsystem.com/img/carregando.gif' />");
					$("#" + div).fadeOut("slow");
				},
				success: function(data){
						$("#" + div).html(data);
						$("#" + div).fadeIn("slow");
				}
			});
			
		}
		
    });
}


function carrega(pagina,div){
    $(document).ready(function() {
        $.ajaxSetup({
            contentType : "",
            beforeSend : function(xml){
                // xml.setRequestHeader('Accept','*/*');
                xml.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
                xml.setRequestHeader("charset","UTF-8");
                xml.setRequestHeader("Encoding","UTF-8");
                xml.setRequestHeader("X-Requested-With", "");
            }
        });

        $("#" + div).html("<span align='left' valign='middle'><img src='http://ribsystem.com/img/carregando.gif'><span>");
        $("#" + div).hide("slow");
        $.ajax({
            url: pagina,
            cache: false,
            success: function(html){
                $("#" + div).html(html);
            }
        });
        $("#" + div).show("slow");
    });
}