var epicFrameHeight = 495;

function OnLoadDiv(height) {
height=height+30;
document.getElementById("ContentWrapper").style.height = height+"px";
}

function SetNewsbox()
{   // CHANGE THE NUMBERS IN THIS SCRIPT TO FIT THE CONTENT FOR EACH PAGE
	top.OnLoadDiv(520); // default (smallest) ccontainner-- typically 30px less than mainContent 
	top.document.getElementById("mainContent").style.height = "550px"; // Content size
	parent.document.getElementById("SideBar").style.height = "550px"; // SAme AS MAIN CONTENT
	parent.document.getElementById("MainBox").style.height = "490px"; // 60PX LESS THAN MAIN CONTENT
	parent.document.getElementById("RightSideColumn").style.height = "490px"; // 60PX LESS THAN MAIN CONTENT
}

function SetFixDivframe(height) {
height=height+30;
top.document.getElementById("ContentWrapper").style.height = height+"px";
document.getElementById("MainEpicbox").style.height = height+"px";
document.getElementById("MainBox").height=height;
}


function SetEpicFrameHeight()
{
	epicFrameHeight=900;
}

function SetDivHeight(iFrameName) {
  var frameHeight= document.getElementById(iFrameName).contentWindow.document.body.scrollHeight;
//why this does not work with chrome?  How about netscape and safari test on mac!!!!


  if (frameHeight >515){
  document.getElementById(iFrameName).height=frameHeight;
 top.document.getElementById("ContentWrapper").style.height = frameHeight+35;
// alert(frameHeight+35);
  } else {
  document.getElementById(iFrameName).height="515px";
 top.document.getElementById("ContentWrapper").style.height = "550px";
//  alert("550px");
  }
}

//  for Epic pages
function SetEpicDiv(iFrameName) {
//  var frameHeight= document.getElementById(iFrameName).contentWindow.document.body.scrollHeight;
var frameHeight = epicFrameHeight;
if (frameHeight >515){
  document.getElementById(iFrameName).height="960px";
 top.document.getElementById("ContentWrapper").style.height = "1015px";

  } else {
  document.getElementById(iFrameName).height="495px";
 top.document.getElementById("ContentWrapper").style.height = "550px";

  }
}

// see if this change frame work with safari and chrome
function changeFrame()
{
  var oIframe = document.getElementById('myframe');
  var oDoc = (oIframe.contentWindow || oIframe.contentDocument);
  if (oDoc.document) oDoc = oDoc.document;
  oDoc.body.style.backgroundColor = "#00f";
  return true;
  
 
  //  orget reference to form named 'ifrmTest' 
var iframeEl = document.getElementById('ifrm');
if ( iframeEl.contentDocument ) { // DOM
    var form = iframeEl.contentDocument.getElementById('ifrmTest');
} else if ( iframeEl.contentWindow ) { // IE win
    var form = iframeEl.contentWindow.document.getElementById('ifrmTest');
}
}

function SetDivHeightORINIAL(iFrameName) {
  var frameHeight=
    document.getElementById(iFrameName).contentWindow.document.body.scrollHeight;
 //document.write('the_height');
  //change the height of the iframe and Content Wrapper
  if (frameHeight >515){
  document.getElementById(iFrameName).height=frameHeight;
 top.document.getElementById("ContentWrapper").style.height = frameHeight+35;
 alert(frameHeight+35);
  }
  else {
  document.getElementById(iFrameName).height="515px";
 top.document.getElementById("ContentWrapper").style.height = "550px";
  alert("550px");
  }
}
function toggle(toggleId1, e)
{
/* ---------------to resize left size with 4 (FOUR) boxes -------------- */

 // for the news and announcements toggle
 if (toggleId1 =='Announcements')
 {
//	if (document.getElementById(toggleId1).style.height == "125px") 
//		{

//		document.getElementById("Events").style.fontSize = "14px";
		document.getElementById("Events").style.height = "25px";
		document.getElementById("Events").style.top = "435px";
		document.getElementById("Events").style.overflow = "hidden";
		changeFontcolorback("EventBar");
		changeBgcolor("EventBar");
		document.images["Events_toggle"].src = "Webimages/arrowup.png";
//		document.getElementById("Quicklinks").style.fontSize = "14px";
		document.getElementById("Quicklinks").style.height = "25px";
		document.getElementById("Quicklinks").style.top = "462px";
		document.getElementById("Quicklinks").style.overflow = "hidden";
		changeFontcolorback('QuicklinkBar');
		changeBgcolor('QuicklinkBar');
		document.images["Quicklinks_toggle"].src = "Webimages/arrowup.png";
//		document.getElementById("Siteindex").style.fontSize = "14px";
		document.getElementById("Siteindex").style.height = "25px";
		document.getElementById("Siteindex").style.top = "489px";
		changeFontcolorback('SiteindexBar');
		changeBgcolor('SiteindexBar');
		document.getElementById("EventBar").style.backgroundColor = "#777777";
		document.getElementById("Siteindex").style.overflow = "hidden";
		document.images["Siteindex_toggle"].src = "Webimages/arrowup.png";
//		for (i==document.getElementById("Announcements").style.height(); i>=400; next){
		document.getElementById("Announcements").style.height = "430px";
//		}
//		document.getElementById("Announcements").style.fontSize = "16px";
		changeFontcolor("AnnouncementBar");
		changeBgcolorback("AnnouncementBar");
   		document.images["Announcements_toggle"].src = "Webimages/arrowdown.png";
		document.getElementById("Announcements").style.overflow = "auto";
//		} 

 } //(body.style.top =='5px')
// for event toggle
 else if (toggleId1=="Events")
	{
// 	if (body.style.height == "170px") 
//		{
		document.getElementById("Announcements").style.height = "25px";
//		document.getElementById("Announcements").style.fontSize = "14px";
		changeFontcolorback("AnnouncementBar");
		changeBgcolor("AnnouncementBar");
		document.images["Announcements_toggle"].src = "Webimages/arrowup.png";
		document.getElementById("Announcements").style.overflow = "hidden";
//		document.getElementById("Events").style.fontSize = "16px";
		document.getElementById("Events").style.height = "430px";
		document.getElementById("Events").style.top = "27px";
		document.getElementById("Events").style.overflow = "auto";
		changeFontcolor("EventBar");
		changeBgcolorback("EventBar");
		document.images["Events_toggle"].src = "Webimages/arrowdown.png";
//		document.getElementById("Quicklinks").style.fontSize = "14px";
		document.getElementById("Quicklinks").style.height = "25px";
		document.getElementById("Quicklinks").style.top = "460px";
		document.getElementById("Quicklinks").style.overflow = "hidden";
		changeFontcolorback('QuicklinkBar');
		changeBgcolor('QuicklinkBar');
		document.images["Quicklinks_toggle"].src = "Webimages/arrowup.png";
//		document.getElementById("Siteindex").style.fontSize = "14px";
		document.getElementById("Siteindex").style.height = "25px";
		document.getElementById("Siteindex").style.top = "490px";
		changeFontcolorback('SiteindexBar');
		changeBgcolor('SiteindexBar');
		document.getElementById("Siteindex").style.overflow = "hidden";
		document.images["Siteindex_toggle"].src = "Webimages/arrowup.png";
//		} 
	}	
 else if (toggleId1=="Quicklinks")
	{
// 	if (body.style.height == "170px") 
//		{
		document.getElementById("Announcements").style.height = "25px";
//		document.getElementById("Announcements").style.fontSize = "14px";
		changeFontcolorback("AnnouncementBar");
		changeBgcolor("AnnouncementBar");
		document.images["Announcements_toggle"].src = "Webimages/arrowup.png";
		document.getElementById("Announcements").style.overflow = "hidden";
//		document.getElementById("Events").style.fontSize = "14px";
		document.getElementById("Events").style.height = "25px";
		document.getElementById("Events").style.top = "27px";
		document.getElementById("Events").style.overflow = "hidden";
		changeFontcolorback("EventBar");
		changeBgcolor("EventBar");
		document.images["Events_toggle"].src = "Webimages/arrowup.png";
//		document.getElementById("Quicklinks").style.fontSize = "16px";
		document.getElementById("Quicklinks").style.height = "430px";
		document.getElementById("Quicklinks").style.top = "56px";
		document.getElementById("Quicklinks").style.overflow = "auto";
		changeFontcolor("QuicklinkBar")
		changeBgcolorback('QuicklinkBar');
		document.images["Quicklinks_toggle"].src = "Webimages/arrowdown.png";
//		document.getElementById("Siteindex").style.fontSize = "14px";
		document.getElementById("Siteindex").style.height = "25px";
		document.getElementById("Siteindex").style.top = "490px";
		changeFontcolorback('SiteindexBar');
		changeBgcolor('SiteindexBar');
		document.getElementById("Siteindex").style.overflow = "hidden";
		document.images["Siteindex_toggle"].src = "Webimages/arrowup.png";
//		} 
	}	
 else {
//	if (body.style.height == "170px") 
//	{
		document.getElementById("Announcements").style.height = "25px";
//		document.getElementById("Announcements").style.fontSize = "14px";
		changeFontcolorback("AnnouncementBar");
		changeBgcolor("AnnouncementBar");
		document.images["Announcements_toggle"].src = "Webimages/arrowup.png";
		document.getElementById("Announcements").style.overflow = "hidden";
//		document.getElementById("Events").style.fontSize = "14px";
		document.getElementById("Events").style.height = "25px";
		document.getElementById("Events").style.top = "27px";
		document.getElementById("Events").style.overflow = "hidden";
		changeFontcolorback("EventBar");
		changeBgcolor("EventBar");
		document.images["Events_toggle"].src = "Webimages/arrowup.png";
//		document.getElementById("Quicklinks").style.fontSize = "14px";
		document.getElementById("Quicklinks").style.height = "25px";
		document.getElementById("Quicklinks").style.top = "56px";
		document.getElementById("Quicklinks").style.overflow = "hidden";
		changeFontcolorback("QuicklinkBar");
		changeBgcolor('QuicklinkBar');
		document.images["Quicklinks_toggle"].src = "Webimages/arrowup.png";
		document.getElementById("Siteindex").style.height = "430px";
		document.getElementById("Siteindex").style.top = "84px";
		changeFontcolor("SiteindexBar");
		changeBgcolorback('SiteindexBar');
		document.getElementById("Siteindex").style.overflow = "auto";
		document.images["Siteindex_toggle"].src = "Webimages/arrowdown.png";

} // else  
} // function toggle

/*  -------------function to resize three (3)  side boxes ------------- */

function resize3(toggleId1, e)
{

 // for the news and announcements toggle
 if (toggleId1 =='LeftBox1')
 {
		document.getElementById("LeftBox2").style.height = "25px";
		document.getElementById("LeftBox2").style.top = "465px";
		document.getElementById("LeftBox2").style.overflow = "hidden";
		changeFontcolorback("LeftBox2Bar");
		changeBgcolor("LeftBox2Bar");
		document.images["LeftBox2_toggle"].src = "Webimages/arrowup.png";
		document.getElementById("LeftBox3").style.height = "25px";
		document.getElementById("LeftBox3").style.top = "490px";
		document.getElementById("LeftBox3").style.overflow = "hidden";
		changeFontcolorback('LeftBox3Bar');
		changeBgcolor('LeftBox3Bar');
		document.images["LeftBox3_toggle"].src = "Webimages/arrowup.png";
		document.getElementById("LeftBox1").style.height = "460px";
		changeFontcolor("LeftBox1Bar");
		changeBgcolorback("LeftBox1Bar");
   		document.images["LeftBox1_toggle"].src = "Webimages/arrowdown.png";
		document.getElementById("LeftBox1").style.overflow = "auto";
 } 
 else if (toggleId1=="LeftBox2")
	{
		document.getElementById("LeftBox1").style.height = "25px";
		document.getElementById("LeftBox1").style.top = "0px";
		document.getElementById("LeftBox1").style.overflow = "hidden";
		changeFontcolorback("LeftBox1Bar");
		changeBgcolor("LeftBox1Bar");
		document.images["LeftBox1_toggle"].src = "Webimages/arrowup.png";
		document.getElementById("LeftBox3").style.height = "25px";
		document.getElementById("LeftBox3").style.top = "490px";
		document.getElementById("LeftBox3").style.overflow = "hidden";
		changeFontcolorback('LeftBox3Bar');
		changeBgcolor('LeftBox3Bar');
		document.images["LeftBox3_toggle"].src = "Webimages/arrowup.png";
		document.getElementById("LeftBox2").style.height = "455px";
		document.getElementById("LeftBox2").style.top = "30px";
		changeFontcolor("LeftBox2Bar");
		changeBgcolorback("LeftBox2Bar");
   		document.images["LeftBox2_toggle"].src = "Webimages/arrowdown.png";
		document.getElementById("LeftBox2").style.overflow = "auto";
	}	
	
 else {
		document.getElementById("LeftBox1").style.height = "25px";
		document.getElementById("LeftBox1").style.top = "0px";
		document.getElementById("LeftBox1").style.overflow = "hidden";
		changeFontcolorback("LeftBox1Bar");
		changeBgcolor("LeftBox1Bar");
		document.images["LeftBox1_toggle"].src = "Webimages/arrowup.png";
		document.getElementById("LeftBox2").style.height = "25px";
		document.getElementById("LeftBox2").style.top = "25px";
		document.getElementById("LeftBox2").style.overflow = "hidden";
		changeFontcolorback('LeftBox2Bar');
		changeBgcolor('LeftBox2Bar');
		document.images["LeftBox2_toggle"].src = "Webimages/arrowup.png";
		document.getElementById("LeftBox3").style.height = "460px";
		document.getElementById("LeftBox3").style.top = "55px";
		changeFontcolor("LeftBox3Bar");
		changeBgcolorback("LeftBox3Bar");
   		document.images["LeftBox3_toggle"].src = "Webimages/arrowdown.png";
		document.getElementById("LeftBox3").style.overflow = "auto";

} // else  
} // function resize3

/*  -------------function to RESET three (3) left side boxes ------------- */

function reSet3()
{

		document.getElementById("LeftBox1").style.height = "169px";
		document.getElementById("LeftBox1").style.top = "0px";
		document.getElementById("LeftBox1").style.overflow = "hidden";
		changeFontcolorback("LeftBox1Bar");
		changeBgcolorback("LeftBox1Bar");
		document.images["LeftBox1_toggle"].src = "Webimages/arrowneutral.png";
		document.getElementById("LeftBox2").style.height = "169px";
		document.getElementById("LeftBox2").style.top = "173px";
		document.getElementById("LeftBox2").style.overflow = "hidden";
		changeFontcolorback('LeftBox2Bar');
		changeBgcolorback('LeftBox2Bar');
		document.images["LeftBox2_toggle"].src = "Webimages/arrowneutral.png";
		document.getElementById("LeftBox3").style.height = "169px";
		document.getElementById("LeftBox3").style.top = "346px";
		changeFontcolorback("LeftBox3Bar");
		changeBgcolorback("LeftBox3Bar");
   		document.images["LeftBox3_toggle"].src = "Webimages/arrowneutral.png";
		document.getElementById("LeftBox3").style.overflow = "hidden";

} // function reSet3

/*  -------------function to reset three (3)  side boxes ------------- */

function resize2(toggleId1, pageHeight)
{
var spacer =3;
 // for the news and announcements toggle
 if (toggleId1 =='Box1')
 {
		document.getElementById("Box2").style.height = "20px";
		document.getElementById("Box2").style.top = pageHeight-22+"px";
		document.getElementById("Box2").style.overflow = "hidden";
		changeBarFontcolor("Box2Bar");
		changeBarBgcolor("Box2Bar");
		document.images["Box2_toggle"].src = "Webimages/arrowup.png";

		document.getElementById("Box1").style.height = pageHeight-22-spacer+"px";
//		changeBarFontcolor("Box1Bar");
//		changeBarBgcolorback("Box1Bar");
   		document.images["Box1_toggle"].src = "Webimages/arrowdown.png";
		document.getElementById("Box1").style.overflow = "auto";
 } 
 else if (toggleId1=='Box2')
	{
		document.getElementById("Box1").style.height = "22px";
		document.getElementById("Box1").style.top = "0px";
		document.getElementById("Box1").style.overflow = "hidden";
		changeBarFontcolor("Box1Bar");
		changeBarBgcolor("Box1Bar");
		document.images["Box1_toggle"].src = "Webimages/arrowup.png";

		document.getElementById("Box2").style.height = pageHeight-22-spacer+"px";
		document.getElementById("Box2").style.top = "22px";
//		changeBarFontcolor("Box2Bar");
//		changeBarBgcolorback("Box2Bar");
   		document.images["Box2_toggle"].src = "Webimages/arrowdown.png";
		document.getElementById("Box2").style.overflow = "auto";
	}	
	 
} // function resize2

/*  -------------function to RESET Two (2) side boxes ------------- */

function reSet2(pageHeight)
{
		document.getElementById("Box1").style.height = pageHeight/2-3+"px";
		document.getElementById("Box1").style.top = "0px";
		document.getElementById("Box1").style.overflow = "hidden";
		changeBarFontcolorback("Box1Bar");
		changeBarBgcolorback("Box1Bar");
		document.images["Box1_toggle"].src = "Webimages/arrowneutral.png";
		document.getElementById("Box2").style.height = pageHeight/2-3+"px";
		document.getElementById("Box2").style.top = pageHeight/2+"px";
		document.getElementById("Box2").style.overflow = "hidden";
		changeBarFontcolorback('Box2Bar');
		changeBarBgcolorback('Box2Bar');
		document.images["Box2_toggle"].src = "Webimages/arrowneutral.png";
} // function reSet2

/*  -------------function to reset TWO (2)  side boxes ------------- */
function resizeIframes(pageHeight)
{
	top.OnLoadDiv(pageHeight);
	parent.document.getElementById("SideBar").style.height = pageHeight+30+"px";
	parent.document.getElementById("MainIframe").style.height = pageHeight-10+"px";
	parent.document.getElementById("RightSideColumn").style.height = pageHeight-10+"px";
}

function resizeDeptIframes(pageHeight)
{
	top.OnLoadDiv(pageHeight);
	parent.document.getElementById("SideBar").style.height = pageHeight+30+"px";
	parent.document.getElementById("MainIframe").style.height = pageHeight-10+"px";
	parent.document.getElementById("RightColumn").style.height = pageHeight-10+"px";
}

