$j = jQuery.noConflict();
$j(document).ready(
	function () {
		  $j(".top-movie-poster").each(
			  function (i) {
				  if (i == 0) {
					  $j(this).show();
				  } else {
				 	 $j(this).hide();
				  }
			  }
		  );
		$j(".button-movie").click(
			function() {				
				var thePanel = $j(this).parent().find(".top-movie-poster");				
				$j(".top-movie-poster").each(
					function (i) {
						$j(this).slideUp("slow");
					}
				);
				
				$j(thePanel).slideDown("slow");
				
			}
		);
		// Tool tip
		$j(".config, .tooltip").tooltip( {
				background: '#FFFFFF'	
			}
		);
		// User control
		$j(".button-user-panel").click(
			function () {
				var acording = $j(this).parent().find(".content-user-panel");
				$j(".content-user-panel").each(
					function () {
						$j(this).slideUp("slow");		
					}
				);
				$j(acording).slideDown("slow");
			}
		);
		// Pop up register
		$j(".popup").popup({
				button: '.reg',
				backgroundPopup: '#backgroundRegister',
				popupContainer: '#popupRegister',
				opacity: '0.4'
			}
		);
		// Control panel
		$j('#welcome').hover(
			function () {
				$j('.box-top-control').show();	
			}, function () {
				$j('.box-top-control').hide();		
			}
		);
		// Movie gens
		$j('li.movie-gens').hover(
			function () {
				$j('div.movie-gens').show();		
			}, function () {
				$j('div.movie-gens').hide();		
			}
		);
		// Movie controll
		function movieControl () {

			var player = document.getElementById('myplayer');
			var mute = 0;
			// play movie
			$j("#play").click(
				function () {
					player.sendEvent("PLAY", "true");	
			  	}
			);
			// pause movie
			$j("#pause").click (
				function () {
					player.sendEvent("PLAY", "false");	
				}
			);
			// mute sound
			$j("#mute").click(
				function () {
					player.sendEvent("mute", "true");
					if (mute == 0) {
						player.sendEvent("MUTE", "true");
						mute = 1;
					} else {
						player.sendEvent("MUTE", "false");
						mute = 0;
					}
				}
			);
		}
		movieControl();
		$j('.media-comment').acording();
		$j('.movie-element, .download-now, .movie-day, .pngfix, .txtDone, .txtError').pngFix(); 

	}
);

$j = jQuery.noConflict();
$j(document).ready(
	function () {
		  $j(".top-movie-poster2").each(
			  function (i) {
				  if (i == 0) {
					  $j(this).show();
				  } else {
				 	 $j(this).hide();
				  }
			  }
		  );
		$j(".button-movie2").click(
			function() {				
				var thePanel = $j(this).parent().find(".top-movie-poster2");				
				$j(".top-movie-poster2").each(
					function (i) {
						$j(this).slideUp("slow");
					}
				);
				
				$j(thePanel).slideDown("slow");
				
			}
		);
		// Tool tip
		$j(".config, .tooltip").tooltip( {
				background: '#FFFFFF'	
			}
		);
		// User control
		$j(".button-user-panel").click(
			function () {
				var acording2 = $j(this).parent().find(".content-user-panel");
				$j(".content-user-panel").each(
					function () {
						$j(this).slideUp("slow");		
					}
				);
				$j(acording2).slideDown("slow");
			}
		);
		// Pop up register
		$j(".popup").popup({
				button: '.reg',
				backgroundPopup: '#backgroundRegister',
				popupContainer: '#popupRegister',
				opacity: '0.4'
			}
		);
		// Control panel
		$j('#welcome').hover(
			function () {
				$j('.box-top-control').show();	
			}, function () {
				$j('.box-top-control').hide();		
			}
		);
		// Movie gens
		$j('li.movie-gens').hover(
			function () {
				$j('div.movie-gens').show();		
			}, function () {
				$j('div.movie-gens').hide();		
			}
		);
		// Movie controll
		function movieControl () {

			var player = document.getElementById('myplayer');
			var mute = 0;
			// play movie
			$j("#play").click(
				function () {
					player.sendEvent("PLAY", "true");	
			  	}
			);
			// pause movie
			$j("#pause").click (
				function () {
					player.sendEvent("PLAY", "false");	
				}
			);
			// mute sound
			$j("#mute").click(
				function () {
					player.sendEvent("mute", "true");
					if (mute == 0) {
						player.sendEvent("MUTE", "true");
						mute = 1;
					} else {
						player.sendEvent("MUTE", "false");
						mute = 0;
					}
				}
			);
		}


	}
);
