﻿// JScript 파일

function openImage(imgno)
{
  var width = 600;
  var height = 600;
  
  if (imgno == "01")
  {
    width = 730;
    height = 488;
  }
  else if (imgno == "02")
  {
    width = 730;
    height = 488;
  }
  else if (imgno == "03")
  {
    width = 480;
    height = 480;
  }
  else if (imgno == "04")
  {
    width = 613;
    height = 829;
  }
  else if (imgno == "05")
  {
    width = 560;
    height = 715;
  }
  else if (imgno == "06")
  {
    width = 560;
    height = 715;
  }
  else if (imgno == "07")
  {
    width = 560;
    height = 715;
  }
  else if (imgno == "08")
  {
    width = 560;
    height = 715;
  }
  else if (imgno == "09")
  {
    width = 560;
    height = 715;
  }
  else if (imgno == "10")
  {
    width = 560;
    height = 715;
  }
  
  width = width + 20;
  height =  height + 30;
  
  newwins = window.open("/viewImage.aspx?CODE=" + imgno,"viewImage","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height);
	newwins.focus();
}

function load() {
		if (GBrowserIsCompatible()) {        
			var map = new GMap2(document.getElementById("map"));
			map.addControl(new GSmallMapControl());
			map.addControl(new GMapTypeControl());
			var geocoder = new GClientGeocoder();
			var pcode = 'M8X 1C1';
			var address = '2981 Bloor St. West.<br />Etobicoke, ON';

			//if there is poing
			var tmppoint1 = '';
			var tmppoint2 = '';
			
			if (tmppoint1 != '' && tmppoint2 != '')
			{
				var point2 = new GLatLng(tmppoint1, tmppoint2);
				
				map.setCenter(point2, 15);          
				var marker = new GMarker(point2);
						
				//add marker
				map.addOverlay(marker);
				
				
				//when click market detail window show
				GEvent.addListener(
					marker, 
					"click", 
					function() { 
						marker.openInfoWindowHtml("<div style='font-family:verdana; font-size:13px; color:#666666; padding:7px; padding-left:16px;'>" + address + "</div>");  
					}
				 );
			}
			else
			{        
				geocoder.getLatLng(
					pcode,
					function(point) {
					if (!point) {
						alert(address + " not found");
					} else {
						map.setCenter(point, 15);
						var marker = new GMarker(point);
						
						//add marker
						map.addOverlay(marker);
						
						
						//when click market detail window show
						GEvent.addListener(
							marker, 
							"click", 
							function() { 
								marker.openInfoWindowHtml("<div style='font-family:verdana; font-size:13px; color:#666666; padding-top:10px; padding-left:20px; text-align:left;'>" + address + "</div>");  
							}
						 );
						
						//marker.openInfoWindowHtml("<div style='font-family:verdana; font-size:13px; color:#666666; padding-top:10px; padding-left:20px;'>" + address + "</div>");
					}
				});
			 }
		}
	}