// JavaScript Document

 //functions for map
/*
 * 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 */
       
        xOffset = 10;
        yOffset = 30;
       
        // these 2 variable determine popup's distance from the cursor
        // you might want to adjust to get the right result
       
    /* END CONFIG */
    var handleover = function(e){
        this.t = this.alt;
        this.alt = "";   
        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 - xOffset) + "px")
            .css("left",(e.pageX + yOffset) + "px")
            .fadeIn("fast");                       
    };
    var handleout = function(){
        this.alt = this.t;
        $("#preview").remove();
    };
    if ($.browser.msie) {
        $("area.preview").mouseover(handleover).mouseout(handleout);
    } else {
        $("area.preview").hover(handleover,handleout);
    }
    $("area.preview").mousemove(function(e){
        $("#preview")
            .css("top",(e.pageY - xOffset) + "px")
            .css("left",(e.pageX + yOffset) + "px");
    });           
};


// starting the script on page load
$(document).ready(function(){
	imagePreview();
});


function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

