/**
 * Klasa dla okienka wyskakującego
 */
var PopupWindow = 
{
  
  /**
   * Konstruktor
   */
  initialize: function(div_id, _title, _link) 
  {
  },
  
  /**
   * Funkcja uruchamia playera
   *
   * @param string {url} - url do pliku
   */  
  play: function() 
  {
  },
  
  close: function()
  {
	  if(this.obContent)
	  {
		 if($(this.obContent))
			 //$(this.obContent).css('visibility', 'hidden');
			 $(this.obContent).hide();
	  }
	  return false;
  },
  
  /**
   * Konstruktor - 
   */
  dialog: function(div_id, _title, _url) 
  {
	  this.title = _title;
	  this.url = _url;
	  this.obContent = document.getElementById(div_id);
	  this.pageSize = Logishop.pageSize();
		
		if(!this.obContent)
		{
			this.dialog_active = false;
			this.obContent = document.createElement("div");
			this.obContent.setAttribute('id',div_id);  

			var obBody = document.getElementsByTagName("body").item(0);

			this.obContent.style.visibility = 'hidden';
			this.obContent.style.className = '';
			obBody.insertBefore(this.obContent, obBody.firstChild);
		}
		win_center = Logishop.winSize();
		pg_offset = Logishop.scrollSize();
		$(this.obContent).css('left', (win_center[0]/2-195+pg_offset[0]-140)+'px');
		$(this.obContent).css('top', (win_center[1]/2-200+pg_offset[1])+'px');
		
		//$(this.obContent).html('<img src="/images/indicator.gif" alt="" />');
		$(this.obContent).load(this.url, {}, function() {
			this.obContent = document.getElementById(div_id);
			Logishop.hideIndicator();			
   		 	$(this.obContent).css('visibility', 'visible');
   		 	$(this.obContent).css('display', 'block');
   		 	$(this.obContent).show();
	        this.dialog_active = true;
	        return false;
		});

	  //$(this.obContent).bind('dialogbeforeclose', function() { });
		
  }


	  
  
} // end PopupWindow

