    function hidePageElements(element)
    {
        document.getElementById(element).style.opacity = "0.01";
	    document.getElementById(element).style.MozOpacity = "0.01";
	    document.getElementById(element).style.filter = "alpha(opacity=0.99)";
    }
    
    if (referrer == "home")
    {
        var pos = 0;
        switch(section)
        {
            case "kitchen":
            pos = 196;
            break;
            case "bedroom":
            pos = 392;
            break;
            case "door":
            pos = 588;
            break;
        }
        document.getElementById(section+"_section").style.left = pos+"px";
        document.getElementById(section+"_section").style.pixelLeft = pos+"px";
    } else {
        document.getElementById(referrer+"_section").style.zIndex = 1;
    }
    
    hidePageElements("page_header_pic");
    hidePageElements("text_area");
    
    dojo.require("dojo.fx");

	document.getElementById("page_header_pic").style.width = '0';
        
	var makeWider = dojo.animateProperty(
    {
      node: "page_header_pic",duration: 1000,
      properties: {
        width: {end: 580}
      }
    });
    var fadeIn = dojo.fadeIn({node: "text_area",duration: 3000});
	var slideLeft = dojo.fx.slideTo({node: section+"_section",duration: 1000, left: 0, top:0}); 
	var wipeIn = dojo.fx.wipeIn({node: "page_header_pic",duration: 1000});     
	var fadeTopIn = dojo.fadeIn({node: "page_header_pic", duration: 2000});    
    /*var currentAnimation = dojo.fx.chain([dojo.fx.combine([slideLeft, makeWider, fadeTopIn]),fadeIn]);*/

	var currentAnimation = dojo.fx.combine([fadeIn, slideLeft]);
	currentAnimation.play();
    var currentAnimation = dojo.fx.combine([makeWider, fadeTopIn]);
	currentAnimation.play();
	
	function fadeSection(sectionOut, sectionIn)
	{
	    var fadeOut = dojo.fadeOut({node: sectionOut, duration: 3000});
	    var fadeIn = dojo.fadeIn({node: sectionIn, duration: 1000});         
        var currentAnimation = dojo.fx.chain([fadeOut,fadeIn]);
        currentAnimation.play();
	}