/****************************************************
 * Copyright 2008 mipang.com
 * JS Functions for store 
 * require: /js/fb/base.js
 ****************************************************/


function items_store(store_id)
{
    this.__name__ = 'items_store';
    this.store_id = store_id || null;
    this._uid = gen_unique();
}

items_store.prototype.set_store=function(store_id)
{
    this.store_id = store_id;
    return this;
};
items_store.prototype.set_onDone=function(onDone)
{
    this.onDone = onDone || function(){};
    return this;
};

function items_store_people(store_id)
{
    this.parent.construct(this,store_id);
}
items_store_people.class_extend(items_store);

items_store_people.prototype.set_flag=function(flag)
{
    if(flag == 'went')
	this.show_went_dialog();
    
    return this;
};

items_store_people.prototype.show_went_dialog=function()
{
    var uid = this._uid;

    var onfailjs='(function(){generic_dialog.get_dialog(ge("fa-l-'+uid+'")).hide();})();';

    var html = '<div style="color:#000;" id="fa-l-'+uid+'">加载数据...</div>';

    this._set_flag_window_obj = new pop_dialog('share_store_dialog')
    .show_choice_ajax_custom_loader(
				    html,
				    '分享餐馆&nbsp;',
				    '/items/ajax/store.ue?method=Store.People.PrepareWentInfo'
				    +'&store_id='+UrlEncode(this.store_id)
				    +'&shield=1&ot='+UrlEncode('json+html')+'&uid='+uid
				    +'&onFail='+UrlEncode(onfailjs),
				    '&nbsp;确 定&nbsp;',
				    function(){
					eval('buttonjs_'+this._uid+'()');
				    }.bind(this),
				    '&nbsp;取 消&nbsp;',
				    function(){
					generic_dialog.get_dialog(this).hide();
				    }
				    );
    this._set_flag_window_obj.items_store = this;

    return this;
};

