IE4 = navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4;        
NS4 = navigator.appName.substring(0,8) == "Netscape" && parseInt(navigator.appVersion) >= 4;

function checkBrowser(){
        if(IE4 || NS4){
                return true;
        }
        return false;
}

function doOutput(output) {
	var thisOutput = document.getElementById('output');
	thisOutput.innerHTML = output + "<br />" + thisOutput.innerHTML;
	// thisOutput.innerHTML += output + "<br />";
}

function doPopup(popdata) {
	var thisContent = popdata;
	showPopup(thisContent);
}	

function showPopup(html) {
	// showFade();
	var thisPopup = document.createElement('div');
	thisPopup.setAttribute('id','thispopup');
	// thisPopup.setAttribute('style','position:relative;border:3px solid;width:810px;top:285px;left:50%;height:450px;margin-left:-405px;margin-top:-200px;background:#ffffff;font-size:12px;padding:20px;z-index:20000');
    if(!IE4) {
		thisPopup.setAttribute("class","popup2");
	} else {
		thisPopup.className = 'popup2';
	}

	document.body.appendChild(thisPopup);
	// alert(document.getElementById('thispopup').className);
	thisPopup.innerHTML = html + '<br /><br /><div><div style="width:100%;text-align:center;"><input type="button" value="Close" onclick="hidePopup();"></div></div>';
}

function hidePopup() {
	var thisPopup = document.getElementById('thispopup');
	document.body.removeChild(thisPopup);
	// var thisPopupBG = document.getElementById('thispopupbg');
	// document.body.removeChild(thisPopupBG);
	//hideFade();
}

function getElementsByClass(searchClass,node,tag,value) {

        var classElements = new Array();
        if (node == null)
                node = document;
        if (tag == null)
                tag = '*';
        var els = node.getElementsByTagName(tag);
        var elsLen = els.length;
        var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
        var j = 0;
        for (i = 0; i < elsLen; i++) {
                if (pattern.test(els[i].className) ) {
                        classElements[j] = els[i];
						// doOutput(els[i].id);
                        j++;
                }
        }
        return classElements;
}