
/*
[功能] 在线帮助
[参数] 
[作者] molm 2003/9/11
class="helpLink" href="?" onclick="showHelp(event, 'String to show'); return false"
*/


/*
function helpInfoValue(){
	try{
		showHelpTip(event,"<iframe width=250 scrolling=no frameborder=0 vspace=3 hspace=3 id=helpInfo src=\include\src\display_help.asp>");
		helpInfo.document.write(strhelpInfo);
		document.all.helpInfo.style.height=helpInfo.helpInfotable.clientHeight;
		return false;
	}
	catch(E){
		errorHandle(E);	
	}
}
*/
function showHelpTip(showe, s) {
	try{
		var el = showe.target ? showe.target : showe.srcElement;
		while (el.tagName != "A")
			el = el.parentNode;
	
		if (el._helpTip) {
			document.body.removeChild(el._helpTip);
			el._helpTip = null;
			el.onblur = null;
			return;
		}
	
		var d = document.createElement("DIV");
		d.className = "help-tooltip";
		document.body.appendChild(d);
		d.innerHTML = s;
	
		d.onmousedown = function (showe) {
			if (!showe) showe = event;
			var t = showe.target ? showe.target : showe.srcElement;
			while (t.tagName != "A" && t != d)
				t = t.parentNode;
			if (t == d) return;
			
			el._onblur = el.onblur;
			el.onblur = null;
		};
		d.onmouseup = function () {
			el.onblur = el._onblur;
			el.focus();
		};
		
	
		var dw = document.width ? document.width : document.documentElement.offsetWidth - 25;	
		if (d.offsetWidth >= dw)
			d.style.width = dw - 10 + "px";	else
			d.style.width = "";	
		var scroll = getScroll();
		if (showe.clientX > dw - d.offsetWidth)
			d.style.left = dw - d.offsetWidth + scroll.x + "px";
		else
			d.style.left = showe.clientX - 2 + scroll.x + "px";
		d.style.top = showe.clientY + 18 + scroll.y + "px";
	
		el.onblur = function () {
			document.body.removeChild(d);
			el.onblur = null;
			el._helpTip = null;
		};
		
		el._helpTip = d;
	}
	catch(E){
		errorHandle(E);
	}
}

function getScroll() {
	if (document.all && document.body.scrollTop != undefined) {	// IE model
		var ieBox = document.compatMode != "CSS1Compat";
		var cont = ieBox ? document.body : document.documentElement;
		return {x : cont.scrollLeft, y : cont.scrollTop};
	}
	else {
		return {x : window.pageXOffset, y : window.pageYOffset};
	}
}