function helpWindow(helpID) {
	var wHelp = window.open(baseURL + "/help/help_display.cfm?hp_id=" + helpID, "wHelp", "width=450,height=500,scrollbars,resizable");
	wHelp.focus();
	
	return false;
}

function hideHelp() {
	closeObj.style.visibility = "hidden";
}

// Show the question for non IE browsers
function popupQuestionHelp(helpQID, langCode, event) {
	var helpWin = window.open(baseURL + "/display/question_help.cfm?q_id=" + helpQID + "&gl_code=" + langCode, "helpWin", "width=450,height=300,scrollbars,resizable");
	helpWin.blur();
	//helpWin.moveTo(window.screenX + event.pageX, window.screenY + event.pageY);
	helpWin.moveTo(event.screenX + 22, event.screenY - 10);
	helpWin.focus();
	return false;
}


// Show the term for non IE browsers
function popupTermHelp(sTerm, event) {
	var helpWin = window.open(baseURL + "/help_term.cfm?hg_term=" + escape(sTerm), "helpWin", "width=300,height=200,scrollbars,resizable");
	//helpWin.moveTo(window.screenX + event.pageX, window.screenY + event.pageY);
	helpWin.moveTo(event.screenX + 22, event.screenY - 10);
	helpWin.focus();
	return false;
}

function showHelp(helpID) {
	theObj = eval("document.all.help" + helpID);
	
	// Hide
	if (theObj.style.visibility == "visible") {
		closeObj = theObj;
		closeObj.style.clip = "rect(0 " + closeObj.clientWidth + " " + closeObj.clientHeight + " 0)";
		slideCloseLeft();
		slideCloseTop();
		setTimeout("hideHelp()",300);
		
	// Show
	} else {
		openObj = theObj;
		theObj.style.visibility = "visible";
		theObj.style.clip = "rect(0,0,0,0)";
		slideOpenRight();
		slideOpenBottom();
	}
	
	
}

function slideOpenRight(theObj) {
	var w = openObj.clientWidth;
	var wInc = Math.round(w/10);
	if (getClipOpen(openObj,'cr','1') < w + 10) {
		clipByOpen(openObj,0,wInc,0,0)
		setTimeout("slideOpenRight()",10)
	}
}
function slideOpenBottom(theObj,hInc,h) {
	var h = openObj.clientHeight;
	var hInc = Math.round(h/10);
	if (getClipOpen(theObj,'cb','1') < h + 10) {
		clipByOpen(theObj,0,0,hInc,0)
		setTimeout("slideOpenBottom()",10)
	}
}
function slideCloseLeft(theObj,wInc,w) {
	var w = closeObj.clientWidth;
	var wInc = Math.round(w/10);
	if (getClipClose(theObj,'cr','2') > 0) {
		clipByClose(theObj,0,-wInc,0,0)
		setTimeout("slideCloseLeft()",10)
	}
}
function slideCloseTop(theObj,hInc,h) {
	var h = closeObj.clientHeight;
	var hInc = Math.round(h/10);
	if (getClipClose(theObj,'cb','2') > 0) {
		clipByClose(theObj,0,0,-hInc,0)
		setTimeout("slideCloseTop()",5)
	}
}
function getClipOpen(theObj,side,which) {
	var clipv = openObj.style.clip.split("rect(")[1].split(")")[0].split("px")
	if (side=="ct") return Number(clipv[0])
	if (side=="cr") return Number(clipv[1])
	if (side=="cb") return Number(clipv[2])
	if (side=="cl") return Number(clipv[3])
}
function getClipClose(theObj,side,which) {
	var clipv = closeObj.style.clip.split("rect(")[1].split(")")[0].split("px")
	if (side=="ct") return Number(clipv[0])
	if (side=="cr") return Number(clipv[1])
	if (side=="cb") return Number(clipv[2])
	if (side=="cl") return Number(clipv[3])
}
function clipByOpen(theObj,ct,cr,cb,cl) {
	openObj.style.clip = "rect("+(this.getClipOpen(theObj,'ct')+ct)+"px "+(this.getClipOpen(theObj,'cr')+cr)+"px "+Number(this.getClipOpen(theObj,'cb')+cb)+"px "+Number(this.getClipOpen(theObj,'cl')+cl)+"px)";
}
function clipByClose(theObj,ct,cr,cb,cl) {
	closeObj.style.clip = "rect("+(this.getClipClose(theObj,'ct')+ct)+"px "+(this.getClipClose(theObj,'cr')+cr)+"px "+Number(this.getClipClose(theObj,'cb')+cb)+"px "+Number(this.getClipClose(theObj,'cl')+cl)+"px)";
}

