$(function() {
		   
	$(".png").supersleight();
	
	pic1 = new Image();
    pic2 = new Image();
    pic3 = new Image();
    pic4 = new Image();
    pic5 = new Image();
    pic1.src="images/bg.jpg";
    pic2.src="images/header.png";
    pic3.src="images/footer.png";
    pic4.src="images/home.jpg";
    pic5.src="images/popup_title.png";

	$("a").click(function(){
		var href = $(this).attr("href");
		if(href == "#"){
			return false;
		}
	});

	// dropdown hover function
	$("ul.parent li").hover(function(){
		if($(this).hasClass("dropdown")){
			if(!$(this).hasClass("active")){
				var dropdown_id = $(this).stop().find("a").attr("class");
				$(".shown").stop().removeClass("shown");
				$(this).stop().addClass("shown");
				$("#dropdown").stop().show();
				$("#dropdown").find("#"+dropdown_id).show().siblings().hide();
			}
		}
		else{
			$(".shown").stop().removeClass("shown");
			$("#dropdown").stop().hide();
		}
	});

	$("#dropdown").hover(function(){
	},function(){
		$(".shown").stop().removeClass("shown");
		$("#dropdown").stop().hide();
	});

	$("#navigation").hover(function(){
	},function(){
		$(".shown").stop().removeClass("shown");
		$("#dropdown").stop().hide();
	});

	// put the content of the current dropdown in a new div
	var current = $(".current").html();
	var current_id = $(".current").attr("id");
	$('#dropdown_shown').html('<ul id="'+current_id+'_shown">'+current+'</ul>');

	// social networks hover function
	$("#social_networks ul li a").hover(function(){
		$("#social_networks .switch").stop().addClass("hovered");
	},function(){
		$("#social_networks .switch").stop().removeClass("hovered");
	});

	$("ul#music-thumb li img").hover(function(){
		$(this).stop().addClass("hovered");
	},function(){
		$(this).stop().removeClass("hovered");
	});
	
	$('a#jukebox').click(function(){
		popUp('music_player.php');
		return false;
	});

});

function popUp(url){
    playerW=300
    playerH=447
    popupx = Math.round((screen.availWidth-playerW)/2);
    popupx = 0;
    popupy = Math.round((screen.availHeight-playerH)/2);
    popupy = 0;
    prop='width='+playerW+',height='+playerH+',scrollbars=no,left='+popupx+',top='+popupy+',resizable=no';
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(url, '" + id + "','"+ prop+"');");     
}
