var IE6 = (navigator.userAgent.indexOf("MSIE 6")>=0) ? true : false;
if(IE6){

	$(function(){
		
		$("<div>")
			.css({
				'position': 'absolute',
				'top': '0px',
				'left': '0px',
				backgroundColor: 'black',
				'opacity': '0.75',
				'width': '100%',
				'height': $(window).height(),
				zIndex: 5000
			})
			.appendTo("body");
			
		$("<div><img src='http://d2fm.com.br/js/no-ie6.png' alt='' style='float: left;'/><p><br /><strong>Desculpa! Essa página não suporta Internet Explorer 6.</strong><br /><br />Por favor! Atualize seu navegador!</p>")
			.css({
				backgroundColor: 'white',
				'top': '50%',
				'left': '50%',
				marginLeft: -210,
				marginTop: -100,
				width: 410,
				paddingRight: 10,
				height: 200,
				'position': 'absolute',
				zIndex: 6000
			})
			.appendTo("body");
	});		
}























function mycarousel_initCallback(carousel) {
    $('#mycarousel-prev').bind('click', function(){
        carousel.next();
        return false;
    });

    $('#mycarousel-next').bind('click', function(){
        carousel.prev();
        return false;
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function(){
        carousel.stopAuto();
    }, function(){
        carousel.startAuto();
    });

};

$(document).ready(function(){
	$(document).pngFix();

	$('#slide').jcarousel({
        vertical: true,
        scroll: 1,
        wrap: 'last',
        auto: 5,
        initCallback: mycarousel_initCallback,
        buttonNextHTML: null,
        buttonPrevHTML: null
        });
});























		$(window).load(function(){
			
			//set and get some variables
			var thumbnail = {
				imgIncrease : 100, /* the image increase in pixels (for zoom) */
				effectDuration : 400, /* the duration of the effect (zoom and caption) */
				/* 
				get the width and height of the images. Going to use those
				for 2 things:
					make the list items same size
					get the images back to normal after the zoom 
				*/
				imgWidth : $('.thumbnailWrapper ul li').find('img').width(), 
				imgHeight : $('.thumbnailWrapper ul li').find('img').height() 
				
			};
			
			//make the list items same size as the images
			$('.thumbnailWrapper ul li').css({ 
				
				'width' : thumbnail.imgWidth, 
				'height' : thumbnail.imgHeight 
				
			});
			
			//when mouse over the list item...
			$('.thumbnailWrapper ul li').hover(function(){
				
				$(this).find('img').stop().animate({
					
					/* increase the image width for the zoom effect*/
					width: parseInt(thumbnail.imgWidth) + thumbnail.imgIncrease,
					/* we need to change the left and top position in order to 
					have the zoom effect, so we are moving them to a negative
					position of the half of the imgIncrease */
					left: thumbnail.imgIncrease/2*(-1),
					top: thumbnail.imgIncrease/2*(-1)
					
				},{ 
					
					"duration": thumbnail.effectDuration,
					"queue": false
					
				});
				
				//show the caption using slideDown event
				$(this).find('.caption:not(:animated)').slideDown(thumbnail.effectDuration);
				
			//when mouse leave...
			}, function(){
				
				//find the image and animate it...
				$(this).find('img').animate({
					
					/* get it back to original size (zoom out) */
					width: thumbnail.imgWidth,
					/* get left and top positions back to normal */
					left: 0,
					top: 0
					
				}, thumbnail.effectDuration);
				
				//hide the caption using slideUp event
				$(this).find('.caption').slideUp(thumbnail.effectDuration);
				
			});
			
		});
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		$(function() {

		    $(".jMyCarousel").jMyCarousel({
		        visible: '5',
		        eltByElt: true,
		        evtStart: 'mousedown',
		        evtStop: 'mouseup'
		    });

		});
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		/*******

	***	Anchor Slider by Cedric Dugas   ***
	*** Http://www.position-absolute.com ***
	
	Never have an anchor jumping your content, slide it.

	Don't forget to put an id to your anchor !
	You can use and modify this script for any project you want, but please leave this comment as credit.
	
*****/
		


$(document).ready(function() {
	$("a.anchorLink").anchorAnimate()
});

jQuery.fn.anchorAnimate = function(settings) {

 	settings = jQuery.extend({
		speed : 1100
	}, settings);	
	
	return this.each(function(){
		var caller = this
		$(caller).click(function (event) {	
			event.preventDefault()
			var locationHref = window.location.href
			var elementClick = $(caller).attr("href")
			
			var destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
				window.location.hash = elementClick
			});
		  	return false;
		})
	})
}












function Vivo() {

windowprops = "top=100,right=50,resizable=no,toolbar=no,scrollbars=no" + ",width=505,height=373";
window.open("http://d2fm.com.br/aovivo", "popupPage", windowprops);
}






function studio() {

windowprops = "top=200,right=0,resizable=no,toolbar=no,scrollbars=no" + ",width=600,height=375";
window.open("http://www.d2fm.com.br/studio/aovivo.html", "popupPage", windowprops);
}

function regra() {

windowprops = "top=200,right=0,resizable=no,toolbar=no,scrollbars=yes" + ",width=500,height=400";
window.open("http://www.d2fm.com.br/promocoes/regulamento.html", "popupPage", windowprops);
}

function musica03() {

windowprops = "top=200,right=0,resizable=no,toolbar=no,scrollbars=no" + ",width=500,height=180";
window.open("top20/bep.html", "popupPage", windowprops);
}

function Galeria() {

windowprops = "top=100,right=0,resizable=no,toolbar=no,scrollbars=no" + ",width=817,height=547";
window.open("http://d2fm.com.br/1/index", "popupPage", windowprops);
}


function regra2() {

windowprops = "top=200,right=0,resizable=no,toolbar=no,scrollbars=yes" + ",width=500,height=400";
window.open("http://www.d2fm.com.br/promocoes/regulamento2.html", "popupPage", windowprops);
}

function regra3() {

windowprops = "top=200,right=0,resizable=no,toolbar=no,scrollbars=yes" + ",width=500,height=400";
window.open("http://www.d2fm.com.br/promocoes/regulamento3.html", "popupPage", windowprops);
}

function regra10() {

windowprops = "top=200,right=0,resizable=no,toolbar=no,scrollbars=yes" + ",width=500,height=400";
window.open("http://www.d2fm.com.br/promocoes/regulamento7.html", "popupPage", windowprops);
}

function cupom() {

windowprops = "top=200,right=0,resizable=no,toolbar=no,scrollbars=yes" + ",width=410,height=450";
window.open("http://www.d2fm.com.br/promocoes/pop-up-rodel.html", "popupPage", windowprops);
}

function regra_britney() {

windowprops = "top=200,right=0,resizable=no,toolbar=no,scrollbars=yes" + ",width=410,height=450";
window.open("http://www.d2fm.com.br/promocoes/regulamento-britney.html", "popupPage", windowprops);
}




function abre_flash(nome,largura,altura){

document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'+ 
' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"'+
' width="'+largura+'" height="'+altura+'" id="'+nome+'" align="middle">');

document.write('<param name="allowScriptAccess" value="sameDomain" />');

document.write('<param name="movie" value="'+nome+'.swf" />');

document.write('<param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />');

document.write('<embed src="'+nome+'.swf" quality="high" bgcolor="#ffffff"'+
' width="'+largura+'" height="'+altura+'" name="'+nome+'" align="middle"'+
' allowScriptAccess="sameDomain" type="application/x-shockwave-flash"'+
' pluginspage="http://www.macromedia.com/go/getflashplayer" />');

document.write('</object>');

}


	
