
function popUp(url, w, h)
{
	window.open(url, null, 'top=50,left=50,scrollbars=yes,resizable=yes,width='+(w+40)+',height='+(h+60)); 
	return false;
}

function switchView(ID)
{
	el = document.getElementById(ID); //alert(el); return false;
	if (el)
	{
		el.style.display = el.style.display == '' ? 'none' : '';
	}
	return false;
}

function initMenu( isVertical )
{
	DynarchMenu.setup( 'menu', { electric: true, lazy: true, scrolling: true, vertical: isVertical } );
	document.getElementById('menu-placeholder').style.display = 'none';
}


var req;

function loadXMLDoc(url, HTTPMethod) 
{
	if (HTTPMethod != "GET" && HTTPMethod != "POST")
	{
		HTTPMethod = "GET";
	}
	// branch for native XMLHttpRequest object
  if(window.XMLHttpRequest) 
  {
  	try 
  	{
			req = new XMLHttpRequest();
    } 
    catch(e) 
    {
			req = false;
    }
    // branch for IE/Windows ActiveX version
  } 
  else if(window.ActiveXObject) 
  {
   	try 
   	{
    	req = new ActiveXObject("Msxml2.XMLHTTP");
    } 
    catch(e) 
    {
     	try 
     	{
      	req = new ActiveXObject("Microsoft.XMLHTTP");
      } 
      catch(e) 
      {
      	req = false;
      }
		}
  }
    
	if(req) 
	{
		req.onreadystatechange = processReqChange;
		req.open(HTTPMethod, url, true);
		req.send("");
	}
}


function processReqChange() 
{
	// only if req shows "complete"
  if (req.readyState == 4) 
  {
  	// only if "OK"
    if (req.status == 200) 
    {
    	// ...processing statements go here...
   		method = req.responseXML.getElementsByTagName('method')[0].firstChild.data; 
   		result = req.responseXML.getElementsByTagName('result')[0]; 
   		eval(method+'(\'\', result);');
     } 
     else 
     {
	     alert("There was a problem retrieving  the XML data:\n" + req.statusText);
     }
  }
}
