/*
 * Image 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.imagePreview = function(){
 /* CONFIG */

 xImageOffset = -395;
 yImageOffset = 335;

 // these 2 variable determine popup's distance from the cursor
 // you might want to adjust to get the right result

 /* END CONFIG */
 $("a.preview").hover(function(e){
 this.t = this.title;
 this.title = "";
 var c = (this.t != "") ? "<br/>" + this.t : "";
 $("body").append("<p id='preview'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");
 $("#preview")
 .css("top",(e.pageY + xImageOffset) + "px")
 .css("left",(e.pageX - yImageOffset) + "px")
 .fadeIn("fast");
 },
 function(){
 this.title = this.t;
 $("#preview").remove();
 });
 $("a.preview").mousemove(function(e){
 $("#preview")
 .css("top",(e.pageY + xImageOffset) + "px")
 .css("left",(e.pageX - yImageOffset) + "px");
 });
};

this.imageRollover = function(){
 /* CONFIG */

 xRolloverOffset = -235; //Original value on 8/15/2011 -405
 yRolloverOffset = 125; //Original value on 8/15/2011 335

 // these 2 variable determine popup's distance from the cursor
 // you might want to adjust to get the right result

 /* END CONFIG */
 $("a.rollpreview").hover(function(e){
 this.t = this.title;
 this.title = "";
 var c = (this.t != "") ? "<br/>" + this.t : "";
 $("body").append("<p id='rollpreview'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");
 $("#rollpreview")
 .css("top",(e.pageY + xRolloverOffset) + "px")
 .css("left",(e.pageX - yRolloverOffset) + "px")
 .fadeIn("fast");
 },
 function(){
 this.title = this.t;
 $("#rollpreview").remove();
 });
 $("a.rollpreview").mousemove(function(e){
 $("#rollpreview")
 .css("top",(e.pageY + xRolloverOffset) + "px")
 .css("left",(e.pageX - yRolloverOffset) + "px");
 });
};

this.tallImageRollover = function(){
 /* CONFIG */

 xTallImageOffset = -545;
 yTallImageOffset = 250;

 // these 2 variable determine popup's distance from the cursor
 // you might want to adjust to get the right result

 /* END CONFIG */
 $("a.tallpreview").hover(function(e){
 this.t = this.title;
 this.title = "";
 var c = (this.t != "") ? "<br/>" + this.t : "";
 $("body").append("<p id='tallpreview'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");
 $("#tallpreview")
 .css("top",(e.pageY + xTallImageOffset) + "px")
 .css("left",(e.pageX - yTallImageOffset) + "px")
 .fadeIn("fast");
 },
 function(){
 this.title = this.t;
 $("#tallpreview").remove();
 });
 $("a.tallpreview").mousemove(function(e){
 $("#tallpreview")
 .css("top",(e.pageY + xTallImageOffset) + "px")
 .css("left",(e.pageX - yTallImageOffset) + "px");
 });
};

// starting the script on page load
$(document).ready(function(){
 imageRollover();
});
$(document).ready(function(){
 tallImageRollover();
});
$(document).ready(function(){
 imagePreview();
});

/*
 * Tooltip 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.tooltip = function(){
 /* CONFIG */
 xOffset = 5;
 yOffset = 15;
 // these 2 variable determine popup's distance from the cursor
 // you might want to adjust to get the right result
 /* END CONFIG */
 $("a.tooltip").hover(function(e){
 this.t = this.title;
 this.title = "";
 $("body").append("<p id='tooltip'>"+ this.t +"</p>");
 $("#tooltip")
 .css("top",(e.pageY - xOffset) + "px")
 .css("left",(e.pageX + yOffset) + "px")
 .fadeIn("fast");
},
 function(){
 this.title = this.t;
 $("#tooltip").remove();
 });
 $("a.tooltip").mousemove(function(e){
 $("#tooltip")
 .css("top",(e.pageY - xOffset) + "px")
 .css("left",(e.pageX + yOffset) + "px");
 });
};

this.duplicateButton = function(){
 /* CONFIG */
 xOffset = 50;
 yOffset = -100;
 // these 2 variable determine popup's distance from the cursor
 // you might want to adjust to get the right result
 /* END CONFIG */
 $("a.duplicateButton").hover(function(e){
 this.t = this.title;
 this.title = "";
 $("body").append("<p id='duplicateButton'>"+ this.t +"</p>");
 $("#duplicateButton")
 .css("top",(e.pageY - xOffset) + "px")
 .css("left",(e.pageX + yOffset) + "px")
 .fadeIn("fast");
},
 function(){
 this.title = this.t;
 $("#duplicateButton").remove();
 });
 $("a.duplicateButton").mousemove(function(e){
 $("#duplicateButton")
 .css("top",(e.pageY - xOffset) + "px")
 .css("left",(e.pageX + yOffset) + "px");
 });
};

this.preventDuplicate = 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.preventDuplicate").hover(function(e){
 this.t = this.title;
 this.title = "";
 $("body").append("<p id='preventDuplicate'>"+ this.t +"</p>");
 $("#preventDuplicate")
 .css("top",(e.pageY - xOffset) + "px")
 .css("left",(e.pageX + yOffset) + "px")
 .fadeIn("fast");
},
 function(){
 this.title = this.t;
 $("#preventDuplicate").remove();
 });
 $("a.preventDuplicate").mousemove(function(e){
 $("#preventDuplicate")
 .css("top",(e.pageY - xOffset) + "px")
 .css("left",(e.pageX + yOffset) + "px");
 });
};

this.hotShock = function(){
 /* CONFIG */
 xOffset = 75;
 yOffset = -100;
 // these 2 variable determine popup's distance from the cursor
 // you might want to adjust to get the right result
 /* END CONFIG */
 $("a.hotShock").hover(function(e){
 this.t = this.title;
 this.title = "";
 $("body").append("<p id='hotShock'>"+ this.t +"</p>");
 $("#hotShock")
 .css("top",(e.pageY - xOffset) + "px")
 .css("left",(e.pageX + yOffset) + "px")
 .fadeIn("fast");
},
 function(){
 this.title = this.t;
 $("#hotShock").remove();
 });
 $("a.hotShock").mousemove(function(e){
 $("#hotShock")
 .css("top",(e.pageY - xOffset) + "px")
 .css("left",(e.pageX + yOffset) + "px");
 });
};



// starting the script on page load
$(document).ready(function(){
 tooltip();
});
$(document).ready(function(){
	duplicateButton();
});
$(document).ready(function(){
	preventDuplicate();
});
$(document).ready(function(){
	hotShock();
});

