emc_map = {
	init:function(){
		var _1 = new Image();
		_1.src = "/img/ec_label_lg_bkg.png";
		var _2 = new Image();
		_2.src = "/img/ec_label_bkg.png";

		emc_map.dots();
		emc_map.facilities();
	},
	
	
	dots:function(){

		$(".dot a").hover(
						  function(){
							//  $(this).toggleClass("dl-on");
							  var txt = $(this).children("span").html();
							  var id = $(this).parent().attr("id");
							  var d = document.getElementById(id);
							  var x = 0;
							  var y = 0;
							  x = d.offsetLeft+20;
							  y = d.offsetTop+10;
							  $("#map-label").empty();
							  if(x > 340){
								  x-=122;
							  }
							  if(y > 150){
								  y-=50;
							  }
							  $("#map-label").append("<div class=\"inside5\">"+txt+"</div>");
							  //$("#map-label").css({left:x+"px", top:y+"px",width:"175px",height:"80px"});
								
								if(id == "dot-3"){
					   				//$("#map-label").css({left:x+"px", top:"0px", width:"240px", height:"250px",backgroundImage:"/img/ec_label_lg_bkg.gif"}).fadeIn(1000);
									
					   				$("#map-label").css({top:"330px", width:"240px", height:"260px",backgroundImage:"url(/img/ec_label_lg_bkg.png)"}).show();
							   							$("#map-label").animate({left:(x+10)+"px",top:"0px"}, 1000 );
								}else{
					   				$("#map-label").css({top:"330px", width:"175px", height:"80px",backgroundImage:"url(/img/ec_label_bkg.png)"}).show();
							   							$("#map-label").animate({left:x+"px",top:y+"px"}, 1000 );
					   				
								}
					//if ($.browser.msie){
					  //$("#map-label").show();
 					//}else{
					// $("#map-label").fadeIn(1000);
					//}
							 
							 	/**/	
													   
							 // alert(x);
							 //$(this).parent().width(70).height(70).css({"overflow":"visible","z-index":"99"});
							  //$(this).parent().children("div").fadeIn();
							  },
						  function(){
							  $("#map-label").stop();
							  $("#map-label").hide();
							   $("#map-label").css({top:"330px",height:"80px"});
							  //$(this).toggleClass("dl-on");
							 // $(this).parent().width(7).height(5).css({"overflow":"visible","z-index":"2"});
							 // $(this).parent().children("div").fadeOut();
							  }

		);
		
		$(".dot a").fadeIn();
	
	},
	/*--   --*/
	facilities:function(){
		
		/*$("#facility-list .l").each(function(i,dom){
											 $(dom).show();
							}
									
		);*/
		$("#facility-list .l").click(
			function(){
				$(this).toggleClass("m");
				var id = $(this).attr("id");
				var num = id.split("-");
				$("#faci-"+num[1]).slideToggle(1000);
				return false;
				//alert(num);
			}
		);
		
		$("#facility-list .l").fadeIn(1000);
		
	}
}


$(document).ready(emc_map.init);