﻿/**
Hi Joseph,

Can we use this file and make condition to load custom javascript function for each page.

Pat.

**/


	$(document).ready(function(){
				$('.scroll-pane').jScrollPane({showArrows: true});
				//DD_belatedPNG.fix("#videoBox .video_mask_image img");
				$.each($('div.video_mask_image [id$=hypImageMask] img'),function(idx,obj){
					$(obj).attr('src','/images/MMBY3/thumb_mask_video.png');
					if ($.browser.msie && $.browser.version.substr(0,1)<7) {
						DD_belatedPNG.fixPng(obj);
					}
				});
	});

/** PLAY AND STOP SOUND **/
	$(document).ready(function(){
		$("#jquery_jplayer_1").jPlayer({
			ready: function () {
				$(this).jPlayer("setMedia", {
					mp3: "/images/song/song_1.mp3"
				}).jPlayer("stop");
			},
			ended: function (event) {
				$(this).jPlayer("play");
			},
			swfPath: "/Scripts/MMBY3",
			supplied: "mp3"
		});
		
			$('.jp-play').click(function() {
				if ($('.jp-play').hasClass("active")){

			  			$('.jp-play').removeClass("active");
			  			$('.jp-pause').addClass("active");
				}
				else{
						$('.jp-play').addClass("active");
			  			$('.jp-pause').removeClass("active");
						
				}				
				$('.button_play').css('display','none');
				$('.button_stop').css('display','block');

			});
			$('.jp-stop').click(function() {
				/*
				if ($('.jp-stop').hasClass("active")){

			  			//$('.jp-play').addClass("active");
			  			//$('.jp-stop').removeClass("active");
				}
				else{
	
			  			//$('.jp-play').removeClass("active");
			  			//$('.jp-stop').addClass("active");
						//alert("stop");
				}*/
				$('.button_play').css('display','block');
				$('.button_stop').css('display','none');

			});
			$('.jp-pause').click(function() {
				if ($('.jp-pause').hasClass("active")){

			  			$('.jp-pause').removeClass("active");
			  			$('.jp-play').addClass("active");
				}
				else{
						$('.jp-pause').removeClass("active");
			  			$('.jp-play').addClass("active");
				}
				$('.button_play').css('display','block');
				$('.button_stop').css('display','none');

			});

	});
	
	
/** TEXT SERACH INTERACTIVE**/
	$(document).ready(function(){
				$('.textsearch').click(function() {
					if ($(this).val() =="Search MommyBear"){					
					$(this).val('');
					$(this).css('color','#666666');
					}				
					
				});
				$('.textsearch').blur(function() {
					if ($(this).val() ==""){					
					$(this).val('Search MommyBear');
					$(this).css('color','#ececec');
					}
				});
	});
	
$(document).ready(function(){
	$(".signin a[id$=lnkSignIn]").colorbox({   inline: true, transition: "fade", speed: 100, href: "#login_popup"});
	  
});
	
/**FADE GAME**/
    $(document).ready(function() {
        //fadeInGame2();
		$('#game1 a').attr('href','/Figurine').removeAttr('name');
    });
	//$('#game1 a').click(function(){
		//window.location=$(this).attr('href');
	//});


    function fadeInGame1() {
        $('#game3').fadeOut(700);
        $('#game4').fadeIn(1000);
        setTimeout(fadeInGame2, 3500);
    }
    function fadeInGame2() {
        $('#game4').fadeOut(700);
        $('#game1').fadeIn(1000);
        setTimeout(fadeInGame3, 3500);
    }
    function fadeInGame3() {
        $('#game1').fadeOut(700);
        $('#game2').fadeIn(1000);
        setTimeout(fadeInGame4, 3500);
    }
    function fadeInGame4() {
        $('#game2').fadeOut(700);
        $('#game3').fadeIn(1000);
        setTimeout(fadeInGame1, 3500);
    }

