﻿/*!
 * Ext JS Library 3.0.0
 * Copyright(c) 2006-2009 Ext JS, LLC
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
/* 
<!> Include mt_functions.js
*/

var MX_BOOK = Ext.extend(Ext.util.Observable, {
    constructor: function(config){
        this.addEvents('finished'); // specify the events we're going to fire
        MX_BOOK.constructor.call(this, config);
    },
	
    create: function(pid, value){
		var lang_info = 'Pré-réserver';
		
		var v = value.split('|||',4);
		if (v[3].length > 0){
			lang_info = v[3];
		}
		
		this.panel = new Ext.Panel({ 
			id: 'mt_detail_mx_book',
			cls: 'mt_detail_mx_book',
			hideLabel: true,
			layout:'form',
			width:'auto',
			mobiClass: 'MX_BOOK',
			items:[{
				xtype: 'button',
				id: 'mt_detail_mx_book_btn',
				cls: 'mt_detail_mx_book_btn',
				text: lang_info,
				handler: function(){
					var pidParam = '&opid='+document.getElementById('mobi-pid').innerHTML; 
					var doParam = '&do='+gup('do');
					var idObjectParam = "&idObject="+v[1];
					mobiRedirect('index.php?id='+v[0]+idObjectParam+doParam+pidParam);
				}
			}]
		});
		
		this.fireEvent('finished', this.panel);
	}	
});