//write cookie for user resolution
function writeCookie() {
	 var today = new Date();
	 var the_date = new Date("December 31, 2023");
	 var the_cookie_date = the_date.toGMTString();
	 var availheight=screen.availHeight;
     var availwidth=screen.availWidth;
     var colordepth=screen.colorDepth + "bit";
	 var pixeldepth=screen.pixelDepth + "bit";
	 var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
	 var the_cookie = the_cookie + ";path=/;expires=" + the_cookie_date;
	 document.cookie=the_cookie
}
if (document.cookie.indexOf('users_resolution') != ''){
	writeCookie();
}

//document ready
$(function(){
	
	//menu
	$("#mainmenu li").hover(

	  //Opens drop down
	  function (event) { 
	 	event.preventDefault();
		$(this).find(".child").fadeIn(100);
	  },
	
	  //Closes drop down
	  function (event) {
		event.preventDefault();
		$(this).find(".child").fadeOut(100);
	  }
	);
	
	//init slider
	$("#slider div").iModSlider({
		start_item	:	0,
		navigationL : '#slide-prev',
		navigationR : '#slide-next',
		slide_interval: 500
	});
	
	//nit page flip
	$("#pageflip").hover(function() { //On hover...
	$("#pageflip img , .msg_block").stop()
		.animate({ //Animate and expand the image and the msg_block (Width + height)
			width: '307px',
			height: '319px'
		}, 500);
	} , function() {
	$("#pageflip img").stop() //On hover out, go back to original size 50x52
		.animate({
			width: '50px',
			height: '52px'
		}, 220);
	$(".msg_block").stop() //On hover out, go back to original size 50x50
		.animate({
			width: '50px',
			height: '50px'
		}, 200); //Note this one retracts a bit faster (to prevent glitching in IE)
	});
	
});
