function getStyleObj(id) {
    if (document.getElementById || // DOM-compliant browsers (MSIE5, NSN6, O5)
        document.all) {            // or MSIE 4
        return getObj(id).style;
    } else return getObj(id); // NSN4
}

function getObj(id) {
    if (document.getElementById) { // DOM-compliant browsers (MSIE5, NSN6, O5)
        return document.getElementById(id);
   	} else if (document.all) { // MSIE4
        return document.all[id];
    } else if (document.layers) { // NSN4
        return document.layers[id];
    } else { // Trap DHTML-impaired browsers 
        //alert("Your browser does not support DHTML!");
        return false;
    }
}

function openPopup(popup)
{
	var tempObj=getStyleObj(popup);
	tempObj.visibility = "visible";
	
}
function emBold(div)
{
	var tempObj=getStyleObj(div);
	tempObj.fontWeight = "bold";
}
function unBold(div)
{
	var tempObj=getStyleObj(div);
	tempObj.fontWeight = "normal";
}
function closePopup(popup)
{
	var tempObj=getStyleObj(popup);
	tempObj.visibility = "hidden";
}
function openAnsBox(popup) {
	var num;
	for (var i =0; i < ansboxes.length; i++) {
   		if (menuTimers[i]) clearTimeout(menuTimers[i]);
		if (ansboxes[i] == popup) {
			num = i;
			openPopup(ansboxes[i]);
		} else {
			closePopup(ansboxes[i]);
		}
	} 
}

function closeAnsBox(popup) {
	var num;
	for (var i =0; i < ansboxes.length; i++) {
   		if (menuTimers[i]) clearTimeout(menuTimers[i]);
		if (ansboxes[i] == popup) {
			num = i;
			menuTimers[i] = setTimeout("closePopup('"+popup+"');",500);
		} 
	} 
}
function showBus(popup) {
	var num;
	for (var i =0; i < busGrps.length; i++) {
			var mItem = "b_" + busGrps[i];
		if (busGrps[i] == popup) {
			emBold(mItem);
			num = i;
			openPopup(busGrps[i]);
		} else {
			closePopup(busGrps[i]);
			unBold(mItem);
		}
	} 
}

function setBGColor(obj,color) 
{
	var tempObj=getStyleObj(obj);
	tempObj.backgroundColor = color;
}

function getHeight() {
	var myHeight = 0;
  	if (typeof(window.innerHeight) == 'number') {
		myHeight = window.innerHeight;
	} else if (document.body.parentNode) {
		myHeight = document.body.parentNode.clientHeight;
	} else {
		myHeight =  650;
	}
	return myHeight;
}



function writeWMV(video, wd, ht) {
	document.write("<object height=\"" + ht + "\" classid=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" id=\"mediaplayer1\">");
	document.write("<param name=\"Filename\" value=\"/" + video + "\">");
	document.write("<param name=\"ShowControls\" value=\"True\">");
	document.write("<param name=\"AutoStart\" value=\"True\">");
	document.write("<PARAM NAME=\"AutoSize\" VALUE=\"1\">");
	document.write("<param name=\"ShowStatusBar\" value=\"False\">");
	document.write("<param name=\"ShowDisplay\" value=\"False\">");
	document.write("<param name=\"AutoRewind\" value=\"True\">");
	document.write("<embed type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/\" width=\"" + wd + "\" height=\"" + ht + "\" src=\"/" + video + "\" filename=\"/" + video +  "\" autostart=\"True\" showstatusbar=\"False\" showdisplay=\"False\" autorewind=\"True\">");
	document.write("</embed>");
	document.write("</object>");

}
