
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');
	//if (objIfr.src!=url){
	    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)+20;
	var t_y = parseInt(event.clientY)+20;
	var t_h = parseInt(objMsg.style.height);
	var t_w = parseInt(objMsg.style.width);
	var win_w = parseInt(BodyOffsetWidth());
	var win_h = parseInt(BodyOffsetHeight());

    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 + BodyScrollTop())) + '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="position:absolute;display:none;z-index:999;left:0px;top:0px;width:320px;height:320px;">');

document.write('<table cellspacing="0" cellpadding="0" border="0" width="320" height="320">');

document.write('<tr>');
document.write('<td width="10" height="10" bgcolor="" style="font-size:2px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'./js/neartip_b1.png\';);"></td>');
document.write('<td width="300" height="10" bgcolor="#ffffff"></td>');
document.write('<td width="10" height="10" bgcolor="" style="font-size:2px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'./js/neartip_b2.png\';);"></td>');
document.write('</tr>');
document.write('</table>');

document.write('<iframe frameborder="0" src="" id="nearIfr" style="width:100%;height:100%;overflow:hidden;scroll:none;border:1px solid #666;z-index:999;" scrolling="no"></iframe>');
document.write('</div>');
*/

document.write('<div  id="nearMsgdiv"  style="position:absolute;display:none;z-index:999;left:0px;top:0px;width:320px;height:320px;">');

document.write('<!-- start content -->');
document.write('<table style="position:absolute;left:0px;top:0px;z-index:888" cellspacing="0" cellpadding="0" border="0" width="320" height="320">');

document.write('<tr>');
document.write('<td width="10" height="10" bgcolor="" style="font-size:2px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'./js/neartip_b1.png\';);"></td>');
document.write('<td width="300" height="10" bgcolor="#ffffff" style="background:url(./js/neartip_l1.png) repeat-x;"></td>');
document.write('<td width="10" height="10" bgcolor="" style="font-size:2px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'./js/neartip_b2.png\';);"></td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td width="10" height="300" bgcolor="#ffffff"  style="background:url(./js/neartip_l2.png) repeat-y;" ></td>');
document.write('<td width="300" height="300" bgcolor="#ffffff"  ><iframe frameborder="0" src="" id="nearIfr" style="width:100%;height:100%;overflow:hidden;scroll:none;border:none;z-index:999;" scrolling="no"></iframe></td>');
document.write('<td width="10" height="300" bgcolor="#ffffff"></td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td width="10" height="10" bgcolor="" style="font-size:2px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'./js/neartip_b4.png\';);"></td>');
document.write('<td width="300" height="10" bgcolor="#ffffff"></td>');
document.write('<td width="10" height="10" bgcolor="" style="font-size:2px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'./js/neartip_b3.png\';);"></td>');
document.write('</tr>');

document.write('</table>');
document.write('<!-- END content -->');

document.write('<!-- start shadow -->');
document.write('<table style="position:absolute;left:4px;top:4px;filter:Alpha(Opacity=20);" bgcolor="" cellspacing="0" cellpadding="0" border="0" width="320" height="320">');

document.write('<tr>');
document.write('<td width="10" height="10" bgcolor="" style="font-size:2px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'./js/neartip_bb1.png\';);;"></td>');
document.write('<td width="300" height="10" bgcolor="#000" ></td>');
document.write('<td width="10" height="10" bgcolor="" style="font-size:2px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'./js/neartip_bb2.png\';);"></td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td width="10" height="300" bgcolor="#000" ></td>');
document.write('<td width="300" height="300"></td>');
document.write('<td width="10" height="300" bgcolor="#000" ></td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td width="10" height="10" bgcolor="" style="font-size:2px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'./js/neartip_bb4.png\';);"></td>');
document.write('<td width="300" height="10" bgcolor="#000" ></td>');
document.write('<td width="10" height="10" bgcolor="" style="font-size:2px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'./js/neartip_bb3.png\';);"></td>');
document.write('</tr>');

document.write('</table>');
document.write('<!-- END shadow -->');
document.write('</div>');


