function adjustGANavtextSize(w, h) {

    if (w > 1680) {
        $(".mycontent a").css("font-size", "24px");
        $(".mytitle").css("font-size", "26px");
        $(".areacontainer p").css("font-size", "24px");
        $(".areacontainer h2").css("font-size", "26px");
        $(".areacontainer h1").css("font-size", "26px");
        $(".areacontainer h3").css("font-size", "24px");
        $(".myheading").css("font-size", "24px");
        $(".mysubheading").css("font-size", "24px");

        $(".header ul.toplevelnav li a").css("font-size", "26px");
//        $(".header .topnavbottomright .innertopnav h1").css("font-size", "24px");
//        $(".header .topnavbottomright .innertopnav h2").css("font-size", "24px");
//        $(".header .topnavbottomright .innertopnav .dropdownboxarea").css("padding", "10px 3px 3px 0");


//        $(".header #gobutton").addClass("cssnavmed");
//        $(".header #gobutton").removeClass("cssnavlarge");
//        $(".header #gobutton").removeClass("cssnav");

//        $(".header #clearbutton").addClass("cssnavmed");
//        $(".header #clearbutton").removeClass("cssnavlarge");
//        $(".header #clearbutton").removeClass("cssnav");

    } else if (w <= 1200) {
        $(".mycontent a").css("font-size", "12px");
        $(".mytitle").css("font-size", "16px");
        $(".areacontainer p").css("font-size", "12px");
        $(".areacontainer h2").css("font-size", "14px");
        $(".areacontainer h1").css("font-size", "14px");
        $(".areacontainer h3").css("font-size", "12px");
        $(".myheading").css("font-size", "12px");
        $(".mysubheading").css("font-size", "12px");

       $(".header ul.toplevelnav li a").css("font-size", "16px");
//        $(".header .topnavbottomright .innertopnav h1").css("font-size", "12px");
//        $(".header .topnavbottomright .innertopnav h2").css("font-size", "12px");
//        $(".header .topnavbottomright .innertopnav .dropdownboxarea").css("padding", "3px 3px 3px 0");

//        $(".header #gobutton").addClass("cssnav");
//        $(".header #gobutton").removeClass("cssnavmed");
//        $(".header #gobutton").removeClass("cssnavlarge");

//        $(".header #clearbutton").addClass("cssnav");
//        $(".header #clearbutton").removeClass("cssnavmed");
//        $(".header #clearbutton").removeClass("cssnavlarge");
            
    } else  {

        $(".mycontent a").css("font-size", "18px");
        $(".mytitle").css("font-size", "22px");
        $(".areacontainer p").css("font-size", "18px");
        $(".areacontainer h2").css("font-size", "20px");
        $(".areacontainer h1").css("font-size", "20px");
        $(".areacontainer h3").css("font-size", "18px");
        $(".myheading").css("font-size", "18px");
        $(".mysubheading").css("font-size", "18px");

        $(".header ul.toplevelnav li a").css("font-size", "22px");
        
//        $(".header .topnavbottomright .innertopnav h1").css("font-size", "18px");
//        $(".header .topnavbottomright .innertopnav h2").css("font-size", "18px");
//        $(".header .topnavbottomright .innertopnav .dropdownboxarea").css("padding", "7px 3px 3px 0");

//        $(".header #gobutton").addClass("cssnavmed");
//        $(".header #gobutton").removeClass("cssnavlarge");
//        $(".header #gobutton").removeClass("cssnav");

//        $(".header #clearbutton").addClass("cssnavmed");
//        $(".header #clearbutton").removeClass("cssnavlarge");
//        $(".header #clearbutton").removeClass("cssnav");
   }    
}


function adjustNavtextSize(w, h) {

//    if ((w > 1680) && (h > 750)) {
//        //alert("w > 1600");
//        $("#MainDiv p").css("font-size", "20px");
//        $("#MainDiv h2").css("font-size", "24px");
//        $("#MainDiv h1").css("font-size", "24px");
//        $("#ProductionContentDiv p").css("font-size", "20px");
//        $("#ProductionContentDiv h2").css("font-size", "24px");
//        $("#ProductionContentDiv h1").css("font-size", "24px");
//        $(".contact-container p").css("font-size", "20px");
//        $(".contact-container a").css("font-size", "16px");
//        $(".contact-container h2").css("font-size", "22px");
//        $(".contact-container h1").css("font-size", "22px");
//       
//        $("#oher_offices .mytitle_inactive a").css("font-size", "26px");
//      
//        
//        $(".mytitle").css("font-size", "26px");
//        $(".mytitle a").css("font-size", "26px");
//        
//        $("#country .mytitle a").css("font-size", "16px");
//        $(".mycontent ul li a").css("font-size", "20px");
//    } else 
    
    if (w <= 1024) {

        $("#MainDiv p").css("font-size", "12px");
        $("#MainDiv h2").css("font-size", "16px");
        $("#MainDiv h1").css("font-size", "16px");
        $("#ProductionContentDiv p").css("font-size", "12px");
        $("#ProductionContentDiv h2").css("font-size", "16px");
        $("#ProductionContentDiv h1").css("font-size", "16px");
        $(".contact-container p").css("font-size", "12px");
        $(".contact-container a").css("font-size", "10px");
        $(".contact-container h2").css("font-size", "14px");
        $(".contact-container h1").css("font-size", "14px");


        $(".mytitle").css("font-size", "18px");
        $(".mytitle a").css("font-size", "18px");
        $("#oher_offices .mytitle_inactive a").css("font-size", "18px");
     
        
        $("#country .mytitle a").css("font-size", "10px");
        $(".mycontent ul li a").css("font-size", "12px");

    } else {
        //alert("else");
        $("#MainDiv p").css("font-size", "16px");
        $("#MainDiv h2").css("font-size", "20px");
        $("#MainDiv h1").css("font-size", "20px");
        $("#ProductionContentDiv p").css("font-size", "16px");
        $("#ProductionContentDiv h2").css("font-size", "20px");
        $("#ProductionContentDiv h1").css("font-size", "20px");
        $(".contact-container p").css("font-size", "16px");
        $(".contact-container a").css("font-size", "14px");
        $(".contact-container h2").css("font-size", "18px");
        $(".contact-container h1").css("font-size", "18px");
        
        $(".mytitle").css("font-size", "22px");
        $(".mytitle a").css("font-size", "22px");
        $("#oher_offices .mytitle_inactive a").css("font-size", "22px");
    
        
        $("#country .mytitle a").css("font-size", "14px");
        $(".mycontent ul li a").css("font-size", "16px");

    }

}

var url = ""
function navigate() {
    setTimeout('window.location = url;', 400);
}

var ortherOfficesFlag = false;

function showOffices() {
    $("#oher_offices").slideDown(500);
    $("#list1").hide();
    $("#changeOffice").hide();
    $("#backtoOffice").show();
    ortherOfficesFlag = true;
}

function hideOffice() {

    if (ortherOfficesFlag == true) {
        $("#oher_offices").slideUp(500);
        $("#list1").show(); $("#backtoOffice").hide(); $("#changeOffice").show();

        $("#backtoOffice").hide();
        $("#changeOffice").show();

        ortherOfficesFlag = false;
    }
}


function staticNav() { 
	var sidenavHeight = $("#list1").height();
	var winHeight = $(window).height();
	var browserIE6 = (navigator.userAgent.indexOf("MSIE 6")>=0) ? true : false;
	
	if (browserIE6) {
		$("#header").css({'position' : 'absolute'});
		$("#menu").css({'position' : 'absolute'});
		$("#supersize").css({'position' : 'absolute'});
		$("#footer").css({ 'position': 'absolute' });
		$("#bottom-hit-area").css({ 'position': 'absolute' });
		$("#top-hit-area").css({ 'position': 'absolute' });
		//$("#next-previous").css({ 'position': 'absolute' });
	} else {
		$("#header").css({'position' : 'fixed'});
		$("#menu").css({'position' : 'fixed'});
		$("#supersize").css({'position' : 'fixed'});
		$("#footer").css({ 'position': 'fixed' });
		$("#bottom-hit-area").css({ 'position': 'fixed' });
		$("#top-hit-area").css({ 'position': 'fixed' });
		//$("#next-previous").css({ 'position': 'fixed' });
	}
	
	/*if (sidenavHeight > winHeight) {
		$("#list1").css({'position' : 'static'});
		$("#footer").css({'position' : 'static'});
	}*/
}




var winW = 0;
var winH = 0;

function getWIndowSize() {

	winW = $(window).width() ;
	winH = $(window).height();

}

function doResize() {
    getWIndowSize();
   
	$('#container').css({'width' : winW-38, 'min-height' : winH});
	$('#content').css({'width' : winW-304});
	$('#menu').css({ 'height': winH - 110 });
	$('#whiteBanner').css({ 'width': winW - 19 });
	$('#header').css({ 'width': winW - 38 });
	

}



$(document).ready(function() {
	
	doResize();
	staticNav();
		
	$(window).resize(function () {							   
		staticNav();
		doResize();
	});

});



/* Video ToolTip */

var tootipflag = false;
var timeOutid = 0;
var onenter = false;

function videoInit() {

    $("div.videoDiv").bind("mouseenter", function() {
        showTooltip( $(this).attr("id").replace("video", "tooltip"));
    }).bind("mousemove", function() {
        _showTooltip($(this).attr("id").replace("video", "tooltip"));
    }).bind("mouseleave", function() {
        hideTooltip($(this).attr("id").replace("video", "tooltip"));
    });


    $("div.tooltipDiv").bind("mouseenter", function() {
        keepTooltip(  $(this).attr("id").replace("video", "tooltip"));
    }).bind("mouseleave", function() {
        releaseTooltip($(this).attr("id").replace("video", "tooltip"));
    });
}

function fadeOut(id) {

    $("#" + id).fadeOut(1000);
    tootipflag = false;
}

function showTooltip(id) {

    if (tootipflag == false) {
        clearTimeout(timeOutid);
        $("#" + id).slideDown(300);
        timeOutid = setTimeout("fadeOut('" + id + "')", 5000);
        tootipflag = true;
        onenter = true
    }
}

function _showTooltip(id) {

    if ((tootipflag == false) && (onenter == true)) {
        clearTimeout(timeOutid);
        $("#" + id).fadeIn(300);
        timeOutid = setTimeout("fadeOut('" + id + "')", 5000);
        tootipflag = true;
    }
}

function hideTooltip(id) {

    $("#" + id).slideUp(300);
    tootipflag = false;
    onenter = false;
}

function keepTooltip(id) {
    clearTimeout(timeOutid);
    $("#" + id).show();
    tootipflag = true;
}

function releaseTooltip(id) {
    timeOutid = setTimeout("fadeOut('" + id + "')", 5000);
    tootipflag = true;
}

