
/*******************************************************************************************
// Zoom In Controls
*******************************************************************************************/
var mapSize;
var mapObject;

// == Create a Custom GControl ==
function zoomInControl(tempMapSize, tempMapObject) 
{ 
	mapSize = tempMapSize;
	mapObject = tempMapObject;
}

zoomInControl.prototype = new GControl();

// == This gets called bu the API when addControl(new YSlider()) is used ==
zoomInControl.prototype.initialize = function(mapObject)
{
	// obtain Function Closure on a reference to "this"
	var that = this;
	
	// store a reference to the map so that we can call setZoom() on it
	this.mapObject = mapObject;

	// Is this MSIE, if so we need to use AlphaImageLoader
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)){this.ie = true} else {this.ie = false}

	// create the background graphic as a <div> containing an image
	var container = document.createElement("div");
	container.style.width="22px";
	container.style.height="22px";

	// Handle transparent PNG files in MSIE
	if (this.ie)
	{
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://www.northwestidx.com/images/map/slider_plus.png', sizingMethod='scale');";
		container.innerHTML = '<a href="javascript:void(0);" onClick="clickZoomIn();" title="Zoom In" style="height:22px;width:22px;"><div style="height:22px;width:22px;' +loader+ ' "></div></a>';
	}
	else
	{
		var tempInnerHTML = '<a href="javascript:void(0);" onClick="clickZoomIn();" title="Zoom In">' 
					+ '<img src="http://www.northwestidx.com/images/map/slider_plus.png" width=22 height=22 border="0"/></a>';
		container.innerHTML = tempInnerHTML;
	}

	// attach the control to the map
	mapObject.getContainer().appendChild(container);

	return container;
}

// == Set the default position for the control ==
zoomInControl.prototype.getDefaultPosition = function()
{
	if(mapSize == "small")
	{	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(8, 5));	}
	else if(mapSize == "large")
	{	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(8, 5));	}
	else
	{	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(12, 40));	}
}

/*******************************************************************************************
// Zoom Out Controls
*******************************************************************************************/

// == Create a Custom GControl ==
function zoomOutControl() { }

zoomOutControl.prototype = new GControl();

// == This gets called bu the API when addControl(new YSlider()) is used ==
zoomOutControl.prototype.initialize = function(mapObject)
{
	// obtain Function Closure on a reference to "this"
	var that = this;
	// store a reference to the map so that we can call setZoom() on it
	this.mapObject = mapObject;

	// Is this MSIE, if so we need to use AlphaImageLoader
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)){this.ie = true} else {this.ie = false}

	// create the background graphic as a <div> containing an image
	var container = document.createElement("div");
	container.style.width="22px";
	container.style.height="22px";

	// Handle transparent PNG files in MSIE
	if (this.ie)
	{
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://www.northwestidx.com/images/map/slider_minus.png', sizingMethod='scale');";
		container.innerHTML = '<a href="javascript:void(0);" onClick="clickZoomOut();" title="Zoom Out"><div style="height:22px; width:22px; ' +loader+ '" ></div></a>';
	}
	else
	{
		var tempInnerHTML = '<a href="javascript:void(0);" onClick="clickZoomOut();" title="Zoom Out"><img src="http://www.northwestidx.com/images/map/slider_minus.png" width=22 height=22 border="0"/></a>';
		container.innerHTML = tempInnerHTML;
	}

	// attach the control to the map
	mapObject.getContainer().appendChild(container);

	return container;
}

// == Set the default position for the control ==
zoomOutControl.prototype.getDefaultPosition = function()
{
	if(mapSize == "small")
	{	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(8, 26));	}
	else if(mapSize == "large")
	{	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(8, 191));	}
	else
	{	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(12, 226));	}
}

/**
 *
 * @access public
 * @return void
 **/
function clickZoomIn()
{	mapObject.zoomIn();	}

/**
 *
 * @access public
 * @return void
 **/
function clickZoomOut()
{	mapObject.zoomOut();	}
