window.onload= function() {
    P7_swapClass(0,'none','open','closed','li');
//    setHeight();
}

// Make sure all the column heights are the same.
function setHeight()
{
    e1 = document.getElementById("leftcol");
	e2 = document.getElementById("maincol");
	e3 = document.getElementById("rightcol");
	e4 = document.getElementById("l1");
	e5 = document.getElementById("l2");
	
	maxhgt = Math.max(e3.offsetHeight,Math.max(e1.offsetHeight, e2.offsetHeight)); // + 10;
	if (maxhgt == e1.offsetHeight)
	{
	    hgt = e1.offsetHeight;
	    e1.style.height='auto';
        e2.style.height=hgt+'px';
        e3.style.height=hgt+'px';
        e4.style.height=hgt+'px';
        e5.style.height=hgt+'px';
	}
	else if (maxhgt == e2.offsetHeight)
	{
	    hgt = e2.offsetHeight;
	    e2.style.height='auto';
        e1.style.height=hgt+'px';
        e3.style.height=hgt+'px';
        e4.style.height=hgt+'px';
        e5.style.height=hgt+'px';
	}
	else if (maxhgt == e3.offsetHeight)
    {
	    hgt = e3.offsetHeight;
	    e3.style.height='auto';
        e1.style.height=hgt+'px';
        e2.style.height=hgt+'px';
        e4.style.height=hgt+'px';
        e5.style.height=hgt+'px';
    }
	
	    
	
/*	e1.style.height=hgt+'px';
	e2.style.height=hgt+'px';
	e3.style.height=hgt+'px';
	e4.style.height=hgt+'px';
	e5.style.height=hgt+'px';*/
	

}

// Popup window for projects
function openWin(url) {
    features = "toolbar=no,location=no,directories=no,status=no,menubar=no,";
    features =  features + "scrollbars=no,resizable=no,width=680,height=710";
    window.open (url,"proj",features);
}

// Functions for the alt template
function projSwap(id, rightalign) {
    if (rightalign) {
        align = "R";
        inv = "L";
    }
    else {
        align = "L";
        inv = "R";
    }

    for (x = 1; x < 10; x++)
    {
        thumb = document.getElementById("Thumb" + align + x);
        text = document.getElementById("Desc" + align + x);
        
        if (thumb != null && text != null) {
            if (x == id) {
                thumb.style.visibility = 'visible';
                text.style.visibility = 'visible';
            }
            else {
                thumb.style.visibility = 'hidden';
                text.style.visibility = 'hidden';
            }
        }
        text2 = document.getElementById("Desc" + inv + x);
        if (text2 != null)
            text2.style.visibility = 'hidden';
    }

}

/*
function projText(pagetitle, pagecategory, newid, newtitle, newclient, newlocation, rightalign) {
    /*var llink = document.getElementById("LeftPicLink");
    var rlink = document.getElementById("RightPicLink");
    var tlink = document.getElementById("TextLink");
    llink.onclick = alert(this.id);;//"openWin('Project.aspx?id=" + newid + "&parent=" + pagetitle + "&referrer=" + pagecategory + "');";
    var t = document.getElementById("ProjectTitle");
    var c = document.getElementById("ProjectClient");
    var l = document.getElementById("ProjectLocation");*/ /*
    t.firstChild.nodeValue=newtitle;
    c.firstChild.nodeValue=newclient;
    l.firstChild.nodeValue=newlocation;
    var z = document.getElementById("ProjDescArea");
    if (rightalign)
        z.style.textAlign = 'right';
    else
        z.style.textAlign = 'left';
}
*/
function newsText(news) {
    var n = document.getElementById("NewsAwardText");
    n.firstChild.nodeValue=news;
}        

function newsErase() {
    var n = document.getElementById("NewsAwardText");
    n.firstChild.nodeValue='';
}    


// Swap Image Code
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

function imgSwap(oImg)
{
   var strOver  = "_on"    // image to be used with mouse over
   var strOff = "_off"     // normal image
   var strImg = oImg.src
   if (strImg.indexOf(strOver) != -1) 
      oImg.src = strImg.replace(strOver,strOff)
   else
      oImg.src = strImg.replace(strOff,strOver)
}

function swapArrow(id) {
    var pic = document.getElementById(id);
    f = pic.src;
    if (f.search(/arrowup/) != -1)
        f = f.replace(/arrowup/, "arrowdown");
    else
        f = f.replace(/arrowdown/, "arrowup");
    //alert(f);
    pic.src = f;

}


