/*
Menu Variables 
*/
var maxLeftMenu = 0;
var menuTop = 0;
var IE = 0; // FLAG FOR IE BROWSER;
var currMenu = 0;
// JavaScript Document
function MAIN_GetDivProp(div,prop) {
   return parseInt(eval("div.offset"+prop+"")); 
}


function NAV_showMenu(b) {
	
    if( currMenu > 0 && currMenu != b )
	NAV_hideMenu(currMenu);
		
    currMenu = b;
	
	
    button = $('btn_'+b+'');
    menu   = $('menu'+b+'');
    shadow = $('NAV_menuShadow');
	

		
    /*
    if( IE == 1 )
	var menuLeft  = (MAIN_GetDivProp(button,'Left') + minLeftMenu) - 3; // a
    else
       var menuLeft  = (MAIN_GetDivProp(button,'Left') + minLeftMenu) - 6; // a
	
    */

    var xOff = 0;
    var mOff = 0;
	

					 
    switch( parseInt($('screenwidth').value) ) {
	case 1024:
	   if( IE == 1 ) {
	       xOff = 3;
	       mOff = 3;   
	   }
	   else {
			  
	      xOff = 15;
	      mOff = -5;
	   }
	   break;
	case 1280:
	   if( IE == 1 ) {
	       xOff = 3;
	       mOff = 3;   
	   }
	   else {
			  
	      xOff = 18;
	      mOff = -4;
	   }
	   break;
	default:
	   if( IE == 1 ) {
	       xOff = 3;
	       mOff = 3;
	   }
	   else {
	      xOff = 15;
	      mOff = -5;
	   }
	   break;
		   
		
    } // ENDS SWITCH
	
	var menuLeft = (MAIN_GetDivProp(button,'Left') + minLeftMenu)-xOff;
	var dropMenuWidth = MAIN_GetDivProp( menu ,'Width'); // b

	
	if( (menuLeft + dropMenuWidth) > maxLeftMenu )
	     menuLeft = (maxLeftMenu - dropMenuWidth) + mOff; 
		
		
		
		
	menu.style.left = menuLeft + "px";
	menu.style.top = menuTop+"px";

	
	shadow.style.width = menu.offsetWidth + "px";
	shadow.style.height = menu.offsetHeight + "px";
	shadow.style.top = menu.offsetTop + "px";
	shadow.style.left = menu.offsetLeft + "px"; 
	shadow.style.visibility = "visible";
	menu.style.visibility = "visible";
     
}
function NAV_hideMenu(m) {
	$('menu'+m+'').style.visibility = "hidden";
	$('NAV_menuShadow').style.visibility = "hidden";
	$('menu'+m+'').style.left = "0px";
	
}
function NAV_menuOff() {
     if( currMenu > 0 )
	 NAV_hideMenu(currMenu);
}
function NAV_setVariables() {
   if( document.all ) 
       IE = 1;
	   
	   
    var myWidth = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
    }
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
         //IE 6+ in 'standards compliant mode'
         myWidth = document.documentElement.clientWidth;
    }
    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
         //IE 4 compatible
         myWidth = document.body.clientWidth;
    }

    var minScreenWidth = MAIN_GetDivProp( $('STRUCTURE_bottom_shadow'),'Width');
	if( myWidth < minScreenWidth )
	    myWidth = minScreenWidth;
		
	
    minLeftMenu = (myWidth-MAIN_GetDivProp( $('NAV_main'), 'Width'))/2;	
    maxLeftMenu = minLeftMenu + MAIN_GetDivProp( $('NAV_main'), 'Width');	
    menuTop = (MAIN_GetDivProp( $('NAV_main'),'Top') + MAIN_GetDivProp( $('NAV_main'),'Height'))-2;
	
}

function NAV_ZoomIn() {
    
     var rel = 0;
     switch( parseInt($('screenwidth').value) ) {
         case 800:
	    $('screenwidth').value = "1024";
	    rel = 1;
	    break;
	 case 1024:
	    $('screenwidth').value = "1280";
	    rel = 1;
	    break;
     
     }
     if( rel == 1 ) {
     
         $('frmMainPageInfo').action = window.location.href;
	 $('frmMainPageInfo').target = "";
	 $('frmMainPageInfo').submit();
	 
     }
}

function NAV_ZoomOut() {
   
     var rel = 0;
     switch( parseInt( $('screenwidth').value ) ) {
         case 1024:
	    $('screenwidth').value = "800";
	    rel = 1;
	    break;
	 case 1280:
	    $('screenwidth').value = "1024";
	    rel = 1;
	    break;
     
     }
     if( rel == 1 ) {
     
         $('frmMainPageInfo').action = window.location.href;
	 $('frmMainPageInfo').target = "";
	 $('frmMainPageInfo').submit();
	 
     }
}







function NAV_ZoomIn_() {
    
     var rel = 0;
     switch( parseInt($('screenwidth').value) ) {
         case 800:
	    $('screenwidth').value = "1024";
	    rel = 1;
	    break;
	 case 1024:
	    $('screenwidth').value = "1280";
	    rel = 1;
	    break;
     
     }
     if( rel == 1 ) {
     
         $('frmMainPageInfo').action = window.location.href;
	 $('frmMainPageInfo').target = "";
	 $('frmMainPageInfo').submit();
	 
     }
}

function NAV_ZoomOut_() {
   
     var rel = 0;
     switch( parseInt( $('screenwidth').value ) ) {
         case 1024:
	    $('screenwidth').value = "800";
	    rel = 1;
	    break;
	 case 1280:
	    $('screenwidth').value = "1024";
	    rel = 1;
	    break;
     
     }
     if( rel == 1 ) {
     
         $('frmMainPageInfo').action = window.location.href;
	 $('frmMainPageInfo').target = "";
	 $('frmMainPageInfo').submit();
	 
     }
}


