// JavaScript Document

/* Opens popup window  */
function opener(page)
{
  window.open(page, "popup", "location=no,menubar=no,resizable=no,width=550,height=580,scrollbars=yes");
}

/* Opens popup window */
function NewWindow(mypage, myname, w, h, scroll) 
{
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
  win = window.open(mypage, myname, winprops)
  if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

/* Even 'column' script
Derived from a script by Alejandro Gervasio. 
Modified to work in FireFox by Stefan Mischook for Killersites.com
Modified by Erica Melton to work in WST
How it works: just apply the CSS class of 'column' to your pages' main columns.
Add "matchColumns();" to body onload.
*/
function matchColumns()
{ 
  var divs,contDivs,maxHeight,divHeight,d; 
	
  // get all <div> elements in the document 
  divs=document.getElementsByTagName('div'); 
  contDivs=[]; 

  // initialize maximum height value 
  maxHeight=0; 

  // iterate over all <div> elements in the document 
  for(var i=0;i<divs.length;i++){ 
    // make collection with <div> elements with class attribute 'container' 
    if(/\bcolumn\b/.test(divs[i].className))
	  { 
      d=divs[i]; 
      contDivs[contDivs.length]=d; 
		
      // determine height for <div> element 
      if(d.offsetHeight)
	    { divHeight=d.offsetHeight;}
      else if(d.style.pixelHeight)
	    { divHeight=d.style.pixelHeight;} 

      // calculate maximum height 
      maxHeight=Math.max(maxHeight,divHeight); 
      } 
    } 

    // assign maximum height value to all of container <div> elements 

    for(var i=0;i<contDivs.length;i++)
	{ contDivs[i].style.height=maxHeight + "px"; } 	
} 

/* AJAX FUNCTION */
function ajaxFunction(url,divid)
  {
	 
  var xmlHttp = null;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
	
    }
  catch (e)
     {
    // Internet Explorer
	
    try
      {
		 
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	 
      }
    catch (e)
      {
      try
        {
			
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
	 
    xmlHttp.onreadystatechange=function()
      {
		 
      if(xmlHttp.readyState==4)
        {
        
		
		var s = xmlHttp.responseText;
    s = s.slice(s.indexOf("<fo" + "rm"));
    s = s.replace("</body>","");
    s = s.replace("</html>","");
    s = s.replace(/<form/ig,"<formdisabled");
		
		
		document.getElementById(divid).innerHTML = s;

        }
      }
    
	
	xmlHttp.open("GET",url,true);
	
    xmlHttp.send(null);
	
  }
  
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//Functions for pop up boxes 
function closepopup(boxname){
	box = document.getElementById(boxname);
	box.style.visibility = "hidden";
}

function openpopup(boxname){
	box = document.getElementById(boxname);
	box.style.visibility = "visible";
}

function MM_showHideLayers() { //v9.0

  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}