
//alert('entrou');

$(document).ready(function() {
    
    $('.headlineScroll').cycle({
        fx:    'fade', 
	speed:  'fast',
	//delay: 12,
	//pause: 12,
	timeout: 12000,
	//timeout: 1000,
	pager:  '#menu' 
	//next:   '#nextHeadline', 
	//prev:   '#prevHeadline' 
     })

     .mouseover(function() {
        $('.headlineScroll').cycle('pause');
     })
			
     .mouseout(function() {
        $('.headlineScroll').cycle('resume');
     }); 
     
     zIndexWorkaround();
     
});

		
function write_player_video(strCaminho) {
	flashvar = '';
	flashvar += '<object width="320" height="280" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0">';
		flashvar += '<param name="allowScriptAccess" value="sameDomain" />';
		flashvar += '<param name="movie" value="swf/' + strCaminho + '" />';
		flashvar += '<param name="quality" value="high" />';
		flashvar += '<param name="bgcolor" value="#ffffff" />';
		flashvar += '<param name="wmode" value="transparent" />';
		flashvar += '<param name="allowFullScreen" value="false" />';
		flashvar += '<embed src="swf/' + strCaminho + '" allowFullScreen="false" wmode="transparent" width="320" height="280" quality="high" bgcolor="#ffffff" name="" align="middle" allowscriptaccess="sameDomain" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	flashvar += '</object>';
	document.write(flashvar);
}


// Fun�oes para consertar o bug do zindex no ie7
function isIE() {
    if(navigator.userAgent.match(/MSIE \d\.\d+/))
        return true;
    return false;
}

function zIndexWorkaround() {
  // If the browser is IE,
 if(isIE()) {
        /*
        ** For each div with class menu (i.e.,
        ** the thing we want to be on top),
        */
        $("#transbox").parents().each(function() {
            var p = $(this);
            var pos = p.css("position");

            // If it's positioned,
            if(pos == "relative" || pos == "absolute" || pos == "fixed") {
                /*
                ** Add the "on-top" class name when the
                ** mouse is hovering over it, and remove
                ** it when the mouse leaves.
                */
                p.hover(function() {
                        $(this).addClass("on-top");
                    },
                    function () { 
                        // do something... or nothing 
                    } 
                
                //,
                    //function() {
                    //    $(this).removeClass("on-top");
                    //}
                    );
            }
        });
    }
}

