$(document).ready(
	function () {
	    if ($('.slidephoto') != null) {
	        $('.slidephoto').cycle({
	            //fx:      'scrollHorz', 
	            speed: 500,
	            timeout: 6000,
	            pause: 1,
	            pager: '#destaques_imgs',
	            pagerEvent: 'mouseover',
	            pauseOnPagerHover: true,
	            pagerAnchorBuilder: function (idx, slide) {
	                //return selector string for existing anchor
	                //$("p:last").addClass("selected");
	                return '#destaques_imgs li:eq(' + idx + ') a';
	            }

	        });
	    }

	    if ($('#destaques') != null) {
	        $('#destaques').cycle({
	            //fx:      'scrollHorz', 
	            speed: 500,
	            timeout: 3000,
	            pause: 1,
	            pager: '#controle',
	            pagerEvent: 'mouseover',
	            pauseOnPagerHover: true,
	            pagerAnchorBuilder: function (idx, slide) {
	                //return selector string for existing anchor
	                //$("p:last").addClass("selected");
	                return '#controle a:eq(' + idx + ')';
	            },
	            after: onAfter

	        });
	       // $('#conteudo_left_topo').css('Display', 'block');
	        //$('#conteudo_left_topo').show();
	    }

	    function onAfter() {
	        //activeSlide
	        var num_entries = $('#destaques li p').length;
	        //alert(num_entries);
	        for (count = 0; count < num_entries; count++) {
	            if ($('#controle a').eq(count).attr('class') == 'activeSlide') {
	                /*tmpText = $('#destaques li p a').eq(count).html();
	                tmpLength = tmpText.length
	                //alert(tmpLength);	
	                if (tmpLength < 68) {
	                    $('#controle').removeClass();
	                    $('#controle').addClass('l1');
	                }
	                else {
	                    $('#controle').removeClass();
	                    $('#controle').addClass('l2');
	                }
                    */
	            }
	            //varId = '#link_0' + count;
	            //alert($('#controle a').eq(count).attr('class'));
	            //alert($('#destaques li p a').eq(count).html());
	        }
	    }
        /*

	    if ($('.slideMarketing') != null) {
	        $('.slideMarketing').cycle({
	            speed: 500,
	            timeout: 3000,
	            pause: 1,
	            pagerEvent: 'mouseover',
	            pauseOnPagerHover: true
	        })
	    }

	    if ($('#jogadores') != null) {
	        $('#jogadores').cycle({
	            fx: 'scrollHorz',
	            startingSlide: 1,
	            timeout: 0,
	            speed: 500,
	            prev: '.elenco_left',
	            next: '.elenco_right'
	        });
	    }

	    if ($('#jogos') != null) {
	        var auxStart;
	        if ($('#fCount') != null) {
	            if ($('#fCount').attr("value").length > 0) {
	                auxStart = $('#fCount').attr("value") - 1
	            }
	            else {
	                auxStart = 0;
	            }
	        }
	        else {
	            auxStart = 0;
	        }


	        $('#jogos').cycle({
	            fx: 'fade',
	            startingSlide: auxStart,
	            timeout: 0,
	            speed: 500,
	            nowrap: 1,
	            prev: '#jogos_left',
	            next: '#jogos_right'
	        });
	    }


	    $(".tbl_btn_up").click(
			function () {
			    var tmpMargin = $("#tbl_tabela").css("margin-top");
			    tmpMargin = tmpMargin.replace("px", "");
			    if (parseInt(tmpMargin) < 0) {
			        tmpMargin = parseInt(tmpMargin) + 19;
			        tmpMargin = tmpMargin + 'px';
			        $("#tbl_tabela").css("margin-top", tmpMargin);
			    }
			}
		);

	    $(".tbl_btn_down").click(
			function () {
			    var tmpMargin = $("#tbl_tabela").css("margin-top");
			    tmpMargin = tmpMargin.replace("px", "");
			    if (parseInt(tmpMargin) >= -247) {
			        tmpMargin = parseInt(tmpMargin) - 19;
			        tmpMargin = tmpMargin + 'px';
			        $("#tbl_tabela").css("margin-top", tmpMargin);
			    }
			}
		);

	    if ($('#slideBanner01') != null) {
	        $('#slideBanner01').cycle({
	            speed: 500,
	            timeout: 5000,
	            pause: 1,
	            pager: '#ctrlBanner',
	            //pagerEvent: 'mouseover',
	            pauseOnPagerHover: true,
	            prev: '.bt_esq',
	            next: '.bt_dir',
	            pagerAnchorBuilder: function (index, DOMelement) {
	                return '#ctrlBanner a:eq(' + index + ')';
	            }
	        })
	    }
        */
	}
);
