﻿                                         // JScript File
var objSections;
var objHeader;
var oldColor = "07A9EC";
var twP, twC, twS;


function hideSections(){
    objHeader.style.backgroundColor="#"+oldColor;
    var top = parseInt(objSections.style.top);
    var end = (top==-55) ? 110 : -55;
    if(top==-55 || top==110){
        for(var i=1;i<5;i++){
            var s=document.getElementById("s"+i).style;
            s.height="54px";
        }
        var t = new Tween(objSections.style,"top",Tween.strongEaseOut,parseInt(objSections.style.top),end,2,"px"); 
        t.start();
    }
}

function moveSection(index, height, newColor){
    var section = document.getElementById("s"+index);
    var sectionHeight = (section.style.height=="") ? 54 : parseInt(section.style.height);
    var newHeight = (sectionHeight==54) ? height : 54;
    
    objHeader.style.backgroundColor="transparent";
    if(sectionHeight==54 || sectionHeight==height){
        var t = new Tween(section.style,"height",Tween.strongEaseOut,sectionHeight,newHeight,2,"px"); 
        t.start();
        
        if(index==1){                    
            twP = new ColorTween(document.body.style, 'backgroundColor', Tween.strongEaseOut, oldColor, newColor, 2);
            twP.start();
        }else if(index==2){
            twC = new ColorTween(document.body.style, 'backgroundColor', Tween.strongEaseOut, oldColor, newColor, 2);
            twC.start();                
        }else if(index==3){
            twS = new ColorTween(document.body.style, 'backgroundColor', Tween.strongEaseOut, oldColor, newColor, 2);
            twS.start();                
        }
        oldColor = newColor;
    }
}

window.onload = function(){
    correctPNG();
	objSections = document.getElementById("sections");
    objHeader = document.getElementById("header");
    var t = new Tween(objSections.style,"top",Tween.strongEaseOut,0,110,2,"px"); 
    t.start();
	
}
