// JScript File
var currentWidth = 0;
var slideStatus = 0; // -1 = sliding out, 0 = nothing, 1 = sliding in
var id_Slide = "WW_Slideout";
var id_SlideContainer = "worldWide";
var obj_Slide;
var w_Max = 175;
var w_Interval = 15;
var ww_FadeInterval;


function toggleSlide () {


    if ( ( slideStatus == 0 && currentWidth == 0 ) || slideStatus == 1 ) {
        
        startTransitionOut ();
        
    } else if ( ( slideStatus == 0 && currentWidth == w_Max ) || slideStatus == -1 ) { 
    
        startTransitionIn ();
 
    } 

}


function startTransitionOut () {

    obj_SlideContainer = document.getElementById( id_SlideContainer);
    obj_Slide = document.getElementById ( id_Slide );
    slideStatus = -1;
    slideOut();
   
}


function startTransitionIn () {
    obj_SlideContainer = document.getElementById( id_SlideContainer);
    obj_Slide = document.getElementById ( id_Slide );
    slideStatus = 1;
    slideIn();

}


function slideOut () {
 
    if ( slideStatus == -1 ) {
        
        if ( currentWidth < w_Max  ) {
        
        
            currentWidth += w_Interval;
            
            if ( currentWidth > w_Max ) currentWidth = w_Max;
            
            ww_FadeInterval = setTimeout ( "adjustWidth(" + currentWidth + ", 1 )", 20 );
            
    
        } else {
            
            slideStatus = 0;
    
        }
    }

}


function slideIn () {
 
    if ( slideStatus == 1 ) {
        
        if ( currentWidth > 0  ) {
            
            currentWidth -= w_Interval;
            
            if ( currentWidth < 0 ) currentWidth = 0;
            
            ww_FadeInterval = setTimeout ( "adjustWidth(" + currentWidth + ", -1 )", 20 );
            
    
        } else {
            
            slideStatus = 0;
    
        }
    }
    

}


function adjustWidth( newWidth, funcOut ) {

    obj_Slide.style.width = newWidth + "px";
    obj_SlideContainer.style.width = (newWidth + 131) + "px";

    if ( funcOut == 1 ) {
    
        slideOut();
        
    } else if ( funcOut == -1 ) {
    
        slideIn();
    
    }


}

