var gCurrentHeight = 0;

/* window.onresize=function () {
	var dContainer = document.documentElement;
    if ( Number(gCurrentHeight) < Number(dContainer.clientHeight) || Number(gCurrentHeight) > Number(dContainer.clientHeight) )
    {
      gCurrentHeight = dContainer.clientHeight;
      window.setTimeout("ResizeIt();", 200);
    }
} */

// resize content div's 
function ResizeIt()
{
   
   try {
   
     // IE and Google Chrome
     pagewrapper.style.height = String(( gCurrentHeight - 125 ) + 'px');
     content.style.height = String(( gCurrentHeight - 157 ) + 'px');
     rightsidebar.style.height = String(( gCurrentHeight - 125 ) + 'px');
     rightspace.style.height = String(( gCurrentHeight - 125 ) + 'px');
     
     // simple slider
     var newHeight = Number(gCurrentHeight - 127);
     var newWidth = Number(newHeight / 0.665).toFixed(0);
              
     for ( picIndex=1 ; picIndex < 4 ; picIndex++ ) {

        var id = String("simplesliderImage" + picIndex);
        // alert(id + ':' + newHeight + ':' + newWidth);
        eval(id).width = newWidth.toString(10);
        eval(id).height = newHeight.toString(10); 
     }
     
   } catch(e) {
   
     // FireFox
     document.getElementById("pagewrapper").style.height = String(( gCurrentHeight - 125 ) + 'px');
     document.getElementById("content").style.height = String(( gCurrentHeight - 157 ) + 'px');
     document.getElementById("rightsidebar").style.height = String(( gCurrentHeight - 125 ) + 'px');
     document.getElementById("rightspace").style.height = String(( gCurrentHeight - 125 ) + 'px');
     
     try {
	     var newHeight = Number(gCurrentHeight - 127);
	     var newWidth = Number(newHeight / 0.665).toFixed(0);
	              
	     for ( picIndex=1 ; picIndex < 4 ; picIndex++ ) {
	
	        var id = String("simplesliderImage" + picIndex);
	        // alert(id + ':' + newHeight + ':' + newWidth);
	        eval(id).width = String(newWidth.toString(10) + 'px');
	        eval(id).height = String(newHeight.toString(10) + 'px'); 
	     }
     } catch(e) {}
     
   }

   // Silverlite objects
   //try {
   
   //  control.resize('100%', gCurrentHeight - 127);
   
   //} catch(e) {};
   
   //try {
   
   //  control_galerie.resize('100%', gCurrentHeight * 0.5);
   
   //} catch(e) {}
      
}

// initial .. fired -> body onload
function LocalSailing_InitPage()
{
    // var dContainer = document.documentElement;
    //	gCurrentHeight = dContainer.clientHeight;
    // window.setTimeout("ResizeIt();", 200);
}

// remove right click menu (IE)
document.oncontextmenu=new Function("return false");
