function writeHelpLayer(layerID,txt){
	if(document.getElementById){
		document.getElementById(layerID).innerHTML+=txt;
	}else if(document.all){
		document.all[layerID].innerHTML+=txt;
	}else if(document.layers){
		with(document.layers[layerID].document){
			open();
			write(txt);
			close();
		}
	}
}
var helpwindow = "";
function openHelpWindow(helpCategory, helpSection) {
	if (!helpwindow.closed && helpwindow.location){
		helpwindow.location.href = 'faq.php?popcat='+helpCategory+'&popsec='+helpSection;
		if (window.focus) {
			helpwindow.focus();
		}
	} else {
		helpwindow = window.open('faq.php?popcat='+helpCategory+'&popsec='+helpSection,'','scrollbars=yes,width=600,height=300,resizable=yes');
		if (!helpwindow.opener) {
			helpwindow.opener = self;
		}
		if (window.focus) {
			helpwindow.focus();
		}
	}
}

// getHelpElementsByAttribute([string attributeName],[string attributeValue],[boolean isCommaSeparatedList:false])
function getHelpElementsByAttribute(attrN,attrV,multi){
    attrV=attrV.replace(/\|/g,'\\|').replace(/\[/g,'\\[').replace(/\(/g,'\\(').replace(/\+/g,'\\+').replace(/\./g,'\\.').replace(/\*/g,'\\*').replace(/\?/g,'\\?').replace(/\//g,'\\/');
    var
        multi=typeof multi!='undefined'?
            multi:
            false,
        cIterate=typeof document.all!='undefined'?
            document.all:
            document.getElementsByTagName('*'),
        aResponse=[],
        re=new RegExp(multi?
            '\\b'+attrV+'\\b':
            '^'+attrV+'$'),
        i=0,
        elm;
    while((elm=cIterate.item(i++))){
        if(re.test(elm.getAttribute(attrN)||''))
            aResponse[aResponse.length]=elm;
    }
    return aResponse;
}
function turnOnHelp() {
	if (document.getElementById('hidehelptr').style.visibility == "hidden") {
		document.getElementById('hidehelptr').style.visibility = "";
		document.getElementById('hidehelptr').style.display = "";
		document.getElementById('showhelptr').style.visibility = "hidden";
		document.getElementById('showhelptr').style.display = "none";
	} else {
		document.getElementById('showhelptr').style.visibility = "";
		document.getElementById('showhelptr').style.display = "";
		document.getElementById('hidehelptr').style.visibility = "hidden";
		document.getElementById('hidehelptr').style.display = "none";
	}
	var divcheck = getHelpElementsByAttribute('helpdiv', 'yes');
	var x = 0;
	for (var i = 0; i < divcheck.length; i++){
		if (divcheck[i].style.visibility == "hidden") {
			divcheck[i].style.visibility = "";
			divcheck[i].style.display = "";
		} else {
			divcheck[i].style.visibility = "hidden";
			divcheck[i].style.display = "none";		
		}
	}
}