﻿
    //this is jQuery code
    //for ie: set nav bar equal to other
$(document).ready(function() {
						
    var theight = $("#table1").height();
    var tdaheight = $("#tda").height() * 2;
    var contentorgheight = $("#dm_MenuContainer").height();
    if (jQuery.browser.msie) {
        $("#button1").height(theight - tdaheight);
        $("#button2").height(theight - tdaheight);
        $("#button3").height(theight - tdaheight);
        $("#button4").height(theight - tdaheight);
        $("#button5").height(theight - tdaheight);
        $("#button6").height(theight - tdaheight);
        if ($.browser.version.substr(0, 1) < 7) {

            var orgContentContainerheight;
            if (document.getElementById("ContentContainer")) {
                var footertop = document.getElementById("ContentContainer").style.top;
                orgContentContainerheight = document.getElementById("ContentContainer").style.top;
                document.getElementById("ContentContainer").style.top = orgContentContainerheight - 10;
                document.getElementById("footer").style.top = footertop + 15;
                $("#dm_MenuContainer").height(theight - 15);
            }
        }
        else {
            $("#dm_MenuContainer").height(theight - 10);
        }

    } else {
        //set content div menu height
        $("#dm_MenuContainer").height(theight - 10);

    }

    //default change text size
	//20100101
    //ChangPageSize(1);
    //change hidden layer size
    var h = $("body").height();
    if (h < 3000)
        h = 3200;
	//hidden layer no longer need modify by yin 2010 03 06
   // $("#hiddenLayer").height(h);
	//hidden layer no longer need modify by yin 2010 03 06
	
    //set img src
    var path = "./images/" + document.getElementById("hidlang").value;
    if (document.getElementById("img_sharing")) {
        document.getElementById("img_sharing").src = path + "/side/side_infoshare_link.png";
    }
    if (document.getElementById("img_news")) {
        document.getElementById("img_news").src = path + "/side/side_news.png";
    }
    if (document.getElementById("img_contact")) {
        document.getElementById("img_contact").src = path + "/side/side_contactus.png";
    }
    if (document.getElementById("img_event_reg")) {
        document.getElementById("img_event_reg").src = path + "/side/side_event_registration.png";
    }
    if (document.getElementById("img_shortcut_system")) {
        document.getElementById("img_shortcut_system").src = path + "/0_0/shortcut_system.png";
    }
    if (document.getElementById("img_ppp")) {
        document.getElementById("img_ppp").src = path + "/side/side_ppp.png";
    }

    $("#searchpullmenu").bind("mouseleave", function() {
        hiddensearchmenu2();

    });
    $("#pullmenu").bind("mouseleave", function() {
        hiddenmenu();

    });

    //set height if side bar taller than main content
    if ($("#sideshort").height() > $("#masthead").height() - 200) {
        $("#masthead").height($("#sideshort").height() + 150);
    } 
   
	reloaddiv();
	
	
	        $('#pullmenu').bgiframe();  
	   
	
});

function reloadall() {
    var theight = $("#table1").height();
    var tdaheight = $("#tda").height() * 2;
    var contentorgheight = $("#dm_MenuContainer").height();
    if (jQuery.browser.msie) {
        $("#button1").height(theight - tdaheight);
        $("#button2").height(theight - tdaheight);
        $("#button3").height(theight - tdaheight);
        $("#button4").height(theight - tdaheight);
        $("#button5").height(theight - tdaheight);
        $("#button6").height(theight - tdaheight);
        if ($.browser.version.substr(0, 1) < 7) {

            var orgContentContainerheight;
            if (document.getElementById("ContentContainer")) {
                var footertop = document.getElementById("ContentContainer").style.top;
                orgContentContainerheight = document.getElementById("ContentContainer").style.top;
                document.getElementById("ContentContainer").style.top = orgContentContainerheight - 10;
                document.getElementById("footer").style.top = footertop + 15;
                $("#dm_MenuContainer").height(theight - 15);
            }
        }
        else {
            $("#dm_MenuContainer").height(theight - 10);
        }

    } else {
        //set content div menu height
        $("#dm_MenuContainer").height(theight - 10);

    }

    //default change text size
    //ChangPageSize(1);
    //change hidden layer size
    var h = $("body").height();
    if (h < 3000)
        h = 3200;

    $("#hiddenLayer").height(h);

    //set img src
    var path = "./images/" + document.getElementById("hidlang").value;
    if (document.getElementById("img_sharing")) {
        document.getElementById("img_sharing").src = path + "/side/side_infoshare_link.png";
    }
    if (document.getElementById("img_news")) {
        document.getElementById("img_news").src = path + "/side/side_news.png";
    }
    if (document.getElementById("img_contact")) {
        document.getElementById("img_contact").src = path + "/side/side_contactus.png";
    }
    if (document.getElementById("img_event_reg")) {
        document.getElementById("img_event_reg").src = path + "/side/side_event_registration.png";
    }
    if (document.getElementById("img_shortcut_system")) {
        document.getElementById("img_shortcut_system").src = path + "/0_0/shortcut_system.png";
    }
    if (document.getElementById("img_ppp")) {
        document.getElementById("img_ppp").src = path + "/side/side_ppp.png";
    }

    $("#searchpullmenu").bind("mouseleave", function() {
        hiddensearchmenu2();

    });
    $("#pullmenu").bind("mouseleave", function() {
        hiddenmenu();

    });
    //set height if side bar taller than main content
    if ($("#sideshort").height() > $("#masthead").height() - 200) {
        $("#masthead").height($("#sideshort").height() + 150);
    }
	
	        $('#pullmenu').bgiframe();  
			
  reloaddiv();
      
}
function reloaddiv() {
    //alert($("#masthead").height() - 100 + ' < ' + $("#contentL_5").height());contentL_5
    /**/
   
	
    if (document.getElementById("contentL_5")) {
        $("#masthead").height($("#contentL_5").height() + 70);
    } else if (document.getElementById("contentL_2")) {
    $("#masthead").height($("#contentL_2").height() + 70);

	} else if (document.getElementById("contentL")) {
	    $("#masthead").height($("#contentL").height() + 70);
	}
	if (document.getElementById("bluetab")) {
		
	    $("#masthead").height($("#masthead").height() + $("#bluetab").height() +80);

	}

	if ($("#sideshort").height() > $("#masthead").height() - 200) {
        $("#masthead").height($("#sideshort").height() + 150);
		
    }

}
