var xmlHttp;
var curComm;
var moz=document.getElementById&&!document.all
var mozHeightOffset=10

function resize_iframe(fid)
{
  //document.getElementById("i" + fid).height=100
  // required for Moz bug, value can be "", null, or integer
  document.getElementById("i" + fid).height = window.frames["n" + fid].document.body.scrollHeight+(moz?mozHeightOffset:0);
}
function showComm(com)
{
  if (com.length==0)
    {
    return;
    }
  xmlHttp = GetXmlHttpObject()
  if (xmlHttp==null)
    {
    alert ("Your browser does not support AJAX, download Firefox.");
    return;
    }
  var url;
  switch(com.toLowerCase())
  {
		//case "logon":
	  	//	url = "logon.html"
	  	//	break;
		default:
	  		url = com.toLowerCase() + ".html"
	  		break;
  }
  curComm = "c" + com;
  if (document.getElementById(curComm).innerHTML.length==0)
    {
    xmlHttp.onreadystatechange = function()
      {
      if (xmlHttp.readyState==4)
        {
        document.getElementById(curComm).innerHTML=xmlHttp.responseText;
		document.getElementById(curComm).style.display = 'block';
        }
      }
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
    }
  else
    {
    switchVisibility(curComm);
    }

}
function GetXmlHttpObject()
  {
  var xmlHttp=null;
  try
    {
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
  return xmlHttp;
  }
function switchVisibility(obj)
{
  if(document.getElementById(obj).style.display == 'block')
    {
    hide(obj);
    } else {
    show(obj);
    }

}
function hideVisibility(objs)
{
	obja = objs.split(',');
	var ln=messages.length;
    for(var i=0;i<ln;i++)
	
	{
        obj = obja[i];
        if(document.getElementById("c" + obj).style.display == 'block' || document.getElementById("c" + obj).innerHTML.length!=0)
        {
        hide("c" + obj);
        }
	}

}

function show(obj) {
  document.getElementById(obj).style.display = 'block';
}
function hide(obj) {
  document.getElementById(obj).style.display = 'none';
}
