
function showNeartip(url){
	setNearURL(url);
	followNearMsg();
	showNearIfr();
	document.onmousemove=followNearMsg; 
	showNearMsg();
}

function hideNeartip(){
	hideNearMsg();
	hideNearIfr();
	document.onmousemove="";
}

function setNearURL(url){
    var objIfr = document.getElementById('nearIfr');
	objIfr.src = url;
}

function showNearMsg(){
	var objMsg = document.getElementById('nearMsgdiv');
	objMsg.style.display = '';
}

function hideNearMsg(){
	var objMsg = document.getElementById('nearMsgdiv');
	objMsg.style.display = 'none';
}

function showNearIfr(){
	var objMsg = document.getElementById('nearIfr');
	objMsg.style.display = '';
}

function hideNearIfr(){
	var objMsg = document.getElementById('nearIfr');
	objMsg.style.display = 'none';
}

function followNearMsg(){
	var objMsg = document.getElementById('nearMsgdiv');
	var t_x = parseInt(event.clientX)+30;
	var t_y = parseInt(event.clientY)+30;
	var t_h = parseInt(objMsg.style.height);
	var t_w = parseInt(objMsg.style.width);
	var win_w = parseInt(document.body.offsetWidth);
	var win_h = parseInt(document.body.offsetHeight);

    if ((t_y+t_h)>win_h){
		t_y=win_h-t_h;
    }/**/

	objMsg.style.left = t_x + 'px';
	objMsg.style.top = (Number(t_y + document.body.scrollTop)) + 'px';
}

function InitNeartip(){
	var objs = document.getElementsByTagName('a');
	for (var i=0;i<objs.length;i++){
         var obj = objs[i];
		 if (obj.neartip){
			 obj.onmouseover=function(){
                  showNeartip(this.neartip);
			 }
			 obj.onmouseout=function(){
                  hideNeartip();
			 }
		 }
	}
}
//window.attachEvent("onload", InitNeartip);
//InitNeartip;
window.attachEvent('onload',InitNeartip);


/*
function NearDebug(msg){
    var objDebug = document.getElementById('nearDebug');
	objDebug.innerHTML=msg;
}
document.write('<div id="nearDebug"></div>');*/

document.write('<div id="nearMsgdiv" style="display:none;position:absolute;left:0px;top:0px;width:300px;height:300px;background-color:#fff;"><iframe frameborder="0" src="" id="nearIfr" style="width:100%;height:100%;overflow:hidden;scroll:none;border:1px solid #666;" scrolling="no"></iframe></div>');
