	function ZeroMapImage(ZeroMap)
	{
		this.grid_size_x = new Array(19);
		this.grid_size_x[0] = 2561; 
        this.grid_size_x[1] = 1281; 
        this.grid_size_x[2] = 641; 
        this.grid_size_x[3] = 481; 
        this.grid_size_x[4] = 385; 
        this.grid_size_x[5] = 321; 
        this.grid_size_x[6] = 247; 
        this.grid_size_x[7] = 161; 
        this.grid_size_x[8] = 129; 
        this.grid_size_x[9] = 65; 
        this.grid_size_x[10] = 43; 
        this.grid_size_x[11] = 33; 
        this.grid_size_x[12] = 25; 
        this.grid_size_x[13] = 17; 
        this.grid_size_x[14] = 13; 
        this.grid_size_x[15] = 15; 
        this.grid_size_x[16] = 13; 
        this.grid_size_x[17] = 7; 
        this.grid_size_x[18] = 2; 
	    
		this.m_ZeroMap = ZeroMap;
	    this.m_aImage = new Array();
	    this.m_aImageDisplay = new Array();
	};
	
	ZeroMapImage.prototype.ImageError = function()
	{
		var strSrc = g_strResource + "error.png";
		this.src = strSrc;
	};
	
	ZeroMapImage.prototype.Draw = function(ptStartGrid , ptEndGrid , ptStart)
	{
		var fMapZoom = this.m_ZeroMap.m_fMapZoom;
		var nImageSizeX = GetImageSizeX(fMapZoom);
		var nImageSizeY = GetImageSizeY(fMapZoom);
			
		var yc = 0; var xc = 0;
		var ZeroMap = this.m_ZeroMap;
		var nSacel = ZeroMap.m_nMapScale;
		
		while(this.m_aImageDisplay.length)
		{
			var obj = this.m_aImageDisplay.pop();
			ZeroMap.m_dBack.removeChild(obj);
		}
		
		if(fMapZoom == 1.0)
		{
			for(var y = ptEndGrid.y ; y <= ptStartGrid.y ; y++)
			{
				for(var x = ptStartGrid.x ; x <= ptEndGrid.x ; x++)
				{
					var strTileName = nSacel + "_" + x + "_" + y;
					var obj = this.m_aImage[strTileName];
															
					var nLeft = (ptStart.x + (xc * nImageSizeX));
					var nTop  = (ptStart.y - (yc * nImageSizeY));
					
					if(!obj)
					{
						var nGridFolder = (this.grid_size_x[nSacel] * y) + x;
						var strFolderName = Math.floor(nGridFolder / 5000);
						var strSRC = g_strResource + nSacel + "/" + strFolderName + "/g_" + nSacel  + "_"  + x + "_" + y + ".png";
						//var strSRC = "\\\\cid2\\d$\\MapImage\\" + nSacel + "\\" + strFolderName + "\\g_" + nSacel  + "_"  + x + "_" + y + ".png";
						
						/*obj = new Image();
						obj.onload = function()
						{
			        		this.div.appendChild(this);
						}
						
						obj.src = strSRC;	
		                obj.style.position = "absolute";
		                obj.style.left = nLeft;
		                obj.style.top = nTop;
		                obj.style.width = nImageSizeX; 
		                obj.style.height = nImageSizeY; 
		                
						this.m_aImage[strTileName] = obj;
						obj.div = ZeroMap.m_dBack;*/
										    				
						
						
						obj = CreateImage(ZeroMap.m_dBack , strSRC , nLeft , nTop , nImageSizeX , nImageSizeY);
						obj.setAttribute("id", strTileName);
						//obj.onerror = this.ImageError;
						this.m_aImage[strTileName] = obj;
					}
					else
					{
						obj.style.left = nLeft;
						obj.style.top = nTop;
						
						obj.style.width = nImageSizeX;
						obj.style.height = nImageSizeY;
						ZeroMap.m_dBack.appendChild(obj);
					}
					this.m_aImageDisplay.push(obj);
					
					
					xc++;
				}
				xc = 0;
				yc++;
			}
		}
		else
		{
			for(var y = ptEndGrid.y ; y <= ptStartGrid.y ; y++)
			{
				for(var x = ptStartGrid.x ; x <= ptEndGrid.x ; x++)
				{
					var strTileName = ZeroMap.m_nMapScale + "_" + x + "_" + y;
					var obj = this.m_aImage[strTileName];

					if(obj != null)
					{
						obj.style.left = (ptStart.x + (xc * nImageSizeX)) + "px";
						obj.style.top = (ptStart.y - (yc * nImageSizeY)) + "px";
						obj.style.width = nImageSizeX;
						obj.style.height = nImageSizeY;
						
						ZeroMap.m_dBack.appendChild(obj);
						this.m_aImageDisplay.push(obj);
					}
					xc++;
				}
				xc = 0;
				yc++;
			}
		}
	};