var Numero = 0;
var Elem = "'base'";
var Altura = "";
var Cont = Number(0);

/* LIGHTBOX */
hs.align = 'center';
hs.graphicsDir = base + 'images/graphics/';
hs.transitions = ['expand', 'crossfade'];
hs.fadeInOut = true;
hs.headingEval = 'this.thumb.alt';
hs.headingOverlay.position = 'below';
hs.addSlideshow({
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		opacity: .75,
		position: 'bottom center',
		hideOnMouseOut: true
	}
});
/* FIM LIGHBOX */
$(document).ready(function() {
	$("form#mural").parent("div#middle").addClass("recados-mural");

	$("input[name='telefone']").mask("(99) 9999-9999");
	$("input[name='cep']").mask("99999-999");

	/* BUSCA */
	$("form#busca div input").focus(function() {
		if($(this).val() == "Busque por Artista, bandas e etc.") {
			$(this).val("");
		}
	});
	$("form#busca div input").blur(function() {
		if($(this).val() == "") {
			$(this).val("Busque por Artista, bandas e etc.");
		}
	});

	/* MURAL DE RECADOS */
	$("input[name='video']").focus(function() {
		if($(this).val() == "(cole aqui o link do video do youtube)") {
			$(this).val("");
		}
	});
	$("input[name='video']").blur(function() {
		if($(this).val() == "") {
			$(this).val("(cole aqui o link do video do youtube)");
		}
	});

	$("#home").parent().children("div#header").children("h1").find("img + img").remove();

	/* EBIS */
	$("#link").mouseover(function() {
		$("#ebis img").stop();
		$("#ebis img:first-child").animate({top:0, opacity: 0}, 250, function() {
			$(this).animate({top:15, opacity: 1}, 250);
			$("#ebis img + img").animate({top:35, opacity: 1}, 250);
		});
	});
	$("#link").mouseout(function() {
		$("#ebis img").stop();
		$("#ebis img + img").animate({top:45, opacity: 0}, 250);
		$("#ebis img:first-child").animate({top:0, opacity: 0}, 250, function() {
			$(this).animate({top:15, opacity: 1}, 250);
		});
	});

	/* ARTISTAS */
	$("#artistas > li > a:first-child").click(function() {
		if(!$(this).parent().hasClass("selected")){
			$("#artistas > li").removeClass("selected");
			$(this).parent().addClass("selected");
		}else{
			$("#artistas > li").removeClass("selected");
		};
	});

	/* NEWS */
	if ($("#form form div input").val() != "") {
		$("#form form div label").css('display', 'none');
	}
	$("#form form div label").mouseup(function() {
		$(this).parent().children("input").focus();
	});
	$("#form form div input").focus(function() {
		$(this).parent().children("label").css('display', 'none');
	});
	$("#form form div input").blur(function() {
		if ($(this).val() == "") {
			$(this).parent().children("label").css('display', 'block');
		}
	});

	$("div.text").each(function() {
		$(this).find("object").each(function() {
			$(this).attr("wmode", "transparent");
		});
		$(this).find("embed").each(function() {
			$(this).attr("wmode", "transparent");
		});
	});

	/* 	BANNER */
	$(".images > div").each(function(){
		Numero = Numero + 1;
		$(".slidetabs").append("<a href='javascript:;'>" + Numero + "</a>");
	});
	$(".slidetabs").tabs(".images > div", {
		effect: 'fade',
		fadeOutSpeed: "slow",
		rotate: true
	}).slideshow({ autoplay: true, interval: 6000});

	$('#lista-revistas li:odd').append('<span><img src="' + base + '/public/images/default/branco.png" alt="" /></span>');

	$("#artistas li > div + a.ver").click(function() {
		$("#overlay").fadeIn(500);
	});
	$("#overlay > div > a").click(function() {
		$("#overlay").fadeOut(500);
	});
	$("#login a").click(function() {
		$("#senha").show();
	});

	/* TOP MUSIC */
	$("#ranking > div + div ul li span").each(function() {
		Cont = Cont + 1;
		if ($(this).text() > $("#ranking > div:first-child ul li").eq(Cont - 1).text()) {
			$(this).parent().addClass("down");
		} else if ($(this).text() < $("#ranking > div:first-child ul li").eq(Cont - 1).text()) {
			$(this).parent().addClass("up");
		}
	});
	
	
});

function ExibeFlash(src, larg, alt, vars)
{
    var strHtml = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ larg +'" height="'+ alt +'">';
    strHtml += '<param name="movie" value="'+ src +'" />';
    strHtml += '<param name="wmode" value="transparent" />';
    strHtml += '<param name="flashvars" value="'+ vars +'" />';
    strHtml += '<embed src="'+ src +'" wmode="transparent" flashvars="'+ vars +'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ larg +'" height="'+ alt +'"></embed>';
    strHtml += '</object>';
    document.write(strHtml);
}





