YAHOO.ext.SSL_SECURE_URL = 'https://kotisivukone.fi/www/pics/blank.htm';

var StorePopup = Class.create();
StorePopup.prototype = {
  dialog: null,
  showBtn: null,
  functionName: null,
  btnElem: null,
  dialogElem: null,
  showStandardBuyTab: null,

  initialize: function(functionName, showStandardBuyTab) {
    this.functionName = functionName;
    this.btnElem = functionName + "_popup_btn";
    this.dialogElem = functionName + "_popup";
    this.showStandardBuyTab = showStandardBuyTab;
  },

  init: function() {
    this.showBtn = getEl(this.btnElem);
  },

  viewBuyTab: function() {
    this.dialog.getTabs().activate(this.functionName + "_buytab");
  },

  showDialog: function() {
    if(!this.dialog){
      this.dialog = new YAHOO.ext.BasicDialog(this.dialogElem, {
                                                                 resizable:false,
                                                                 autoTabs:true,
                                                                 width:520,
                                                                 height:430,
                                                                 shadow:false,
                                                                 minWidth:300,
                                                                 minHeight:250,
                                                                 proxyDrag: false
                                                                });
      this.dialog.addKeyListener(27, this.dialog.hide, this.dialog);
      this.dialog.addButton(closeButtonLabel, this.dialog.hide, this.dialog);

      /*if (this.showStandardBuyTab == true) {
        var buytab = this.dialog.getTabs().addTab(this.functionName + "_buytab", orderTabLabel);
        buytab.setUrl(ajaxUrl + "?resource=functionstore&action=" + this.functionName, null, true);
      }*/
    }
    this.dialog.show(this.showBtn.dom);
    this.dialog.toFront();
    return false;
  }
};
