// gbParam.js
// javascript file with parameters specific to calling page


//*********************************************************************
//*			parameters set by Designer			                     *
//*********************************************************************
var imsURL = window.hostURL + "scripts/esrimap.dll";
var printForm ="Print2A4.asp"; //"Print2Scale.asp";
//var imsURL = "http://web.gis.zh.ch/scripts/esrimap.dll"; //top.hostURL + "scripts/esrimap.dll";
//alert(imsURL);

// variables for setting component colors
var mapBackColor = '225,225,225';
var ovBoxSize = 3;
var hasOVMap=false;
var canQuery=true;
var zoomBoxColor = '#ff0000';

// variables for using individual components
var hasInfoWindow = false;
var hasTOC = true;
var useModeFrame = true;

//maximum map extent
var limitLeft = 668000;
var limitRight = 718000;
var limitTop = 284000;
var limitBottom = 224000;
//Banner
var bannerWidth = 150;
var bannerHeight =25;
//Web site path
var formFilePath = "";
var usePan=true;
var usePanNorth=false;
var usePanWest=false;
var usePanEast=false;
var usePanSouth=false;
var useZoomIn=true;
var useZoomOut=true;
var useFullExtent=false;
var useZoomActive=false;
var useZoomLast=false;
var useIdentify=true;
var useMeasure=true;
var useArea=true;
var useDBLink=true;
var useSetUnits=false;
var useSelect=false;
var useQuery=false;
var useFind=false;
var useGeocode=false;
var useStoredQuery=false;
var useClearSelect=false;
var usePrint=true;
var useBuffer=false;
var useExtract=false;
var useShowTOC=true;
var useShowLegend=true;
var useRefresh=true;

var MapUnits = "Meters";
var ScaleBarUnits="m";
var numDecimals=2;
var panFactor=0.8;


// End of Designer set parameters


/**************************************
* Basic Map parameters
**************************************/

// variables for map pixel offset from upper left corner of frame
	// horizontal offset
var hspc = 0;
	// vertical offset
var vspc = 0;

//zoom factors for v.3
var zoomFactor = 2;

// display coords in status line
var showXYs=true;

// setup test for Nav 4.0
var isNav4 = false;
var isNav5up = false;
var isNav = false;
var isIE = false;
var isSaf = false;
if (navigator.appName == "Netscape") {
	isNav =true;
	if (navigator.appVersion.search("5.0") == -1)
   		isNav4 = true;
	else isNav5up = true;
	if (navigator.userAgent.indexOf("Safari")>0){
		isSaf = true;
	}
}else{
	isIE = true;
}

		
/**************************************
* Extended Map parameters
**************************************/

// variables for using individual components
var useTextFrame=true;
// use external window for dialogs
var useExternalWindow=false;



// the starting point. . . it all starts here on loading
function checkParams(toolon) {
	appDir = getPath(document.location.pathname);

	debugOn = 0;
	if (parent.TextFrame==null) {
		useTextFrame = false;
		useExternalWindow=true;
	}
	if (!hasLayer("measureBox")) useMeasure = false;
	if (parent.TOCFrame==null) hasTOC = false;
	if (parent.ModeFrame==null) useModeFrame = false;

	//if (!document.layers)	{
	//	if (hasLayer("theTop")) document.all.theTop.style.cursor = "crosshair";
	//}

	
	if (gbNavigationPresent) {
		// Set up event capture for mouse movement
		if (isNav4) {
			document.captureEvents(Event.MOUSEMOVE);
			document.captureEvents(Event.MOUSEDOWN);
			document.captureEvents(Event.MOUSEUP);
			document.captureEvents(Event.DBLCLICK);
		}
		document.onmousemove = getMouse;
		document.onmousedown = mapTool;
		document.onmouseup = chkMouseUp;
		document.ondblclick = chkDblClick;

	} else {
		usePan=false;
		usePanNorth=false;
		usePanWest=false;
		usePanEast=false;
		usePanSouth=false;
		useMeasure=false;
		useZoomIn=false;
		useZoomOut=false
	}
	
	if ((gbTalkPresent) && (gbMapPresent)) {
		if (gbClickPresent) clickFunction("zoomin");
        var app=parent.TitleFrame.document.location.search;
		if (parent.ToolFrame!=null) {
            parent.ToolFrame.document.location="toolbar.asp?toolon=" + toolon + "&" + app.substring(1,app.length);
		    startUp();
        }
	} else {
		alert("Fehler");
	}
}

