    // map size
    var iWidth;
    var iHeight;
    var ovRatio;
    var ovHeight;
    var ovWidth;
    var sovImage;
    var sMapProcessor;
    var sIDProcessor;
    var sImage;
    // map extent.
    var minx;
    var maxx;
    var maxy;
    var miny;
    var hspc = 0;
	var vspc = 0;
	var finfo = "";

	
    sMapProcessor = document.Variables.MapProcessor.value;
    sIDProcessor = document.Variables.IDProcessor.value;
    ovRatio = document.Variables.OVMapRatio.value;
    ovHeight = document.Variables.OVMapHeight.value;
    ovWidth = document.Variables.OVMapWidth.value;
    sovImage = document.Variables.OVMapSource.value;
    sImage = document.Variables.MapSource.value;
    iWidth = document.Variables.MapWidth.value;
    iHeight = document.Variables.MapHeight.value;
	finfo = document.Variables.LonLat.value;
    parent.vlayerlist = document.Variables.LayersIn.value;
	
    minx = parseFloat(document.Variables.MapExtentMinX.value);
    miny = parseFloat(document.Variables.MapExtentMinY.value);
    maxx = parseFloat(document.Variables.MapExtentMaxX.value);
    maxy = parseFloat(document.Variables.MapExtentMaxY.value);

	if (parent.stWinX != 0) parent.stWinX=iWidth-116;
	
    content = '<img name="theImage" style="cursor: url(../natlas/images/zoomin.cur);" src="'+sImage+'" border="1" hspace=0 vspace=0 border=0 width=' + iWidth + ' height=' + iHeight + '>';
    //content = '<img name="theImage" style="cursor: crosshair;" src="'+sImage+'" border="1" hspace=0 vspace=0 border=0 width=' + iWidth + ' height=' + iHeight + '>';
    
	createLayer("theMap",hspc,vspc,(parseInt(iWidth)+2),(parseInt(iHeight)+2),true,content);
    
    // needed so that pan works
    clipLayer("theMap",0,0,(parseInt(iWidth)+2),(parseInt(iHeight)+2));
    
    //create layer for state list in a layer if browser is ie and the interface requires it
	if ((parent.isIE) && (parent.bgoff == 'F'))
       createLayer("stateListWin",parent.stWinX,149-parent.stWinY,(ovWidth+40),(ovHeight+40),false,parent.listWinStr);

    // overview map
	var ovcontent = 'onmouseover="parent.MapFrame.createToolTips(\'OVWIN\',' + ovWidth + ');" onmouseout="parent.MapFrame.hideLayer(\'TTMSGBox\');"';
    var ovcontent_full = 'onmouseover="parent.MapFrame.createToolTips(\'OVWIN_FULL\',' + ovWidth + ');" onmouseout="parent.MapFrame.hideLayer(\'TTMSGBox\');"';

	if (Math.abs(maxx - minx) >= 10040192)
	  content = '<img name="ovImage"  style="cursor:hand;" src="'+sovImage+'" border=2 width=' + ovWidth + ' height=' + ovHeight + ' ' + ovcontent_full + '>';
 
	else
      content = '<img name="ovImage"  style="cursor:hand;" src="'+sovImage+'" border=2 width=' + ovWidth + ' height=' + ovHeight + ' ' + ovcontent + '>';
   
	if (parent.ovIsVisible)
	   
        createLayer("ovLayer",0,0,(ovWidth+4),(ovHeight+4),true,content);
    else
        createLayer("ovLayer",0,0,(ovWidth+4),(ovHeight+4),false,content);
  /*  content = '<img name="zoomOVImageTop" src="../natlas/images/pixel.gif" width=1 height=1>';
    createLayer("zoomOVBoxTop",0,0,ovWidth+4,ovHeight+4,false,content);
    content = '<img name="zoomOVImageLeft" src="../natlas/images/pixel.gif" width=1 height=1>';
    createLayer("zoomOVBoxLeft",0,0,ovWidth+4,ovHeight+4,false,content);
    content = '<img name="zoomOVImageRight" src="../natlas/images/pixel.gif" width=1 height=1>';
    createLayer("zoomOVBoxRight",0,0,ovWidth+4,ovHeight+4,false,content);
    content = '<img name="zoomOVImageBottom" src="../natlas/images/pixel.gif" width=1 height=1>';
    createLayer("zoomOVBoxBottom",0,0,ovWidth+4,ovHeight+4,false,content);
*/
    // Zoom Box
    content = '<img name="zoomImageTop" src="../natlas/images/transparent.gif" width=1 height=1>';
    createLayer("zoomBoxTop",hspc,vspc,iWidth,iHeight,false,content);
    content = '<img name="zoomImageLeft" src="../natlas/images/transparent.gif" width=1 height=1>';
    createLayer("zoomBoxLeft",hspc,vspc,iWidth,iHeight,false,content);
    content = '<img name="zoomImageRight" src="../natlas/images/transparent.gif" width=1 height=1>';
    createLayer("zoomBoxRight",hspc,vspc,iWidth,iHeight,false,content);
    content = '<img name="zoomImageBottom" src="../natlas/images/transparent.gif" width=1 height=1>';
    createLayer("zoomBoxBottom",hspc,vspc,iWidth,iHeight,false,content);
    
    // zoom box color
    setLayerBackgroundColor("zoomBoxTop", "#ff0000");
    setLayerBackgroundColor("zoomBoxLeft", "#ff0000");
    setLayerBackgroundColor("zoomBoxRight", "#ff0000");
    setLayerBackgroundColor("zoomBoxBottom", "#ff0000");
    
    // set Overview map extent box color
  /*  setLayerBackgroundColor("zoomOVBoxTop", "#ff0000");
    setLayerBackgroundColor("zoomOVBoxLeft", "#ff0000");
    setLayerBackgroundColor("zoomOVBoxRight", "#ff0000");
    setLayerBackgroundColor("zoomOVBoxBottom", "#ff0000");
*/
    // Loading splash 
   content = '<img src="../natlas/images/loading.gif" width="110" height="120">';
   createLayer("loadLayer",hspc+iWidth/2-55,vspc+iHeight/2-60,110,120,false,content);
   moveLayer("loadLayer",hspc+iWidth/2-55,vspc+iHeight/2-60); 


    // Loading feedback window
	if (parent.bgoff == 'T') {
	   // Create a special scalebar layer

   		createScalebarLayer("scalebarLayer",iWidth,iHeight,265,35,true);
   		moveLayer("scalebarLayer",hspc+iWidth-310,vspc+iHeight-35); 
    
    	createTTLayer("TTMSGBox",0,0,200,15,false,'This will be a tool tip');  

		parent.changeStateMsg();
    	content = parent.stateMsg;
    	createLayerWithBorder("feedbackLayer",hspc+iWidth/2-155,vspc+iHeight/2-160,200,45,false,content);
    	moveLayer("feedbackLayer",hspc+iWidth/2-100,vspc+iHeight/2-105); 
		setLayerBackgroundColor("feedbackLayer", "#ffffff");
		//Create a Layer for the Measure Tool
		createLayer("measureBox",1,1,400,30,false,parent.measureWinStr);
		setLayerBackgroundColor("measureBox", "#AAAAAA");  
	}
    // glass layer for mouse click handling
    content = '<img name="pixel" src="../natlas/images/transparent.gif" width=1 height=1>';
    createLayer("theTop",hspc,vspc,iWidth,iHeight,true,content);

	if (parent.bgoff == 'F')
		makeScaleBar(minx,maxx,iWidth);
	

