/**
 * ViewWorldLocationDialog
 */
var ViewWorldLocationDialog = Class.create({
  /**
   * Init ViewWorldLocationDialog
   */
  initialize: function() {
	this.options = Object.extend({
	  elemContent : null
	}, arguments[0] || { });		
	
	this.fade = new EggFade({elemContent:this.options.elemContent});
	this.fadeClose = new EggFade({elemContent:this.options.elemContent.down('.contenttext')});	
  },

  show: function(strLocation) {
	// look for location
    var elemItems = this.options.elemContent.select('.item');
	for (var nLocation=0; nLocation < elemItems.length; nLocation++) {
	  if (strLocation == elemItems[nLocation].getAttribute('datafld')) {
		// found
		break;
	  }
	}
    var elemItem = this.options.elemContent.down('.item', nLocation);
	  
	this.fadeText = new EggFade({elemContent:elemItem.down('.itemtext')});
    this.elemImage = elemItem.down('.image');
    this.image = new EggImage(this.elemImage);
    this.image.load();        	

	this.fade.show();
	this.fadeClose.show();
	this.fadeText.show();
	this.image.show();
  },
  
  hide: function() {
	this.fade.hide();
	this.fadeClose.hide();
	this.fadeText.hide();
	this.image.hide();
  }

});

