/* *
 * FileName ShowMap.js
 * Create Time 2007-1-22
 * Author shiwei 
 * Descript 地图
 * Version 
 * 
 */

/**
 *	在屏幕的中间位置弹出地图窗口
 *
 *
 */
function popWindow(url,windowname,width,height){
   var chasm = screen.availWidth;
   var mount = screen.availHeight;
   var w;
   var h; 
   
   if(width>0){
     w=width;
   }else{
     w=600;
   }
   
   if(height>0){
     h=height;
   }else{
     h=500;
   }
   
　  window.open (url, windowname, 'width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5)+',toolbar=no, menubar=no,status=on,scrollbars=auto');
}

/**
 *	弹出地图窗口
 *
 *
 */
function popMap(url){
	var width;
	var height;
	width=310+5;
	height=210+5;
	popWindow(url,'_blank',width,height);
}

/**
 *	生成地图背景
 *	img : 地图背景
 *
 */
function createMap(mapId,img){
	var mapStr="<table border=\"1\" width=\"100%\" height=\"100%\" align=\"center\"><tr><td width=\"100%\" height=\"100%\" align=\"center\" style=\"background-image:url("+img+");\"></td></tr></table>";
	mapId.innerHTML=mapStr;
}

/**
 *	生成一个坐标
 *	idStr ：坐标点ID
 *	nameStr ：坐标点名称
 *	x ：坐标点x轴坐标
 *	y ：坐标点y轴坐标
 *
 */
function createMapAreaDiv(idStr,nameStr,x,y,img){
	var divWidth=50;
	var divHeight=20;
	var divStr;
	var divElement;
	divStr="<div onclick=\"dsClick('"+idStr+"');\" align='center' id='"+idStr+"' name='"+nameStr+"' style='width:"+divWidth+"px;height:"+divHeight+"px;left:"+x+"px;top:"+y+"px;position:absolute;background-image:url("+img+");background-repeat:no-repeat;filter:glow(color=#ffffff,strength=3);cursor:hand;' title='点击链接'></div>";
	divElement=document.createElement(divStr);
	divElement.innerHTML="<font color=#000000>"+nameStr+"</font>";
	document.getElementsByTagName('body')[0].insertBefore(divElement);
}

document.onselectstart=function (){return false;}

//document.onclick=function(){alert(event.clientX);alert(event.clientY);return false;}

