
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - ag_common.js - */
// http://www.das.psu.edu/portal_javascripts/ag_common.js?original=1
function resizeColumns(){setTimeout("doresizeColumns()",300)}
function doresizeColumns(){var bodyClass=document.body.className;var contentWrapper=document.getElementById("portal-column-content");var centerColumn=document.getElementById("centercolumn");var personalTools=document.getElementById("portal-personaltools");if(!personalTools&&bodyClass.match(/template-document_homepage_view/)&&contentWrapper&&centerColumn&&(msieversion()>=8||msieversion()==0)){centerColumn.style.height="auto";iHeight=centerColumn.offsetHeight;failsafe=0;while(failsafe<500&&(centerColumn.offsetTop+centerColumn.offsetHeight)<(contentWrapper.offsetTop+contentWrapper.offsetHeight-3)){iHeight++;failsafe++;centerColumn.style.height=iHeight+"px"}}}
function msieversion(){var ua=window.navigator.userAgent
var msie=ua.indexOf("MSIE ")
if(msie>0)
return parseInt(ua.substring(msie+5,ua.indexOf(".",msie)))
else
return 0}
function getElement(theId,vPadding,IEvPadding){var theElement=document.getElementById(theId)?document.getElementById(theId):document.createElement("div");theElement.elementHeight=theElement.offsetHeight?theElement.offsetHeight:theElement.pixelHeight;theElement.style.height="auto";if(!vPadding){vPadding=0}
if(document.all&&IEvPadding){theElement.vPadding=IEvPadding}
else{theElement.vPadding=vPadding}
return theElement}
function setSearch(){var theSearchButton=document.getElementById("goSearch");var theSearchDropdown=document.getElementById("searchSource");var thePloneSearchForm=document.getElementById("plonesearchform");if(theSearchButton&&theSearchDropdown&&thePloneSearchForm){theSearchDropdown.style.display="inline";theSearchButton.onclick=function(){return searchOnSubmit()}
thePloneSearchForm.onsubmit=function(){return searchOnSubmit()}}}
function searchOnSubmit(){var theSearchDropdown=document.getElementById("searchSource");var theSearchForm=document.getElementById("GoogleSearch");var theSearchBox=document.getElementById("searchBox");var theCustomSearchBox=document.getElementById("GoogleCustomSearch");if(theSearchDropdown&&theSearchForm&&theSearchBox&&theCustomSearchBox){var theSearchOption=theSearchDropdown.options[theSearchDropdown.selectedIndex].value;if(theSearchOption=="college"){theCustomSearchBox.q.value=theSearchBox.value;theCustomSearchBox.submit();return false}
else if(theSearchOption=="psu"){theSearchForm.q.value=theSearchBox.value;theSearchForm.site.value="PennState";theSearchForm.proxystylesheet.value="PennState";theSearchForm.submit();return false}
else{return true}}}
registerPloneFunction(setSearch);registerPloneFunction(resizeColumns);

/* - scroller.js - */
// http://www.das.psu.edu/portal_javascripts/scroller.js?original=1
var delayb4scroll=4000
var marqueespeed=1
var pauseit=1
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)?copyspeed:0
var actualheight=''
function scrollmarquee(){if(parseInt(cross_marquee.style.top)>(actualheight*(-1)+8)){cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"}
else{cross_marquee.style.top=parseInt(marqueeheight)+8+"px"}}
function initializemarquee(){cross_marquee=document.getElementById("vmarquee")
marquee_container=document.getElementById("marqueecontainer")
if(cross_marquee&&marquee_container){cross_marquee.style.top=0
marqueeheight=marquee_container.offsetHeight
actualheight=cross_marquee.offsetHeight
if(window.opera||navigator.userAgent.indexOf("Netscape/7")!=-1){cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return}
cross_marquee.onmouseover=function(){copyspeed=pausespeed}
cross_marquee.onmouseout=function(){copyspeed=marqueespeed}
setTimeout('lefttime=setInterval("scrollmarquee()",30)',delayb4scroll)}}
registerPloneFunction(initializemarquee);
