var lt = 0;
var tp = 0;

function mapAreaAction(){
	
var img = document.getElementById("_picsrc");//显示的图片(切热点的图片)
var imgleft = 0;
var imgtop = 0;
	var imgdiv = document.getElementById("_picdiv");
	var imgbox = document.getElementById("_picbox");
	
	var imgparent = imgdiv.parentNode;
	
	while(typeof imgparent == "object" && imgparent.tagName.toUpperCase() != "BODY"){
		
		imgleft += imgparent.offsetLeft ;//- imgparent.style.borderLeft;
		imgtop += imgparent.offsetTop ;//- imgparent.style.borderTop;
		imgparent = imgparent.parentNode;
	}	

	//lxh@2005-06-25,修改鼠标离开图片隐藏相关设置
	var mybody = document.getElementById("mybody");
	var mybodyleft = mybody.offsetLeft;
	var mybodytop = mybody.offsetTop;
	lt = imgleft;
	tp = imgtop;
	
	var picdiv = $("#_picdiv"); 
	//picdiv.css("left",imgleft);//这个可能需要根据实际细微调整一下
	//picdiv.css("top",imgtop);
	picdiv.show();

	var  picbox = $("#_picbox")

	var areaEl = $("#pagepicmap > Area");//pagepicmap:map元素的id

	areaEl.hover(
		function(){
			var self = $(this);
			var crds = self.attr("coords").split(",");

 			var regiondiv = $("#regiondiv");//红框显示的空div
			document.getElementById('regiondiv').innerHTML = '<v:polyline id="s"  href="'+self.attr("href")+'"style="Z-INDEX: 10; FILTER: alpha(opacity=22,style=0); LEFT: '+(imgleft)+'px; CURSOR: hand; POSITION: absolute; TOP: '+(imgtop+5)+'px; TEXT-ALIGN: left" points = "'+self.attr("coords")+'" filled = "t" fillcolor = "blue" strokecolor = "blue" strokeweight = "1pt" onmousemove="reMoveTitle()" onmouseout="hideAlt()"></v:polyline>';
           if(self.attr("_alt"))document.getElementById('divTdTitle').innerHTML = self.attr("_alt");else document.getElementById('divTdTitle').innerHTML = self.attr("title");
			//document.getElementById('divTdTitle').innerHTML = self.attr("_alt");//alert(self.attr("title"));
			regiondiv.show();
			
			
		},
		function(){
			}
	);	

//细缆热点：

var areaE2 = $("#pagepicmap2 > Area");//pagepicmap:map元素的id

	areaE2.hover(
		function(){
			var self = $(this);
			var crds = self.attr("coords").split(",");

 			var regiondiv = $("#regiondiv");//红框显示的空div
			document.getElementById('regiondiv').innerHTML = '<v:polyline id="s"  href="'+self.attr("href")+'"style="Z-INDEX: 10; FILTER: alpha(opacity=22,style=0); LEFT: '+(imgleft)+'px; CURSOR: hand; POSITION: absolute; TOP: '+(imgtop-13)+'px; TEXT-ALIGN: left" points = "'+self.attr("coords")+'" filled = "t" fillcolor = "blue" strokecolor = "blue" strokeweight = "1pt" onmousemove="reMoveTitle()" onmouseout="hideAlt()"></v:polyline>';
if(self.attr("_alt"))document.getElementById('divTdTitle').innerHTML = self.attr("_alt");else document.getElementById('divTdTitle').innerHTML = self.attr("title");
			//document.getElementById('divTdTitle').innerHTML = self.attr("_alt");//alert(self.attr("title"));
			regiondiv.show();
			
			
		},
		function(){
			}
	);	

	picbox.hover(
		function(){
			if(img.width>400)
				picdiv.width(784);
	
	},
		function(){
	
	}
	);
	
}

function openWin(obj){

window.open(obj.getAttribute("href"));

}

function reMoveTitle()
{	
	divTdTitle.setAttribute("nowrap", true,0); 
	divTitle.style.display="inline";
	divTitle.style.left=event.x + document.documentElement.scrollLeft ;
	divTitle.style.top=event.y + document.documentElement.scrollTop ;
}
function hideDuo(){
		var img = document.getElementById("_picsrc");
		var img = document.getElementById("_picsrc");
			if(event.x<(lt+13-document.documentElement.scrollLeft) || event.x>(lt+img.width+13-document.documentElement.scrollLeft) || event.y<(tp+21-document.documentElement.scrollTop) || event.y>(tp+21+img.height-document.documentElement.scrollTop)){
				if(document.getElementById('regiondiv').style.display!='none'){
					document.getElementById('regiondiv').style.display='none';}
				if(document.getElementById('divTitle').style.display!='none'){
					document.getElementById('divTitle').style.display='none';}

				document.getElementById("_picdiv").style.width="380";
			}


}

