//a grab bag of CSS and Window controls with JS

    // <![CDATA[

        function toggleSource( id,label )
        {
          var elem
          var link
          //var label

          if( document.getElementById )
          {
            elem = document.getElementById( id )
            link = document.getElementById( "l_" + id )
          }
          else if ( document.all )
          {
            elem = eval( "document.all." + id )
            link = eval( "document.all.l_" + id )
          }
          else
            return false;

          if( elem.style.display == "block" )
          {
            elem.style.display = "none"
            link.innerHTML = label
          }
          else
          {
            elem.style.display = "block"
            link.innerHTML = "HIDE " + label
          }
        }

        function openCode( url )
        {
          window.open( url, "POP", "width=400,height=400,scrollbars=yes" )
        }
        
        
        function swapSource( id )
        {
          var elem_edit
          var elem_view
          var link

          if( document.getElementById )
          {
            elem_view = document.getElementById( "view" )
            elem_edit = document.getElementById( "edit" )
            link = document.getElementById( "l_" + id )
          }
          else if ( document.all )
          {
            elem_view = eval( "document.all." + "view" )
            elem_edit = eval( "document.all." + "edit" )
            link = eval( "document.all.l_" + id )
          }
          else
            return false;

          if( elem_view.style.display == "block" )
          {
            elem_view.style.display = "none"
            elem_edit.style.display = "block"
            //link.innerHTML = "show"
          }
          else
          {
            elem_view.style.display = "block"
            elem_edit.style.display = "none"
            //link.innerHTML = "hide"
          }
        }
        
        
// Global "swap" holder Use value, null, if no layer initially visible

var currLayerId = "default";

//used in the peoples' section
function togLayer(id)
{
if(currLayerId) setDisplay(currLayerId, "none");
if(id)setDisplay(id, "block");
currLayerId = id;
}

function setDisplay(id,value)
{
var elm = document.getElementById(id);
elm.style.display = value;
} 

// make the columns have the proper border length
window.onload = columnBorder;

function columnBorder(){
var col1 = "columnOne";
var col2 = "columnTwo";

var elmt1 = document.getElementById(col1);
var elmt2 = document.getElementById(col2);

if (elmt1.className == "sub3c") {
	if (elmt1.innerHTML.length > (elmt2.innerHTML.length/2)){
	elmt1.style.borderRight = "1.20px solid #999999";
	elmt2.style.borderLeft = "0px solid #999999";

	} else {
	elmt2.style.borderLeft = "1.20px solid #999999";
	elmt1.style.borderRight = "0px solid #999999";
	}
}

//alert (elmt1.className + " " +elmt1.innerHTML.length +" and " + elmt2.innerHTML.length);
}


// positioning the window based on browser size
if (self.innerWidth){
var frameWidth;
var frameHeight;

frameWidth = self.innerWidth;
frameHeight = self.innerHeight;
} 
else if (document.documentElement && document.documentElement.clientWidth){
frameWidth = document.documentElement.clientWidth;
frameHeight = document.documentElement.clientHeight;
} 
else if (document.body){
frameWidth = document.body.clientWidth;
frameHeight = document.body.clientHeight;
} 
else {
frameWidth = 600;
frameHeight = 400;
}

//old works_popup.js 
//windowName = "POP works";	
function openNewWindow(URLtoOpen,windowName){
    windowFeatures = "width=616,height=560,toolbar=no,scrollbars=yes";
	var winl = (frameWidth/2) +15;
	var wint = 30;
	//var wint = (frameHeight/2);
	var newWindow = window.open(URLtoOpen, windowName, windowFeatures + ',left='+winl+',top='+wint+'');
	newWindow.focus();
	}
	
function openSecondWindow(URLtoOpen,windowName){
    windowFeatures = "width=640,height=560,toolbar=no,scrollbars=yes";
	var winl = (frameWidth/2) +15;
	var wint = 30;
	//var wint = (frameHeight/2);
	var secondWindow = window.open(URLtoOpen, windowName, windowFeatures + ',left='+winl+',top='+wint+'');
	secondWindow.focus();
	}
	

      // ]]>	
    