$(document).ready(function(){  
  
    $("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)  
  
    $("ul.navmain li.menu").hover(function() { // trigger 
  
        //Following events are applied to the subnav itself (moving subnav up and down)  
        $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click  
  
        $("ul.navmain li.menu").hover(function() {  
        }, function(){  
            $(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up  
        });  
 
    });  
  
});  

//did you know animation

$(document).ready(function(){

	$('#didyouknowinner').animate({opacity: 0}, 0); 
		
	$('#didyouknow').hover(function(){ 
		$("#didyouknowinner").stop().animate({opacity: 1}); 
	}, function() { 
		$("#didyouknowinner").stop().animate({opacity: 0}, "slow"); 
	});
	
	$("#didyouknowinner").click(function(){
	  window.location="#"; return false;
	});
}); 

//page flip animation

$(document).ready(function(){
 
	$("#banner-leftcontainer").hover(function() {
		$("#banner-left").animate({top: "-=400"}, 300);
	}, function() {
		$("#banner-left").animate({top: "0"}, 600);
	});	 
	
	$("#pageflip").hover(function() { //On hover...
		$("#pageflip img , .msg_block").stop()
			.animate({ //Animate and expand the image and the msg_block (Width + height)
				width: '180px',
				height: '105px'
			}, 500);
		} , function() {
		$("#pageflip img").stop() //On hover out, go back to original size 50x52
			.animate({
				width: '147px',
				height: '86px'
			}, 220);
		$(".msg_block").stop() //On hover out, go back to original size 50x50
			.animate({
				width: '147px',
				height: '86px'
			}, 200); //Note this one retracts a bit faster (to prevent glitching in IE)
	});
 
});
