﻿var hfopentimer;
var hfclosetimer;
var workingbox;
function toggletext(boxID) {
    var thebox = jQuery("#" + boxID)
    if (!thebox.is(":visible")) {
        thebox.slideDown();
    }
    else {
        thebox.slideUp();
    }
}
function opentext(boxID) {
	
	if (boxID == workingbox){
		clearTimeout(hfclosetimer)
	}
	else{
		closebox(workingbox)
		workingbox = boxID
	}
	hfopentimer = window.setTimeout("openbox('"+boxID+"')",100)
}
function closetext(boxID) {
	if (boxID == workingbox){
		clearTimeout(hfclosetimer)
	}
	else{
		workingbox = boxID
	}
	clearTimeout(hfopentimer)
	hfclosetimer = window.setTimeout("closebox('"+boxID+"')",500)
}
function openbox(boxID){
	var thebox = jQuery("#" + boxID)
    if (!thebox.is(":visible")) {
        thebox.slideDown();
    }
}
function closebox(boxID) {
    var thebox = jQuery("#" + boxID)
	if(thebox){
		if (thebox.is(":visible")) {
			thebox.slideUp();
		}
	}
}