/**
 * ViewWorldLocation
 */
var ViewWorldLocation = Class.create({
  /**
   * Init ViewWorldLocation
   */	
  initialize: function() {
	this.options = Object.extend({
	  elemContent : null,
	  nPos        : 0
	}, arguments[0] || { });		
	
	var elemDot = this.options.elemContent.down('.dot');
    this.contentDotFade = new EggFade({elemContent:elemDot});
    var elemTitle = this.options.elemContent.down('.title');
    this.contentTitleFade = new EggFade({elemContent:elemTitle});
    
    elemDot.observe('click', this.onClick.bind(this));
    elemDot.observe('mouseover', this.onOverDot.bind(this));				    
    
    var elemTitleHref = elemTitle.down('a');
    elemTitleHref.observe('click', this.onClick.bind(this));
  },

  show: function() {
	this.contentDotFade.show();
	this.contentTitleFade.show();
  },

  hide: function() {
	this.contentDotFade.hide();
	this.contentTitleFade.hide();
  },
   
  onOverDot: function(evt) {
    evt.element().setStyle({cursor:"pointer"});
  },
  
  onClick: function(evt) {
    // fire event
    this.options.elemContent.fire("viewworldlocation:click", { nPos: this.options.nPos, strName: this.options.elemContent.getAttribute('datafld') });	  
  }
  
});
