﻿// JScript File
//alert();
/*
if (isIE && ieVersion < 7){
    var elm1 = document.getElementById("Panel_Resources");
    if(elm1!= null){ //alert("ll");
      //  elm1.style.cssText = "WIDTH: 810px; HEIGHT: 700px; BACKGROUND-COLOR: black";
        alert(elm1.id);
    }else{
        alert("map1 not exit");
    } 
}else{
    alert(here);
}
*/

// setup test for browser
var isNav = (window.navigator.appName.toLowerCase().indexOf("netscape")>=0);
var isIE = (window.navigator.appName.toLowerCase().indexOf("microsoft")>=0);
var userAgent = navigator.userAgent;
var navType = "IE";
var nav70 = false;
var nav8 = false;
var isNav4 = false;

// get flavor of mozilla/netscape
if (isNav) {
	// test for Netscape 7.0 because of a CSS rendering quirk
	if (parseFloat(navigator.appVersion)<5) {
		isNav4=true;
	}
	nav70 = (userAgent.indexOf("Netscape/7.0")!=-1);
	if (userAgent.indexOf("FireFox")!=-1) {
		navType = "FireFox";
	} else if (userAgent.indexOf("Opera")!=-1) {
		navType = "Opera";
	} else if (userAgent.indexOf("Safari")!=-1) {
		navType = "Safari";
	} else if (userAgent.indexOf("Netscape")!=-1) {
		navType = "Netscape";
		nav8 = (userAgent.indexOf("Netscape/8")!=-1);
	} else {
		navType = "Mozilla";
	}
}
// if IE, check for major versions
if (isIE) {
    var verPos = userAgent.indexOf("MSIE ");
    verPos +=5;
    var ieVersion = parseInt(userAgent.substring(verPos));
    if (isNaN(ieVersion)) ieVersion = 6; // default to 6; 
}



var IE6MapWidth;
var IE6MapHeight;
var IE6NavWidth;
var IE6NavHeight;
var IE6CopyRightWidth;
var IE6CopyRightTop;
var IE6ScalebarWidth;
var IE6ScalebarTop;
var IE6RightPanelLeft;
var IE6RightPanelHeight;
var isSmallScreen = false;

//if (isIE && ieVersion < 7){
    window.moveTo(0,0)
    window.resizeTo(screen.width,screen.height-30)
//}

function getPageOffsetWidth(){
    var MenuBodyRef;
    for(var i in document.all)
    {
        if (document.all[i].tagName == 'BODY')
        {
            MenuBodyRef = document.all[i]
        }
    }
    return MenuBodyRef.offsetWidth;
}
function MaximizeW(){
    window.moveTo(0,0);
    window.resizeTo(screen.width,screen.height);
    var borderw = screen.width - getPageOffsetWidth();
    window.moveTo(-borderw/2, -borderw/2);
    window.resizeTo(screen.width + borderw,screen.height + borderw);
}
//MaximizeW();
addjustIE6Div();

function addjustIE6Div(){
    IE6MapWidth = document.documentElement.clientWidth - 130 - 340 - 10; //10 is scroll width
    IE6MapHeight = document.documentElement.clientHeight- 61 -50 - 10;  
    if(IE6MapWidth < 620){
        IE6MapWidth = 620;
        isSmallScreen = true;
    } 
    if(IE6MapHeight < 420){
        IE6MapHeight = 420;
    } 
    IE6NavWidth = IE6MapWidth + 20;
    IE6NavHeight = IE6MapHeight + 20;
    IE6CopyRightWidth = IE6MapWidth + 20;
    IE6CopyRightTop = IE6MapHeight + 65;
    IE6ScalebarWidth = IE6MapWidth + 20;
    IE6ScalebarTop = IE6MapHeight + 80;
    IE6RightPanelLeft = IE6MapWidth + 150;
    IE6RightPanelHeight = IE6MapHeight;
}
