/* Declare a namespace for the site */
var Site = window.Site || {};
var i=0;
var j=0;
var maxW=parseInt((screen.width/40)-1);
var maxH=parseInt((screen.height/40)-1);
document.write('<map name="grid">');
for (j=0;j<=maxH;j++)
{
	for (i=0;i<=maxW;i++)
	{
	document.write('<area shape="rect" href="#" coords="'+(i*40)+','+(j*40)+','+((i+1)*40)+','+((j+1)*40)+'" />');
	}
}
document.write('</map>');
/* Create a closure to maintain scope of the '$'
   and remain compatible with other frameworks.  */
(function($) {
	//same as $(document).ready();
	$(function() {
		xicon = function(x,y){return '<img src="_/img/bgd.png" width="40" height="40" id="i'+x+y+'" style="display:none;position:absolute;left:'+ x +'px;top:'+ y +'px;"/>'};
		$("area").hover(
		  function () {
				coords = this.getAttribute('coords').split(',');
				//console.log('x='+coords[0]+',y='+coords[1]);
				$(xicon(coords[0],coords[1])).appendTo(document.body).fadeIn(300,function(){$(this).fadeOut(600,function(){$(this).remove()})});
		  }
		);




	});//end $(document).ready();


	$(window).bind("load", function() {
		
		
	
	});
	
})(jQuery);
