/*
 * Url preview script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */

this.screenshotPreview = function(){	
	/* CONFIG */		
		xOffset = -50;
		yOffset = 50;	

		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result

	/* END CONFIG */
	
	$("a.screenshot").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? this.t : "";
		//$("body").append("<p id='screenshot'><img src='"+ this.rel +"' alt='' />"+ c +"</p>");	
		$("body").append(largeImg);
		$("#screenshot")
			.css("top",(e.pageY - yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#screenshot").remove();
    });
	$("a.screenshot").mousemove(function(e){
		$("#screenshot")
			.css("top",(e.pageY - yOffset) + "px")

			.css("left",(e.pageX + xOffset) + "px");

	});		

};

this.MonthMO = function(){
	//preload images into images objects
	var Hover = new Array();
	//Hover[0] = $("<img />").attr("src", "images/01_Hover.gif").attr("id", "screenshot").css("width", "782px").css("height", "438");
	/*Hover[1] = $("<img />").attr("src", "images/02_Hover.gif").attr("id", "screenshot").css("width", "782px").css("height", "438");
	Hover[2] = $("<img />").attr("src", "images/03_Hover.gif").attr("id", "screenshot").css("width", "782px").css("height", "438");
	Hover[3] = $("<img />").attr("src", "images/04_Hover.gif").attr("id", "screenshot").css("width", "782px").css("height", "438");
	Hover[4] = $("<img />").attr("src", "images/05_Hover.gif").attr("id", "screenshot").css("width", "782px").css("height", "438");
	Hover[5] = $("<img />").attr("src", "images/06_Hover.gif").attr("id", "screenshot").css("width", "782px").css("height", "438");
	Hover[6] = $("<img />").attr("src", "images/07_Hover.gif").attr("id", "screenshot").css("width", "782px").css("height", "438");
	Hover[7] = $("<img />").attr("src", "images/08_Hover.gif").attr("id", "screenshot").css("width", "782px").css("height", "438");
	Hover[8] = $("<img />").attr("src", "images/09_Hover.gif").attr("id", "screenshot").css("width", "782px").css("height", "438");
	Hover[9] = $("<img />").attr("src", "images/10_Hover.gif").attr("id", "screenshot").css("width", "782px").css("height", "438");
	Hover[10] = $("<img />").attr("src", "images/11_Hover.gif").attr("id", "screenshot").css("width", "782px").css("height", "438");
	Hover[11] = $("<img />").attr("src", "images/12_Hover.gif").attr("id", "screenshot").css("width", "782px").css("height", "438");*/
		
	$("img[class=Arrow]").hover(function(e){
		var ImageIndex = parseInt(this.name) - 1;
		//$("body").append(Hover[ImageIndex]);
		$("body").append("<div id='screenshot' style='width:782px;height:438px;background-image:url(images/" + this.name + "_Hover.gif)'></div>");
		switch(this.name){
			case "01":
			case "02":
			case "03":
			case "04":
				$("#screenshot")
				.css("top", "150px")
				.fadeIn("fast");
			break;
			case "05":
			case "06":
			case "07":
			case "08":
				$("#screenshot")
				.css("top", "515px")
				.fadeIn("fast");
			break;
			case "09":
			case "10":
			case "11":
			case "12":
				$("#screenshot")
				.css("top", "880px")
				.fadeIn("fast");
			break;
			default:
		}
	},
	function(){
		$("#screenshot").remove();
    });
}



// starting the script on page load

$(document).ready(function(){
    $("a").attr("hideFocus", "true");
	//screenshotPreview();
	MonthMO();
});