// JavaScript Document
$(window).load(function(){
	var body_w = $("body").width();
	if(body_w > 1300){
		$("a.about").css({marginTop: "3px"});
		$("a.photo").css({marginLeft: "7px"});
		$("a.video").css({marginRight: "7px"});
		$("a.contacts").css({marginBottom: "3px", marginLeft: "-33px"});
		$("#logo a").css({fontSize: "16px"});
	}
	var imgw = $("#logo img").width();
	$("#links").css({width: imgw+"px", marginLeft: -1*imgw/2+"px"});
	$("#logo a:not(.main)").click(function(){
		var url = $(this).attr("href");
		$("#loadhere").load(url);
		$("#content").fadeIn();
		//$("#logo").animate({top: "50%"}, "slow");
		//var height = $(document).height();
		//$("body").css({height: height+"px"});
		return false;
	});
	$("a.video").click(function(){
		$("#videoBar").fadeIn(200);
		$("#videoPlayer").fadeIn(200);
		$("#status").fadeIn(200);
		var embed = $("#first").html();
		//$("#first").html("");
		$("div.alldone_gsvb").hide();
		$("div.playerBox_gsvb").removeClass("idle_gsvb").addClass("playing_gsvb");
		$("div.playerInnerBox_gsvb").html(embed);
	});
	//firts run
	/*$("#player").jPlayer( {
		ready: function () {
		  $(this).setFile("../mp3/Hayah_Baad_Hayyah.mp3").play(); // Defines the mp3
		},
    swfPath: "javascript"
	})
	.jPlayerId("play", "play")
	.jPlayerId("pause", "pause")
	.jPlayerId("stop", "stop")
	.jPlayerId("volumeMax", "vmax")
    .jPlayerId("volumeBar", "vmin");
	//timer run
	$("#player").everyTime("500s", "timer", function(){
	$("#player").jPlayer( {
		ready: function () {
		  $(this).setFile("../mp3/Hayah_Baad_Hayyah.mp3"); // Defines the mp3
		  $(this).play();
		},
    swfPath: "javascript"
	})
	.jPlayerId("play", "play")
	.jPlayerId("pause", "pause")
	.jPlayerId("stop", "stop")
	.jPlayerId("volumeMax", "vmax")
    .jPlayerId("volumeBar", "vmin");
	});
	*/
	$("#play").click(function(){
		$("#player").everyTime("500s", "timer", function(){
		$("#player").jPlayer( {
			ready: function () {
			  $(this).setFile("../mp3/Hayah_Baad_Hayyah.mp3"); // Defines the mp3
			  $(this).play();
			},
		swfPath: "javascript"
		})
		.jPlayerId("play", "play")
		.jPlayerId("pause", "pause")
		.jPlayerId("stop", "stop")
		.jPlayerId("volumeMax", "vmax")
		.jPlayerId("volumeBar", "vmin");
		});
	});
	$("#pause").click(function(){
		$("#player").stopTime("timer");
		$("#play").show();
	});
	$("#stop").click(function(){
		$("#player").stopTime("timer");
		$("#play").show();
	});
	//$("#pause").show();
	/*$("#videobar").gsvideobar({ 
			horizontal: true, // True for horizontal display, false for vertical 
			thumbnailSize: this.thumbnailsMedium, // The size of the video thumbnails 
			player: '#player', // jQuery selector, jQuery object, or element 
				// for the player area, or '' for a floating player 
			//master: '', // jQuery selector, jQuery object, or element 
				// for the master videobar on the same page 
			closeText: '', // Text displayed at the top of the player to close it 
			search: $.gsvideobar.youTube('WDancecompany'), // Single or list of search terms 
			manyResults: true, // True for many results, false for only a few 
			cycleTime: this.cycleMedium, // Time between cycles of the search terms 
			cycleMode: this.cycleRandom, // Mode of cycling through the search terms 
			statusArea: '' // jQuery selector, jQuery object, or element for a status area 
		});*/
});