var ex;
var ey;
function over(e, id)
{
	
	if(document.getElementById('faqdiv') == null)
		return;
	document.getElementById('faqdiv').style.position = "absolute";
	ex = e.clientX;
	ey = e.clientY;
	document.getElementById('faqdiv').style.left = document.body.scrollLeft + ex - 15;
	document.getElementById('faqdiv').style.top = document.body.scrollTop + ey - document.getElementById('faqdiv').clientHeight;
	document.getElementById('faqdiv').style.display = "block";
	
	document.getElementById('faqcontent').innerHTML = "在线帮助加载中...";
	faqajax_request(id);
}

function out(id)
{
	if(document.getElementById('faqdiv') == null)
		return;
	document.getElementById('faqdiv').style.display = "none";
}

function divover(obj)
{
	obj.style.display = "block";
}

function divout(obj)
{
	obj.style.display = "none";
}


var faq_request = false;
function faqajax_request(faqID)
{
	faq_request = false;
	
	if(window.XMLHttpRequest) { 
		faq_request = new XMLHttpRequest();
		if (faq_request.overrideMimeType) {
			faq_request.overrideMimeType("text/xml");
		}
	}
	else if (window.ActiveXObject) { 
		try {
			faq_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				faq_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!faq_request) { 
		window.alert("不能创建XMLHttpRequest 对象实例.");
		return false;
	}
	faq_request.onreadystatechange = GetFAQBack;
	
	faq_request.open("GET", 'ajax.axd?methodName=faq&faqId='+faqID + "&r=" + Math.random(), true);
	faq_request.send("");
}

function GetFAQBack()
{
	if (faq_request.readyState == 4) 
	{ 
		if (faq_request.status == 200)
		{ 
			if(faq_request.responseText == "")
				return;
			var sAlls = faq_request.responseText.split("^");
			showBalloon(sAlls[0], sAlls[1]);
		} 
		else 
		{ 
			
		}
	}	
}


var ShowObj;
var bl=new JSBalloon();
function ajaxShow(obj, faqId)
{
	ShowObj	= obj;
	faqajax_request(faqId)
}

function showBalloon(txtTitle, txtmessage)
{	
	bl.autoHide=true; 
	bl.autoHideInterval = 2000; 
	bl.transShow=true; 
	bl.autoAway=false; 
	bl.showCloseBox=true;
	
	
	bl.Show({title:txtTitle,message:txtmessage,anchor:ShowObj, icon:'Info'});
}

