function adjustLayout()
{
    var t = Math.max(xHeight("rail"), Math.max(xHeight("contentContainer"), xHeight("content")));
            
    xHeight("rail", t);
    xHeight("content", t);
    xHeight("contentContainer", t);
}

function displayFlash()
{
    if (xGetElementById("bannerImg"))
    {
        var flashvars = {
            xmlFile: "/helpers/slideshow-xml.aspx"
        };
        
        var params = {};        
        var attributes = {};

        swfobject.embedSWF("/flash/sjsSlideShow.swf", "flashSlideShowContainer", "718", "263", "8", "/flash/expressInstall.swf", flashvars, params, attributes);
    }
  
  if (document.getElementById("sjsKindergartenVideo"))
    {	    
	    var flashvars = {};        
        var params = {};        
        var attributes = {};

        swfobject.embedSWF("/flash/sjsKindergarten.swf", "flashKindergartenVideoContainer", "484", "406", "9", "/flash/expressInstall.swf", flashvars, params, attributes);
	}
	
	if (document.getElementById("sjsPromoVideo"))
    {	    
	    var flashvars = {};        
        var params = {};        
        var attributes = {};

        swfobject.embedSWF("/flash/sjsPromo.swf", "flashPromoVideoContainer", "480", "410", "9", "/flash/expressInstall.swf", flashvars, params, attributes);
	}
}

function toggle(sId)
{
    var menuItemParent = xGetElementById(sId);
    var menuItemChild = xGetElementById(sId + "Items");
    menuItemParent.className = (menuItemParent.className == "expanded" ? "" : "expanded");
    menuItemChild.className = (menuItemChild.className == "hide" ? "show" : "hide");
    return false;
}

window.onload = function()
{
    //adjustLayout();
    displayFlash();
    initLinks();
  
}


// Script written by Drew Noakes -- http://drewnoakes.com
function initLinks() {
  for (i in document.links) {
    link = document.links[i];
    if (link.rel && link.rel.indexOf('external')!=-1) {
      link.onclick = onExternalLinkActivate;
      link.onkeypress = onExternalLinkActivate;
    }
  }
}

function onExternalLinkActivate() {
  window.open(this.href);
  return false;
}
