genMap2.prototype.showButtonType = function (flag)
{
	var bDiv = "buttonTypeDiv_" + this.divName ;
	var buttonDiv = document.getElementById(bDiv) ;

		if (flag == true)
		{
			buttonDiv.style.visibility = 'visible' ;
			buttonDiv.style.display = '' ;
		}
		else
		{
			buttonDiv.style.visibility = 'hidden' ;
			buttonDiv.style.display = 'none' ;
		}

}

genMap2.prototype.setButtonLeftPosition = function (n)
{
  //var gmain = document.getElementById("g")
  var x = parseInt(n);
  var bDiv = "buttonTypeDiv_" + this.divName ;
  var buttonDiv = document.getElementById(bDiv);
  buttonDiv.style.left = n + 'px';


 //for ausway div
/*  var cDiv = "mapInfoDiv_" + this.divName ;
  var mapinfoDiv = document.getElementById(cDiv);
  mapinfoDiv.style.left = (n - 220) +  'px';

  var dDiv = "mapInfoDiv1_" + this.divName ;
  var mapinfoDiv1 = document.getElementById(dDiv);
  mapinfoDiv1.style.left = parseInt(mapinfoDiv.style.left) + 1 + 'px';
*/
}

genMap2.prototype.addButtonLeftPosition = function (n)
{
 //for ausway div
  var cDiv = "mapInfoDiv_" + this.divName ;
  var mapinfoDiv = document.getElementById(cDiv);
  mapinfoDiv.style.left = (parseInt(mapinfoDiv.style.left) + n ) + 'px';
  var dDiv = "mapInfoDiv1_" + this.divName ;
  var mapinfoDiv1 = document.getElementById(dDiv);
  mapinfoDiv1.style.left = parseInt(mapinfoDiv.style.left) + 1 + 'px';


}

genMap2.prototype.showhideButtonAusway = function ()
{
	if(document.getElementById("buttonTypeAuswayDiv_" + this.divName)){
		var butAusway = document.getElementById("buttonTypeAuswayDiv_" + this.divName) ;
		var butMap = document.getElementById("buttonTypeMapDiv_" + this.divName) ;

		if (this.ausway == 1)
		{
			if (this.level != 12 && this.level != 13 && this.level != 14)
			{
			  butAusway.style.visibility = 'hidden' ;
			  butAusway.style.display = 'none' ;    

			  butMap.style.visibility = 'hidden' ;
			  butMap.style.display = 'none' ;    
			} else {
			  butAusway.style.visibility = 'visible' ;
			  butAusway.style.display = '' ;    
			  butMap.style.visibility = 'visible' ;
			  butMap.style.display = '' ;    		
			}
		} else {
		  this.flagAusway = 0;
		  butAusway.style.visibility = 'hidden' ;
		  butAusway.style.display = 'none' ;    
		  butMap.style.visibility = 'hidden' ;
		  butMap.style.display = 'none' ;    
		}
	}

}

genMap2.prototype.setButtonType = function ()
{
	var canvasDiv = "canvasDiv_" + this.divName ;
	var bDiv = "buttonTypeDiv_" + this.divName ;
	if (!document.getElementById(bDiv))
	{
		createNewLayer(canvasDiv,bDiv) ;
	}	
	var buttonDiv = document.getElementById(bDiv) ;
	buttonDiv.innerHTML = "" ;
	buttonDiv.style.position = 'absolute' ;		

	// set button position
//	this.setButtonLeftPosition(parseInt(document.getElementById('map-content').style.width) - 375);
	this.setButtonLeftPosition(parseInt(document.getElementById('map-content').style.width) - 85); // awal 85
	buttonDiv.style.top = 5 + 'px' ;
	buttonDiv.style.zIndex = "999999" ;
//	buttonDiv.style.visibility = 'hidden' ;
//	buttonDiv.style.display = 'none';

  /*=================AUSWAY=====================*/
/*	var id = "buttonTypeAuswayDiv_" + this.divName ;
	if (!document.getElementById(id)) 
	{
		createNewLayer(bDiv,id) ;
	}
	var butAusDiv = document.getElementById(id) ;
	butAusDiv.style.position = 'absolute' ;
	butAusDiv.style.top = 0 + 'px' ;
	butAusDiv.style.left = -57 + 'px' ;	
	var img = document.createElement("img") ;
	img.src = imageURL + "images/ausway-rest.gif" ;
	butAusDiv.appendChild (img) ;
	butAusDiv.img = img ;
	butAusDiv.obj = this ;
	if (this.getViewType() != 'ausway')
	{
		butAusDiv.onmouseover = function ()
		{		
			this.img.src = imageURL + "images/ausway-pres.gif" ;
		}
		butAusDiv.onmouseout = function ()
		{
			this.img.src = imageURL + "images/ausway-rest.gif" ;
		}
	}
	butAusDiv.onclick = function ()
	{	
		//get map reference
		ajax_getMapReference();
		this.obj.flagAusway = 1 ;	  
		this.obj.setViewType("ausway") ;
		this.obj.getRowCol() ;
		this.obj.setType() ;
		this.obj.setButtonType() ;
		this.obj.showButtonType(true);	
	}
  
*/
	/*=================MAP=====================*/
/*	var id = "buttonTypeMapDiv_" + this.divName ;
	if (!document.getElementById(id))
	{
		createNewLayer(bDiv,id) ;
	}
	var butMapDiv = document.getElementById(id) ;
	butMapDiv.style.position = 'absolute' ;
	butMapDiv.style.top = 0 + 'px' ;
	butMapDiv.style.left = 0 + 'px' ;	

	var img = document.createElement("img") ;
	img.src = imageURL + "images/map-rest.gif" ;
	butMapDiv.appendChild (img) ;
	butMapDiv.img = img ;
	butMapDiv.obj = this ;
	if (this.getViewType() != 'normal')
	{
		butMapDiv.onmouseover = function ()
		{		
			this.img.src = imageURL + "images/map-pres.gif" ;
		}
		butMapDiv.onmouseout = function ()
		{
			this.img.src = imageURL + "images/map-rest.gif" ;
		}
	}
	butMapDiv.onclick = function ()
	{	  	 	 
	  if(this.obj.level == 12 || this.obj.level == 13 || this.obj.level == 14)
	  {
	   this.obj.flagAusway = 0 ;
	  }
		//get map reference
		hide_auswayMap(); //genmap.mapreference
		this.obj.setViewType("normal") ;
		this.obj.getRowCol() ;
		this.obj.setType() ;
		this.obj.setButtonType() ;
		this.obj.showButtonType(true);
	}
*/
	/*=================Satelite=====================*/
/*	var id = "buttonTypeSateliteDiv_" + this.divName ;
	if (!document.getElementById(id))
	{
		createNewLayer(bDiv,id) ;
	}
	var butSatDiv = document.getElementById(id) ;
	butSatDiv.style.position = 'absolute' ;
	butSatDiv.style.top = 0 + 'px' ;
	butSatDiv.style.left = 76 + 'px' ;
	var img = document.createElement("img") ;
	img.src = imageURL + "images/satelite-rest.gif" ;
	butSatDiv.appendChild (img) ;
	butSatDiv.img = img ;
	butSatDiv.obj = this ;
	if (this.getViewType() != 'satelite')
	{
		butSatDiv.onmouseover = function ()
		{
			this.img.src = imageURL + "images/satelite-pres.gif" ;
		}
		butSatDiv.onmouseout = function ()
		{
			this.img.src = imageURL + "images/satelite-rest.gif" ;
		}
	}
	butSatDiv.onclick = function ()
	{
		if(this.obj.level == 12 || this.obj.level == 13 || this.obj.level == 14)
	  {
	   this.obj.flagAusway = 0 ;
    }
		this.obj.setViewType("satelite") ;
		this.obj.getRowCol() ;
		this.obj.setType() ;
		this.obj.setButtonType() 
    this.obj.showButtonType(true);;
	}
*/
	/*=================HYBRID=====================*/
/*	var id = "buttonTypeHybridDiv_" + this.divName ;
	if (!document.getElementById(id))
	{
		createNewLayer(bDiv,id) ;
	}
	var butHybDiv = document.getElementById(id) ;
	butHybDiv.style.position = 'absolute' ;
	butHybDiv.style.top = 0 + 'px' ;
	butHybDiv.style.left = 152 + 'px' ;
	var img = document.createElement("img") ;
	img.src = imageURL + "images/hybrid-rest.gif" ;
	butHybDiv.appendChild (img) ;
	butHybDiv.img = img ;
	butHybDiv.obj = this ;
	if (this.getViewType() != 'hybrid')
	{
		butHybDiv.onmouseover = function ()
		{
			this.img.src = imageURL + "images/hybrid-pres.gif" ;
		}
		butHybDiv.onmouseout = function ()
		{
			this.img.src = imageURL + "images/hybrid-rest.gif" ;
		}
	}
	butHybDiv.onclick = function ()
	{
	  if(this.obj.level == 12 || this.obj.level == 13 || this.obj.level == 14)
	  {
	   this.obj.flagAusway = 0 ;
    }
		this.obj.setViewType("hybrid") ;
		this.obj.getRowCol() ;
		this.obj.setType() ;
		this.obj.setButtonType() ;
		this.obj.showButtonType(true);
	}
*/	


//this.showhideButtonAusway() ;

	/*=================Streetview=====================*/
/*	var id = "buttonTypeStreetviewDiv_" + this.divName ;
	if (!document.getElementById(id))
	{
		createNewLayer(bDiv,id) ;
	}
	var butsviewDiv = document.getElementById(id) ;
	butsviewDiv.style.position = 'absolute' ;
	butsviewDiv.style.top = 0 + 'px' ;
	butsviewDiv.style.left = -76 + 'px' ;
	var img = document.createElement("img") ;
	img.src = imageURL + "images/streetview-rest.gif" ;
	butsviewDiv.appendChild (img) ;
	butsviewDiv.img = img ;
	butsviewDiv.obj = this ;
	if (this.getViewType() != 'streetview')
	{
		butsviewDiv.onmouseover = function ()
		{
			this.img.src = imageURL + "images/streetview-pres.gif" ;
		}
		butsviewDiv.onmouseout = function ()
		{
			this.img.src = imageURL + "images/streetview-rest.gif" ;
		}
	}
	butsviewDiv.onclick = function ()
	{
		this.obj.setViewType("streetview") ;
		this.obj.getRowCol() ;
		this.obj.setType() ;
		this.obj.setButtonType() ;
		this.obj.showButtonType(true);
	}
*/

	/*=================LAYER CONTROL=====================*/
	var id = "buttonTypeLayersDiv_" + this.divName ;
	if (!document.getElementById(id))
	{
		createNewLayer(bDiv,id) ;
	}
	var butLayDiv = document.getElementById(id) ;
//	butLayDiv.style.visibility = "hidden";
//	var img = document.createElement("img") ;
//	img.src = imageURL + "images/layersControl2.gif" ;
//	img.style.width = 200 + 'px' ;
	butLayDiv.style.position = 'absolute' ;
	butLayDiv.style.top = 0 + 'px' ;
	butLayDiv.style.left = 152 + 'px' ;
//	butLayDiv.img = img ;
	butLayDiv.show = 0 ;
	butLayDiv.obj = this ;
	if(typeof(dataFull)!="undefined") {
	 butLayDiv.obj.showLayers(this.show);  
  }
	butLayDiv.visibility = "hidden";
	butLayDiv.display = "none";

/*	butLayDiv.onclick = function ()
	{
		if (this.show == 0)
		{
			this.img.src = imageURL + "images/layersControl.gif" ;			
			this.show = 1 ;
			this.obj.showLayers(this.show) ;
		}		
		else
		{
			this.img.src = imageURL + "images/layersControl2.gif" ;
			this.show = 0 ;
			this.obj.showLayers(this.show) ;
		}
	}
	butLayDiv.appendChild (img) ;
*/
//	this.setCurrButtonType () ;
}

genMap2.prototype.setCurrButtonType = function ()
{
	var butMapDiv = document.getElementById("buttonTypeMapDiv_" + this.divName) ;
//	var butSatDiv = document.getElementById("buttonTypeSateliteDiv_" + this.divName) ;
//	var butHybDiv = document.getElementById("buttonTypeHybridDiv_" + this.divName) ;		
//	var butSvDiv = document.getElementById("buttonTypeStreetviewDiv_" + this.divName) ;

	butMapDiv.img.src = imageURL + "images/map-rest.gif" ;
//	butSatDiv.img.src = imageURL + "images/satelite-rest.gif" ;
//	butHybDiv.img.src = imageURL + "images/hybrid-rest.gif" ;
	if (document.getElementById("buttonTypeAuswayDiv_" + this.divName))
	{
  	var butAusDiv = document.getElementById("buttonTypeAuswayDiv_" + this.divName) ;
  	butAusDiv.img.src = imageURL + "images/ausway-rest.gif" ;	
  }
//	butSvDiv.img.src = imageURL + "images/streetview-rest.gif" ;

	if (this.getViewType() == "normal")
	{
		butMapDiv.img.src = imageURL + "images/map-pres.gif" ;
	}
/*	else if (this.getViewType() == "satelite")
	{		
		butSatDiv.img.src = imageURL + "images/satelite-pres.gif" ;		
	}
	else if (this.getViewType() == "hybrid")
	{
		butHybDiv.img.src = imageURL + "images/hybrid-pres.gif" ;
	}
*/	else if (this.getViewType() == "ausway")
	{
	  butAusDiv.img.src = imageURL + "images/ausway-pres.gif" ;
  }
//	else if (this.getViewType() == "streetview")
//	{
//		var butSvDiv = document.getElementById("buttonTypeStreetviewDiv_" + this.divName) ;
//		butSvDiv.img.src = imageURL + "images/streetview-pres.gif" ;		
//	}
	//alert (this.getViewType()) ;
}



