if (typeof (jiyiri) == 'undefined') {
	var jiyiri = {};
	jiyiri.Version = 0.1;
	jiyiri.RequiredFiles = [];
	( function() {
		/* Codes Start Here */
		jiyiri.init = function() {
			/* Check if prototype is successful loaded */
			if ('undefined' == typeof (Prototype)) {
				throw new Error('You Need Prototype Loaded first!');
			}
		};

		jiyiri.register_namespace = function(fullNS) {

			var nsArray = fullNS.split('.');
			var sEval = "";
			var sNS = "";
			for ( var i = 0; i < nsArray.length; i++) {
				if (i != 0)
					sNS += ".";
				sNS += nsArray[i];
				sEval += "if (typeof(" + sNS + ") == 'undefined') " + sNS
						+ " = new Object();";
			}
			if (sEval != "")
				eval(sEval);
		};

		jiyiri.require_css = function(path)
		{
			document.write('<link href="'+path+'" rel="stylesheet" />');
		}
		jiyiri.require_file = function(file_name) {
			document.write('<script type="text/javascript" src="' + file_name + '"><\/script>');
		};

		jiyiri.require = function(class_name) {
			libraryName = this._parse_class_file_by_name(class_name);
			jiyiri.require_file(libraryName);
			/* 记录已经required的文件 */
			jiyiri.RequiredFiles.push(class_name);
		};

		jiyiri.require_once = function(class_name) {
			libraryName = this._parse_class_file_by_name(class_name);

			var found = false;
			
			var requiredfiles = jiyiri.RequiredFiles;
			for ( var i = 0 ; i < requiredfiles.length ; i++ ){
				if( requiredfiles[i] == class_name ){
					found = true;
					break;
				}
			}
			
//			var scripts = document.getElementsByTagName("script");
//			for ( var i = 0; i < scripts.length; i++) {
//				if (scripts[i].src == libraryName) {
//					found = true;
//					break;
//				}
//			}

			if (!found) {
				jiyiri.require(class_name);
			}
		};

		jiyiri._parse_class_file_by_name = function(class_name) {

			var scripts = document.getElementsByTagName("script");
			var path = __JSLIB_PATH__;
//			var path = '';
//			for ( var i = 0; i < scripts.length; i++) {
//				if (scripts[i].src.match(/jiyiri\/base\.js(\?.*)?$/)) {
//					path = scripts[i].src.replace(/jiyiri\/base\.js(\?.*)?$/,
//							'');
//					break;
//				}
//			}

			var rst_name = '';
			
			name_array = class_name.split('.');
			rst_name = name_array.join('/');
			rst_name = rst_name + '.js';
			rst_name = rst_name.toLowerCase();
			rst_name = path + rst_name;
			return rst_name;
		};
		/* Codes End Here */
	})();

	jiyiri.init();
	
	var __APP__ = '/index.php';
	var __PUBLIC__ = '/Public';
	
	var ProductType = {
		Card : 1,
		Promo: 2
	};
}
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/data/reminder/categorydatamanager.js -----*/jiyiri.register_namespace('jiyiri.data.reminder');
/* jiyiri.require_once('jiyiri.helper.net.ajax'); */
/* jiyiri.require_once('jiyiri.helper.json.json'); */

( function() {

	/* Codes Start Here */

	var BirthdayCategoryDataManager = Class.create();
	BirthdayCategoryDataManager._instance = null;
	BirthdayCategoryDataManager.GetInstance = function() {
		if (BirthdayCategoryDataManager._instance == null) {
			BirthdayCategoryDataManager._instance = new BirthdayCategoryDataManager();
		}
		return BirthdayCategoryDataManager._instance;
	};
	BirthdayCategoryDataManager.prototype = {
		initialize : function() {
			this._categories = null;
		},
		load_categories : function(callback) {
			jiyiri.helper.net.Ajax.post_tp('Reminder', 'LoadBirthdayCategories', new jiyiri.helper.net.Parameter(),
					callback_wrapper);

			function callback_wrapper(response) {
				var categories = jiyiri.helper.json.JSON.parse(response.responseText);
				if(categories)
				{
					BirthdayCategoryDataManager.GetInstance().set_categories(categories);
				}
				else
				{
					throw new Error('load birthday category data failed');
				}
				callback();
			}
		},
		has_data:function()
		{
			return (null!==this._categories);
		},
		set_categories:function(categories)
		{
			this._categories = categories;
		},
		get_categories:function()
		{
			return this._categories;
		},
		/**
		 * 获取系统分类的所有父级分类
		 *
		 * @return ReminderCategoryInfo[]
		 */
		get_all_parent_categories:function()
		{
			if(!this.has_data()){throw new Error('No birthday category data loaded.');return}
			var rtn = new Array();
			var categories = this.get_categories();
			for ( var i = 0; i < categories.length; i++) {
				rtn.push(categories[i][0]);
			}
			return rtn;

		},
		get_system_parent_categories:function()
		{
			if(!this.has_data()){throw new Error('No birthday category data loaded.');return}

			var rtn = new Array();
			var categories = this.get_all_parent_categories();
			for ( var i = 0; i < categories.length; i++) {
				if (categories[i].IsSystem == true) {
					rtn.push(categories[i]);
				}
			}
			return rtn;
		},
		/**
		 * 根据父级分类的Id获取其所有子分类
		 *
		 * @return ReminderCategoryInfo[]
		 */
		get_system_child_category_by_parent_id:function(category_id)
		{
			if(!this.has_data()){throw new Error('No birthday category data loaded.');return}
			var categories = this.get_categories();
			var rtn = new Array();

			for ( var i = 0; i < categories.length; i++) {
				for ( var j = 0; j < categories[i].length; j++) {
					if (categories[i][j].ParentId == category_id) {
						rtn.push(categories[i][j]);
					}
				}
			}

			return rtn;
		},
		/**
		 * 获取用户的所有自定义分类
		 *
		 * @return ReminderCategoryInfo[]
		 */
		get_user_categories:function()
		{
			if(!this.has_data()){throw new Error('No birthday category data loaded.');return}

			var rtn = new Array();
			var categories = this.get_all_parent_categories();
			for ( var i = 0; i < categories.length; i++) {
				if (categories[i].IsSystem == false) {
					rtn.push(categories[i]);
				}
			}
			return rtn;
		},
		/**
		 * 根据一个分类Id获取其信息
		 *
		 * @return ReminderCategoryInfo
		 */
		get_category_info_by_id:function(category_id)
		{
			if(!this.has_data()){throw new Error('No birthday category data loaded.');return}

			var categories = this.get_categories();
			var rtn = null;

			for ( var i = 0; i < categories.length; i++) {
				for ( var j = 0; j < categories[i].length; j++) {
					if (categories[i][j].Id == category_id) {
						rtn = (categories[i][j]);
					}
				}
			}
			return rtn;
		}

	};

	var CommemoCategoryDataManager = Class.create();
	CommemoCategoryDataManager._instance = null;
	CommemoCategoryDataManager.GetInstance = function() {
		if (CommemoCategoryDataManager._instance == null) {
			CommemoCategoryDataManager._instance = new CommemoCategoryDataManager();
		}
		return CommemoCategoryDataManager._instance;
	};
	CommemoCategoryDataManager.prototype = {
		initialize : function() {
			this._categories = null;
		},
		load_categories : function(callback) {
			jiyiri.helper.net.Ajax.post_tp('Reminder', 'LoadCommemoCategories', new jiyiri.helper.net.Parameter(),
					callback_wrapper);

			function callback_wrapper(response) {
				var categories = jiyiri.helper.json.JSON.parse(response.responseText);
				if(categories)
				{
					CommemoCategoryDataManager.GetInstance().set_categories(categories);
				}
				else
				{
					throw new Error('load commemo category data failed');
				}

				callback();
			}
		},
		has_data:function()
		{
			return (null!==this._categories);
		},
		set_categories:function(categories)
		{
			this._categories = categories;
		},
		get_categories:function()
		{
			return this._categories;
		},
		/**
		 * 获取系统分类的所有父级分类
		 *
		 * @return ReminderCategoryInfo[]
		 */
		get_all_parent_categories:function()
		{
			if(!this.has_data()){throw new Error('No commemo category data loaded.');return}
			var rtn = new Array();
			var categories = this.get_categories();
			for ( var i = 0; i < categories.length; i++) {
				rtn.push(categories[i][0]);
			}
			return rtn;

		},
		get_system_parent_categories:function()
		{
			if(!this.has_data()){throw new Error('No commemo category data loaded.');return}

			var rtn = new Array();
			var categories = this.get_all_parent_categories();
			for ( var i = 0; i < categories.length; i++) {
				if (categories[i].IsSystem == true) {
					rtn.push(categories[i]);
				}
			}
			return rtn;
		},
		/**
		 * 根据父级分类的Id获取其所有子分类
		 *
		 * @return ReminderCategoryInfo[]
		 */
		get_system_child_category_by_parent_id:function(category_id)
		{
			if(!this.has_data()){throw new Error('No commemo category data loaded.');return}
			var categories = this.get_categories();
			var rtn = new Array();

			for ( var i = 0; i < categories.length; i++) {
				for ( var j = 0; j < categories[i].length; j++) {
					if (categories[i][j].ParentId == category_id) {
						rtn.push(categories[i][j]);
					}
				}
			}

			return rtn;
		},
		/**
		 * 获取用户的所有自定义分类
		 *
		 * @return ReminderCategoryInfo[]
		 */
		get_user_categories:function()
		{
			if(!this.has_data()){throw new Error('No commemo category data loaded.');return}

			var rtn = new Array();
			var categories = this.get_all_parent_categories();
			for ( var i = 0; i < categories.length; i++) {
				if (categories[i].IsSystem == false) {
					rtn.push(categories[i]);
				}
			}
			return rtn;
		},
		/**
		 * 根据一个分类Id获取其信息
		 *
		 * @return ReminderCategoryInfo
		 */
		get_category_info_by_id:function(category_id)
		{
			if(!this.has_data()){throw new Error('No commemo category data loaded.');return}

			var categories = this.get_categories();
			var rtn = null;

			for ( var i = 0; i < categories.length; i++) {
				for ( var j = 0; j < categories[i].length; j++) {
					if (categories[i][j].Id == category_id) {
						rtn = (categories[i][j]);
					}
				}
			}
			return rtn;
		}

	};

	var CategoryDataManager = {};
	CategoryDataManager.birthday = BirthdayCategoryDataManager.GetInstance();
	CategoryDataManager.commemo = CommemoCategoryDataManager.GetInstance();
	/* Codes End Here */

	/* Register Start Here */
	jiyiri.data.reminder.CategoryDataManager = CategoryDataManager;

	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/data/reminder/categorydatamanager.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/data/reminder/reminderdatamanager.js -----*/jiyiri.register_namespace('jiyiri.data.reminder');
/* jiyiri.require_once('jiyiri.helper.net.ajax'); */
/* jiyiri.require_once('jiyiri.helper.json.json'); */
/* jiyiri.require_once('jiyiri.data.reminder.ReminderDataMerger'); */

( function() {

	/* Codes Start Here */
	var AllReminderDataReader = Class.create();
	AllReminderDataReader._instance = null;
	AllReminderDataReader.GetInstance = function() {
		if (null == AllReminderDataReader._instance) {
			AllReminderDataReader._instance = new AllReminderDataReader();
		}

		return AllReminderDataReader._instance;
	};

	AllReminderDataReader.prototype = {
		initialize : function() {
			this._data_container = DataContainer.GetInstance();
		},
		load : function(callback) {
			this._data_container.load_all(callback);
		},
		_get_all_reminders : function() {
			try {
				var birthday_reminders = BirthdayReminderDataManager
						.GetInstance().get_all_reminders(1, 999999);
				var commemo_reminders = CommemoReminderDataManager
						.GetInstance().get_all_reminders(1, 999999);

				var reminders = new Array();
				if (birthday_reminders) {
					birthday_reminders.each( function(reminder) {
						reminder.Type = 'BIRTHDAY';
					});
					reminders = reminders.concat(birthday_reminders);
				}
				if (commemo_reminders) {
					commemo_reminders.each( function(reminder) {
						reminder.Type = 'COMMEMO';
					});
					reminders = reminders.concat(commemo_reminders);
				}

			} catch (e) {
				// do nothing
			}
            reminders = this._sort(reminders);
			return reminders;
		},
        _sort:function(reminders)
        {
            reminders = reminders.sort(ReminderDataSorter.sort);
            return reminders;
        },
		_get_recycle_reminders : function() {
			try {
				var birthday_reminders = BirthdayReminderDataManager
						.GetInstance().get_reminders_in_recycle(1, 999999);
				var commemo_reminders = CommemoReminderDataManager
						.GetInstance().get_reminders_in_recycle(1, 999999);

				var reminders = new Array();
				if (birthday_reminders) {
					birthday_reminders.each( function(reminder) {
						reminder.Type = 'BIRTHDAY';
					});
					reminders = reminders.concat(birthday_reminders);
				}
				if (commemo_reminders) {
					commemo_reminders.each( function(reminder) {
						reminder.Type = 'COMMEMO';
					});
					reminders = reminders.concat(commemo_reminders);
				}

			} catch (e) {

				// do nothing
			}

			return reminders;
		},
		count_all_reminders : function() {
			var reminders = this._get_all_reminders();
			return reminders.length;
		},
		get_all_reminders : function(page, pagesize) {
			var reminders = this._get_all_reminders();
			var rtn = new Array();
			var offset = (page - 1) * pagesize;
			var cnt = 0;
			for ( var i = offset; i < reminders.length; i++) {
				if (cnt >= pagesize) {
					break;
				}
				rtn.push(reminders[i]);
				cnt++;
			}

			return rtn;
		},
		count_recycle_reminders : function() {
			var reminders = this._get_recycle_reminders();
			return reminders.length;
		},
		get_recycle_reminders : function(page, pagesize) {
			var reminders = this._get_recycle_reminders();
			var rtn = new Array();
			var offset = (page - 1) * pagesize;
			var cnt = 0;
			for ( var i = offset; i < reminders.length; i++) {
				if (cnt >= pagesize) {
					break;
				}
				rtn.push(reminders[i]);
				cnt++;
			}

			return rtn;
		}
	};

	var AbstractReminderDataManager = Class.create();
	AbstractReminderDataManager.prototype = {
		/**
		 *
		 * @abstract
		 */
		load_reminders : function() {
			throw new Error('you must overwrite the method');
		},
		count_all_reminders : function() {
			var reminders = this.get_reminders();
			return reminders.length - this.count_reminders_in_recycle();
		},
		get_all_reminders : function(page, pagesize) {
			var reminders = this._get_normal_reminders();
			var rtn = new Array();
			var offset = (page - 1) * pagesize;
			var cnt = 0;
			for ( var i = offset; i < reminders.length; i++) {
				if (cnt >= pagesize) {
					break;
				}
				rtn.push(reminders[i]);
				cnt++;
			}

			return rtn;
		},
		count_reminders_by_category_id : function(category_id) {
			var reminders = this.get_reminders();
			var cnt = 0;
			for ( var i = 0; i < reminders.length; i++) {
				if (reminders[i].CategoryId == category_id
						|| parseInt(reminders[i].CategoryId/100,10) == category_id) {
					if (this._is_reminder_is_normal(reminders[i])) {
						cnt++;
					}
				}
			}
			return cnt;
		},
		get_reminders_by_category_id : function(category_id, page, pagesize) {
			var reminders = this._get_normal_reminders();
			var rtn_temp = new Array();

			for ( var i = 0; i < reminders.length; i++) {
				if (this._is_reminder_in_category(reminders[i], category_id)) {
						rtn_temp.push(reminders[i]);
				}
			}

			var rtn = new Array();
			var offset = (page - 1) * pagesize;

			var cnt = 0;
			for(var i=offset;i<rtn_temp.length;i++)
			{
				if(rtn.length>=pagesize)
				{
					break;
				}
				rtn.push(rtn_temp[i]);
			}
			return rtn;
		},
		count_reminders_in_recycle : function() {
			var reminders = this.get_reminders();

			var cnt = 0;
			for ( var i = 0; i < reminders.length; i++) {
				if (this._is_reminder_in_recycle(reminders[i])) {
					cnt++;
				}
			}

			return cnt;
		},
		get_reminders_in_recycle : function(page, pagesize) {
			var reminders = this.get_reminders();
			var rtn = new Array();
			var offset = (page - 1) * pagesize;
			var cnt = 0;
			for ( var i = offset; i < reminders.length; i++) {
				if (cnt >= pagesize) {
					break;
				}
				if (this._is_reminder_in_recycle(reminders[i])) {
					rtn.push(reminders[i]);
					cnt++;
				}
			}

			return rtn;
		},
		_get_normal_reminders:function()
		{
			var reminders = this.get_reminders();
			var rtn = new Array();
			for ( var i = 0; i < reminders.length; i++) {
				if (this._is_reminder_is_normal(reminders[i])) {
					rtn.push(reminders[i]);
				}
			}

			return rtn;
		},

		get_reminders : function() {
			if (null == this._reminders) {
				this._reminders = this._read_and_process_data();
			}
			return this._reminders;
		},
		/**
		 * @access protected
		 */
		_is_reminder_in_category : function(reminder, category_id) {
			if (reminder.CategoryId == category_id
					|| parseInt(reminder.CategoryId/100,10) == category_id) {
				return true;
			} else {
				return false;
			}
		},
		/**
		 * @access protected
		 */
		_is_reminder_is_normal : function(reminder) {
			if (reminder.State == 0) {
				return true;
			} else {
				return false;
			}
		},
		/**
		 * @access protected
		 */
		_is_reminder_in_recycle : function(reminder) {
			if (reminder.State == 1) {
				return true;
			} else {
				return false;
			}
		},
		_sort : function(reminders) {
			reminders = reminders.sort(this._sorter);
			return reminders;
		},
		_sorter : function(reminder1, reminder2) {
            return ReminderDataSorter.sort(reminder1,reminder2);

//			if (reminder1.DaysLeft > reminder2.DaysLeft) {
//				return 1;
//			} else if (reminder1.DaysLeft == reminder2.DaysLeft) {
//				return 0;
//			} else {
//				return -1;
//			}
		}
	};

    var ReminderDataSorter = {};
    ReminderDataSorter.sort = function(reminder1, reminder2) {
			if (reminder1.DaysLeft > reminder2.DaysLeft) {
				return 1;
			} else if (reminder1.DaysLeft == reminder2.DaysLeft) {
				return 0;
			} else {
				return -1;
            }
	};

	var CachedReminderDataManager = Class.create(AbstractReminderDataManager,
	{
	    on_change:function(merge_obj)
	    {
	        merged_reminders = jiyiri.data.reminder.ReminderDataMerger.merge(this._reminders,merge_obj);
	        merged_reminders = this._sort(merged_reminders);
	        this._reminders = merged_reminders;

	    }
	});

	var BirthdayReminderDataManager = Class.create(CachedReminderDataManager,
			{
				_reminders :null,
				initialize : function() {
					this._data_container = DataContainer.GetInstance();
				},
				load_reminders : function(callback) {
					this._reminders = null;
					this._data_container.load_birthday(callback);
				},
				_read_and_process_data : function() {
					var reminders = this._data_container
							.get_birthday_reminders();
					reminders = this._sort(reminders);
					return reminders;
				}
			});

	BirthdayReminderDataManager._instance = null;
	BirthdayReminderDataManager.GetInstance = function() {
		if (null == BirthdayReminderDataManager._instance) {
			BirthdayReminderDataManager._instance = new BirthdayReminderDataManager();
		}

		return BirthdayReminderDataManager._instance;
	};

	var CommemoReminderDataManager = Class.create(CachedReminderDataManager,
			{
				initialize : function() {
					this._data_container = DataContainer.GetInstance();
				},
				load_reminders : function(callback) {
					this._reminders = null;
					this._data_container.load_commemo(callback);
				},
				_read_and_process_data : function() {
					var reminders = this._data_container
							.get_commemo_reminders();
					reminders = this._sort(reminders);
					return reminders;
				}
			});
	CommemoReminderDataManager._instance = null;
	CommemoReminderDataManager.GetInstance = function() {
		if (null == CommemoReminderDataManager._instance) {
			CommemoReminderDataManager._instance = new CommemoReminderDataManager();
		}

		return CommemoReminderDataManager._instance;
	};

	var DataContainer = Class.create();
	DataContainer._instance = null;
	DataContainer.GetInstance = function() {
		if (null === DataContainer._instance) {
			DataContainer._instance = new DataContainer();
		}
		return DataContainer._instance;
	};
	DataContainer.prototype = {

		_birthday_reminders :null,
		_commemo_reminders :null,
		_callback :null,
		_load_type :null,
		initialize : function() {
			this._birthday_reminders = null;
			this._commemo_reminders = null;
			this._callback = {
				Birthday :null,
				Commemo :null,
				All :null
			};
			this._load_type = null;
		},
		load_birthday : function(callback) {
			this._load_type = 'birthday';
			this._callback.Birthday = callback;
			this._load('birthday');
		},
		load_commemo : function(callback) {
			this._load_type = 'commemo';
			this._callback.Commemo = callback;
			this._load('commemo');
		},
		load_all : function(callback) {
			this._load_type = 'all';
			this._callback.All = callback;
			this._load('all');
		},
		get_birthday_reminders : function() {
			if (null === this._birthday_reminders) {
				throw new Error('no data loaded');
			}
			return this._birthday_reminders;
		},
		get_commemo_reminders : function() {
			if (null === this._commemo_reminders) {
				throw new Error('no data loaded');
			}
			return this._commemo_reminders;
		},
		_load : function(type) {
			var data_interface = {
				Action :'Reminder',
				Method :'LoadReminder'
			};
			var parameter = new jiyiri.helper.net.Parameter();
			parameter.add_param('type', type);
			jiyiri.helper.net.Ajax
					.post_tp(data_interface.Action, data_interface.Method,
							parameter, jiyiri.helper.eventhelper.EventHelper
									.create_callback_function(this,
											'_on_receive_data'));
		},
		_on_receive_data : function(response) {
			var reminders = jiyiri.helper.json.JSON
					.parse(response.responseText);
			if (!reminders) {
				throw new Error(
						'error accours while loading data:' + this._load_type);
			}
			this._set_data(reminders);
			this._load_complete();
		},
		_set_data : function(reminders) {
			switch (this._load_type) {
			case 'birthday':
				this._birthday_reminders = reminders;
				break;
			case 'commemo':
				this._commemo_reminders = reminders;
				break;
			case 'all':
				this._birthday_reminders = reminders['birthday'];
				this._commemo_reminders = reminders['commemo'];
				break;
			}
		},
		_load_complete : function() {
			switch (this._load_type) {
			case 'birthday':
				if (this._callback.Birthday) {
					this._callback.Birthday();
				}
				break;
			case 'commemo':
				if (this._callback.Commemo) {
					this._callback.Commemo();
				}
				break;
			case 'all':
				if (this._callback.All) {
					this._callback.All();
				}
				break;
			}
		}
	};

	var ReminderDataManager = {};

	ReminderDataManager.all = AllReminderDataReader.GetInstance();
	ReminderDataManager.birthday = BirthdayReminderDataManager.GetInstance();
	ReminderDataManager.commemo = CommemoReminderDataManager.GetInstance();
	/* Codes End Here */

	/* Register Start Here */
	jiyiri.data.reminder.ReminderDataManager = ReminderDataManager;

	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/data/reminder/reminderdatamanager.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/data/reminder/reminderdatamerger.js -----*/jiyiri.register_namespace('jiyiri.data.reminder');
/* jiyiri.require_once('jiyiri.helper.net.ajax'); */
/* jiyiri.require_once('jiyiri.helper.json.json'); */

( function() {

	/* Codes Start Here */
	var ReminderDataMerger = {};
	ReminderDataMerger.merge = function(source_data,merge_obj)
	{
		var rtn_data = null;
	    switch(merge_obj.type)
	    {
	        case "ADD":
	            rtn_data = ReminderDataMerger._merge_add(source_data,merge_obj.data);
	            break;
	        case "EDIT":
	            rtn_data = ReminderDataMerger._merge_edit(source_data,merge_obj.data);
	            break;
	        case "DELETE":
	            rtn_data = ReminderDataMerger._merge_delete(source_data,merge_obj.data);
	            break;
	        default:
	            throw new Error("Unknow merge type:" + merge_obj.type);break;
	    }
	    return rtn_data;
	};

	ReminderDataMerger._merge_add = function(source_data,merge_data)
	{
	    if(typeof(merge_data)=="Array")
	    {
	        for(var i=0;i<merge_data.length;i++)
	        {
	            source_data.push(merge_data[i]);
	        }
	    }
	    else
	    {
	        source_data.push(merge_data);
	    }
	    return source_data;
	};

	ReminderDataMerger._merge_edit = function(source_data,merge_data)
	{
	    if(typeof(merge_data)=="Array")
	    {
	        for(var i=0;i<merge_data.length;i++)
	        {
	            source_data = ReminderDataMerger._replace_element(source_data,merge_data[i]);
	        }
	    }
	    else
	    {
	        source_data = ReminderDataMerger._replace_element(source_data,merge_data);
	    }
	    return source_data;
	};

	ReminderDataMerger._merge_delete = function(source_data,merge_data)
	{
	    if(typeof(merge_data)=="Array")
	    {
	        for(var i=0;i<merge_data.length;i++)
	        {
	            source_data = ReminderDataMerger._remove_element(source_data,merge_data[i]);
	        }
	    }
	    else
	    {
	        source_data = ReminderDataMerger._remove_element(source_data,merge_data);
	    }
	    return source_data;
	};

	ReminderDataMerger._replace_element = function(source_data,target_element)
	{
	    for(var i=0;i<source_data.length;i++)
	    {
	        if(source_data[i].Id==target_element.Id)
	        {
	            source_data[i] = target_element;
	        }
	    }
	    return source_data;
	};

	ReminderDataMerger._remove_element = function(source_data,target_element)
	{
	    for(var i=0;i<source_data.length;i++)
	    {
	        if(source_data[i].Id==target_element.Id)
	        {
	            source_data.splice(i,1);
	        }
	    }
	    return source_data;
	};



	/* Codes End Here */

	/* Register Start Here */
	jiyiri.data.reminder.ReminderDataMerger = ReminderDataMerger;

	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/data/reminder/reminderdatamerger.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/data/shop/recommendproducts.js -----*/jiyiri.register_namespace('jiyiri.data.shop');
/* jiyiri.require_once('jiyiri.helper.net.ajax'); */
/* jiyiri.require_once('jiyiri.helper.json.json'); */

( function() {

	/* Codes Start Here */

	var RecommendProductEntity = Class.create();
	RecommendProductEntity.prototype =
	{
			Id:null,
			Name:null,
			Url:null,
			Picture:null,
			initialize:function(id,kind_id,name,picture)
			{
				this.Id = id;
				this.Name = name;
				this.Url = __APP__ + '/Shop/View/kind_id/' + kind_id + '/id/' + id;
				this.Picture = picture;
			}
	}
	var RecommendProductsDataManager = Class.create();
	RecommendProductsDataManager._instance = null;
	RecommendProductsDataManager.GetInstance = function() {
		if (RecommendProductsDataManager._instance == null) {
			RecommendProductsDataManager._instance = new RecommendProductsDataManager();
		}
		return RecommendProductsDataManager._instance;
	};
	RecommendProductsDataManager.prototype = {
		initialize : function() {
			this._products = null;
		},
		/**
		 * @param callback_function will be called after load the data, and the array of *RecommendProductEntity* object will be passed
		 */
		get:function(sex,age,num,callback_function)
		{
			var param = new jiyiri.helper.net.Parameter();
			if(sex)
			{
				param.add_param('sex',sex);
			}
			if(age)
			{
				param.add_param('age',age);
			}
			if(num)
			{
				param.add_param('num',num);
			}
			jiyiri.helper.net.Ajax.get_tp('Shop','GetRecommendProducts',param,
					_on_load_complete
					);

			function _on_load_complete(response)
			{
				var datas;
				var products = new Array();
				eval('datas='+response.responseText);
				for(var i=0;i<datas.length;i++)
				{
					var data = datas[i];
					var id= data['base_info']['id'];
					var name=data['base_info']['name'];
					var kind_id= data['category_info'][0]['id'];
					var picture = data['base_info']['picture'];
					var product = new RecommendProductEntity(id,kind_id,name,picture)
					products.push(product);
				}
				RecommendProductsDataManager.GetInstance()._products = products;
				callback_function(products);
			}
		}
	}
	/* Codes End Here */

	/* Register Start Here */
	jiyiri.data.shop.RecommendProductsDataManager = RecommendProductsDataManager;

	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/data/shop/recommendproducts.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/date/dateobject.js -----*/jiyiri.register_namespace('jiyiri.date');
/* jiyiri.require_once('jiyiri.date.SolarLunarHelper'); */

(function(){

    /* Codes Start Here */
    var DateObject = Class.create();
    DateObject.compare = function(/*DateObject*/date1,/*DateObject*/ date2){
    	if(date1.IsSolar!=date2.IsSolar)
    	{
	    	if(!date1.IsSolar)
	    	{
	    		date1 = jiyiri.date.SolarLunarHelper.get_solar_by_lunar(date1);
	    	}
	    	if(!date2.IsSolar)
	    	{
	    		date2 = jiyiri.date.SolarLunarHelper.get_solar_by_lunar(date2);
	    	}
    	}
    	
        var rst = null;
        if (date1.Year > date2.Year) {
            rst = 1;
        }
        
        else 
            if (date1.Year < date2.Year) {
                rst = -1;
            }
            else {
                if (date1.Month > date2.Month) {
                    rst = 1;
                }
                else 
                    if (date1.Month < date2.Month) {
                        rst = -1;
                    }
                    else {
                        if (date1.Day > date2.Day) {
                            rst = 1;
                        }
                        else 
                            if (date1.Day < date2.Day) {
                                rst = -1;
                            }
                            else {
                                rst = 0;
                            }
                    }
            }
        
        return rst;
    };
    DateObject.prototype = {
        Year: null,
        Month: null,
        Day: null,
        IsSolar: null,
        initialize: function(year, month, day, issolar){
            this.Year = year;
            this.Month = month;
            this.Day = day;
            this.IsSolar = issolar;
        }
    };
    DateObject.GetToday = function(is_solar/*=true*/)
    {
    	if(undefined===is_solar)
    	{
    		is_solar = true;
    	}
    	
    	var rtn = null;
    	var date = new Date();
    	var year = date.getFullYear();
    	var month = date.getMonth()+1;
    	var day = date.getDate();
    	rtn = new DateObject(year,month,day,true);
    	if(!is_solar)
    	{
    		rtn = jiyiri.date.SolarLunarHelper.get_lunar_by_solar(rtn);
    	}
    	return rtn;
    }
    
    /* Codes End Here */
    
    /* Register Start Here */
    jiyiri.date.DateObject = DateObject;
    /* Register End Here */

})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/date/dateobject.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/date/output.js -----*/jiyiri.register_namespace('jiyiri.date');
/* jiyiri.require_once('jiyiri.date.DateObject'); */
/* jiyiri.require_once('jiyiri.date.SolarLunarHelper'); */

(function(){

    /* Codes Start Here */
    var Output = Class.create();
	Output.to_string = function (/*DateObject*/dateobj, format)
	{
		rtn = '';
		if(dateobj.IsSolar)
		{
			rtn = jiyiri.date.Output._solar_to_solar_string(dateobj,format);
		}
		else
		{
			rtn = jiyiri.date.Output._lunar_to_lunar_string(dateobj,format);
		}
		return rtn;
	};
	
	Output.weekday_string = function(/*DateObject*/dateobj)
	{
		if(!dateobj.IsSolar)
		{
			dateobj = jiyiri.date.SolarLunarHelper.get_solar_by_lunar(dateobj);
		}
		
		var date = new Date(dateobj.Year,dateobj.Month-1,dateobj.Day);
        var weekdays = new Array('日','一','二','三','四','五','六');
        var weekday = '星期' + weekdays[date.getDay()];
        return weekday;

	};
	
	Output.to_solar_string = function(/*DateObject*/dateobj, format)
	{
		if(!dateobj.IsSolar)
		{
			dateobj = jiyiri.date.SolarLunarHelper.get_solar_by_lunar(dateobj);
		}
		
		return jiyiri.date.Output._solar_to_solar_string(dateobj,format);
	};
	
	Output.to_lunar_string = function(/*DateObject*/dateobj, format)
	{
		if(dateobj.IsSolar)
		{
			dateobj = jiyiri.date.SolarLunarHelper.get_lunar_by_solar(dateobj);
		}
		
		return jiyiri.date.Output._lunar_to_lunar_string(dateobj,format);
	};
    
    Output._solar_to_solar_string = function(/*DateObject*/dateobj, format){
        var year = dateobj.Year;
        var month = dateobj.Month;
        var day = dateobj.Day;
        
        var year_string = Output._get_solar_year_string(year);
        var month_string = Output._get_solar_month_string(month);
        var day_string = Output._get_solar_day_string(day);
        
        var rtn = format;
        rtn = rtn.replace('#Y#', year_string);
        rtn = rtn.replace('#M#', month_string);
        rtn = rtn.replace('#D#', day_string);
        
        return rtn;
    };
    
    Output._lunar_to_lunar_string = function(/*DateObject*/dateobj, format){
        var year = dateobj.Year;
        var month = dateobj.Month;
        var day = dateobj.Day;
        
        var year_string = Output._get_lunar_year_string(year);
        var month_string = Output._get_lunar_month_string(month);
        var day_string = Output._get_lunar_day_string(day);
        
        var rtn = format;
        rtn = rtn.replace('#Y#', year_string);
        rtn = rtn.replace('#M#', month_string);
        rtn = rtn.replace('#D#', day_string);
        
        return rtn;
    };
    
    Output._get_lunar_year_string = function(year){
        var num = parseInt(year) + '';
        var chinese_num = new Array('零', '一', '二', '三', '四', '五', '六', '七', '八', '九');
        var rtn = new Array();
        for (var i = 0; i < num.length; i++) {
            index = num.substring(i, i + 1);
            rtn.push(chinese_num[index]);
        }
        return rtn.join('');
    }
    
    Output._get_lunar_month_string = function(month){
        var num = parseInt(month);
        var lunar_month_arr = new Array('', '正', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '腊');
        var s = lunar_month_arr[num];
        return s;
    };
    
    Output._get_lunar_day_string = function(day){
        var daynum = day;
        var nStr1 = new Array('日', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十');
        var nStr2 = new Array('初', '十', '廿', '卅', '□');
        
        var s;
        switch (daynum) {
            case 10:
                s = '初十';
                break;
            case 20:
                s = '廿十';
                break;
            case 30:
                s = '卅十';
                break;
            default:
                s = nStr2[Math.floor(daynum / 10)];
                s += nStr1[daynum % 10];
        }
        
        return s;
    };
    
    Output._get_solar_year_string = function(year){
    	return year;
    };
    
    Output._get_solar_month_string = function(month){
    	return month;
    };
    
    Output._get_solar_day_string = function(day){
    	return day;
    };
    
    /* Codes End Here */
    
    /* Register Start Here */
    jiyiri.date.Output = Output;
    /* Register End Here */

})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/date/output.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/date/periodcalculator.js -----*/jiyiri.register_namespace('jiyiri.date');
/* jiyiri.require_once('jiyiri.date.DateObject'); */
/* jiyiri.require_once('jiyiri.date.SolarLunarHelper'); */

(function(){

    /* Codes Start Here */
    var PeriodCalculator = {};
    PeriodCalculator.get_next_solar = function(/* DateObject */dateobj){
        var rst = null;
        if (dateobj.IsSolar) {
            rst = PeriodCalculator._get_next_solar_date_by_solar(dateobj);
        }
        else {
            rst = PeriodCalculator._get_next_solar_date_by_lunar(dateobj);
        }

        return rst;
    };

    PeriodCalculator.get_next_lunar = function(/* DateObject */dateobj){
        var rst = null;
        if (dateobj.IsSolar) {
            rst = PeriodCalculator._get_next_lunar_date_by_solar(dateobj);
        }
        else {
            rst = PeriodCalculator._get_next_lunar_date_by_lunar(dateobj);
        }

        return rst;
    };

    PeriodCalculator.get_next_distance = function(/* DateObject */dateobj){
        var next_solar_dateobj = PeriodCalculator.get_next_solar(dateobj);
        var next_solar_systemdate = new Date(next_solar_dateobj.Year, next_solar_dateobj.Month - 1, next_solar_dateobj.Day);

        var rtn = Math.floor((next_solar_systemdate - new Date()) / (3600 * 24 * 1000)) + 1;
        return rtn;
    };

    PeriodCalculator._get_next_solar_date_by_solar = function(/* DateObject */dateobj){
        if (!dateobj.IsSolar) {
            throw new Error('dateobj must be a SOLAR date!');
        }

        var year = new Date().getFullYear();
        var month = dateobj.Month;
        var day = dateobj.Day;

        today = new Date(); //今天的日期对象
        today = new Date(today.getFullYear(), today.getMonth(), today.getDate());
        theday = new Date(today.getFullYear(), month - 1, day); //本年的那个日期
        if (theday >= today) //如果今年的那个日期
        {
            rtn_solar = theday; //则就是今年的那个日期
        }
        else //如果今年的那个日期已经到了
        {
            for (var i = 1; i < 10; i++) {
                var current_solar_dateobj = new jiyiri.date.DateObject(year+i,month,day, true);
                var is_valid = jiyiri.date.SolarLunarHelper.is_valid_solar_date(current_solar_dateobj);
                if (is_valid) {
                	rtn_solar = new Date(current_solar_dateobj.Year,current_solar_dateobj.Month-1,current_solar_dateobj.Day);
                    break;
                }
            }
        }


        var rtn = new jiyiri.date.DateObject(rtn_solar.getFullYear(), rtn_solar.getMonth() + 1, rtn_solar.getDate(), true);
        return rtn;
    };

    PeriodCalculator._get_next_lunar_date_by_solar = function(/* DateObject */dateobj){
        var next_solar_date = PeriodCalculator._get_next_solar_date_by_solar();
        var next_lunar_date = jiyiri.date.SolarLunarHelper.get_lunar_by_solar(next_solar_date);
        return next_lunar_date;
    };

    PeriodCalculator._get_next_lunar_date_by_lunar = function(/* DateObject */dateobj){
        var today_solar_dateobj = new jiyiri.date.DateObject((new Date()).getFullYear(), (new Date()).getMonth() + 1, (new Date()).getDate(), true);
        var today_lunar_dateobj = jiyiri.date.SolarLunarHelper.get_lunar_by_solar(today_solar_dateobj);
        var theday_lunar_dateobj = new jiyiri.date.DateObject(today_lunar_dateobj.Year,dateobj.Month,dateobj.Day,false);
		//theday_lunar_dateobj.Year = today_lunar_dateobj.Year;
        var theday_solar_dateobj = jiyiri.date.SolarLunarHelper.get_solar_by_lunar(theday_lunar_dateobj);
        var rtn_lunar_dateobj = null;

        if (jiyiri.date.DateObject.compare(theday_solar_dateobj, today_solar_dateobj) >= 0) //如果今年的那个日期还没到
        {
            rtn_lunar_dateobj = jiyiri.date.SolarLunarHelper.get_lunar_by_solar(theday_solar_dateobj);
        }
        else //如果今年的那个日期到了
        {
            for (var i = 1; i < 10; i++) {
                var current_lunar_dateobj = new jiyiri.date.DateObject(today_lunar_dateobj.Year + i, theday_lunar_dateobj.Month, theday_lunar_dateobj.Day, false);
                var is_valid = jiyiri.date.SolarLunarHelper.is_valid_lunar_date(current_lunar_dateobj);
                if (is_valid) {
                    rtn_lunar_dateobj = new jiyiri.date.DateObject(today_lunar_dateobj.Year + i, theday_lunar_dateobj.Month, theday_lunar_dateobj.Day, false);
                    break;
                }
            }
            if (null == rtn_lunar_dateobj) {
                throw new Error('Can not get next valid lunar date');
            }
            return rtn_lunar_dateobj;
        }

        return rtn_lunar_dateobj;
    }

    PeriodCalculator._get_next_solar_date_by_lunar = function(/* DateObject */dateobj){
        var next_lunar_date = PeriodCalculator._get_next_lunar_date_by_lunar(dateobj);
        var next_solar_date = jiyiri.date.SolarLunarHelper.get_solar_by_lunar(next_lunar_date);
        return next_solar_date;
    }
    /* Codes End Here */

    /* Register Start Here */
    jiyiri.date.PeriodCalculator = PeriodCalculator;
    /* Register End Here */

})();

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/date/periodcalculator.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/date/phpdate.js -----*/jiyiri.register_namespace('jiyiri.date');

(function(){

    /* Codes Start Here */
    var PhpDate = {};
    function date ( format, timestamp ) {
        // Format a local date/time
        //
        // version: 905.3122
        // discuss at: http://phpjs.org/functions/date
        // +   original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com)
        // +      parts by: Peter-Paul Koch (http://www.quirksmode.org/js/beat.html)
        // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
        // +   improved by: MeEtc (http://yass.meetcweb.com)
        // +   improved by: Brad Touesnard
        // +   improved by: Tim Wiel
        // +   improved by: Bryan Elliott
        // +   improved by: Brett Zamir (http://brett-zamir.me)
        // +   improved by: David Randall
        // +      input by: Brett Zamir (http://brett-zamir.me)
        // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
        // +   improved by: Brett Zamir (http://brett-zamir.me)
        // +   improved by: Brett Zamir (http://brett-zamir.me)
        // +   derived from: gettimeofday
        // %        note 1: Uses global: php_js to store the default timezone
        // *     example 1: date('H:m:s \\m \\i\\s \\m\\o\\n\\t\\h', 1062402400);
        // *     returns 1: '09:09:40 m is month'
        // *     example 2: date('F j, Y, g:i a', 1062462400);
        // *     returns 2: 'September 2, 2003, 2:26 am'
        // *     example 3: date('Y W o', 1062462400);
        // *     returns 3: '2003 36 2003'
        // *     example 4: x = date('Y m d', (new Date()).getTime()/1000); // 2009 01 09
        // *     example 4: (x+'').length == 10
        // *     returns 4: true
        var jsdate=(
            (typeof(timestamp) == 'undefined') ? new Date() : // Not provided
            (typeof(timestamp) == 'number') ? new Date(timestamp*1000) : // UNIX timestamp
            new Date(timestamp) // Javascript Date()
        ); // , tal=[]
        var pad = function(n, c){
            if( (n = n + "").length < c ) {
                return new Array(++c - n.length).join("0") + n;
            } else {
                return n;
            }
        };
        var _dst = function (t) {
            // Calculate Daylight Saving Time (derived from gettimeofday() code)
            var dst=0;
            var jan1 = new Date(t.getFullYear(), 0, 1, 0, 0, 0, 0);  // jan 1st
            var june1 = new Date(t.getFullYear(), 6, 1, 0, 0, 0, 0); // june 1st
            var temp = jan1.toUTCString();
            var jan2 = new Date(temp.slice(0, temp.lastIndexOf(' ')-1));
            temp = june1.toUTCString();
            var june2 = new Date(temp.slice(0, temp.lastIndexOf(' ')-1));
            var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
            var daylight_time_offset = (june1 - june2) / (1000 * 60 * 60);

            if (std_time_offset === daylight_time_offset) {
                dst = 0; // daylight savings time is NOT observed
            }
            else {
                // positive is southern, negative is northern hemisphere
                var hemisphere = std_time_offset - daylight_time_offset;
                if (hemisphere >= 0) {
                    std_time_offset = daylight_time_offset;
                }
                dst = 1; // daylight savings time is observed
            }
            return dst;
        };
        var ret = '';
        var txt_weekdays = ["Sunday","Monday","Tuesday","Wednesday",
            "Thursday","Friday","Saturday"];
        var txt_ordin = {1:"st",2:"nd",3:"rd",21:"st",22:"nd",23:"rd",31:"st"};
        var txt_months =  ["", "January", "February", "March", "April",
            "May", "June", "July", "August", "September", "October", "November",
            "December"];

        var f = {
            // Day
                d: function(){
                    return pad(f.j(), 2);
                },
                D: function(){
                    var t = f.l();
                    return t.substr(0,3);
                },
                j: function(){
                    return jsdate.getDate();
                },
                l: function(){
                    return txt_weekdays[f.w()];
                },
                N: function(){
                    return f.w() + 1;
                },
                S: function(){
                    return txt_ordin[f.j()] ? txt_ordin[f.j()] : 'th';
                },
                w: function(){
                    return jsdate.getDay();
                },
                z: function(){
                    return (jsdate - new Date(jsdate.getFullYear() + "/1/1")) / 864e5 >> 0;
                },

            // Week
                W: function(){
                    var a = f.z(), b = 364 + f.L() - a;
                    var nd2, nd = (new Date(jsdate.getFullYear() + "/1/1").getDay() || 7) - 1;

                    if(b <= 2 && ((jsdate.getDay() || 7) - 1) <= 2 - b){
                        return 1;
                    }
                    if(a <= 2 && nd >= 4 && a >= (6 - nd)){
                        nd2 = new Date(jsdate.getFullYear() - 1 + "/12/31");
                        return date("W", Math.round(nd2.getTime()/1000));
                    }
                    return (1 + (nd <= 3 ? ((a + nd) / 7) : (a - (7 - nd)) / 7) >> 0);
                },

            // Month
                F: function(){
                    return txt_months[f.n()];
                },
                m: function(){
                    return pad(f.n(), 2);
                },
                M: function(){
                    var t = f.F();
                    return t.substr(0,3);
                },
                n: function(){
                    return jsdate.getMonth() + 1;
                },
                t: function(){
                    var n;
                    if( (n = jsdate.getMonth() + 1) == 2 ){
                        return 28 + f.L();
                    }
                    if( n & 1 && n < 8 || !(n & 1) && n > 7 ){
                        return 31;
                    }
                    return 30;
                },

            // Year
                L: function(){
                    var y = f.Y();
                    return (!(y & 3) && (y % 1e2 || !(y % 4e2))) ? 1 : 0;
                },
                o: function(){
                    if (f.n() === 12 && f.W() === 1) {
                        return jsdate.getFullYear()+1;
                    }
                    if (f.n() === 1 && f.W() >= 52) {
                        return jsdate.getFullYear()-1;
                    }
                    return jsdate.getFullYear();
                },
                Y: function(){
                    return jsdate.getFullYear();
                },
                y: function(){
                    return (jsdate.getFullYear() + "").slice(2);
                },

            // Time
                a: function(){
                    return jsdate.getHours() > 11 ? "pm" : "am";
                },
                A: function(){
                    return f.a().toUpperCase();
                },
                B: function(){
                    // peter paul koch:
                    var off = (jsdate.getTimezoneOffset() + 60)*60;
                    var theSeconds = (jsdate.getHours() * 3600) +
                                     (jsdate.getMinutes() * 60) +
                                      jsdate.getSeconds() + off;
                    var beat = Math.floor(theSeconds/86.4);
                    if (beat > 1000) {
                        beat -= 1000;
                    }
                    if (beat < 0) {
                        beat += 1000;
                    }
                    if ((String(beat)).length == 1) {
                        beat = "00"+beat;
                    }
                    if ((String(beat)).length == 2) {
                        beat = "0"+beat;
                    }
                    return beat;
                },
                g: function(){
                    return jsdate.getHours() % 12 || 12;
                },
                G: function(){
                    return jsdate.getHours();
                },
                h: function(){
                    return pad(f.g(), 2);
                },
                H: function(){
                    return pad(jsdate.getHours(), 2);
                },
                i: function(){
                    return pad(jsdate.getMinutes(), 2);
                },
                s: function(){
                    return pad(jsdate.getSeconds(), 2);
                },
                u: function(){
                    return pad(jsdate.getMilliseconds()*1000, 6);
                },

            // Timezone
                e: function () {
    /*                var abbr='', i=0;
                    if (this.php_js && this.php_js.default_timezone) {
                        return this.php_js.default_timezone;
                    }
                    if (!tal.length) {
                        tal = timezone_abbreviations_list();
                    }
                    for (abbr in tal) {
                        for (i=0; i < tal[abbr].length; i++) {
                            if (tal[abbr][i].offset === -jsdate.getTimezoneOffset()*60) {
                                return tal[abbr][i].timezone_id;
                            }
                        }
                    }
    */
                    return 'UTC';
                },
                I: function(){
                    return _dst(jsdate);
                },
                O: function(){
                   var t = pad(Math.abs(jsdate.getTimezoneOffset()/60*100), 4);
                   t = (jsdate.getTimezoneOffset() > 0) ? "-"+t : "+"+t;
                   return t;
                },
                P: function(){
                    var O = f.O();
                    return (O.substr(0, 3) + ":" + O.substr(3, 2));
                },
                T: function () {
    /*                var abbr='', i=0;
                    if (!tal.length) {
                        tal = timezone_abbreviations_list();
                    }
                    if (this.php_js && this.php_js.default_timezone) {
                        for (abbr in tal) {
                            for (i=0; i < tal[abbr].length; i++) {
                                if (tal[abbr][i].timezone_id === this.php_js.default_timezone) {
                                    return abbr.toUpperCase();
                                }
                            }
                        }
                    }
                    for (abbr in tal) {
                        for (i=0; i < tal[abbr].length; i++) {
                            if (tal[abbr][i].offset === -jsdate.getTimezoneOffset()*60) {
                                return abbr.toUpperCase();
                            }
                        }
                    }
    */
                    return 'UTC';
                },
                Z: function(){
                   return -jsdate.getTimezoneOffset()*60;
                },

            // Full Date/Time
                c: function(){
                    return f.Y() + "-" + f.m() + "-" + f.d() + "T" + f.h() + ":" + f.i() + ":" + f.s() + f.P();
                },
                r: function(){
                    return f.D()+', '+f.d()+' '+f.M()+' '+f.Y()+' '+f.H()+':'+f.i()+':'+f.s()+' '+f.O();
                },
                U: function(){
                    return Math.round(jsdate.getTime()/1000);
                }
        };

        return format.replace(/[\\]?([a-zA-Z])/g, function(t, s){
            if( t!=s ){
                // escaped
                ret = s;
            } else if( f[s] ){
                // a date function exists
                ret = f[s]();
            } else{
                // nothing special
                ret = s;
            }
            return ret;
        });
    }

    PhpDate.date = date;


    /* Codes End Here */

    /* Register Start Here */
    jiyiri.date.PhpDate = PhpDate;
    /* Register End Here */

})();

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/date/phpdate.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/date/solarlunarhelper.js -----*/jiyiri.register_namespace('jiyiri.date');
/* jiyiri.require_once('jiyiri.date.DateObject'); */

(function(){

    /* Codes Start Here */
    var SolarLunarHelper = Class.create();
    SolarLunarHelper.lunarInfo = new Array(0x4bd8, 0x4ae0, 0xa570, 0x54d5, 0xd260, 0xd950, 0x5554, 0x56af, 0x9ad0, 0x55d2, 0x4ae0, 0xa5b6, 0xa4d0, 0xd250, 0xd255, 0xb54f, 0xd6a0, 0xada2, 0x95b0, 0x4977, 0x497f, 0xa4b0, 0xb4b5, 0x6a50, 0x6d40, 0xab54, 0x2b6f, 0x9570, 0x52f2, 0x4970, 0x6566, 0xd4a0, 0xea50, 0x6a95, 0x5adf, 0x2b60, 0x86e3, 0x92ef, 0xc8d7, 0xc95f, 0xd4a0, 0xd8a6, 0xb55f, 0x56a0, 0xa5b4, 0x25df, 0x92d0, 0xd2b2, 0xa950, 0xb557, 0x6ca0, 0xb550, 0x5355, 0x4daf, 0xa5b0, 0x4573, 0x52bf, 0xa9a8, 0xe950, 0x6aa0, 0xaea6, 0xab50, 0x4b60, 0xaae4, 0xa570, 0x5260, 0xf263, 0xd950, 0x5b57, 0x56a0, 0x96d0, 0x4dd5, 0x4ad0, 0xa4d0, 0xd4d4, 0xd250, 0xd558, 0xb540, 0xb6a0, 0x95a6, 0x95bf, 0x49b0, 0xa974, 0xa4b0, 0xb27a, 0x6a50, 0x6d40, 0xaf46, 0xab60, 0x9570, 0x4af5, 0x4970, 0x64b0, 0x74a3, 0xea50, 0x6b58, 0x5ac0, 0xab60, 0x96d5, 0x92e0, 0xc960, 0xd954, 0xd4a0, 0xda50, 0x7552, 0x56a0, 0xabb7, 0x25d0, 0x92d0, 0xcab5, 0xa950, 0xb4a0, 0xbaa4, 0xad50, 0x55d9, 0x4ba0, 0xa5b0, 0x5176, 0x52bf, 0xa930, 0x7954, 0x6aa0, 0xad50, 0x5b52, 0x4b60, 0xa6e6, 0xa4e0, 0xd260, 0xea65, 0xd530, 0x5aa0, 0x76a3, 0x96d0, 0x4afb, 0x4ad0, 0xa4d0, 0xd0b6, 0xd25f, 0xd520, 0xdd45, 0xb5a0, 0x56d0, 0x55b2, 0x49b0, 0xa577, 0xa4b0, 0xaa50, 0xb255, 0x6d2f, 0xada0, 0x4b63, 0x937f, 0x49f8, 0x4970, 0x64b0, 0x68a6, 0xea5f, 0x6b20, 0xa6c4, 0xaaef, 0x92e0, 0xd2e3, 0xc960, 0xd557, 0xd4a0, 0xda50, 0x5d55, 0x56a0, 0xa6d0, 0x55d4, 0x52d0, 0xa9b8, 0xa950, 0xb4a0, 0xb6a6, 0xad50, 0x55a0, 0xaba4, 0xa5b0, 0x52b0, 0xb273, 0x6930, 0x7337, 0x6aa0, 0xad50, 0x4b55, 0x4b6f, 0xa570, 0x54e4, 0xd260, 0xe968, 0xd520, 0xdaa0, 0x6aa6, 0x56df, 0x4ae0, 0xa9d4, 0xa4d0, 0xd150, 0xf252, 0xd520);

    SolarLunarHelper.get_lunar_by_solar = function(/* DateObject */dateobj){
        year = parseInt(dateobj.Year);
        month = parseInt(dateobj.Month);
        day = parseInt(dateobj.Day);

        var rstYear = year;
        var rstMonth = month;
        var rstDay = day;


        if (rstYear == 0 || rstMonth == 0 || rstDay == 0) {
        	throw new Error('Input date object is not valid!');
        }
        else {
            var totalDays = 0;

            for (var i = 1900; i < year; i++) {
                totalDays += SolarLunarHelper._solar_year_days(i);
            }
            for (var i = 1; i < month; i++) {
                totalDays += SolarLunarHelper._solar_days(year, i - 1);
            }

            totalDays += day;
            totalDays -= 30;

            for (var i = 1900; i < year + 1; i++) {
                var lYearDay = SolarLunarHelper._get_lunar_year_days(i);
                if (totalDays > lYearDay) {
                    totalDays -= lYearDay;
                }
                else {
                    var leepMonth = SolarLunarHelper._lunar_leap_month(i);
                    for (var j = 1; j < 14; j++) {
                        if (totalDays > SolarLunarHelper._get_lunar_month_days(i, j)) {
                            totalDays -= SolarLunarHelper._get_lunar_month_days(i, j);
                            if (leepMonth == j) {
                                if (totalDays > SolarLunarHelper._lunar_leap_days(i))
                                    totalDays -= SolarLunarHelper._lunar_leap_days(i);
                                else {
                                    rstDay = totalDays;
                                    rstMonth = j;
                                    break;
                                }
                            }
                        }
                        else {
                            rstDay = totalDays;
                            rstMonth = j;
                            break;
                        }
                    }

                    rstYear = i;
                    break;
                }
            }

        }

        return new jiyiri.date.DateObject(rstYear, rstMonth, rstDay, false);
    }

    SolarLunarHelper.get_solar_by_lunar = function(/* DateObject */dateobj){
        year = parseInt(dateobj.Year);
        month = parseInt(dateobj.Month);
        day = parseInt(dateobj.Day);

        var rstYear = year;
        var rstMonth = month;
        var rstDay = day;

        if (rstYear == 0 || rstMonth == 0 || rstDay == 0) {
            throw new Error('Input date object is not valid!');
        }
        else {
            var totalDays = 30;


            for (var i = 1900; i < year; i++) {
                totalDays += SolarLunarHelper._get_lunar_year_days(i);
            }

            for (var i = 1; i < month; i++) {
                totalDays += SolarLunarHelper._get_lunar_month_days(year, i);
            }

            if (month > SolarLunarHelper._lunar_leap_month(year) && SolarLunarHelper._lunar_leap_month(year) != 0) {
                totalDays += SolarLunarHelper._lunar_leap_days(year);
            }

            totalDays += day;


            for (var i = 1900; i < year + 5; i++) {
                var sYearDay = SolarLunarHelper._solar_year_days(i);
                if (totalDays > sYearDay) {
                    totalDays -= sYearDay;
                }
                else {
                    for (var j = 1; j < 13; j++) {
                        if (totalDays > SolarLunarHelper._solar_days(i, j - 1)) {
                            totalDays -= SolarLunarHelper._solar_days(i, j - 1);
                        }
                        else {
                            rstDay = totalDays;
                            rstMonth = j;
                            break;
                        }
                    }

                    rstYear = i;
                    break;
                }
            }


        }

        return new jiyiri.date.DateObject(rstYear, rstMonth, rstDay, true);
    }

    SolarLunarHelper.is_valid_lunar_date = function(/* DateObject */dateobj)
	{
		var year = dateobj.Year;
		var month = dateobj.Month;
		var day = dateobj.Day;

		if(month>12 || month<1)
		{
			return false;
		}

		return SolarLunarHelper._get_lunar_month_days(year, month) >= day;
	}

    SolarLunarHelper.is_valid_solar_date = function(/* DateObject */dateobj)
	{
		var year = dateobj.Year;
		var month = dateobj.Month;
		var day = dateobj.Day;

		var system_date = new Date(year,month-1,day);
		var year_system = system_date.getFullYear();
		var month_system = system_date.getMonth()+1;
		var day_system = system_date.getDate();

		if(year==year_system && month==month_system && day == day_system)
		{
			return true;
		}
		else
		{
			return false;
		}
	}

    SolarLunarHelper._solar_year_days = function(year){
        return 337 + SolarLunarHelper._solar_days(year, 1);
    }

    SolarLunarHelper._solar_days = function(year, month){
        var MonthDay = new Array(31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
        if (month == 1) {
            return SolarLunarHelper._is_pin_year(year) ? 29 : 28;
        }
        else {
            return MonthDay[month + 1];
        }

        return 0;
    }

    SolarLunarHelper._get_lunar_month_days = function(year, month){
        return ((SolarLunarHelper.lunarInfo[year - 1900] & (0x10000 >> month)) ? 30 : 29);
    }

    SolarLunarHelper._get_lunar_year_days = function(year){
        var rst = 348;
        for (var i = 0x8000; i > 0x8; i >>= 1) {
            rst += (SolarLunarHelper.lunarInfo[year - 1900] & i) != 0 ? 1 : 0;
        }

        return rst + SolarLunarHelper._lunar_leap_days(year);
    }

    SolarLunarHelper._lunar_leap_days = function(year){
        if (SolarLunarHelper._lunar_leap_month(year) != 0) {
            return (((SolarLunarHelper.lunarInfo[year - 1899] & 0xf) == 0xf) ? 30 : 29);
        }

        return 0;
    }

    SolarLunarHelper._lunar_leap_month = function(year){
        var lm = SolarLunarHelper.lunarInfo[year - 1900] & 0xf;
        return lm == 0xf ? 0 : lm;
    }
    SolarLunarHelper._is_pin_year = function(year){
        return (0 == year % 4 && (year % 100 != 0 || year % 400 == 0));
    };
    /* Codes End Here */

    /* Register Start Here */
    jiyiri.date.SolarLunarHelper = SolarLunarHelper;
    /* Register End Here */

})();

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/date/solarlunarhelper.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/arrayhelper/arrayhelper.js -----*/jiyiri.register_namespace('jiyiri.helper.arrayhelper');

(function(){
	
	/* Codes Start Here */
    var ArrayHelper = {};
    ArrayHelper.in_array = function(needle, haystack){
        for (var i = 0; i < haystack.length; i++) {
            if (haystack[i] == needle) 
                return true;
        }
        return false;
    }
    ArrayHelper.array_unique = function(array){
        // *     example 1: array_unique(['Kevin','Kevin','van','Zonneveld','Kevin']);
        // *     returns 1: ['Kevin','van','Zonneveld']
        // *     example 2: array_unique({'a': 'green', 0: 'red', 'b': 'green', 1: 'blue', 2: 'red'});
        // *     returns 2: {'a': 'green', 0: 'red', 1: 'blue'}
        
        var key = '', tmp_arr1 = {}, tmp_arr2 = {};
        var val = '';
        tmp_arr1 = array;
        
        var __array_search = function(needle, haystack, strict){
            var fkey = '';
            var strict = !!strict;
            for (fkey in haystack) {
                if ((strict && haystack[fkey] === needle) || (!strict && haystack[fkey] == needle)) {
                    return fkey;
                }
            }
            return false;
        }
        
        for (key in tmp_arr1) {
            val = tmp_arr1[key];
            if (false === __array_search(val, tmp_arr2)) {
                tmp_arr2[key] = val;
            }
            
            delete tmp_arr1[key];
        }
        
        return tmp_arr2;
    }
    
    ArrayHelper.array_rand =function ( input, num_req ) {
        // Return key/keys for random entry/entries in the array  
        // 
        // version: 905.412
        // discuss at: http://phpjs.org/functions/array_rand
        // +   original by: Waldo Malqui Silva
        // *     example 1: array_rand( ['Kevin'], 1 );
        // *     returns 1: 0
        var indexes = [];
        var ticks = num_req || 1;
        var checkDuplicate = function ( input, value ) {
            var exist = false, index = 0;
            while ( index < input.length ) {
                if ( input [ index ] === value ) {
                    exist = true;
                    break;
                }
                index++;
            }
            return exist;
        };

        if ( input instanceof Array && ticks <= input.length ) {
            while ( true ) {
                var rand = Math.floor( ( Math.random( ) * input.length ) );
                if ( indexes.length === ticks ) { break; }
                if ( !checkDuplicate( indexes, rand ) ) { indexes.push( rand ); }
            }
        } else {
            indexes = null;
        }

        return ( ( ticks == 1 ) ? indexes.join( ) : indexes );
    }

	
	/* Codes End Here */
	
	/* Register Start Here */
    jiyiri.helper.arrayhelper.ArrayHelper = ArrayHelper;
    /* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/arrayhelper/arrayhelper.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/base64.js -----*/jiyiri.register_namespace('jiyiri.helper');



/**
*
*  Base64 encode / decode
*  http://www.webtoolkit.info/
*
**/

var Base64 = {

	// private property
	_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",

	// public method for encoding
	encode : function (input) {
		var output = "";
		var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
		var i = 0;

		input = Base64._utf8_encode(input);

		while (i < input.length) {

			chr1 = input.charCodeAt(i++);
			chr2 = input.charCodeAt(i++);
			chr3 = input.charCodeAt(i++);

			enc1 = chr1 >> 2;
			enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
			enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
			enc4 = chr3 & 63;

			if (isNaN(chr2)) {
				enc3 = enc4 = 64;
			} else if (isNaN(chr3)) {
				enc4 = 64;
			}

			output = output +
			this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
			this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);

		}

		return output;
	},

	// public method for decoding
	decode : function (input) {
		var output = "";
		var chr1, chr2, chr3;
		var enc1, enc2, enc3, enc4;
		var i = 0;

		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

		while (i < input.length) {

			enc1 = this._keyStr.indexOf(input.charAt(i++));
			enc2 = this._keyStr.indexOf(input.charAt(i++));
			enc3 = this._keyStr.indexOf(input.charAt(i++));
			enc4 = this._keyStr.indexOf(input.charAt(i++));

			chr1 = (enc1 << 2) | (enc2 >> 4);
			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
			chr3 = ((enc3 & 3) << 6) | enc4;

			output = output + String.fromCharCode(chr1);

			if (enc3 != 64) {
				output = output + String.fromCharCode(chr2);
			}
			if (enc4 != 64) {
				output = output + String.fromCharCode(chr3);
			}

		}

		output = Base64._utf8_decode(output);

		return output;

	},

	// private method for UTF-8 encoding
	_utf8_encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";

		for (var n = 0; n < string.length; n++) {

			var c = string.charCodeAt(n);

			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}

		}

		return utftext;
	},

	// private method for UTF-8 decoding
	_utf8_decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;

		while ( i < utftext.length ) {

			c = utftext.charCodeAt(i);

			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}

		}

		return string;
	}
}

/* Codes End Here */

/* Register Start Here */
jiyiri.helper.Base64 = Base64;

/* Register End Here */

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/base64.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/browser/browsertype.js -----*/jiyiri.register_namespace('jiyiri.helper.browser');

( function() {

	/* Codes Start Here */
	var BrowserType = {};
	/**
	 *
	 * @param browser ie,ff(or gecko),opera
	 */
	BrowserType.is = function(browser,version)
	{
		var rtn = false;
		var browser_type = BrowserType._browsertype;
		browser_version_info = null;
		switch(browser)
		{
			case 'ie':
				browser_version_info = browser_type.ie;
				break;
			case 'ff','gecko':
				browser_version_info = browser_type.gecko;
				break;
			case 'opera':
				browser_version_info = browser_type.opera;
				break;
			default :
				throw new Error('Unknow browser type');
		}

		if(!browser_version_info)
		{
			rtn = false;
		}
		else
		{
			//if(arguments.length ==1)
			if(!version)
			{
				rtn = (browser_version_info!=0);
			}
			else if(typeof(version).toString().toLowerCase() == 'array')
			{
				for(var i=0;i<version.length;i++)
				{
					if(browser_version_info==version[i])
					{
						rtn = true;
					}
				}
			}
			else
			{
				if(browser_version_info==version)
				{
					rtn = true;
				}
			}
		}

		return rtn;
	};
	BrowserType._browsertype = function() {
		var o = {

			/**
			 * Internet Explorer version number or 0. Example: 6
			 *
			 * @property ie
			 * @type float
			 */
			ie :0,

			/**
			 * Opera version number or 0. Example: 9.2
			 *
			 * @property opera
			 * @type float
			 */
			opera :0,

			/**
			 * Gecko engine revision number. Will evaluate to 1 if Gecko is
			 * detected but the revision could not be found. Other browsers will
			 * be 0. Example: 1.8
			 *
			 * <pre>
			 * Firefox 1.0.0.4: 1.7.8   &lt;-- Reports 1.7
			 * Firefox 1.5.0.9: 1.8.0.9 &lt;-- Reports 1.8
			 * Firefox 2.0.0.3: 1.8.1.3 &lt;-- Reports 1.8
			 * Firefox 3 alpha: 1.9a4   &lt;-- Reports 1.9
			 * </pre>
			 *
			 * @property gecko
			 * @type float
			 */
			gecko :0,

			/**
			 * AppleWebKit version. KHTML browsers that are not WebKit browsers
			 * will evaluate to 1, other browsers 0. Example: 418.9.1
			 *
			 * <pre>
			 * Safari 1.3.2 (312.6): 312.8.1 &lt;-- Reports 312.8 -- currently the
			 *                                   latest available for Mac OSX 10.3.
			 * Safari 2.0.2:         416     &lt;-- hasOwnProperty introduced
			 * Safari 2.0.4:         418     &lt;-- preventDefault fixed
			 * Safari 2.0.4 (419.3): 418.9.1 &lt;-- One version of Safari may run
			 *                                   different versions of webkit
			 * Safari 2.0.4 (419.3): 419     &lt;-- Tiger installations that have been
			 *                                   updated, but not updated
			 *                                   to the latest patch.
			 * Webkit 212 nightly:   522+    &lt;-- Safari 3.0 precursor (with native SVG
			 *                                   and many major issues fixed).
			 * 3.x yahoo.com, flickr:422     &lt;-- Safari 3.x hacks the user agent
			 *                                   string when hitting yahoo.com and
			 *                                   flickr.com.
			 * Safari 3.0.4 (523.12):523.12  &lt;-- First Tiger release - automatic update
			 *                                   from 2.x via the 10.4.11 OS patch
			 * Webkit nightly 1/2008:525+    &lt;-- Supports DOMContentLoaded event.
			 *                                   yahoo.com user agent hack removed.
			 *
			 * </pre>
			 *
			 * http://developer.apple.com/internet/safari/uamatrix.html
			 *
			 * @property webkit
			 * @type float
			 */
			webkit :0,

			/**
			 * The mobile property will be set to a string containing any
			 * relevant user agent information when a modern mobile browser is
			 * detected. Currently limited to Safari on the iPhone/iPod Touch,
			 * Nokia N-series devices with the WebKit-based browser, and Opera
			 * Mini.
			 *
			 * @property mobile
			 * @type string
			 */
			mobile :null,

			/**
			 * Adobe AIR version number or 0. Only populated if webkit is
			 * detected. Example: 1.0
			 *
			 * @property air
			 * @type float
			 */
			air :0,

			/**
			 * Google Caja version number or 0.
			 *
			 * @property caja
			 * @type float
			 */
			caja :0

		},

		ua = navigator.userAgent,

		m;

		// Modern KHTML browsers should qualify as Safari X-Grade
		if ((/KHTML/).test(ua)) {
			o.webkit = 1;
		}
		// Modern WebKit browsers are at least X-Grade
		m = ua.match(/AppleWebKit\/([^\s]*)/);
		if (m && m[1]) {
			o.webkit = parseFloat(m[1]);

			// Mobile browser check
			if (/ Mobile\// .test(ua)) {
				o.mobile = "Apple"; // iPhone or iPod Touch
			} else {
				m = ua.match(/NokiaN[^\/]*/);
				if (m) {
					o.mobile = m[0]; // Nokia N-series, ex: NokiaN95
				}
			}

			m = ua.match(/AdobeAIR\/([^\s]*)/);
			if (m) {
				o.air = m[0]; // Adobe AIR 1.0 or better
			}

		}

		if (!o.webkit) { // not webkit
			// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi;
			// U; ssr)
			m = ua.match(/Opera[\s\/]([^\s]*)/);
			if (m && m[1]) {
				o.opera = parseFloat(m[1]);
				m = ua.match(/Opera Mini[^;]*/);
				if (m) {
					o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
				}
			} else { // not opera or webkit
				m = ua.match(/MSIE\s([^;]*)/);
				if (m && m[1]) {
					o.ie = parseFloat(m[1]);
				} else { // not opera, webkit, or ie
					m = ua.match(/Gecko\/([^\s]*)/);
					if (m) {
						o.gecko = 1; // Gecko detected, look for revision
						m = ua.match(/rv:([^\s\)]*)/);
						if (m && m[1]) {
							o.gecko = parseFloat(m[1]);
						}
					}
				}
			}
		}

		m = ua.match(/Caja\/([^\s]*)/);
		if (m && m[1]) {
			o.caja = parseFloat(m[1]);
		}

		return o;
	}();
	/* Codes End Here */

	/* Register Start Here */
	jiyiri.helper.browser.BrowserType = BrowserType;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/browser/browsertype.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/client/3rd/swfobject.js -----*//**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if (!window.opera && document.all && this.installedVer.major > 7) {
		// only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
		deconcept.SWFObject.doPrepUnload = true;
	}
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', false);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	useExpressInstall: function(path) {
		this.xiSWFPath = !path ? "expressinstall.swf" : path;
		this.setAttribute('useExpressInstall', true);
	},
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs[variablePairs.length] = key +"="+ variables[key];
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "PlugIn");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "ActiveX");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
		var axo = 1;
		var counter = 3;
		while(axo) {
			try {
				counter++;
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
//				document.write("player v: "+ counter);
				PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
			} catch (e) {
				axo = null;
			}
		}
	} else { // Win IE (non mobile)
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if (param == null) { return q; }
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i = objects.length - 1; i >= 0; i--) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
if (deconcept.SWFObject.doPrepUnload) {
	if (!deconcept.unloadSet) {
		deconcept.SWFObjectUtil.prepUnload = function() {
			__flash_unloadHandler = function(){};
			__flash_savedUnloadHandler = function(){};
			window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
		}
		window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
		deconcept.unloadSet = true;
	}
}
/* add document.getElementById if needed (mobile IE < 5) */
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/client/3rd/swfobject.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/client/client.js -----*/jiyiri.register_namespace('jiyiri.helper.client');

( function() {

	/* Codes Start Here */
	var Client = {};
	Client.force_open_window = function(url)
	{
		var form = document.createElement('form');
		Element.hide(form);
		document.body.appendChild(form);
		form.action = url;
		form.method = 'get';
		form.target = '_blank';
		form.submit();
	};
	Client.copy_to_clipboard = function(txt) {
		if (window.clipboardData) {
			window.clipboardData.clearData();
			window.clipboardData.setData("Text", txt);
			alert("复制成功！");
		} else if (navigator.userAgent.indexOf("Opera") != -1) {
			window.location = txt;
		} else if (window.netscape) {
			try {
				netscape.security.PrivilegeManager
						.enablePrivilege("UniversalXPConnect");
			} catch (e) {
				alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");
			}
			var clip = Components.classes['@mozilla.org/widget/clipboard;1']
					.createInstance(Components.interfaces.nsIClipboard);
			if (!clip)
				return;
			var trans = Components.classes['@mozilla.org/widget/transferable;1']
					.createInstance(Components.interfaces.nsITransferable);
			if (!trans)
				return;
			trans.addDataFlavor('text/unicode');
			var str = new Object();
			var len = new Object();
			var str = Components.classes["@mozilla.org/supports-string;1"]
					.createInstance(Components.interfaces.nsISupportsString);
			var copytext = txt;
			str.data = copytext;
			trans.setTransferData("text/unicode", str, copytext.length * 2);
			var clipid = Components.interfaces.nsIClipboard;
			if (!clip)
				return false;
			clip.setData(trans, null, clipid.kGlobalClipboard);
			alert("复制成功！");
		}
	};
	/* Codes End Here */

	/* Register Start Here */
	jiyiri.helper.client.Client = Client;
	/* Register End Here */
})();

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/client/client.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/client/swfobject.js -----*/jiyiri.register_namespace('jiyiri.helper.client');
/* jiyiri.require_once('jiyiri.helper.client.3rd.swfobject'); */

( function() {

	/* Codes Start Here */

	/**
	 * @see http://blog.deconcept.com/swfobject/#download
	 */

	/**
	 * @usage
	 * 	var so = new SWFObject("so_tester.swf", "sotester", "300", "300", "9", "#FF6600");
	 *  so.addVariable("flashVarText", "this is passed in via FlashVars for example only"); // this line is optional, but this example uses the variable and displays this text inside the flash movie
	 *	so.write("flashcontent");
	 */


	/* Codes End Here */

	/* Register Start Here */

	/* Register End Here */
})();

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/client/swfobject.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/eventhelper/eventhelper.js -----*/jiyiri.register_namespace('jiyiri.helper.eventhelper');
/* jiyiri.require_once('jiyiri.helper.browser.browsertype'); */

( function() {

	/* Codes Start Here */
	var EventHelper = {};

	EventHelper.create_event_function = function(obj, strFunc) {
		var args = [];
		if (!obj)
			obj = window;
		for ( var i = 2; i < arguments.length; i++)
			args.push(arguments[i]);
		return function() {
			return obj[strFunc].apply(obj, args);
		}
	};

	EventHelper.create_callback_function = function(obj, strFunc) {
		if (!obj)
			obj = window;
		return function() {
			return obj[strFunc].apply(obj, arguments);
		}
	};
	
	EventHelper.bind_iframe_load = function(iframe, callback) {
		if (jiyiri.helper.browser.BrowserType.is('ie')) {
			iframe.onreadystatechange = function() {
				if (this.readyState == "complete") {
					callback();
				}
			}
		} else {
			iframe.onload = callback;
		}
	};

	/* Codes End Here */

	/* Register Start Here */
	jiyiri.helper.eventhelper.EventHelper = EventHelper;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/eventhelper/eventhelper.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/htmlelementhelper/htmlelementhelper.js -----*/jiyiri.register_namespace('jiyiri.helper.htmlelementhelper');

( function() {

	/* Codes Start Here */
	var HTMLElementHelper = {};
	HTMLElementHelper.CleanOption = function(sel) {
		$(sel).innerHTML = '';
	};

	HTMLElementHelper.add_option = function(sel, n, v) {
		var oOption = document.createElement("option");
		sel.appendChild(oOption);
		oOption.text = n;
		oOption.value = v;
		oOption = null;
	};

	HTMLElementHelper.select_option = function(sel, v) {
		var options = sel.getElementsByTagName('option');
		for ( var i = 0; i < options.length; i++) {
			if (options[i].value == v) {
				/**
				 * fix IE6 bug
				 */
				try {
					options[i].selected = true;
				} catch (ex) {
					sel.selectedIndex = i;
				}

				break;
			}
		}
	};

	HTMLElementHelper.delete_option_by_value = function(sel, v) {
		var options = sel.getElementsByTagName('option');
		for ( var i = 0; i < options.length; i++) {
			if (options[i].value == v) {
				sel.removeChild(options[i]);
				break;
			}
		}
	};

	HTMLElementHelper.clean_table = function(tTable) {
		if (null == tTable)
			return;

		var rowNumber = tTable.rows.length;

		for ( var i = 0; i < rowNumber; i++) {
			tTable.deleteRow(0);
		}
	};

	HTMLElementHelper.clean_table_except_th = function(tTable) {
		if (null == tTable)
			return;

		var rowNumber = tTable.rows.length;

		for ( var i = 1; i < rowNumber; i++) {
			tTable.deleteRow(1);
		}
	};

	HTMLElementHelper.get_radio_value = function(radio_name) {

		var objs = document.getElementsByName(radio_name);
		for(var i=0;i<objs.length;i++)
		{
			if(objs[i].checked)
			{
				return $F(objs[i]);
			}
		}
	};
	
	HTMLElementHelper.set_radio_value = function(radio_name,value) {

		var objs = document.getElementsByName(radio_name);
		for(var i=0;i<objs.length;i++)
		{
			if(objs[i].value==value)
			{
				objs[i].checked=true;
			}
		}
	};
	

	/* Codes End Here */

	/* Register Start Here */
	jiyiri.helper.htmlelementhelper.HTMLElementHelper = HTMLElementHelper;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/htmlelementhelper/htmlelementhelper.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/htmlelementhelper/stylesheethelper.js -----*/jiyiri.register_namespace('jiyiri.helper.htmlelementhelper');

( function() {

	/* Codes Start Here */
	//from http://www.zapatec.com/website/ajax/zpsuite/jsdocs/overview-summary-stylesheet.js.html
	StyleSheetHelper = function(bUseLast) {
		if (bUseLast) {
			// Use last style tag
			if (document.createStyleSheet) {
				// IE
				if (document.styleSheets.length) {
					this.styleSheet = document.styleSheets[document.styleSheets.length - 1];
				}
			} else {
				// Others
				var aStyleSheets = document.getElementsByTagName('style');
				if (aStyleSheets.length) {
					this.styleSheet = aStyleSheets[aStyleSheets.length - 1];
				}
				/* Works properly only in Firefox
				if (document.styleSheets) {
					this.n = document.styleSheets.length - 1;
				}
				 */
			}
		}
		if (!this.styleSheet) {
			if (document.createStyleSheet) {
				// IE
				try {
					this.styleSheet = document.createStyleSheet();
				} catch(oException) {
					// There is a limit of 30 style tags in Internet Explorer
					this.styleSheet = document.styleSheets[document.styleSheets.length - 1];
				};
			} else {
				// Others
				this.styleSheet = document.createElement('style');
				this.styleSheet.type = 'text/css';
				var oHead = document.getElementsByTagName('head')[0];
				// If there is no head tag on the page (Opera only)
				if (!oHead) {
					oHead = document.documentElement;
				}
				if (oHead) {
					oHead.appendChild(this.styleSheet);
				}
	/* Works properly only in Firefox
				if (document.styleSheets) {
					this.n = document.styleSheets.length - 1;
				}
	*/
			}
		}
	};

	/**
	 * Adds a rule to the style sheet.
	 *
	 * @param {string} strSelector Rule selector
	 * @param {string} strDeclarations Rule declarations
	 */
	StyleSheetHelper.prototype.addRule = function(strSelector, strDeclarations) {
		if (!this.styleSheet) {
			// Object in not initialized properly
			return;
		}
		if (document.createStyleSheet) {
			// IE
	/* Any unsupported selector in addRule crashes IE 6
			this.styleSheet.addRule(strSelector, strDeclarations);
	*/
			this.styleSheet.cssText += strSelector + ' { ' + strDeclarations + ' }';
	/* Works properly only in Firefox
		} else if (document.styleSheets) {
			// Firefox, Safari, Konqueror
			var objStyleSheet = document.styleSheets.item(this.n);
			objStyleSheet.insertRule(strSelector + ' { ' + strDeclarations + ' }',
			 objStyleSheet.cssRules.length);
	*/
		} else {
			// Opera
			this.styleSheet.appendChild(
			 document.createTextNode(strSelector + ' { ' + strDeclarations + ' }')
			);
		}
	};

    StyleSheetHelper.prototype.addRuleStr = function(str) {
		if (!this.styleSheet) {
			// Object in not initialized properly
			return;
		}
		if (document.createStyleSheet) {
			// IE
	/* Any unsupported selector in addRule crashes IE 6
			this.styleSheet.addRule(strSelector, strDeclarations);
	*/
			this.styleSheet.cssText += str;
	/* Works properly only in Firefox
		} else if (document.styleSheets) {
			// Firefox, Safari, Konqueror
			var objStyleSheet = document.styleSheets.item(this.n);
			objStyleSheet.insertRule(strSelector + ' { ' + strDeclarations + ' }',
			 objStyleSheet.cssRules.length);
	*/
		} else {
			// Opera
			this.styleSheet.appendChild(
			 document.createTextNode(str)
			);
		}
	};

	/**
	 * Removes all rules from the style sheet.
	 */
	StyleSheetHelper.prototype.removeRules = function() {
		if (!this.styleSheet) {
			// Object in not initialized properly
			return;
		}
		if (document.createStyleSheet) {
			// IE
			var iRules = this.styleSheet.rules.length;
			for (var iRule = 0; iRule < iRules; iRule++) {
				this.styleSheet.removeRule();
			}
	/* Works properly only in Firefox
		} else if (document.styleSheets) {
			// Firefox, Safari, Konqueror
			var objStyleSheet = document.styleSheets.item(this.n);
			var iRules = objStyleSheet.cssRules.length;
			for (var iRule = 0; iRule < iRules; iRule++) {
				objStyleSheet.deleteRule(0);
			}
	*/
		} else {
			// Opera
			while (this.styleSheet.firstChild) {
				this.styleSheet.removeChild(this.styleSheet.firstChild);
			}
		}
	};

	/**
	 * Parses a CSS string and adds rules into the style sheet.
	 *
	 * @param {string} strStyleSheet CSS string
	 */
	StyleSheetHelper.prototype.addParse = function(strStyleSheet) {
		// Remove comments
		var arrClean = [];
		var arrTokens = strStyleSheet.split('/*');
		for (var iTok = 0; iTok < arrTokens.length; iTok++) {
			var arrTails = arrTokens[iTok].split('*/');
			arrClean.push(arrTails[arrTails.length - 1]);
		}
		strStyleSheet = arrClean.join('');
		// Remove at-rules
		strStyleSheet = strStyleSheet.replace(/@[^{]*;/g, '');

		if(!Zapatec.is_opera){
			this.addRules(strStyleSheet);
		} else {
			// Opera does not understands cssText feature.
			// So split to styles
			var arrStyles = strStyleSheet.split('}');
			for (var iStl = 0; iStl < arrStyles.length; iStl++) {
				// Split to selector and declarations
				var arrRules = arrStyles[iStl].split('{');
				if (arrRules[0] && arrRules[1]) {
					// Split selector
					var arrSelectors = arrRules[0].split(',');
					for (var iSel = 0; iSel < arrSelectors.length; iSel++) {
						this.addRule(arrSelectors[iSel], arrRules[1]);
					}
				}
			}
		}
	};

	/**
	 * Creates &lt;STYLE&gt; element with given content. Does not work for Opera.
	 * @param cssStr {String} CSS text to add.
	 */
	StyleSheetHelper.prototype.addRules = function(cssStr){
		if(!cssStr || Zapatec.is_opera){
			return;
		}

		if(Zapatec.is_ie){
			// IE
			if(this.styleSheet.disabled){
				var self = this;
				setTimeout(function(){self.styleSheet.cssText = cssStr;}, 10);
			} else {
				this.styleSheet.cssText = cssStr;
			}
		} else {
			// other
			var cssText = document.createTextNode(cssStr);
			this.styleSheet.appendChild(cssText);
		}
	}



	/* Codes End Here */

	/* Register Start Here */
	jiyiri.helper.htmlelementhelper.StyleSheetHelper = StyleSheetHelper;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/htmlelementhelper/stylesheethelper.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/json/json.js -----*/jiyiri.register_namespace('jiyiri.helper.json');

( function() {

	/* Codes Start Here */

	/*
	 * http://www.JSON.org/json2.js 2008-11-19
	 *
	 * Public Domain.
	 *
	 * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
	 *
	 * See http://www.JSON.org/js.html
	 *
	 * This file creates a global JSON object containing two methods: stringify
	 * and parse.
	 *
	 * JSON.stringify(value, replacer, space) value any JavaScript value,
	 * usually an object or array.
	 *
	 * replacer an optional parameter that determines how object values are
	 * stringified for objects. It can be a function or an array of strings.
	 *
	 * space an optional parameter that specifies the indentation of nested
	 * structures. If it is omitted, the text will be packed without extra
	 * whitespace. If it is a number, it will specify the number of spaces to
	 * indent at each level. If it is a string (such as '\t' or '&nbsp;'), it
	 * contains the characters used to indent at each level.
	 *
	 * This method produces a JSON text from a JavaScript value.
	 *
	 * When an object value is found, if the object contains a toJSON method,
	 * its toJSON method will be called and the result will be stringified. A
	 * toJSON method does not serialize: it returns the value represented by the
	 * name/value pair that should be serialized, or undefined if nothing should
	 * be serialized. The toJSON method will be passed the key associated with
	 * the value, and this will be bound to the object holding the key.
	 *
	 * For example, this would serialize Dates as ISO strings.
	 *
	 * Date.prototype.toJSON = function (key) { function f(n) { // Format
	 * integers to have at least two digits. return n < 10 ? '0' + n : n; }
	 *
	 * return this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' +
	 * f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' +
	 * f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z'; };
	 *
	 * You can provide an optional replacer method. It will be passed the key
	 * and value of each member, with this bound to the containing object. The
	 * value that is returned from your method will be serialized. If your
	 * method returns undefined, then the member will be excluded from the
	 * serialization.
	 *
	 * If the replacer parameter is an array of strings, then it will be used to
	 * select the members to be serialized. It filters the results such that
	 * only members with keys listed in the replacer array are stringified.
	 *
	 * Values that do not have JSON representations, such as undefined or
	 * functions, will not be serialized. Such values in objects will be
	 * dropped; in arrays they will be replaced with null. You can use a
	 * replacer function to replace those with JSON values.
	 * JSON.stringify(undefined) returns undefined.
	 *
	 * The optional space parameter produces a stringification of the value that
	 * is filled with line breaks and indentation to make it easier to read.
	 *
	 * If the space parameter is a non-empty string, then that string will be
	 * used for indentation. If the space parameter is a number, then the
	 * indentation will be that many spaces.
	 *
	 * Example:
	 *
	 * text = JSON.stringify(['e', {pluribus: 'unum'}]); // text is
	 * '["e",{"pluribus":"unum"}]'
	 *
	 *
	 * text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); // text is
	 * '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
	 *
	 * text = JSON.stringify([new Date()], function (key, value) { return
	 * this[key] instanceof Date ? 'Date(' + this[key] + ')' : value; }); //
	 * text is '["Date(---current time---)"]'
	 *
	 *
	 * JSON.parse(text, reviver) This method parses a JSON text to produce an
	 * object or array. It can throw a SyntaxError exception.
	 *
	 * The optional reviver parameter is a function that can filter and
	 * transform the results. It receives each of the keys and values, and its
	 * return value is used instead of the original value. If it returns what it
	 * received, then the structure is not modified. If it returns undefined
	 * then the member is deleted.
	 *
	 * Example:
	 *  // Parse the text. Values that look like ISO date strings will // be
	 * converted to Date objects.
	 *
	 * myData = JSON.parse(text, function (key, value) { var a; if (typeof value
	 * === 'string') { a =
	 * /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
	 * if (a) { return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], +a[5],
	 * +a[6])); } } return value; });
	 *
	 * myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { var
	 * d; if (typeof value === 'string' && value.slice(0, 5) === 'Date(' &&
	 * value.slice(-1) === ')') { d = new Date(value.slice(5, -1)); if (d) {
	 * return d; } } return value; });
	 *
	 *
	 * This is a reference implementation. You are free to copy, modify, or
	 * redistribute.
	 *
	 * This code should be minified before deployment. See
	 * http://javascript.crockford.com/jsmin.html
	 *
	 * USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU
	 * DO NOT CONTROL.
	 */

	/* jslint evil: true */

	/* global JSON */

	/*
	 * members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, call,
	 * charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, getUTCMinutes,
	 * getUTCMonth, getUTCSeconds, hasOwnProperty, join, lastIndex, length,
	 * parse, prototype, push, replace, slice, stringify, test, toJSON,
	 * toString, valueOf
	 */

	// Create a JSON object only if one does not already exist. We create the
	// methods in a closure to avoid creating global variables.
	if (!this.JSON) {
		JSON = {};
	}
	( function() {

		function f(n) {
			// Format integers to have at least two digits.
			return n < 10 ? '0' + n : n;
		}

		if (typeof Date.prototype.toJSON !== 'function') {

			Date.prototype.toJSON = function(key) {

				return this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1)
						+ '-' + f(this.getUTCDate()) + 'T'
						+ f(this.getUTCHours()) + ':' + f(this.getUTCMinutes())
						+ ':' + f(this.getUTCSeconds()) + 'Z';
			};

			String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(
					key) {
				return this.valueOf();
			};
		}

		var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = { // table of character substitutions
			'\b' :'\\b',
			'\t' :'\\t',
			'\n' :'\\n',
			'\f' :'\\f',
			'\r' :'\\r',
			'"' :'\\"',
			'\\' :'\\\\'
		}, rep;

		function quote(string) {

			// If the string contains no control characters, no quote
			// characters, and no
			// backslash characters, then we can safely slap some quotes around
			// it.
			// Otherwise we must also replace the offending characters with safe
			// escape
			// sequences.

			escapable.lastIndex = 0;
			return escapable.test(string) ? '"' + string.replace(escapable,
					function(a) {
						var c = meta[a];
						return typeof c === 'string' ? c : '\\u' + ('0000' + a
								.charCodeAt(0).toString(16)).slice(-4);
					}) + '"' : '"' + string + '"';
		}

		function str(key, holder) {

			// Produce a string from holder[key].

			var i, // The loop counter.
			k, // The member key.
			v, // The member value.
			length, mind = gap, partial, value = holder[key];

			// If the value has a toJSON method, call it to obtain a replacement
			// value.

			if (value && typeof value === 'object'
					&& typeof value.toJSON === 'function') {
				value = value.toJSON(key);
			}

			// If we were called with a replacer function, then call the
			// replacer to
			// obtain a replacement value.

			if (typeof rep === 'function') {
				value = rep.call(holder, key, value);
			}

			// What happens next depends on the value's type.

			switch (typeof value) {
			case 'string':
				return quote(value);

			case 'number':

				// JSON numbers must be finite. Encode non-finite numbers as
				// null.

				return isFinite(value) ? String(value) : 'null';

			case 'boolean':
			case 'null':

				// If the value is a boolean or null, convert it to a string.
				// Note:
				// typeof null does not produce 'null'. The case is included
				// here in
				// the remote chance that this gets fixed someday.

				return String(value);

				// If the type is 'object', we might be dealing with an object
				// or an array or
				// null.

			case 'object':

				// Due to a specification blunder in ECMAScript, typeof null is
				// 'object',
				// so watch out for that case.

				if (!value) {
					return 'null';
				}

				// Make an array to hold the partial results of stringifying
				// this object value.

				gap += indent;
				partial = [];

				// Is the value an array?

				if (Object.prototype.toString.apply(value) === '[object Array]') {

					// The value is an array. Stringify every element. Use null
					// as a placeholder
					// for non-JSON values.

					length = value.length;
					for (i = 0; i < length; i += 1) {
						partial[i] = str(i, value) || 'null';
					}

					// Join all of the elements together, separated with commas,
					// and wrap them in
					// brackets.

					v = partial.length === 0 ? '[]' : gap ? '[\n' + gap
							+ partial.join(',\n' + gap) + '\n' + mind + ']'
							: '[' + partial.join(',') + ']';
					gap = mind;
					return v;
				}

				// If the replacer is an array, use it to select the members to
				// be stringified.

				if (rep && typeof rep === 'object') {
					length = rep.length;
					for (i = 0; i < length; i += 1) {
						k = rep[i];
						if (typeof k === 'string') {
							v = str(k, value);
							if (v) {
								partial.push(quote(k) + (gap ? ': ' : ':') + v);
							}
						}
					}
				} else {

					// Otherwise, iterate through all of the keys in the object.

					for (k in value) {
						if (Object.hasOwnProperty.call(value, k)) {
							v = str(k, value);
							if (v) {
								partial.push(quote(k) + (gap ? ': ' : ':') + v);
							}
						}
					}
				}

				// Join all of the member texts together, separated with commas,
				// and wrap them in braces.

				v = partial.length === 0 ? '{}' : gap ? '{\n' + gap
						+ partial.join(',\n' + gap) + '\n' + mind + '}'
						: '{' + partial.join(',') + '}';
				gap = mind;
				return v;
			}
		}

		// If the JSON object does not yet have a stringify method, give it one.

		if (typeof JSON.stringify !== 'function') {
			JSON.stringify = function(value, replacer, space) {

				// The stringify method takes a value and an optional replacer,
				// and an optional
				// space parameter, and returns a JSON text. The replacer can be
				// a function
				// that can replace values, or an array of strings that will
				// select the keys.
				// A default replacer method can be provided. Use of the space
				// parameter can
				// produce text that is more easily readable.

				var i;
				gap = '';
				indent = '';

				// If the space parameter is a number, make an indent string
				// containing that
				// many spaces.

				if (typeof space === 'number') {
					for (i = 0; i < space; i += 1) {
						indent += ' ';
					}

					// If the space parameter is a string, it will be used as
					// the indent string.

				} else if (typeof space === 'string') {
					indent = space;
				}

				// If there is a replacer, it must be a function or an array.
				// Otherwise, throw an error.

				rep = replacer;
				if (replacer
						&& typeof replacer !== 'function'
						&& (typeof replacer !== 'object' || typeof replacer.length !== 'number')) {
					throw new Error('JSON.stringify');
				}

				// Make a fake root object containing our value under the key of
				// ''.
				// Return the result of stringifying the value.

				return str('', {
					'' :value
				});
			};
		}

		// If the JSON object does not yet have a parse method, give it one.

		if (typeof JSON.parse !== 'function') {
			JSON.parse = function(text, reviver) {

				// The parse method takes a text and an optional reviver
				// function, and returns
				// a JavaScript value if the text is a valid JSON text.

				var j;

				function walk(holder, key) {

					// The walk method is used to recursively walk the resulting
					// structure so
					// that modifications can be made.

					var k, v, value = holder[key];
					if (value && typeof value === 'object') {
						for (k in value) {
							if (Object.hasOwnProperty.call(value, k)) {
								v = walk(value, k);
								if (v !== undefined) {
									value[k] = v;
								} else {
									delete value[k];
								}
							}
						}
					}
					return reviver.call(holder, key, value);
				}

				// Parsing happens in four stages. In the first stage, we
				// replace certain
				// Unicode characters with escape sequences. JavaScript handles
				// many characters
				// incorrectly, either silently deleting them, or treating them
				// as line endings.

				cx.lastIndex = 0;
				if (cx.test(text)) {
					text = text.replace(cx, function(a) {
						return '\\u' + ('0000' + a.charCodeAt(0).toString(16))
								.slice(-4);
					});
				}

				// In the second stage, we run the text against regular
				// expressions that look
				// for non-JSON patterns. We are especially concerned with '()'
				// and 'new'
				// because they can cause invocation, and '=' because it can
				// cause mutation.
				// But just to be safe, we want to reject all unexpected forms.

				// We split the second stage into 4 regexp operations in order
				// to work around
				// crippling inefficiencies in IE's and Safari's regexp engines.
				// First we
				// replace the JSON backslash pairs with '@' (a non-JSON
				// character). Second, we
				// replace all simple value tokens with ']' characters. Third,
				// we delete all
				// open brackets that follow a colon or comma or that begin the
				// text. Finally,
				// we look to see that the remaining characters are only
				// whitespace or ']' or
				// ',' or ':' or '{' or '}'. If that is so, then the text is
				// safe for eval.

				if (/^[\],:{}\s]*$/
						.test(text
								.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
										'@')
								.replace(
										/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
										']')
								.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {

					// In the third stage we use the eval function to compile
					// the text into a
					// JavaScript structure. The '{' operator is subject to a
					// syntactic ambiguity
					// in JavaScript: it can begin a block or an object literal.
					// We wrap the text
					// in parens to eliminate the ambiguity.

					j = eval('(' + text + ')');

					// In the optional fourth stage, we recursively walk the new
					// structure, passing
					// each name/value pair to a reviver function for possible
					// transformation.

					return typeof reviver === 'function' ? walk( {
						'' :j
					}, '') : j;
				}

				// If the text is not JSON parseable, then a SyntaxError is
				// thrown.

				throw new SyntaxError('JSON.parse');
			};
		}
	})();

	/* Codes End Here */

	/* Register Start Here */
	jiyiri.helper.json.JSON = JSON;

	/* Register End Here */
})();

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/json/json.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/net/ajax.js -----*/jiyiri.register_namespace('jiyiri.helper.net');
/* jiyiri.require('jiyiri.helper.net.Parameter'); */


(function(){
    /* Codes Start Here */
    var AjaxClass = {};
	
    /**
     * 发送ajax的POST请求
     * 
     * @param {String} url
     * @param {jiyiri.helper.net.Parameter} params
     * @param {Function} callback
     * 
     * @return ajax object
     */
    AjaxClass.post = function(url, params, callback){
    	
    	params = params ? params : new jiyiri.helper.net.Parameter();
        var ajax = new Ajax.Request(url, {
            method: 'post',
            parameters: params.to_query_string(),
            onComplete: callback
        });
        return ajax;
    };
    
	/**
     * 发送ajax的GET请求
     * 
     * @param {String} url
     * @param {jiyiri.helper.net.Parameter} params
     * @param {Function} callback
     * 
     * @return ajax object
     */
    AjaxClass.get = function(url, params, callback){
    	params = params ? params : new jiyiri.helper.net.Parameter();
        var ajax = new Ajax.Request(url, {
            method: 'get',
            parameters: params.to_query_string(),
            onComplete: callback
        });
        return ajax;
    };
    
	/**
	 * 为ThinkPHP定制的ajax的POST请求
	 * 
	 * @param {String} module
	 * @param {String} action
	 * @param {jiyiri.helper.net.Parameter} params
	 * @param {Function} callback
	 * 
	 * @return ajax object
	 */
    AjaxClass.post_tp = function(module, action, params, callback){
        var url = __APP__+'/' + module + '/' + action;
        return this.post(url, params, callback);
    };
    
	/**
	 * 为ThinkPHP定制的ajax的GET请求
	 * 
	 * @param {String} module
	 * @param {String} action
	 * @param {jiyiri.helper.net.Parameter} params
	 * @param {Function} callback
	 * 
	 * @return ajax object
	 */
    AjaxClass.get_tp = function(module, action, params, callback){
        var url = __APP__+'/' + module + '/' + action;
        return this.get(url, params, callback);
    };
	
	/**
	 * 解析ThinkPHP的返回结果
	 * @param {Object} response
	 */
	AjaxClass.parse_tp_return = function(response)
	{
		var response_text = '';
		if('object'== typeof(response) && response.responseText)
		{
			response_text = response.responseText;
		}
		else
		{
			response_text = response;
		}
		
		var rst = null;
		try {
			eval('var rst=' + response_text);
		}
		catch(ex)
		{
			//do nothing
		}
		return rst;		
	}
    /* Codes End Here */
    
    /* Register Start Here */
    jiyiri.helper.net.Ajax = AjaxClass;
    /* Register End Here */

})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/net/ajax.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/net/form.js -----*/jiyiri.register_namespace('jiyiri.helper.net');
/* jiyiri.require_once('jiyiri.helper.net.Parameter'); */

(function(){
	/* Codes Start Here */

	var Form = {};
    /**
     * 使用POST提交
     * @param {String} url 地址
     * @param {jiyiri.helper.net.Parameter} params 参数
     */
    Form.post = function(url, params){
    	params = params ? params : new jiyiri.helper.net.Parameter();
        var form = document.createElement('form');
        form.action = url;
        form.method = 'POST';
        params = params.get_params();
        for (var i = 0; i < params.length; i++) {
			var textfield = document.createElement('input');
			textfield.type = 'hidden';
			textfield.name=params[i].Key
            textfield.value = params[i].Value;
            form.appendChild(textfield);
        }
        document.body.appendChild(form);
        form.submit();
    };
    /**
     * 为ThinkPHP定制的使用Form提交
     * @param {String} module 模块名
     * @param {String} action 操作名
     * @param {jiyiri.helper.net.Parameter} params 参数
     */
    Form.post_tp = function(module, action, params){
		var url = __APP__+'/' + module + '/' + action;
        this.post(url, params);
    };
	/* Codes End Here */

	/* Register Start Here */
	jiyiri.helper.net.Form = Form;
	/* Register End Here */
})();

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/net/form.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/net/parameter.js -----*/
jiyiri.register_namespace('jiyiri.helper.net');

(function()
{
	/* Codes Start Here */
	Parameter = Class.create();
	Parameter.prototype = {
		initialize: function(){
			this._parameters = new Array();
		},
		add_param: function(key, value){
			var param_obj = {
				Key: key,
				Value: value
			};
			this._parameters.push(param_obj);
		},
		get_params: function(){
			return this._parameters;
		},
		to_query_string: function(){
			var query_string = "?";
			for (var i = 0; i < this._parameters.length; i++) {
				query_string += this._parameters[i].Key + '=' + encodeURIComponent(this._parameters[i].Value) + '&';
			}
			return query_string;
		}
	};
	/* Codes End Here */
	
	/* Register Start Here */
	jiyiri.helper.net.Parameter = Parameter;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/net/parameter.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/stringhelper/stringhelper.js -----*/jiyiri.register_namespace('jiyiri.helper.stringhelper');

( function() {

	/* Codes Start Here */
	var StringHelper = {};
	StringHelper.substr = function ( f_string, f_start, f_length ) {
	    // Returns part of a string  
	    // 
	    // version: 810.1317
	    // discuss at: http://phpjs.org/functions/substr
	    // +     original by: Martijn Wieringa
	    // +     bugfixed by: T.Wild
	    // +      tweaked by: Onno Marsman
	    // *       example 1: substr('abcdef', 0, -1);
	    // *       returns 1: 'abcde'
	    // *       example 2: substr(2, 0, -6);
	    // *       returns 2: ''
	    f_string += '';

	    if(f_start < 0) {
	        f_start += f_string.length;
	    }

	    if(f_length == undefined) {
	        f_length = f_string.length;
	    } else if(f_length < 0){
	        f_length += f_string.length;
	    } else {
	        f_length += f_start;
	    }

	    if(f_length < f_start) {
	        f_length = f_start;
	    }

	    return f_string.substring(f_start, f_length);
	}

	StringHelper.strrpos = function ( haystack, needle, offset){
	    // Finds position of last occurrence of a string within another string  
	    // 
	    // version: 810.1317
	    // discuss at: http://phpjs.org/functions/strrpos
	    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	    // +   bugfixed by: Onno Marsman
	    // *     example 1: strrpos('Kevin van Zonneveld', 'e');
	    // *     returns 1: 16
	    var i = (haystack+'').lastIndexOf( needle, offset ); // returns -1
	    return i >= 0 ? i : false;
	}

	StringHelper.str_repeat = function(i, m) {
		for ( var o = []; m > 0; o[--m] = i)
			;
		return (o.join(''));
	};
	StringHelper.sprintf = function() {
		var i = 0, a, f = arguments[i++], o = [], m, p, c, x;
		while (f) {
			if (m = /^[^\x25]+/.exec(f))
				o.push(m[0]);
			else if (m = /^\x25{2}/.exec(f))
				o.push('%');
			else if (m = /^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/
					.exec(f)) {
				if (((a = arguments[m[1] || i++]) == null) || (a == undefined))
					throw ("Too few arguments.");
				if (/[^s]/.test(m[7]) && (typeof (a) != 'number'))
					throw ("Expecting number but found " + typeof (a));
				switch (m[7]) {
				case 'b':
					a = a.toString(2);
					break;
				case 'c':
					a = String.fromCharCode(a);
					break;
				case 'd':
					a = parseInt(a);
					break;
				case 'e':
					a = m[6] ? a.toExponential(m[6]) : a.toExponential();
					break;
				case 'f':
					a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a);
					break;
				case 'o':
					a = a.toString(8);
					break;
				case 's':
					a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a);
					break;
				case 'u':
					a = Math.abs(a);
					break;
				case 'x':
					a = a.toString(16);
					break;
				case 'X':
					a = a.toString(16).toUpperCase();
					break;
				}
				a = (/[def]/.test(m[7]) && m[2] && a > 0 ? '+' + a : a);
				c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' ';
				x = m[5] - String(a).length;
				p = m[5] ? str_repeat(c, x) : '';
				o.push(m[4] ? a + p : p + a);
			} else
				throw ("Huh ?!");
			f = f.substring(m[0].length);
		}
		return o.join('');
	};

	StringHelper.trim = function(str, charlist) {
		var whitespace, l = 0, i = 0;
		str += '';

		if (!charlist) {
			// default list
			whitespace = " \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000";
		} else {
			// preg_quote custom list
			charlist += '';
			whitespace = charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,
					'\$1');
		}

		l = str.length;
		for (i = 0; i < l; i++) {
			if (whitespace.indexOf(str.charAt(i)) === -1) {
				str = str.substring(i);
				break;
			}
		}

		l = str.length;
		for (i = l - 1; i >= 0; i--) {
			if (whitespace.indexOf(str.charAt(i)) === -1) {
				str = str.substring(0, i + 1);
				break;
			}
		}

		return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
	};

	StringHelper.get_length = function(str) {
		var fData = str;
		var intLength = 0;
		for ( var i = 0; i < fData.length; i++) {
			if ((fData.charCodeAt(i) < 0) || (fData.charCodeAt(i) > 255))
				intLength = intLength + 2;
			else
				intLength = intLength + 1;
		}
		return intLength;
	};

	/* Codes End Here */

	/* Register Start Here */
	jiyiri.helper.stringhelper.StringHelper = StringHelper;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/stringhelper/stringhelper.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/validatehelper/data_validate.js -----*/jiyiri.register_namespace('jiyiri.helper.validatehelper');

/* jiyiri.require_once('jiyiri.helper.stringhelper.stringhelper'); */

(function(){

	/*
	 * 数据验证正则
	 */
	var ValidateRegexEnum = Class.create();
		ValidateRegexEnum = {
			Email : /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
			Phone : /^[0]{0,1}(13|15|18|14){1}(\d){1}(\d){8}$/,
			Mobile : /^((\(\d{2,3}\))|(\d{3}\-))?((13\d{9})|(15[389]\d{8}))$/,
			Url : /^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"])*$/,
			Ip : /^(0|[1-9]\d?|[0-1]\d{2}|2[0-4]\d|25[0-5]).(0|[1-9]\d?|[0-1]\d{2}|2[0-4]\d|25[0-5]).(0|[1-9]\d?|[0-1]\d{2}|2[0-4]\d|25[0-5]).(0|[1-9]\d?|[0-1]\d{2}|2[0-4]\d|25[0-5])$/,
			Currency : /^\d+(\.\d+)?$/,
			Number : /^\d+$/,
			Zip : /^[1-9]\d{5}$/,
			QQ : /^[1-9]\d{4,8}$/,
			English : /^[A-Za-z]+$/,
			Chinese :  /^[\u0391-\uFFE5]+$/,
			UserName : /^[a-z]\w{3,19}$/i,
			Integer : /^[-\+]?\d+$/,
			PasswordLength : 6
			};


    var DataValidater = {};

	DataValidater.CheckEmpty = function( content )    /* 检验是否为空 */
	{
		content = jiyiri.helper.stringhelper.StringHelper.trim( content );
		if( content == '' )
		{
			return false;
		}
		else
		{
			return true;
		}
	}

	DataValidater.CheckEmail = function( email )   /* 检验油箱地址格式 */
	{
		var flag = ValidateRegexEnum.Email.test( email );
		return flag;
	}

	DataValidater.CheckPasswordLength = function( password )  /* 检验密码长度 */
	{
		if( password.length < ValidateRegexEnum.PasswordLength )
		{
			return false;
		}
		return true;
	}

	DataValidater.CheckPhone = function( phone )    /* 检验是否为电话号码  */
	{
		var flag = ValidateRegexEnum.Phone.test( phone );
		return flag;
	}

	DataValidater.CheckSame = function( password , repassword )   /* 检验俩次输入是否一致 */
	{
		if( password != repassword )
		{
			return false;
		}
		else
		{
			return true;
		}
	}

	//判断出 str 的长度是否超过了 length
	DataValidater.CheckMaxLength = function( str , length )
	{
		var str_trim = jiyiri.helper.stringhelper.StringHelper.trim(str);
		var str_length = str_trim.length;
		if( str_length > length )
		{
			return false;
		}
		else
		{
			return true;
		}
	}

	//判断出 str 的长度是否小于了 length
	DataValidater.CheckMinLength = function( str , length )
	{
		var str_trim = jiyiri.helper.stringhelper.StringHelper.trim(str);
		var str_length = str_trim.length;
		if( str_length < length )
		{
			return false;
		}
		else
		{
			return true;
		}
	}

    /* Register Start Here */
    jiyiri.helper.validatehelper.DataValidater = DataValidater;
    /* Register End Here */

})();

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/helper/validatehelper/data_validate.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/log/consoleappender.js -----*/jiyiri.register_namespace('jiyiri.log');

( function() {

	/* Codes Start Here */
	var ConsoleAppender = Class.create();
	ConsoleAppender.prototype =
	{
			initialize:function()
			{},
			append:function(level,msg)
			{
				instruct = '';
				var func = null;
				switch(level)
				{
					case jiyiri.log.Log.Level.DEBUG:
						instruct = 'DEBUG';
						func = console.info;
						break;
					case jiyiri.log.Log.Level.INFO:
						instruct = 'INFO';
						func = console.info;
						break;
					case jiyiri.log.Log.Level.ERROR:
						instruct = 'ERROR';
						func = console.info;
						break;
					case jiyiri.log.Log.Level.FATAL:
						instruct = 'FATAL';
						func = console.info;
						break;
					case jiyiri.log.Log.Level.WARN:
						instruct = 'WARN';
						func = console.info;
						break;
					case jiyiri.log.Log.Level.TRACE:
						instruct = 'TRACE';
						func = console.info;
						break;
				}
				func('['+instruct+'] '+msg);
			}
	};
	/* Codes End Here */


	/* Register Start Here */
	jiyiri.log.ConsoleAppender = ConsoleAppender;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/log/consoleappender.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/log/log.js -----*/jiyiri.register_namespace('jiyiri.log');

/* jiyiri.require_once('jiyiri.log.ConsoleAppender'); */
( function() {

	/* Codes Start Here */
	var Log = Class.create();
	Log.Level = {DEBUG:0,INFO:1,ERROR:2,FATAL:3,WARN:4,TRACE:5};
	Log.AppendType = {CLIENT_CONSOLE:1,SERVER:2};
	Log.Config = {
			Append:{Type:Log.AppendType.CLIENT_CONSOLE}
	};
	Log._abstract_log = function(level,msg)
	{
		Log._append(level,msg);
	};
	Log._append = function(level,msg)
	{
		var appender = Log._get_appender();
		appender.append(level,msg);
	};
	Log._get_appender = function()
	{
		var rtn = null;
		switch(Log.Config.Append.Type)
		{
			case Log.AppendType.CLIENT_CONSOLE:
				rtn = new jiyiri.log.ConsoleAppender();
				break;
		}
		return rtn;
	};


	Log.debug = function(msg)
	{
		Log._abstract_log(Log.Level.DEBUG,msg);
	};
	Log.info = function(msg)
	{
		Log._abstract_log(Log.Level.INFO,msg);
	};
	Log.error = function(msg)
	{
		Log._abstract_log(Log.Level.ERROR,msg);
	};
	Log.fatal = function(msg)
	{
		Log._abstract_log(Log.Level.FATAL,msg);
	};
	Log.warn = function(msg)
	{
		Log._abstract_log(Log.Level.WARN,msg);
	};
	Log.trace = function(msg)
	{
		Log._abstract_log(Log.Level.TRACE,msg);
	};

	/* Codes End Here */

	/* Register Start Here */
	jiyiri.log.Log = Log;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/log/log.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/3rd/dateinputer.js -----*/var OldDateInputer = Class.create();
OldDateInputer.prototype = {
    SolarBtn:null,
    LunarBtn:null,
    YearSelect:null,
    MonthSelect:null,
    CurrentShowType:null,
    initialize:function(solarbtn,lunarbtn,yearselect,monthselect,dayselect,issolarhiddenfiled)
    {
        this.SolarBtn = solarbtn;
        this.LunarBtn = lunarbtn;
        this.YearSelect = yearselect;
        this.MonthSelect = monthselect;
        this.DaySelect = dayselect;
        this.IsSolarHiddenFiled = issolarhiddenfiled;
        this.SolarBtn.onclick = createCallbackFunction(this,'ShowSolar');
        this.LunarBtn.onclick = createCallbackFunction(this,'ShowLunar');
        this.YearSelect.onchange = createCallbackFunction(this,'Show');
        this.MonthSelect.onchange = createCallbackFunction(this,'Show');
        this.BeSolar = true;

        //this.YearSelect.onchange = createCallbackFunction(this, 'OnYearSelect');
        //this.MonthSelect.onchange = createCallbackFunction(this, 'OnMonthSelect');
        //this.DaySelect.onchange = createCallbackFunction(this, 'OnDaySelect');

        this.lunarInfo=new Array(
        0x4bd8,0x4ae0,0xa570,0x54d5,0xd260,0xd950,0x5554,0x56af,0x9ad0,0x55d2,
        0x4ae0,0xa5b6,0xa4d0,0xd250,0xd255,0xb54f,0xd6a0,0xada2,0x95b0,0x4977,
        0x497f,0xa4b0,0xb4b5,0x6a50,0x6d40,0xab54,0x2b6f,0x9570,0x52f2,0x4970,
        0x6566,0xd4a0,0xea50,0x6a95,0x5adf,0x2b60,0x86e3,0x92ef,0xc8d7,0xc95f,
        0xd4a0,0xd8a6,0xb55f,0x56a0,0xa5b4,0x25df,0x92d0,0xd2b2,0xa950,0xb557,
        0x6ca0,0xb550,0x5355,0x4daf,0xa5b0,0x4573,0x52bf,0xa9a8,0xe950,0x6aa0,
        0xaea6,0xab50,0x4b60,0xaae4,0xa570,0x5260,0xf263,0xd950,0x5b57,0x56a0,
        0x96d0,0x4dd5,0x4ad0,0xa4d0,0xd4d4,0xd250,0xd558,0xb540,0xb6a0,0x95a6,
        0x95bf,0x49b0,0xa974,0xa4b0,0xb27a,0x6a50,0x6d40,0xaf46,0xab60,0x9570,
        0x4af5,0x4970,0x64b0,0x74a3,0xea50,0x6b58,0x5ac0,0xab60,0x96d5,0x92e0,
        0xc960,0xd954,0xd4a0,0xda50,0x7552,0x56a0,0xabb7,0x25d0,0x92d0,0xcab5,
        0xa950,0xb4a0,0xbaa4,0xad50,0x55d9,0x4ba0,0xa5b0,0x5176,0x52bf,0xa930,
        0x7954,0x6aa0,0xad50,0x5b52,0x4b60,0xa6e6,0xa4e0,0xd260,0xea65,0xd530,
        0x5aa0,0x76a3,0x96d0,0x4afb,0x4ad0,0xa4d0,0xd0b6,0xd25f,0xd520,0xdd45,
        0xb5a0,0x56d0,0x55b2,0x49b0,0xa577,0xa4b0,0xaa50,0xb255,0x6d2f,0xada0,
        0x4b63,0x937f,0x49f8,0x4970,0x64b0,0x68a6,0xea5f,0x6b20,0xa6c4,0xaaef,
        0x92e0,0xd2e3,0xc960,0xd557,0xd4a0,0xda50,0x5d55,0x56a0,0xa6d0,0x55d4,
        0x52d0,0xa9b8,0xa950,0xb4a0,0xb6a6,0xad50,0x55a0,0xaba4,0xa5b0,0x52b0,
        0xb273,0x6930,0x7337,0x6aa0,0xad50,0x4b55,0x4b6f,0xa570,0x54e4,0xd260,
        0xe968,0xd520,0xdaa0,0x6aa6,0x56df,0x4ae0,0xa9d4,0xa4d0,0xd150,0xf252,
        0xd520);

        var ThisObj = this;
        /* 设置消息 */
        this.YearSelect.onchange = function(){
            if( ThisObj.BeSolar ) ThisObj.OnSolarYearChange();
            else ThisObj.OnLunarYearChange();
        }

        this.MonthSelect.onchange = function(){
            if( ThisObj.BeSolar ) ThisObj.OnSolarMonthChange();
            else ThisObj.OnLunarMonthChange();
        }

        this.LunarBtn.onclick = function(){
            ThisObj.OnLunarBtnClick();
            return false;
        }

        this.SolarBtn.onclick = function(){
            ThisObj.OnSolarBtnClick();
            return false;
        }
    },
    Show:function()
    {
        var y=0;
        var m=0;
        var d=0;
        var is_solar = false;

        if(arguments.length==4)
        {
        	y = arguments[0];
        	m = arguments[1];
        	d = arguments[2];
        	is_solar = arguments[3];
        	if(is_solar==='0')
        	{
        		is_solar = false;
        	}
        }

        this.BeSolar = is_solar;

        if(this.BeSolar)
        {
            this.ShowSolar(y,m,d);
        }
        else
        {
            this.ShowLunar(y,m,d);
        }
    },
    ShowLunar:function ()
    {
        this.IsSolarHiddenFiled.value = 'false';
        this.SolarBtn.removeClassName('current');
        this.LunarBtn.addClassName('current');

        var y=0;
        var m=0;
        var d=0;
        var is_solar = false;
        if(arguments.length==3)
        {
        	y = arguments[0];
        	m = arguments[1];
        	d = arguments[2];
        }

        this.ShowDateTime(is_solar,y,m,d);
    },
    ShowSolar:function()
    {
        this.IsSolarHiddenFiled.value = 'true';
        this.SolarBtn.addClassName('current');
        this.LunarBtn.removeClassName('current');

        var y=0;
        var m=0;
        var d=0;
        var is_solar = true;
        if(arguments.length==3)
        {
        	y = arguments[0];
        	m = arguments[1];
        	d = arguments[2];
        }

        this.ShowDateTime(is_solar,y,m,d);
    },
    GetSelectedYear : function(){return parseInt(this.YearSelect.value);},
    GetSelectedMonth:function(){return parseInt(this.MonthSelect.value);},
    GetSelectedDay:function(){return parseInt(this.DaySelect.value);},
    GetSelectedIsSolar:function(){return (this.IsSolarHiddenFiled.value=='true');},

    OnSolarBtnClick:function()
    {
        this.IsSolarHiddenFiled.value = 'true';
        this.SolarBtn.addClassName('current');
        this.LunarBtn.removeClassName('current');

        var lunarYear = parseInt(this.YearSelect.value);
        var lunarMonth = parseInt(this.MonthSelect.value);
        var lunarDay = parseInt(this.DaySelect.value);

        var solarDate = this.GetSolarByLunar(lunarYear, lunarMonth, lunarDay);

        this.ShowDateTime(true, solarDate.year,solarDate.month,solarDate.day);
        return false;
    },

    OnLunarBtnClick:function()
    {
        this.IsSolarHiddenFiled.value = 'false';
        this.SolarBtn.removeClassName('current');
        this.LunarBtn.addClassName('current');

        var solarYear = parseInt(this.YearSelect.value);
        var solarMonth = parseInt(this.MonthSelect.value);
        var solarDay = parseInt(this.DaySelect.value);

        var lunarDate = this.GetLunarBySolar(solarYear, solarMonth, solarDay);

        this.ShowDateTime(false,lunarDate.year,lunarDate.month,lunarDate.day);
        return false;
    },

    GetSolarByLunar:function(year, month, day)
    {
        var rstYear = year;
        var rstMonth = month;
        var rstDay = day;

        if( rstYear == 0 || rstMonth == 0 || rstDay == 0)
        {
            return {'year':rstYear, 'month':rstMonth, 'day':rstDay };
        }else{
            var totalDays = 30;


            for( var i=1900; i<year; i++)
            {
                totalDays += this.GetLunarYearDays(i);
            }

            for( var i=1; i<month; i++)
            {
                totalDays += this.GetLunarMonthDays(year, i);
            }

            if (month > this.LunarleapMonth(year) && this.LunarleapMonth(year) != 0)
            {
                totalDays += this.LunarLeapDays(year);
            }

            totalDays += day;


            for (var i = 1900; i < year + 5; i++)
            {
                var sYearDay = this.SolarYearDays(i);
                if (totalDays > sYearDay)
                {
                    totalDays -= sYearDay;
                }
                else
                {
                    for (var j = 1; j < 13; j++)
                    {
                        if (totalDays > this.SolarDays(i, j - 1))
                        {
                            totalDays -= this.SolarDays(i, j - 1);
                        }
                        else
                        {
                            rstDay = totalDays;
                            rstMonth = j;
                            break;
                        }
                    }

                    rstYear = i;
                    break;
                }
            }


        }

        return {'year':rstYear, 'month':rstMonth, 'day':rstDay };
    },

    GetLunarBySolar:function(year, month, day)
    {
        var rstYear = year;
        var rstMonth = month;
        var rstDay = day;

        if( rstYear == 0 || rstMonth == 0 || rstDay == 0)
        {
            if( rstDay == 31 ) rstDay = 0;
            return {'year':rstYear, 'month':rstMonth, 'day':rstDay };
        }else{
            var totalDays = 0;

            for (var i = 1900; i < year; i++)
            {
                totalDays += this.SolarYearDays(i);
            }

            for (var i = 1; i < month; i++)
            {
                totalDays += this.SolarDays(year, i-1);
            }

            totalDays += day;
            totalDays -= 30;

            for (var i = 1900; i < year + 1; i++)
            {
                var lYearDay = this.GetLunarYearDays(i);
                if (totalDays > lYearDay)
                {
                    totalDays -= lYearDay;
                }
                else
                {
                    var leepMonth = this.LunarleapMonth(i);
                    for (var j = 1; j < 14; j++)
                    {
                        if (totalDays > this.GetLunarMonthDays(i, j))
                        {
                            totalDays -= this.GetLunarMonthDays(i, j);
                            if (leepMonth == j)
                            {
                                if (totalDays > this.LunarLeapDays(i))
                                    totalDays -= this.LunarLeapDays(i);
                                else
                                {
                                    rstDay = totalDays;
                                    rstMonth = j;
                                    break;
                                }
                            }
                        }
                        else
                        {
                            rstDay = totalDays;
                            rstMonth = j;
                            break;
                        }
                    }

                    rstYear = i;
                    break;
                }
            }

        }

        return {'year':rstYear, 'month':rstMonth, 'day':rstDay };
    },

    ShowDateTime:function(beSolar, year, month, day)
    {
        this.BeSolar = beSolar;

        if( true == beSolar )
        {
            //this.SelSolarBtn.className='CalendarBtnCurrent';
            //this.SelLunarBtn.className='CalendarBtnNormal';
            this.ShowSolarDateTime(year, month, day);
        }else{
            //this.SelSolarBtn.className='CalendarBtnNormal';
            //this.SelLunarBtn.className='CalendarBtnCurrent';
            this.ShowLunarDateTime(year, month, day);
        }
    },

    CheckBeValid:function()
    {
        if( 0 == this.MonthSelect.value || 0 == this.DaySelect.value )
        {
            return false;
        }

        return true;
    },

    ShowSolarDateTime:function(year, month, day)
    {
        var cur = new Date();
        this.ModifySolarYearSelector(1901, cur.getFullYear(), year);
        this.ModifySolarMonthSelector(month);
        this.ModifySolarDaySelector(31,day);
    },

    ShowLunarDateTime:function(year, month, day)
    {
        var cur = new Date();
        this.ModifyLunarYearSelector(1901, cur.getFullYear(), year);
        this.ModifyLunarMonthSelector(month);
        this.ModifyLunarDaySelector(30, day);
    },

    ModifySolarYearSelector:function(minNum, maxNum, selNum)
    {
        this.ClearOptions(this.YearSelect);

        this.YearSelect.options.add(new Option("选择年(可选)", 0));
        for (var i = maxNum; i >= minNum; i--)
           this.YearSelect.options.add(new Option(i+"年",i));
        this.YearSelect.value = (selNum <= maxNum)?selNum:0;
    },

    ModifySolarMonthSelector:function(selNum)
    {
        this.ClearOptions(this.MonthSelect);

        this.MonthSelect.options.add(new Option("选择月", 0));
        for (var i = 1; i <= 12; i++)
           this.MonthSelect.options.add(new Option(i+"月",i));

        this.MonthSelect.value = (selNum <= 12)?selNum:0;
    },

    ModifySolarDaySelector:function(maxNum, selNum)
    {
        this.ClearOptions(this.DaySelect);

        this.DaySelect.options.add(new Option("选择日", 0));
        for (var i = 1; i <= maxNum; i++)
           this.DaySelect.options.add(new Option(i+"日",i));
        this.DaySelect.value = (selNum <= maxNum)?selNum:0;
    },

    ModifyLunarYearSelector:function(minNum, maxNum, selNum)
    {
        this.ClearOptions(this.YearSelect);

        this.YearSelect.options.add(new Option("选择年(可选)", 0));
        for (var i = maxNum; i >= minNum; i--)
           this.YearSelect.options.add(new Option("农历"+i+"年",i));
        this.YearSelect.value = (selNum <= maxNum)?selNum:0;
    },

    ModifyLunarMonthSelector:function(selNum)
    {
        var nStr0 = new Array('日','正','二','三','四','五','六','七','八','九','十',"十一", "腊");

        this.ClearOptions(this.MonthSelect);

        this.MonthSelect.options.add(new Option("选择月", 0));
        for (var i = 1; i <= 12; i++)
           this.MonthSelect.options.add(new Option(nStr0[i]+"月",i));

        this.MonthSelect.value = (selNum <= 12)?selNum:0;
    },

    ModifyLunarDaySelector:function(maxNum, selNum)
    {
        this.ClearOptions(this.DaySelect);

        this.DaySelect.options.add(new Option("选择日", 0));
        for (var i = 1; i <= maxNum; i++)
           this.DaySelect.options.add(new Option(this.ChinaLunarDayString(i),i));
        this.DaySelect.value = (selNum <= maxNum)?selNum:0;
    },

    ChinaLunarDayString:function(daynum)
    {
        var nStr1 = new Array('日','一','二','三','四','五','六','七','八','九','十');
        var nStr2 = new Array('初','十','廿','卅','□');

        var s;
        switch (daynum)
        {
          case 10:
             s = '初十';
             break;
          case 20:
             s = '廿十';
             break;
          case 30:
             s = '卅十';
             break;
          default :
             s = nStr2[Math.floor(daynum/10)];
             s += nStr1[daynum%10];
        }

        return s;
    },



    ClearAllOptions:function()
    {
        this.ClearOptions(this.YearSelect);
        this.ClearOptions(this.MonthSelect);
        this.ClearOptions(this.DaySelect);
    },

    ClearOptions:function(selector)
    {
        for (var i=selector.options.length; i>=0; i--)
        {
            selector.remove(i);
        }
    },

    IsPinYear:function(year)//判断是否闰平年
    {
        return(0 == year%4 && (year%100 !=0 || year%400 == 0));
    },

    OnSolarYearChange:function(selector)
    {
        var MonthDay = new Array(31,31,28,31,30,31,30,31,31,30,31,30,31);

        if( this.YearSelect.value == 0 )
        {
            if(this.MonthSelect.value == 2)
            {
                this.ModifySolarDaySelector(29, this.DaySelect.value);
            }else
            {
                this.ModifySolarDaySelector(MonthDay[this.MonthSelect.value], this.DaySelect.value);
            }
        }else
        {
            if( this.MonthSelect.value != 0 )
            {
                var monthdays = 0;
                if( this.MonthSelect.value == 2 )
                {
                    monthdays = this.IsPinYear(this.YearSelect.value) ? 29 : 28;
                }else
                {
                    monthdays = MonthDay[this.MonthSelect.value];
                }

                this.ModifySolarDaySelector(monthdays, this.DaySelect.value);
            }
        }
    },

    OnSolarMonthChange:function()
    {
        var MonthDay = new Array(31,31,28,31,30,31,30,31,31,30,31,30,31);

        if( this.MonthSelect.value == 0 )
        {
            this.ModifySolarDaySelector(31, this.DaySelect.value);
        }else
        {
            if( this.YearSelect.value != 0 )
            {
                var monthdays = 0;
                if( this.MonthSelect.value == 2 )
                {
                    monthdays = this.IsPinYear(this.YearSelect.value) ? 29 : 28;
                }else
                {
                    monthdays = MonthDay[this.MonthSelect.value];
                }

                this.ModifySolarDaySelector(monthdays, this.DaySelect.value);
            }else{
                if(this.MonthSelect.value == 2)
                {
                    this.ModifySolarDaySelector(29, this.DaySelect.value);
                }else
                {
                    this.ModifySolarDaySelector(MonthDay[this.MonthSelect.value], this.DaySelect.value);
                }
            }
        }
    },

    SolarYearDays:function(year)
    {
        return 337 + this.SolarDays(year, 1);
    },

    SolarDays:function(year, month)
    {
        var MonthDay = new Array(31,31,28,31,30,31,30,31,31,30,31,30,31);
        if (month == 1)
        {
            return this.IsPinYear(year) ? 29 : 28;
        }
        else
        {
            return MonthDay[month+1];
        }

        return 0;
    },

    //返回农历 y年m月的总天数
    GetLunarMonthDays:function(year,month)
    {
        return( (this.lunarInfo[year-1900] & (0x10000>>month))? 30: 29 );
    },

    GetLunarYearDays:function(year)
    {
        var rst = 348;
        for( var i = 0x8000; i > 0x8; i >>= 1)
        {
            rst += (this.lunarInfo[year - 1900] & i) != 0 ? 1 : 0;
        }

        return rst + this.LunarLeapDays(year);
    },

    LunarLeapDays:function(year)
    {
        if (this.LunarleapMonth(year) != 0)
        {
            return (((this.lunarInfo[year - 1899] & 0xf) == 0xf) ? 30 : 29);
        }

        return 0;
    },

    LunarleapMonth:function(year)
    {
        var lm = this.lunarInfo[year - 1900] & 0xf;
        return lm == 0xf ? 0 : lm;
    },


    OnLunarYearChange:function()
    {
        if( this.YearSelect.value == 0 )
        {
            /* 重新安排Day */
            this.ModifyLunarDaySelector(30, this.DaySelect.value);
        }else
        {
            if( this.MonthSelect.value != 0)
            {
                /* 这个时候才有可能发生调整 */
                var maxDayNums = this.GetLunarMonthDays(this.YearSelect.value, this.MonthSelect.value);

                this.ModifyLunarDaySelector(maxDayNums, this.DaySelect.value);
            }
        }
    },

    OnLunarMonthChange:function()
    {
        if( this.MonthSelect.value == 0 )
        {
            this.ModifyLunarDaySelector(30, this.DaySelect.value);
        }else
        {
            if(this.YearSelect.value != 0)
            {
                /* 这个时候才有可能发生调整 */
                 var maxDayNums = this.GetLunarMonthDays(this.YearSelect.value, this.MonthSelect.value);

                this.ModifyLunarDaySelector(maxDayNums, this.DaySelect.value);
            }
        }
    }
};
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/3rd/dateinputer.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/3rd/protocheck.js -----*//*--------------------------------------------------------------------------

| Proto Check, version 1.0

| (c) 2008 Neil Harrison

| Released under the terms and conditions of the

| Creative Commons Attribution-Share Alike

| http://creativecommons.org/licenses/by-sa/3.0/

*--------------------------------------------------------------------------*/

ProtoCheck = Class.create({

   initialize: function(options) {

      this.options = {

         checkClass:             'pc_checkbox',

         radioClass:             'pc_radiobutton',

         checkOnClass:           'pc_check_checked',

         checkOffClass:          'pc_check_unchecked',

         radioOnClass:           'pc_radio_checked',

         radioOffClass:          'pc_radio_unchecked',

         checkOnDisabledClass:   'pc_check_checked_disabled',

         checkOffDisabledClass:  'pc_check_unchecked_disabled',

         radioOnDisabledClass:   'pc_radio_checked_disabled',

         radioOffDisabledClass:  'pc_radio_unchecked_disabled',

         focusClass:             'pc_focus'

      };

      Object.extend(this.options, options || { });

      this.classez               = [];

      this.disClassez            = [];

      this.classez.checkbox      = {"on": this.options.checkOnClass, "off": this.options.checkOffClass

};

      this.disClassez.checkbox   = {"on": this.options.checkOnDisabledClass, "off": this.options.checkOffDisabledClass

};

      this.classez.radio         = {"on": this.options.radioOnClass, "off": this.options.radioOffClass

};

      this.disClassez.radio      = {"on": this.options.radioOnDisabledClass, "off": this.options.radioOffDisabledClass

};

    //this.redraw();

    /*

      var elements = $$("label."+this.options.checkClass).concat($$("label."+this.options.radioClass

));

      elements.each(function(label) {

         var element = label.down();

         element.setStyle({position:'absolute',left:'-9999px'});

         if (element.checked) {

            this.check(element, label);

         } else {

            this.uncheck(element, label);

         }

         if (!element.disabled) {

            element.observe("click", function(ev) {

               this.click(ev);

            }.bind(this));

            element.observe("focus", function(ev) {

               this.focus(ev);

            }.bind(this));

            element.observe("blur", function(ev) {

               this.blur(ev);

            }.bind(this));

            if (this.fixIE) {

               label.observe("click", function(ev) {

                  this.clickIE6(ev);

               }.bind(this));

            }

         }

      }.bind(this));*/

      //ProtoCheck._instance = this;

   },

   redraw:function()

   {

       var elements = $$("label."+this.options.checkClass).concat($$("label."+this.options.radioClass

));

       elements.each(function(label) {

         var element = label.down();

         element.setStyle({position:'absolute',left:'-10000px'});

         if (element.checked) {

            this.check(element, label);

         } else {

            this.uncheck(element, label);

         }

         if (!element.disabled) {

            element.observe("click", function(ev) {

               this.click(ev);

            }.bind(this));

            element.observe("focus", function(ev) {

               this.focus(ev);

            }.bind(this));

            element.observe("blur", function(ev) {

               this.blur(ev);

            }.bind(this));

            if (this.fixIE) {

               label.observe("click", function(ev) {

                  this.clickIE6(ev);

               }.bind(this));

            }

         }

        }.bind(this));

   },

   redraw_element_by_state:function(element)

    {

       var label = element.up();

        element.setStyle({position:'absolute',left:'-10000px'});

        if (element.checked)

        {

            this.check(element, label);

        } else

        {

            this.uncheck(element, label);

        }

    },

   handle_element:function(element)

   {

        var label = element.up();

        element.setStyle({position:'absolute',left:'-10000px'});

        if (element.checked)

        {

            this.check(element, label);

        } else

        {

            this.uncheck(element, label);

        }

         if (!element.disabled)

         {

            element.observe("click", function(ev) {this.click(ev);}.bind(this) );

            element.observe("focus", function(ev) {this.focus(ev);}.bind(this));

            element.observe("blur", function(ev) {this.blur(ev);}.bind(this));

            if (this.fixIE)

            {

               label.observe("click", function(ev) {this.clickIE6(ev);}.bind(this));

            }

         }

    },

   fixIE: (function(agent){

      var version = new RegExp('MSIE ([\\d.]+)').exec(agent);

      return version ? (parseFloat(version[1]) <= 6) : false;

   })(navigator.userAgent),

   check: function(element, label) {

      var css = element.disabled ? this.disClassez[element.type] : this.classez[element.type];

      label.addClassName(css.on).removeClassName(css.off);

   },

   uncheck: function(element, label) {

      var css = element.disabled ? this.disClassez[element.type] : this.classez[element.type];

      label.addClassName(css.off).removeClassName(css.on);

   },

   focus: function(ev) {

      var label = ev.element().up();

      label.addClassName(this.options.focusClass);

   },

   blur: function(ev) {

      var label = ev.element().up();

      label.removeClassName(this.options.focusClass);

   },

   click: function(ev) {

      var element = ev.element();

      var label = element.up();

      this.update(ev, element, label);

   },

   clickIE6: function(ev) {

      var label = ev.element();

      if (label.nodeName == "LABEL") {

         var element = label.down();

         element.click();

      }

   },

   update: function(ev, element, label) {

      if (label.hasClassName(this.options.checkClass)) {

         if (element.checked) {

            this.check(element, label);

         } else {

            this.uncheck(element, label);

         }

      }

      if (label.hasClassName(this.options.radioClass)) {

         $$("input[name="+element.name+"]").each(function(but) {

            if (element != but) {

               this.uncheck(but, but.up());

            }

         }.bind(this));

         this.check(element, label);

      }

      element.focus();

   }

});

/*ProtoCheck._insatance = null;

ProtoCheck.GetInstance = function()

    {

		if (null == ProtoCheck._instance) {

			ProtoCheck._instance = new ProtoCheck();

		}

		return ProtoCheck._instance;

	};*/
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/3rd/protocheck.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/beautifier.js -----*/jiyiri.register_namespace('jiyiri.ui');
/* jiyiri.require_once('jiyiri.helper.eventhelper.eventhelper'); */
/* jiyiri.require_once('jiyiri.ui.3rd.protocheck'); */

( function() {

	/* Codes Start Here */
	var Beautifier = {};
	Beautifier.checkbox = function(checkClass,checkOnClass,checkOffClass)
	{
		if(undefined===checkClass)
		{
			checkClass = 'pretty_checkbox';
		}
		if(undefined===checkOnClass)
		{
			checkOnClass = 'checkboxOn';
		}
		if(undefined===checkOffClass)
		{
			checkOffClass = 'checkboxOff';
		}

        new ProtoCheck(
                {
                    'checkClass':checkClass,
                    'checkOnClass':checkOnClass,
                    'checkOffClass':checkOffClass
                }
            );
	};
    Beautifier.get_beautifier = function(checkClass,checkOnClass,checkOffClass)

    {

		if(undefined===checkClass)

		{

			checkClass = 'pretty_checkbox';

		}

		if(undefined===checkOnClass)

		{

			checkOnClass = 'checkboxOn';

		}

		if(undefined===checkOffClass)

		{

			checkOffClass = 'checkboxOff';

		}

        return new ProtoCheck(

                {

                    'checkClass':checkClass,

                    'checkOnClass':checkOnClass,

                    'checkOffClass':checkOffClass

                }

            );

    }

	Beautifier.radio = function(checkClass,checkOnClass,checkOffClass)
	{
		if(undefined===checkClass)
		{
			checkClass = 'pretty_radio';
		}
		if(undefined===checkOnClass)
		{
			checkOnClass = 'radioOn';
		}
		if(undefined===checkOffClass)
		{
			checkOffClass = 'radioOff';
		}

        new ProtoCheck(
                {
                    'radioClass':checkClass,
                    'radioOnClass':checkOnClass,
                    'radioOffClass':checkOffClass
                }
            );
	};

	/* Codes End Here */

	/* Register Start Here */
	jiyiri.ui.Beautifier = Beautifier;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/beautifier.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/dateinputer.js -----*/jiyiri.register_namespace('jiyiri.ui');
/* jiyiri.require_once('jiyiri.helper.eventhelper.eventhelper'); */
/* jiyiri.require_once('jiyiri.ui.3rd.dateinputer'); */

( function() {

	/* Codes Start Here */
	var DateInputer = Class.create();
	DateInputer.prototype={
			initialize:function(solarbtn,lunarbtn,yearselect,monthselect,dayselect,issolarhiddenfiled)
			{
				this.inputer = new OldDateInputer(solarbtn,lunarbtn,yearselect,monthselect,dayselect,issolarhiddenfiled);
			},
			show:function()
			{
				if(arguments.length==0)
				{
					this.inputer.ShowSolar.apply(this.inputer,arguments);
				}
				else
				{
					this.inputer.Show.apply(this.inputer,arguments);
				}
			},
			get_year:function()
			{
				return this.inputer.GetSelectedYear();
			},
			get_month:function()
			{
				return this.inputer.GetSelectedMonth();
			},
			get_day:function()
			{
				return this.inputer.GetSelectedDay();
			},
			get_issolar:function()
			{
				return this.inputer.GetSelectedIsSolar();
			}
	};

	/* Codes End Here */

	/* Register Start Here */
	jiyiri.ui.DateInputer = DateInputer;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/dateinputer.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/dialog.js -----*/jiyiri.register_namespace('jiyiri.ui');
/* jiyiri.require_once('jiyiri.helper.eventhelper.eventhelper'); */

( function() {

	/* Codes Start Here */
	var Dialog = Class.create();
	Dialog._instance = null;
	Dialog.GetInstance = function() {
		if (null == Dialog._instance) {
			Dialog._instance = new Dialog();
		}

		return Dialog._instance;
	};

	Dialog.prototype = {
		initialize : function() {
			this.config = {
					'container_class':'divOuter',
					'titlebar_class':'divHeader',
					'titletext_class':'title',
					'closebtn_class':'btnDiv',
					'default_width':632,
					'default_height':137,
					'loading_html' : '<div class="addBdaySuccessful"><div class="successBlock"><div class="blockTitleDiv2"><div class="orderPayOk">加载中...</div></div><div class="loading"><!----></div><div class="payOkDes"><!----></div></div></div>',
					'default_title':'加载中...',
					'on_close':null,
					'fixed_width':'632px',
					'fixed_top':'100px'
			}
			this._container_div = null;
			this._content_iframe = null;
			this._true_window = null;
			this._true_document = null;
			this._cover = null;
			this._title_bar = null;
			this._title_bar_title_area = null;
			this._loading = null;

            this._on_close_callback_function = null;
            this._on_close_callback_param = null;
			this.init();
		},
		init : function() {
			this._get_parent_window();
			this._build_cover();
			this._build_container();
			this._build_content_iframe();
			this._build_loading();
			this._hide_my_elements();
			this._hide_loading();
		},
		show : function(url,config) {
			Object.extend(this.config, config || { });
			this._content_iframe.src = url;
				jiyiri.helper.eventhelper.EventHelper.bind_iframe_load(
						this._content_iframe,
						jiyiri.helper.eventhelper.EventHelper.create_event_function(this, '_on_content_iframe_load')
						);
			this._on_show();
		},
		set_title:function(title)
		{
			this._title_bar_title_area.innerHTML = title;
		},
		close : function() {
            if(this._on_close_callback_function){
            	try
            	{
            		 this._on_close_callback_function();
            	}
            	catch(error)
            	{
            		//do something
            	}
            }

			this._hide_my_elements();
			jiyiri.helper.eventhelper.EventHelper.bind_iframe_load(this._content_iframe,function(){});
			this._stop_iframe();
			if(this.config.on_close)
			{
				this.config.on_close(this._on_close_callback_param);
			}
			return false;
		},
		auto_resize:function()
		{
			this._adjust_iframe_size();
			this._adjust_container_size();
			this._adjust_container_position();
			this._adjust_cover_size();
		},
        register_on_close_callback_function:function(callback)
        {
            this._on_close_callback_function = callback;
        },
        set_on_close_callback_param:function(callback_param)
        {
            this._on_close_callback_param = callback_param;
        },
        _on_title_bar_close_btn_click:function()
        {
            this.close();
        },
		_on_show:function()
		{
			this._show_my_elements();
			this._show_loading();
			this._adjust_container_size(this.config.default_width,this.config.default_height);
			this._adjust_container_position();
			this._adjust_cover_size();
			document.body.style.scroll='no';
		},
		_on_content_iframe_load : function() {
			this._hide_loading();
			this._adjust_iframe_size();
			this._adjust_window_title();
			this._adjust_container_size();
			this._adjust_container_position();
			this._adjust_cover_size();
		},
		_stop_iframe : function() {
			this._content_iframe.src = 'about:blank';
		},
		_show_loading : function() {
			Element.hide(this._content_iframe);
			Element.show(this._loading);
		},
		_hide_loading : function() {
			Element.show(this._content_iframe);
			Element.hide(this._loading);
		},
		_hide_my_elements : function() {
			Element.hide(this._container_div);
			Element.hide(this._content_iframe);
			Element.hide(this._cover);
		},
		_show_my_elements : function() {
			Element.show(this._container_div);
			Element.show(this._content_iframe);
			Element.show(this._cover);
		},
		_get_parent_window : function() {
			var twin = window, cover;
			while (twin.parent && twin.parent != twin) {
				try {
					if (twin.parent.document.domain != document.domain)
						break;
				} catch (e) {
					break;
				}
				twin = twin.parent;
			}
			var tdoc = twin.document;
			this._true_window = twin;
			this._true_document = tdoc;
		},
		_build_container : function() {
			if(this._container_div)
			{
				return;
			}
			var container = document.createElement('div');
			Element.addClassName(container,this.config.container_class);
			this._container_div = container;
			document.body.appendChild(container);
			container.style.position = 'absolute';
			container.style.zIndex = 999999;
			container.style.backgroundColor = '#FFF';
			var title_bar = this._create_title_bar();
			container.appendChild(title_bar);
			this._title_bar = title_bar;
		},
		_create_title_bar : function() {
			var title_bar = document.createElement('div');
			Element.addClassName(title_bar,this.config.titlebar_class);
			// title_bar.id = '_dialog_title';
			var title_bar_title_area = document.createElement('div');
			Element.addClassName(title_bar_title_area,this.config.titletext_class);
			title_bar.appendChild(title_bar_title_area);
			this._title_bar_title_area = title_bar_title_area;
			title_bar_title_area.innerHTML = this.config.default_title;
			var title_bar_close_btn = document.createElement('div');
			Element.addClassName(title_bar_close_btn,this.config.closebtn_class);
			var title_bar_close_link = document.createElement('a');
			title_bar_close_link.innerHTML = '';
			title_bar_close_link.href = 'javascript:void(0);';
			title_bar_close_link.onclick = jiyiri.helper.eventhelper.EventHelper
					.create_event_function(this, '_on_title_bar_close_btn_click');
			title_bar_close_btn.appendChild(title_bar_close_link);
			title_bar.appendChild(title_bar_close_btn);
			return title_bar;
		},
		_build_content_iframe : function() {
			if(this._content_iframe)
			{
				return;
			}
			var iframe = document.createElement('iframe');
			this._content_iframe = iframe;
			this._content_iframe.style.width = '1000px';
			iframe.frameBorder = 0;
			this._container_div.appendChild(iframe);
		},
		_build_loading : function() {
			if(this._loading)
			{
				return;
			}
			var loading = document.createElement('div');
			this._loading = loading;
			this._container_div.appendChild(loading);
			loading.innerHTML = this.config.loading_html;
		},
		_adjust_window_title : function() {
			var iframe = this._content_iframe;
			if (iframe.src != 'about:blank') {
				this._title_bar_title_area.innerHTML = iframe.contentWindow.document.title;
			}
		},
		_adjust_iframe_size : function() {

			var iframe = this._content_iframe;

			try {
				var bHeight = Element
						.childElements(iframe.contentWindow.document.body)[0].scrollHeight;
				var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
				var bWidth = Element
						.childElements(iframe.contentWindow.document.body)[0].scrollWidth;
				var dWidth = iframe.contentWindow.document.documentElement.scrollWidth;
			} catch (ex) {
				//do nothing
			}
			if (!bWidth && !dWidth) {
				bWidth = dWidth = 0;
			}
			if (!bHeight && !dHeight) {
				bHeight = dHeight = 0;
			}

			try
			{
				var the_height = 0;
				if(Dialog.binfo.ie)
				{
					the_height = iframe.contentWindow.document.documentElement.scrollHeight;
				}
				else
				{
					the_height = iframe.contentWindow.document.documentElement.offsetHeight;
				}
				//var the_height = Math.max(bHeight,dHeight);

			}
			catch(ex)
			{
				var the_height = 0;
			}
			var the_width = Math.max(bWidth,dWidth);

			the_width = (the_width==0 ) ? this.config.default_width-10 : the_width;
			the_height = (the_height==0) ? this.config.default_height-40 : the_height;

			if(this.config.fixed_width)
			{
				iframe.style.width = '100%';
			}
			else
			{
				iframe.style.width = the_width + 'px';
			}

			iframe.style.height = the_height + 'px';
		},
		_adjust_container_size : function(force_width, force_height) {
			var iframe = this._content_iframe;
			if (force_width && force_height) {
				var width = force_width;
				var height = force_height;
			} else {
				var width = parseInt(iframe.style.width);
				var height = parseInt(iframe.style.height)
						+ parseInt(this._title_bar.clientHeight);
			}
			this._container_div.style.height = height + 'px';

			if(this.config.fixed_width)
			{
				this._container_div.style.width = this.config.fixed_width;
			}
			else
			{
				this._container_div.style.width = width + 'px';
			}
		},
		_adjust_container_position : function() {
			var container = this._container_div;
			var clsize = Dialog.tool.getclsize(this._true_window);
			var spos = Dialog.tool.getspos(this._true_window);
			var container_width = container.clientWidth;
			var container_height = container.clientHeight;

			container.style.left = Math.max(spos.X
					+ (clsize.w - container_width - 20) / 2, 0) + 'px';

			if(this.config.fixed_top)
			{
				container.style.top = this.config.fixed_top;
			}
			else
			{
				container.style.top = Math.max(spos.Y+ (clsize.h - container_height - 20) / 2, 0) + 'px';
			}

		},
		_adjust_cover_size : function() {
			var cover = this._cover;
			var document_size = Dialog.tool.getclsize(this._true_window);
			var document_offset_height = parseInt(Element.childElements(document)[0].offsetHeight);
			var document_scroll_height = parseInt(Element.childElements(document)[0].scrollHeight);
			var the_height = Math.max(document_size.h,document_offset_height);
			the_height = Math.max(the_height,document_scroll_height);

			var final_height = Math.max(the_height,
					parseInt(this._container_div.style.height));
			this._cover.style.height = final_height + 'px';
		},
		_build_cover : function() {
			if(this._cover)
			{
				return;
			}
			cover = this._true_document.createElement('div');
			Dialog.tool.restyle(cover);
			Dialog.tool.ststyle(cover, {
				'position' :'absolute',
				'zIndex' :999998,
				'top' :'0px',
				'left' :'0px',
				'width' :'100%',
				'height' :'100%',
				'backgroundColor' : Dialog.config.bgcolor
			});
			Dialog.tool.stopac(cover, Dialog.config.opac);

			if (Dialog.binfo.ie && !Dialog.binfo.i7) {
				var ifrm = this._true_document.createElement('iframe');
				Dialog.tool.restyle(ifrm);
				ifrm.hideFocus = true;
				ifrm.frameBorder = 0;
				ifrm.src = Dialog.tool.getvoid();
				Dialog.tool
						.ststyle(
								ifrm,
								{
									'width' :'100%',
									'height' :'100%',
									'position' :'absolute',
									'left' :'0px',
									'top' :'0px',
									'filter' :'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'
								});
				cover.appendChild(ifrm);
			}
			this._true_document.body.appendChild(cover);
			this._cover = cover;
		}
	};

			Dialog.binfo = ( function() {
				var ua = navigator.userAgent.toLowerCase();
				return {
					ie :(ua.indexOf("msie") >= 0),
					i7 :(ua.indexOf("msie") >= 0)
							&& (parseInt(ua.match(/msie (\d+)/)[1], 10) >= 7)
				};
			})(),
			Dialog.config = {
				opac :0.50,
				bgcolor :'#CCC',
				bzi :null,
				it :null,
				il :null
			},
			Dialog.tool = {
				restyle : function(e) {
					e.style.cssText = 'margin:0;padding:0;background-image:none;background-color:transparent;border:0;';
				},

				ststyle : function(e, dict) {
					var style = e.style;
					for ( var n in dict)
						style[n] = dict[n];
				},

				getestyle : function(e, p) {
					if (Dialog.binfo.ie)
						return e.currentStyle[p];
					else
						return e.ownerDocument.defaultView.getComputedStyle(e,
								'').getPropertyValue(p);
				},

				stopac : function(e, opac) {
					if (Dialog.binfo.ie) {
						opac = Math.round(opac * 100);
						e.style.filter = (opac > 100 ? ''
								: 'alpha(opacity=' + opac + ')');
					} else
						e.style.opacity = opac;
				},

				getvoid : function() {
					if (Dialog.binfo.ie)
						return (Dialog.binfo.i7 ? '' : 'javascript:\'\'');
					return 'javascript:void(0)';
				},

				addevt : function(o, e, l) {
					if (Dialog.binfo.ie)
						o.attachEvent('on' + e, l);
					else
						o.addEventListener(e, l, false);
				},

				remevt : function(o, e, l) {
					if (Dialog.binfo.ie)
						o.detachEvent('on' + e, l);
					else
						o.removeEventListener(e, l, false);
				},

				isdtd : function(doc) {
					return ('CSS1Compat' == (doc.compatMode || 'CSS1Compat'));
				},

				getclsize : function(w) {
					if (Dialog.binfo.ie) {
						var oSize, doc = w.document.documentElement;
						oSize = (doc && doc.clientWidth) ? doc
								: w.document.body;

						if (oSize)
							return {
								w :oSize.clientWidth,
								h :oSize.clientHeight
							};
						else
							return {
								w :0,
								h :0
							};
					} else
						return {
							w :w.innerWidth,
							h :w.innerHeight
						};
				},

				getev : function() {
					if (Dialog.binfo.ie)
						return window.event;
					var func = tool.getev.caller;
					while (func != null) {
						var arg = func.arguments[0];
						if (arg && (arg + '').indexOf('Event') >= 0)
							return arg;
						func = func.caller;
					}
					return null;
				},

				getepos : function(o) {
					var l, t;
					if (o.getBoundingClientRect) {
						var el = o.getBoundingClientRect();
						l = el.left;
						t = el.top;
					} else {
						l = o.offsetLeft
								- Math.max(document.documentElement.scrollLeft,
										document.body.scrollLeft);
						t = o.offsetTop
								- Math.max(document.documentElement.scrollTop,
										document.body.scrollTop);
					}
					return {
						x :l,
						y :t
					};
				},

				getspos : function(w) {
					if (Dialog.binfo.ie) {
						var doc = w.document;
						var oPos = {
							X :doc.documentElement.scrollLeft,
							Y :doc.documentElement.scrollTop
						};
						if (oPos.X > 0 || oPos.Y > 0)
							return oPos;
						return {
							X :doc.body.scrollLeft,
							Y :doc.body.scrollTop
						};
					} else
						return {
							X :w.pageXOffset,
							Y :w.pageYOffset
						};
				},

				getlink : function(c) {
					if (c.length == 0)
						return;
					return '<' + 'link href="' + c + '" type="text/css" rel="stylesheet"/>';
				},

				regdoll : function(w) {
					if (Dialog.binfo.ie)
						w.$ = w.document.getElementById;
					else
						w.$ = function(id) {
							return w.document.getElementById(id);
						};
				},

				getedoc : function(e) {
					return e.ownerDocument || e.document;
				},

				disctmenu : function(doc) {
					doc.oncontextmenu = function(e) {
						e = e || event || this.parentWindow.event;
						var o = e.srcElement || e.target;
						if (!(o.type == 'password' || o.type == 'text' || o.type == 'textarea')) {
							if (Dialog.binfo.ie)
								e.returnValue = false;
							else
								e.preventDefault();
						}
					};
				},

				getpath : function() {
					var bp, len, sc = document.getElementsByTagName('script');
					for ( var i = 0; i < sc.length; i++) {
						bp = sc[i].src.substring(0, sc[i].src.toLowerCase()
								.indexOf('lhgdialog.js'));
						len = bp.lastIndexOf('/');
						if (len > 0)
							bp = bp.substring(0, len + 1);
						if (bp)
							break;
					}
					if (Dialog.binfo.ie && bp.indexOf('../') != -1) {
						var fp = window.location.href;
						fp = fp.substring(0, fp.lastIndexOf('/'));
						while (bp.indexOf('../') >= 0) {
							bp = bp.substring(3);
							fp = fp.substring(0, fp.lastIndexOf('/'));
						}
						return fp + '/' + bp;
					} else
						return bp;
				},

				remnode : function(n) {
					return n.parentNode.removeChild(n);
				}
			}

	/* Codes End Here */

	/* Register Start Here */
	jiyiri.ui.Dialog = Dialog;
	/* Register End Here */
})();

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/dialog.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/effect.js -----*/jiyiri.register_namespace('jiyiri.ui');
/* jiyiri.require_once('jiyiri.ui.3rd.scriptaculous.scriptaculous'); */
/* jiyiri.require_once('jiyiri.ui.3rd.scriptaculous.effects'); */
( function() {

	/* Codes Start Here */
	var xEffect = {};
	xEffect.SlideDown = function(element)
	{
		Effect.SlideDown(element);
	};
	xEffect.SlideUp = function(element)
	{
		Effect.SlideUp(element);
	};
	/* Codes End Here */

	/* Register Start Here */
	jiyiri.ui.Effect = xEffect;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/effect.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/elementvhmiddler.js -----*/jiyiri.register_namespace('jiyiri.ui');
/* jiyiri.require_once('jiyiri.helper.eventhelper.eventhelper'); */
/* jiyiri.require_once('jiyiri.helper.browser.browsertype'); */

( function() {

	/* Codes Start Here */
	var ElementVHMiddler = {};
	ElementVHMiddler.is_ie = jiyiri.helper.browser.BrowserType.is('ie');

	ElementVHMiddler.middle = function(element,is_fixed)
	{


		/* set position type */
		if(is_fixed)
		{
			if(ElementVHMiddler.is_ie)
			{
				var x = ElementVHMiddler._get_x(element);
				var y = ElementVHMiddler._get_y_scroll(element);
				element.style.position="absolute";
				window.onscroll = function(){ElementVHMiddler._on_scroll(element)};
					//jiyiri.helper.eventhelper.EventHelper.create_callback_function(ElementVHMiddler,'_on_scroll',element);
			}
			else
			{
				var x = ElementVHMiddler._get_x(element);
				var y = ElementVHMiddler._get_y(element);
				element.style.position="fixed";

			}
		}

		/* set position */
		element.style.top = y + 'px';
		element.style.left = x + 'px';
	};

	ElementVHMiddler._get_x = function(element)
	{
		var sClientWidth = document.body.clientWidth;
		var sClientHeight = document.body.clientHeight;
		//var sScrollTop = document.body.scrollTop + document.documentElement.scrollTop;
		var sScrollTop = (document.body.clientHeight-element.offsetHeight) / 2;
		var _show_left = ( sClientWidth - element.offsetWidth ) / 2 ;
		var _show_top  = sScrollTop;
		return _show_left;
	};

	ElementVHMiddler._get_y = function(element)
	{
		var sClientWidth = document.body.clientWidth;
		var sClientHeight = document.body.clientHeight;
		//var sScrollTop = document.body.scrollTop + document.documentElement.scrollTop;
		var sScrollTop = (document.body.clientHeight-element.offsetHeight) / 2 - element.clientHeight*1.2;
		var _show_left = ( sClientWidth - element.offsetWidth ) / 2 ;
		var _show_top  = sScrollTop;
		return _show_top;
	};

	ElementVHMiddler._get_y_scroll = function(element)
	{
		var sClientWidth = document.body.clientWidth;
		var sClientHeight = document.body.clientHeight;
		var sScrollTop = document.body.scrollTop + document.documentElement.scrollTop;
		sScrollTop += (document.body.clientHeight-element.offsetHeight) / 2;
		sScrollTop -= element.clientHeight*1.2;
		var _show_left = ( sClientWidth - element.offsetWidth ) / 2 ;
		var _show_top  = sScrollTop;
		return _show_top;
	};

	ElementVHMiddler._on_scroll = function(element)
	{
		var y = ElementVHMiddler._get_y_scroll(element);
		element.style.position="absolute";
		element.style.top = y + 'px';
	};


	/* Codes End Here */

	/* Register Start Here */
	jiyiri.ui.ElementVHMiddler = ElementVHMiddler;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/elementvhmiddler.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/graycover.js -----*/jiyiri.register_namespace('jiyiri.ui');
/* jiyiri.require_once('jiyiri.helper.eventhelper.eventhelper'); */

( function() {

	/* Codes Start Here */
	var GrayCover = Class.create();
	GrayCover._instance = null;
	GrayCover.GetInstance = function() {
		if (null == GrayCover._instance) {
			GrayCover._instance = new GrayCover();
		}

		return GrayCover._instance;
	};

	GrayCover.prototype = {
		/* public interface functions */
		cover_page:function()
		{
			Element.show(this._cover);
			this._adjust_cover_size();
		},
		uncover_page:function()
		{
			Element.hide(this._cover);
			this._adjust_cover_size();
		},
		/* /public interface functions */
		initialize : function() {
			this._container_div = null;
			this._content_iframe = null;
			this._true_window = null;
			this._true_document = null;
			this._cover = null;
			this._title_bar = null;
			this._title_bar_title_area = null;
			this._loading = null;

            this._on_close_callback_function = null;
            this._on_close_callback_param = null;
			this.init();
		},
		init : function() {
			this._get_parent_window();
			this._build_cover();
			Element.hide(this._cover);
		},


		auto_resize:function()
		{
			this._adjust_iframe_size();
			this._adjust_container_size();
			this._adjust_container_position();
			this._adjust_cover_size();
		},
        register_on_close_callback_function:function(callback)
        {
            this._on_close_callback_function = callback;
        },
        set_on_close_callback_param:function(callback_param)
        {
            this._on_close_callback_param = callback_param;
        },
        _on_title_bar_close_btn_click:function()
        {
            this.close();
        },
		_on_show:function()
		{
			this._adjust_cover_size();
		},
		_on_content_iframe_load : function() {
			this._hide_loading();
			this._adjust_iframe_size();
			this._adjust_window_title();
			this._adjust_container_size();
			this._adjust_container_position();
			this._adjust_cover_size();
		},
		_stop_iframe : function() {
			this._content_iframe.src = 'about:blank';
		},
		_show_loading : function() {
			Element.hide(this._content_iframe);
			Element.show(this._loading);
		},
		_hide_loading : function() {
			Element.show(this._content_iframe);
			Element.hide(this._loading);
		},
		_hide_my_elements : function() {
			Element.hide(this._container_div);
			Element.hide(this._content_iframe);
			Element.hide(this._cover);
		},
		_show_my_elements : function() {
			Element.show(this._container_div);
			Element.show(this._content_iframe);
			Element.show(this._cover);
		},
		_get_parent_window : function() {
			var twin = window, cover;
			while (twin.parent && twin.parent != twin) {
				try {
					if (twin.parent.document.domain != document.domain)
						break;
				} catch (e) {
					break;
				}
				twin = twin.parent;
			}
			var tdoc = twin.document;
			this._true_window = twin;
			this._true_document = tdoc;
		},
		_build_container : function() {
			if(this._container_div)
			{
				return;
			}
			var container = document.createElement('div');
			Element.addClassName(container,this.config.container_class);
			this._container_div = container;
			document.body.appendChild(container);
			container.style.position = 'absolute';
			container.style.zIndex = 999999;
			container.style.backgroundColor = '#FFF';
			var title_bar = this._create_title_bar();
			container.appendChild(title_bar);
			this._title_bar = title_bar;
		},
		_create_title_bar : function() {
			var title_bar = document.createElement('div');
			Element.addClassName(title_bar,this.config.titlebar_class);
			// title_bar.id = '_GrayCover_title';
			var title_bar_title_area = document.createElement('div');
			Element.addClassName(title_bar_title_area,this.config.titletext_class);
			title_bar.appendChild(title_bar_title_area);
			this._title_bar_title_area = title_bar_title_area;
			title_bar_title_area.innerHTML = this.config.default_title;
			var title_bar_close_btn = document.createElement('div');
			Element.addClassName(title_bar_close_btn,this.config.closebtn_class);
			var title_bar_close_link = document.createElement('a');
			title_bar_close_link.innerHTML = '';
			title_bar_close_link.href = 'javascript:void(0);';
			title_bar_close_link.onclick = jiyiri.helper.eventhelper.EventHelper
					.create_event_function(this, '_on_title_bar_close_btn_click');
			title_bar_close_btn.appendChild(title_bar_close_link);
			title_bar.appendChild(title_bar_close_btn);
			return title_bar;
		},
		_build_content_iframe : function() {
			if(this._content_iframe)
			{
				return;
			}
			var iframe = document.createElement('iframe');
			this._content_iframe = iframe;
			iframe.frameBorder = 0;
			this._container_div.appendChild(iframe);
		},
		_build_loading : function() {
			if(this._loading)
			{
				return;
			}
			var loading = document.createElement('div');
			this._loading = loading;
			this._container_div.appendChild(loading);
			loading.innerHTML = this.config.loading_html;
		},
		_adjust_window_title : function() {
			var iframe = this._content_iframe;
			if (iframe.src != 'about:blank') {
				this._title_bar_title_area.innerHTML = iframe.contentWindow.document.title;
			}
		},
		_adjust_iframe_size : function() {
			var iframe = this._content_iframe;

			try {
				var bHeight = Element
						.childElements(iframe.contentWindow.document.body)[0].scrollHeight;
				var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
				var bWidth = Element
						.childElements(iframe.contentWindow.document.body)[0].scrollWidth;
				var dWidth = iframe.contentWindow.document.documentElement.scrollWidth;
			} catch (ex) {
				//do nothing
			}

			if (!bWidth && !dWidth) {
				bWidth = dWidth = 0;
			}
			if (!bHeight && !dHeight) {
				bHeight = dHeight = 0;
			}

			try
			{
				var the_height = iframe.contentWindow.document.body.offsetHeight;
			}
			catch(ex)
			{
				var the_height = 0;
			}
			var the_width = Math.max(bWidth,dWidth);

			the_width = (the_width==0 ) ? this.config.default_width-10 : the_width;
			the_height = (the_height==0) ? this.config.default_height-40 : the_height;

			if(this.config.fixed_width)
			{
				iframe.style.width = '100%';
			}
			else
			{
				iframe.style.width = the_width + 'px';
			}

			iframe.style.height = the_height + 'px';
		},
		_adjust_container_size : function(force_width, force_height) {
			var iframe = this._content_iframe;
			if (force_width && force_height) {
				var width = force_width;
				var height = force_height;
			} else {
				var width = parseInt(iframe.style.width);
				var height = parseInt(iframe.style.height)
						+ parseInt(this._title_bar.clientHeight);
			}
			this._container_div.style.height = height + 'px';

			if(this.config.fixed_width)
			{
				this._container_div.style.width = this.config.fixed_width;
			}
			else
			{
				this._container_div.style.width = width + 'px';
			}
		},
		_adjust_container_position : function() {
			var container = this._container_div;
			var clsize = GrayCover.tool.getclsize(this._true_window);
			var spos = GrayCover.tool.getspos(this._true_window);
			var container_width = container.clientWidth;
			var container_height = container.clientHeight;

			container.style.left = Math.max(spos.X
					+ (clsize.w - container_width - 20) / 2, 0) + 'px';

			if(this.config.fixed_top)
			{
				container.style.top = this.config.fixed_top;
			}
			else
			{
				container.style.top = Math.max(spos.Y+ (clsize.h - container_height - 20) / 2, 0) + 'px';
			}

		},
		_adjust_cover_size : function() {
			var cover = this._cover;
			var document_size = GrayCover.tool.getclsize(this._true_window);
			var document_offset_height = parseInt(Element.childElements(document)[0].offsetHeight);
			var document_scroll_height = parseInt(Element.childElements(document)[0].scrollHeight);
			var the_height = Math.max(document_size.h,document_offset_height);
			the_height = Math.max(the_height,document_scroll_height);
			//var final_height = Math.max(the_height,
			//		parseInt(this._container_div.style.height));
			var final_height = the_height;
			this._cover.style.height = final_height + 'px';
		},
		_build_cover : function() {
			if(this._cover)
			{
				return;
			}
			cover = this._true_document.createElement('div');
			GrayCover.tool.restyle(cover);
			GrayCover.tool.ststyle(cover, {
				'position' :'absolute',
				'zIndex' :999998,
				'top' :'0px',
				'left' :'0px',
				'width' :'100%',
				'height' :'100%',
				'backgroundColor' : GrayCover.config.bgcolor
			});
			GrayCover.tool.stopac(cover, GrayCover.config.opac);

			if (GrayCover.binfo.ie && !GrayCover.binfo.i7) {
				var ifrm = this._true_document.createElement('iframe');
				GrayCover.tool.restyle(ifrm);
				ifrm.hideFocus = true;
				ifrm.frameBorder = 0;
				ifrm.src = GrayCover.tool.getvoid();
				GrayCover.tool
						.ststyle(
								ifrm,
								{
									'width' :'100%',
									'height' :'100%',
									'position' :'absolute',
									'left' :'0px',
									'top' :'0px',
									'filter' :'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'
								});
				cover.appendChild(ifrm);
			}
			this._true_document.body.appendChild(cover);
			this._cover = cover;
		}
	};

			GrayCover.binfo = ( function() {
				var ua = navigator.userAgent.toLowerCase();
				return {
					ie :(ua.indexOf("msie") >= 0),
					i7 :(ua.indexOf("msie") >= 0)
							&& (parseInt(ua.match(/msie (\d+)/)[1], 10) >= 7)
				};
			})(),
			GrayCover.config = {
				opac :0.50,
				bgcolor :'#CCC',
				bzi :null,
				it :null,
				il :null
			},
			GrayCover.tool = {
				restyle : function(e) {
					e.style.cssText = 'margin:0;padding:0;background-image:none;background-color:transparent;border:0;';
				},

				ststyle : function(e, dict) {
					var style = e.style;
					for ( var n in dict)
						style[n] = dict[n];
				},

				getestyle : function(e, p) {
					if (GrayCover.binfo.ie)
						return e.currentStyle[p];
					else
						return e.ownerDocument.defaultView.getComputedStyle(e,
								'').getPropertyValue(p);
				},

				stopac : function(e, opac) {
					if (GrayCover.binfo.ie) {
						opac = Math.round(opac * 100);
						e.style.filter = (opac > 100 ? ''
								: 'alpha(opacity=' + opac + ')');
					} else
						e.style.opacity = opac;
				},

				getvoid : function() {
					if (GrayCover.binfo.ie)
						return (GrayCover.binfo.i7 ? '' : 'javascript:\'\'');
					return 'javascript:void(0)';
				},

				addevt : function(o, e, l) {
					if (GrayCover.binfo.ie)
						o.attachEvent('on' + e, l);
					else
						o.addEventListener(e, l, false);
				},

				remevt : function(o, e, l) {
					if (GrayCover.binfo.ie)
						o.detachEvent('on' + e, l);
					else
						o.removeEventListener(e, l, false);
				},

				isdtd : function(doc) {
					return ('CSS1Compat' == (doc.compatMode || 'CSS1Compat'));
				},

				getclsize : function(w) {
					if (GrayCover.binfo.ie) {
						var oSize, doc = w.document.documentElement;
						oSize = (doc && doc.clientWidth) ? doc
								: w.document.body;

						if (oSize)
							return {
								w :oSize.clientWidth,
								h :oSize.clientHeight
							};
						else
							return {
								w :0,
								h :0
							};
					} else
						return {
							w :w.innerWidth,
							h :w.innerHeight
						};
				},

				getev : function() {
					if (GrayCover.binfo.ie)
						return window.event;
					var func = tool.getev.caller;
					while (func != null) {
						var arg = func.arguments[0];
						if (arg && (arg + '').indexOf('Event') >= 0)
							return arg;
						func = func.caller;
					}
					return null;
				},

				getepos : function(o) {
					var l, t;
					if (o.getBoundingClientRect) {
						var el = o.getBoundingClientRect();
						l = el.left;
						t = el.top;
					} else {
						l = o.offsetLeft
								- Math.max(document.documentElement.scrollLeft,
										document.body.scrollLeft);
						t = o.offsetTop
								- Math.max(document.documentElement.scrollTop,
										document.body.scrollTop);
					}
					return {
						x :l,
						y :t
					};
				},

				getspos : function(w) {
					if (GrayCover.binfo.ie) {
						var doc = w.document;
						var oPos = {
							X :doc.documentElement.scrollLeft,
							Y :doc.documentElement.scrollTop
						};
						if (oPos.X > 0 || oPos.Y > 0)
							return oPos;
						return {
							X :doc.body.scrollLeft,
							Y :doc.body.scrollTop
						};
					} else
						return {
							X :w.pageXOffset,
							Y :w.pageYOffset
						};
				},

				getlink : function(c) {
					if (c.length == 0)
						return;
					return '<' + 'link href="' + c + '" type="text/css" rel="stylesheet"/>';
				},

				regdoll : function(w) {
					if (GrayCover.binfo.ie)
						w.$ = w.document.getElementById;
					else
						w.$ = function(id) {
							return w.document.getElementById(id);
						};
				},

				getedoc : function(e) {
					return e.ownerDocument || e.document;
				},

				disctmenu : function(doc) {
					doc.oncontextmenu = function(e) {
						e = e || event || this.parentWindow.event;
						var o = e.srcElement || e.target;
						if (!(o.type == 'password' || o.type == 'text' || o.type == 'textarea')) {
							if (GrayCover.binfo.ie)
								e.returnValue = false;
							else
								e.preventDefault();
						}
					};
				},

				getpath : function() {
					var bp, len, sc = document.getElementsByTagName('script');
					for ( var i = 0; i < sc.length; i++) {
						bp = sc[i].src.substring(0, sc[i].src.toLowerCase()
								.indexOf('lhgGrayCover.js'));
						len = bp.lastIndexOf('/');
						if (len > 0)
							bp = bp.substring(0, len + 1);
						if (bp)
							break;
					}
					if (GrayCover.binfo.ie && bp.indexOf('../') != -1) {
						var fp = window.location.href;
						fp = fp.substring(0, fp.lastIndexOf('/'));
						while (bp.indexOf('../') >= 0) {
							bp = bp.substring(3);
							fp = fp.substring(0, fp.lastIndexOf('/'));
						}
						return fp + '/' + bp;
					} else
						return bp;
				},

				remnode : function(n) {
					return n.parentNode.removeChild(n);
				}
			}

	/* Codes End Here */

	/* Register Start Here */
	jiyiri.ui.GrayCover = GrayCover;
	/* Register End Here */
})();

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/graycover.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/pager/simplepager.js -----*/jiyiri.register_namespace('jiyiri.ui.pager');

( function() {

	/* Codes Start Here */
	var SimplePager = Class.create();
	SimplePager.prototype = {
			CurrentPage:0,
			TotalPages:0,
			TotalRecords:0,

			initialize:function(options)
			{
			    this.options = {
			    	      pagesize:10,	//页长
			    	      urltemplate:'?page={$page}',	//打开地址模板
			    	      texttemplate:'{$page}',	//文字模板
			    	      htmltemplate_common:'<li><a href="{$url}">{$text}</a></li>',	//分页项html模板
			    	      htmltemplate_curpage:'<li><a href="{$url}" class="current">{$text}</a></li>',
			    	      separator:'',	//分页项分隔符
			    	      pre_btn_class:'',
			    	      next_btn_class:'',
			    	      pre_btn_disable_class:'',
			    	      next_btn_disable_class:'',
			    	      btn_class:'pageSwichBtns',
			    	      target_area:null
			    	    };
			    	    Object.extend(this.options, options || { });

			    	    if (Object.isString(this.options.parameters))
			    	      this.options.parameters = this.options.parameters.toQueryParams();
			    	    else if (Object.isHash(this.options.parameters))
			    	      this.options.parameters = this.options.parameters.toObject();
			},

		    show:function(page,total)
		    {

				var target = this.options.target_area;
				this.TotalRecords = total;
		    	this._Calc();
		    	var sb=new Array();
	            if(this.TotalPages>0)
	            {
	                if(page==1)
	                {
	                    sb.push('<li class="'+this.options.btn_class+'"><a class="'+this.options.pre_btn_disable_class+'" >上一页</a></li>');
	                }
	                else {
	                    sb.push('<li class="'+this.options.btn_class+'"><a class="'+this.options.pre_btn_class+'" href="' + this.options.urltemplate.replace('{$page}',page-1) + '">上一页</a></li>');
	                }
	            }

		    	for(var i=1;i<=this.TotalPages;i++)
		    	{
		    		var url=this._BuildPageUrl(i);
		    		var text = this._BuildText(i);
		    		if(i!=page)
		    		{
		    			var html = this._BuildHtmlCommon(url, text);
		    		}
		    		else
		    		{
		    			var html = this._BuildHtmlCurPage(url,text);
		    		}
		    		sb.push( html );
		    	}
	            if(this.TotalPages>0)
	            {
	                if(page==this.TotalPages)
	                {
	                    sb.push('<li class="'+this.options.btn_class+'"><a class="'+this.options.next_btn_disable_class+'" >下一页</a></li>');
	                }
	                else {
	                    sb.push('<li class="'+this.options.btn_class+'"><a class="'+this.options.next_btn_class+'" href="' + this.options.urltemplate.replace('{$page}',page+1) + '">下一页</a></li>');
	                }
	            }
	            sb.push('&nbsp;');
		    	var rtn = sb.join(this.options.separator);
		    	if(typeof(target)=='object')
		    	{
		    		target.innerHTML = rtn;
		    	}
		    	return rtn;
		    },

		    _BuildPageUrl:function(page)
		    {
		    	var url = this.options.urltemplate;
		    	url = url.replace('{$page}', page);
		    	return url;
		    },
		    _BuildText:function(page)
		    {
		    	var text = this.options.texttemplate;
		    	text = text.replace('{$page}',page);
		    	return text;
		    },
		    _BuildHtmlCommon:function(url,text)
		    {
		    	var html = this.options.htmltemplate_common;
		    	html = html.replace('{$url}',url);
		    	html = html.replace('{$text}',text);
		    	return html;
		    },
		    _BuildHtmlCurPage:function(url,text)
		    {
		    	var html = this.options.htmltemplate_curpage;
		    	html = html.replace('{$url}',url);
		    	html = html.replace('{$text}',text);
		    	return html;
		    },
		    _Calc:function()
		    {
		    	if(this.TotalRecords % this.options.pagesize==0)
		    	{
		    		this.TotalPages = parseInt(this.TotalRecords / this.options.pagesize);
		    	}
		    	else
		    	{
		    		this.TotalPages = parseInt(this.TotalRecords/this.options.pagesize)+1;
		    	}
		    }
	};


	/* Codes End Here */

	/* Register Start Here */
	jiyiri.ui.pager.SimplePager = SimplePager;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/pager/simplepager.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/secondregiondata.js -----*/
var SECOND_REGION_DATA=[{"Province":"\u4e0a\u6d77\u5e02","CityList":[{"City":"\u4e0a\u6d77"},{"City":"\u5357\u6c47\u533a"},{"City":"\u5362\u6e7e\u533a"},{"City":"\u5609\u5b9a\u533a"},{"City":"\u5949\u8d24\u533a"},{"City":"\u5b9d\u5c71\u533a"},{"City":"\u5d07\u660e\u53bf"},{"City":"\u5f90\u6c47\u533a"},{"City":"\u666e\u9640\u533a"},{"City":"\u6768\u6d66\u533a"},{"City":"\u677e\u6c5f\u533a"},{"City":"\u6d66\u4e1c\u65b0\u533a"},{"City":"\u8679\u53e3\u533a"},{"City":"\u91d1\u5c71\u533a"},{"City":"\u957f\u5b81\u533a"},{"City":"\u95f5\u884c\u533a"},{"City":"\u95f8\u5317\u533a"},{"City":"\u9752\u6d66\u533a"},{"City":"\u9759\u5b89\u533a"},{"City":"\u9ec4\u6d66\u533a"}]},{"Province":"\u4e91\u5357\u7701","CityList":[{"City":"\u4e34\u6ca7\u5e02"},{"City":"\u4e3d\u6c5f\u5e02"},{"City":"\u4fdd\u5c71\u5e02"},{"City":"\u5927\u7406\u5dde"},{"City":"\u5fb7\u5b8f\u5dde"},{"City":"\u6012\u6c5f\u5dde"},{"City":"\u601d\u8305\u5e02"},{"City":"\u6587\u5c71\u5dde"},{"City":"\u6606\u660e\u5e02"},{"City":"\u662d\u901a\u5e02"},{"City":"\u66f2\u9756\u5e02"},{"City":"\u695a\u96c4\u5dde"},{"City":"\u7389\u6eaa\u5e02"},{"City":"\u7ea2\u6cb3\u5dde"},{"City":"\u897f\u53cc\u7248\u7eb3\u5dde"},{"City":"\u8fea\u5e86\u5dde"}]},{"Province":"\u5185\u8499\u53e4","CityList":[{"City":"\u4e4c\u5170\u5bdf\u5e03"},{"City":"\u4e4c\u5170\u5bdf\u5e03\u5e02"},{"City":"\u4e4c\u6d77\u5e02"},{"City":"\u5305\u5934\u5e02"},{"City":"\u547c\u4f26\u8d1d\u5c14"},{"City":"\u547c\u4f26\u8d1d\u5c14\u5e02"},{"City":"\u547c\u548c\u6d69\u7279"},{"City":"\u547c\u548c\u6d69\u7279\u5e02"},{"City":"\u5df4\u5f66\u6dd6\u5c14"},{"City":"\u5df4\u5f66\u6dd6\u5c14\u5e02"},{"City":"\u8d64\u5cf0\u5e02"},{"City":"\u901a\u8fbd\u5e02"},{"City":"\u9102\u5c14\u591a\u65af"},{"City":"\u9102\u5c14\u591a\u65af\u5e02"},{"City":"\u9521\u6797\u90ed\u52d2\u76df"},{"City":"\u963f\u62c9\u5584\u76df"}]},{"Province":"\u5317\u4eac\u5e02","CityList":[{"City":"\u4e1c\u57ce\u533a"},{"City":"\u4e30\u53f0\u533a"},{"City":"\u5927\u5174\u533a"},{"City":"\u5ba3\u6b66\u533a"},{"City":"\u5bc6\u4e91\u533a"},{"City":"\u5bc6\u4e91\u53bf"},{"City":"\u5d07\u6587\u533a"},{"City":"\u5e73\u8c37\u533a"},{"City":"\u5ef6\u5e86\u53bf"},{"City":"\u6000\u67d4\u533a"},{"City":"\u623f\u5c71\u533a"},{"City":"\u660c\u5e73\u533a"},{"City":"\u671d\u9633\u533a"},{"City":"\u6d77\u6dc0\u533a"},{"City":"\u77f3\u666f\u5c71\u533a"},{"City":"\u897f\u57ce\u533a"},{"City":"\u901a\u5dde\u533a"},{"City":"\u95e8\u5934\u6c9f\u533a"},{"City":"\u987a\u4e49\u533a"}]},{"Province":"\u5409\u6797\u7701","CityList":[{"City":"\u5409\u6797\u5e02"},{"City":"\u56db\u5e73\u5e02"},{"City":"\u5ef6\u8fb9\u5dde"},{"City":"\u677e\u539f\u5e02"},{"City":"\u767d\u57ce\u5e02"},{"City":"\u767d\u5c71\u5e02"},{"City":"\u8fbd\u6e90\u5e02"},{"City":"\u901a\u5316\u5e02"},{"City":"\u957f\u6625\u5e02"}]},{"Province":"\u56db\u5ddd\u7701","CityList":[{"City":"\u4e50\u5c71\u5e02"},{"City":"\u5185\u6c5f\u5e02"},{"City":"\u51c9\u5c71\u5dde"},{"City":"\u5357\u5145\u5e02"},{"City":"\u5b9c\u5bbe\u5e02"},{"City":"\u5df4\u4e2d\u5e02"},{"City":"\u5e7f\u5143\u5e02"},{"City":"\u5e7f\u5b89\u5e02"},{"City":"\u5fb7\u9633\u5e02"},{"City":"\u6210\u90fd\u5e02"},{"City":"\u6500\u679d\u82b1\u5e02"},{"City":"\u6cf8\u5dde\u5e02"},{"City":"\u7518\u5b5c\u5dde"},{"City":"\u7709\u5c71\u5e02"},{"City":"\u7ef5\u9633\u5e02"},{"City":"\u81ea\u8d21\u5e02"},{"City":"\u8d44\u9633\u5e02"},{"City":"\u8fbe\u5dde\u5e02"},{"City":"\u9042\u5b81\u5e02"},{"City":"\u963f\u575d\u5dde"},{"City":"\u96c5\u5b89\u5e02"}]},{"Province":"\u5929\u6d25\u5e02","CityList":[{"City":"\u5b81\u6cb3\u53bf"},{"City":"\u4e1c\u4e3d\u533a"},{"City":"\u5317\u8fb0\u533a"},{"City":"\u5357\u5f00\u533a"},{"City":"\u548c\u5e73\u533a"},{"City":"\u5858\u6cbd\u533a"},{"City":"\u5927\u6e2f\u533a"},{"City":"\u5b81\u6cb3\u53bf"},{"City":"\u5b9d\u577b\u533a"},{"City":"\u6b66\u6e05\u533a"},{"City":"\u6c49\u6cbd\u533a"},{"City":"\u6cb3\u4e1c\u533a"},{"City":"\u6cb3\u5317\u533a"},{"City":"\u6cb3\u897f\u533a"},{"City":"\u6d25\u5357\u533a"},{"City":"\u7ea2\u6865\u533a"},{"City":"\u84df\u53bf"},{"City":"\u897f\u9752\u533a"},{"City":"\u9759\u6d77\u53bf"}]},{"Province":"\u5b81\u590f\u81ea\u6cbb\u533a","CityList":[{"City":"\u4e2d\u536b\u5e02"},{"City":"\u5434\u5fe0\u5e02"},{"City":"\u56fa\u539f\u5e02"},{"City":"\u77f3\u5634\u5c71\u5e02"},{"City":"\u94f6\u5ddd\u5e02"}]},{"Province":"\u5b89\u5fbd\u7701","CityList":[{"City":"\u4eb3\u5dde\u5e02"},{"City":"\u516d\u5b89\u5e02"},{"City":"\u5408\u80a5\u5e02"},{"City":"\u5b89\u5e86\u5e02"},{"City":"\u5ba3\u57ce\u5e02"},{"City":"\u5bbf\u5dde\u5e02"},{"City":"\u5de2\u6e56\u5e02"},{"City":"\u6beb\u5dde\u5e02"},{"City":"\u6c60\u5dde\u5e02"},{"City":"\u6dee\u5317\u5e02"},{"City":"\u6dee\u5357\u5e02"},{"City":"\u6ec1\u5dde\u5e02"},{"City":"\u829c\u6e56\u5e02"},{"City":"\u868c\u57e0\u5e02"},{"City":"\u94dc\u9675\u5e02"},{"City":"\u961c\u9633\u5e02"},{"City":"\u9a6c\u978d\u5c71\u5e02"},{"City":"\u9ec4\u5c71\u5e02"}]},{"Province":"\u5c71\u4e1c\u7701","CityList":[{"City":"\u4e1c\u8425\u5e02"},{"City":"\u4e34\u6c82\u5e02"},{"City":"\u5a01\u6d77\u5e02"},{"City":"\u5fb7\u5dde\u5e02"},{"City":"\u65e5\u7167\u5e02"},{"City":"\u67a3\u5e84\u5e02"},{"City":"\u6cf0\u5b89\u5e02"},{"City":"\u6d4e\u5357\u5e02"},{"City":"\u6d4e\u5b81\u5e02"},{"City":"\u6dc4\u535a\u5e02"},{"City":"\u6ee8\u5dde\u5e02"},{"City":"\u6f4d\u574a\u5e02"},{"City":"\u70df\u53f0\u5e02"},{"City":"\u804a\u57ce\u5e02"},{"City":"\u83b1\u829c\u5e02"},{"City":"\u83cf\u6cfd\u5e02"},{"City":"\u9752\u5c9b\u5e02"}]},{"Province":"\u5c71\u897f\u7701","CityList":[{"City":"\u4e34\u6c7e\u5e02"},{"City":"\u5415\u6881\u5e02"},{"City":"\u5927\u540c\u5e02"},{"City":"\u592a\u539f\u5e02"},{"City":"\u5ffb\u5dde\u5e02"},{"City":"\u664b\u4e2d\u5e02"},{"City":"\u664b\u57ce\u5e02"},{"City":"\u6714\u5dde\u5e02"},{"City":"\u8fd0\u57ce\u5e02"},{"City":"\u957f\u6cbb\u5e02"},{"City":"\u9633\u6cc9\u5e02"}]},{"Province":"\u5e7f\u4e1c\u7701","CityList":[{"City":"\u4e1c\u839e\u5e02"},{"City":"\u4e91\u6d6e\u5e02"},{"City":"\u4f5b\u5c71\u5e02"},{"City":"\u5e7f\u5dde\u5e02"},{"City":"\u60e0\u5dde\u5e02"},{"City":"\u63ed\u9633\u5e02"},{"City":"\u6885\u5dde\u5e02"},{"City":"\u6c55\u5934\u5e02"},{"City":"\u6c55\u5c3e\u5e02"},{"City":"\u6cb3\u6e90\u5e02"},{"City":"\u6df1\u5733\u5e02"},{"City":"\u6e05\u8fdc\u5e02"},{"City":"\u6e5b\u6c5f\u5e02"},{"City":"\u6f6e\u5dde\u5e02"},{"City":"\u73e0\u6d77\u5e02"},{"City":"\u8087\u5e86\u5e02"},{"City":"\u8302\u540d\u5e02"},{"City":"\u9633\u6c5f\u5e02"},{"City":"\u97f6\u5173\u5e02"}]},{"Province":"\u5e7f\u897f\u7701","CityList":[{"City":"\u5317\u6d77\u5e02"},{"City":"\u5357\u5b81\u5e02"},{"City":"\u6765\u5bbe\u5e02"},{"City":"\u67f3\u5dde\u5e02"},{"City":"\u6842\u6797\u5e02"},{"City":"\u68a7\u5dde\u5e02"},{"City":"\u6cb3\u6c60\u5e02"},{"City":"\u7389\u6797\u5e02"},{"City":"\u767e\u8272\u5e02"},{"City":"\u8d35\u6e2f\u5e02"},{"City":"\u8d3a\u5dde\u5e02"},{"City":"\u94a6\u5dde\u5e02"},{"City":"\u9632\u57ce\u6e2f\u5e02"}]},{"Province":"\u6c5f\u82cf\u7701","CityList":[{"City":"\u5357\u4eac\u5e02"},{"City":"\u5357\u901a\u5e02"},{"City":"\u5bbf\u8fc1\u5e02"},{"City":"\u5e38\u5dde\u5e02"},{"City":"\u5f90\u5dde\u5e02"},{"City":"\u626c\u5dde\u5e02"},{"City":"\u65e0\u9521\u5e02"},{"City":"\u6cf0\u5dde\u5e02"},{"City":"\u6dee\u5b89\u5e02"},{"City":"\u76d0\u57ce\u5e02"},{"City":"\u82cf\u5dde\u5e02"},{"City":"\u8fde\u4e91\u6e2f\u5e02"},{"City":"\u9547\u6c5f\u5e02"}]},{"Province":"\u6c5f\u897f\u7701","CityList":[{"City":"\u4e0a\u9976\u5e02"},{"City":"\u5B9C\u6625\u5E02"}, {"City":"\u4e5d\u6c5f\u5e02"},{"City":"\u5357\u660c\u5e02"},{"City":"\u5409\u5b89\u5e02"},{"City":"\u629a\u5dde\u5e02"},{"City":"\u65b0\u4f59\u5e02"},{"City":"\u666f\u5fb7\u9547"},{"City":"\u666f\u5fb7\u9547\u5e02"},{"City":"\u840d\u4e61\u5e02"},{"City":"\u8d63\u5dde\u5e02"},{"City":"\u9e70\u6f6d\u5e02"}]},{"Province":"\u6cb3\u5317\u7701","CityList":[{"City":"\u4fdd\u5b9a\u5e02"},{"City":"\u5510\u5c71\u5e02"},{"City":"\u5eca\u574a\u5e02"},{"City":"\u5f20\u5bb6\u53e3"},{"City":"\u5f20\u5bb6\u53e3\u5e02"},{"City":"\u627f\u5fb7\u5e02"},{"City":"\u6ca7\u5dde\u5e02"},{"City":"\u77f3\u5bb6\u5e84"},{"City":"\u77f3\u5bb6\u5e84\u5e02"},{"City":"\u79e6\u7687\u5c9b"},{"City":"\u79e6\u7687\u5c9b\u5e02"},{"City":"\u8861\u6c34\u5e02"},{"City":"\u90a2\u53f0\u5e02"},{"City":"\u90af\u90f8\u5e02"}]},{"Province":"\u6cb3\u5357\u7701","CityList":[{"City":"\u4e09\u95e8\u5ce1\u5e02"},{"City":"\u4fe1\u9633\u5e02"},{"City":"\u5357\u9633\u5e02"},{"City":"\u5468\u53e3\u5e02"},{"City":"\u5546\u4e18\u5e02"},{"City":"\u5b89\u9633\u5e02"},{"City":"\u5d07\u660e\u53bf"},{"City":"\u5e73\u9876\u5c71\u5e02"},{"City":"\u5f00\u5c01\u5e02"},{"City":"\u65b0\u4e61\u5e02"},{"City":"\u6d1b\u9633\u5e02"},{"City":"\u6d4e\u6e90\u5e02"},{"City":"\u6f2f\u6cb3\u5e02"},{"City":"\u6fee\u9633\u5e02"},{"City":"\u7126\u4f5c\u5e02"},{"City":"\u8bb8\u660c\u5e02"},{"City":"\u90d1\u5dde\u5e02"},{"City":"\u9a7b\u9a6c\u5e97\u5e02"},{"City":"\u9e64\u58c1\u5e02"}]},{"Province":"\u6d59\u6c5f\u7701","CityList":[{"City":"\u4e3d\u6c34\u5e02"},{"City":"\u53f0\u5dde\u5e02"},{"City":"\u5609\u5174\u5e02"},{"City":"\u5b81\u6ce2\u5e02"},{"City":"\u676d\u5dde\u5e02"},{"City":"\u6e29\u5dde\u5e02"},{"City":"\u6e56\u5dde\u5e02"},{"City":"\u7ecd\u5174\u5e02"},{"City":"\u821f\u5c71\u5e02"},{"City":"\u8862\u5dde\u5e02"},{"City":"\u91d1\u534e\u5e02"}]},{"Province":"\u6d77\u5357\u7701","CityList":[{"City":"\u4e09\u4e9a\u5e02"},{"City":"\u5176\u4ed6\u57ce\u5e02"},{"City":"\u6d77\u53e3\u5e02"}]},{"Province":"\u6e56\u5317\u7701","CityList":[{"City":"\u5341\u5830\u5e02"},{"City":"\u54b8\u5b81\u5e02"},{"City":"\u5b5d\u611f\u5e02"},{"City":"\u5b9c\u660c\u5e02"},{"City":"\u6069\u65bd\u5dde"},{"City":"\u6069\u65bd\u5e02"},{"City":"\u6b66\u6c49\u5e02"},{"City":"\u8346\u5dde\u5e02"},{"City":"\u8346\u95e8\u5e02"},{"City":"\u8944\u6a0a\u5e02"},{"City":"\u9102\u5dde\u5e02"},{"City":"\u968f\u5dde\u5e02"},{"City":"\u9ec4\u5188\u5e02"},{"City":"\u9ec4\u77f3\u5e02"}]},{"Province":"\u6e56\u5357","CityList":[]},{"Province":"\u6e56\u5357\u7701","CityList":[{"City":"\u5a04\u5e95\u5e02"},{"City":"\u5cb3\u9633\u5e02"},{"City":"\u5e38\u5fb7\u5e02"},{"City":"\u5f20\u5bb6\u754c\u5e02"},{"City":"\u6000\u5316\u5e02"},{"City":"\u682a\u6d32\u5e02"},{"City":"\u6c38\u5dde\u5e02"},{"City":"\u6e58\u6f6d\u5e02"},{"City":"\u6e58\u897f\u5dde"},{"City":"\u76ca\u9633\u5e02"},{"City":"\u8861\u9633\u5e02"},{"City":"\u90b5\u9633\u5e02"},{"City":"\u90f4\u5dde\u5e02"},{"City":"\u957f\u6c99\u5e02"}]},{"Province":"\u7518\u8083\u7701","CityList":[{"City":"\u4e34\u590f\u5dde"},{"City":"\u5170\u5dde\u5e02"},{"City":"\u5929\u6c34\u5e02"},{"City":"\u5b9a\u897f\u5e02"},{"City":"\u5e73\u51c9\u5e02"},{"City":"\u5e86\u9633\u5e02"},{"City":"\u5f20\u6396\u5e02"},{"City":"\u6b66\u5a01\u5e02"},{"City":"\u7518\u5357\u5dde"},{"City":"\u767d\u94f6\u5e02"},{"City":"\u9152\u6cc9\u5e02"},{"City":"\u91d1\u660c\u5e02"},{"City":"\u9647\u5357\u5e02"}]},{"Province":"\u798f\u5efa\u7701","CityList":[{"City":"\u4e09\u660e\u5e02"},{"City":"\u5357\u5e73\u5e02"},{"City":"\u53a6\u95e8\u5e02"},{"City":"\u5b81\u5fb7\u5e02"},{"City":"\u6cc9\u5dde\u5e02"},{"City":"\u6f33\u5dde\u5e02"},{"City":"\u798f\u5dde\u5e02"},{"City":"\u8386\u7530\u5e02"},{"City":"\u9f99\u5ca9\u5e02"}]},{"Province":"\u8d35\u5dde\u7701","CityList":[{"City":"\u516d\u76d8\u6c34\u5e02"},{"City":"\u5b89\u987a\u5e02"},{"City":"\u6bd5\u8282\u5730\u533a"},{"City":"\u8d35\u9633\u5e02"},{"City":"\u9075\u4e49\u5e02"},{"City":"\u94dc\u4ec1\u5730\u533a"},{"City":"\u9ed4\u4e1c\u5357\u5dde"},{"City":"\u9ed4\u5357\u5dde"},{"City":"\u9ed4\u897f\u5357\u5dde"}]},{"Province":"\u8d35\u9633\u7701","CityList":[{"City":"\u516d\u76d8\u6c34\u5e02"},{"City":"\u5b89\u987a\u5e02"},{"City":"\u6bd5\u8282\u5730\u533a"},{"City":"\u8d35\u9633\u5e02"},{"City":"\u9075\u4e49\u5e02"},{"City":"\u94dc\u4ec1\u5730\u533a"},{"City":"\u9ed4\u4e1c\u5357\u5dde"},{"City":"\u9ed4\u5357\u5dde"},{"City":"\u9ed4\u897f\u5357\u5dde"}]},{"Province":"\u8fbd\u5b81\u7701","CityList":[{"City":"\u4e39\u4e1c\u5e02"},{"City":"\u5927\u8fde\u5e02"},{"City":"\u629a\u987a\u5e02"},{"City":"\u671d\u9633\u5e02"},{"City":"\u672c\u6eaa\u5e02"},{"City":"\u6c88\u9633\u5e02"},{"City":"\u76d8\u9526\u5e02"},{"City":"\u8425\u53e3\u5e02"},{"City":"\u846b\u82a6\u5c9b\u5e02"},{"City":"\u8fbd\u9633\u5e02"},{"City":"\u94c1\u5cad\u5e02"},{"City":"\u9526\u5dde\u5e02"},{"City":"\u961c\u65b0\u5e02"},{"City":"\u978d\u5c71\u5e02"}]},{"Province":"\u91cd\u5e86\u5e02","CityList":[{"City":"\u4e07\u5dde\u533a"},{"City":"\u4e07\u76db\u533a"},{"City":"\u4e5d\u9f99\u5761\u533a"},{"City":"\u5176\u4ed6\u5730\u533a"},{"City":"\u5317\u789a\u533a"},{"City":"\u5357\u5cb8\u533a"},{"City":"\u53cc\u6865\u533a"},{"City":"\u5927\u6e21\u53e3\u533a"},{"City":"\u5df4\u5357\u533a"},{"City":"\u6c5f\u5317\u533a"},{"City":"\u6c99\u576a\u575d\u533a"},{"City":"\u6daa\u9675\u533a"},{"City":"\u6e1d\u4e2d\u533a"},{"City":"\u6e1d\u5317\u533a"},{"City":"\u957f\u5bff\u533a"},{"City":"\u9ed4\u6c5f\u533a"}]},{"Province":"\u9655\u897f\u7701","CityList":[{"City":"\u54b8\u9633\u5e02"},{"City":"\u5546\u6d1b\u5e02"},{"City":"\u5b89\u5eb7\u5e02"},{"City":"\u5b9d\u9e21\u5e02"},{"City":"\u5ef6\u5b89\u5e02"},{"City":"\u6986\u6797\u5e02"},{"City":"\u6c49\u4e2d\u5e02"},{"City":"\u6e2d\u5357\u5e02"},{"City":"\u897f\u5b89\u5e02"},{"City":"\u94dc\u5ddd\u5e02"}]},{"Province":"\u9ed1\u9f99\u6c5f\u7701","CityList":[{"City":"\u4e03\u53f0\u6cb3\u5e02"},{"City":"\u4f0a\u6625\u5e02"},{"City":"\u4f73\u6728\u65af\u5e02"},{"City":"\u53cc\u9e2d\u5c71\u5e02"},{"City":"\u54c8\u5c14\u6ee8\u5e02"},{"City":"\u5927\u5174\u5b89\u5cad\u5730\u533a"},{"City":"\u5927\u5e86\u5e02"},{"City":"\u7261\u4e39\u6c5f\u5e02"},{"City":"\u7ee5\u5316\u5e02"},{"City":"\u9e21\u897f\u5e02"},{"City":"\u9e64\u5c97\u5e02"},{"City":"\u9ed1\u6cb3\u5e02"},{"City":"\u9f50\u9f50\u54c8\u5c14\u5e02"}]}]
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/secondregiondata.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/secondregionselector.js -----*/jiyiri.register_namespace('jiyiri.ui');

/* jiyiri.require_once('jiyiri.ui.secondregiondata'); */
/* jiyiri.require_once('jiyiri.helper.eventhelper.eventhelper'); */
/* jiyiri.require_once('jiyiri.helper.htmlelementhelper.htmlelementhelper'); */


(
function()
{
	var SecondRegionSelector = Class.create();
	SecondRegionSelector._instance = null;
	SecondRegionSelector.GetInstance = function()
	{
		if(SecondRegionSelector._instance==null)
		{
			SecondRegionSelector._instance = new SecondRegionSelector();
		}
		return SecondRegionSelector._instance;
	};

	SecondRegionSelector.prototype =
	{
			initialize:function(  )
			{
				this._regions = new Array();
				this._LoadFromCache();

				this.ProvinceSelectControl = $('ProvinceSelect');
				this.CitySelectControl = $('CitySelect');
			},
			InitialControl:function(province_ctl_name , city_ctl_name)
			{
				if( province_ctl_name != null && province_ctl_name != '' )
				{
					this.ProvinceSelectControl = $(province_ctl_name);
				}
				if( city_ctl_name != null && city_ctl_name != '' )
				{
					this.CitySelectControl = $(city_ctl_name);
				}
			},
			DrawProvinceSelectControl:function()
			{
				var select = this.ProvinceSelectControl;
				var provinces = this._GetProvinces();
				jiyiri.helper.htmlelementhelper.HTMLElementHelper.CleanOption(select);
				jiyiri.helper.htmlelementhelper.HTMLElementHelper.add_option(select,'选择省','选择省');
				for(var i=0;i<provinces.length;i++)
				{
					jiyiri.helper.htmlelementhelper.HTMLElementHelper.add_option(select,provinces[i],provinces[i]);
				}
				select.onchange = SecondRegionSelector.GetInstance().DrawCitiesSelectControl;
				//jiyiri.helper.eventhelper.EventHelper.create_event_function(select,'onchange',SecondRegionSelector.GetInstance()._DrawCitiesSelectControl);
			},
			DrawCitiesSelectControl:function()
			{
				var select = SecondRegionSelector.GetInstance().CitySelectControl;
				var province_name = $F(SecondRegionSelector.GetInstance().ProvinceSelectControl);
				if(!province_name) return false;
				var cities = SecondRegionSelector.GetInstance()._GetCitiesByProvinceName(province_name);
				jiyiri.helper.htmlelementhelper.HTMLElementHelper.CleanOption(select);
				jiyiri.helper.htmlelementhelper.HTMLElementHelper.add_option(select,'选择市','选择市');
				for(var i=0;i<cities.length;i++)
				{
					jiyiri.helper.htmlelementhelper.HTMLElementHelper.add_option(select,cities[i],cities[i]);
				}
			},
			_LoadFromCache:function()
			{
				if(SECOND_REGION_DATA==undefined)
				{
					alert('need cache file');
				}
				else
				{
					this._regions  = SECOND_REGION_DATA;
				}
			},
			_GetProvinces:function()
			{
				regions = this._regions;
				rtn = new Array();
				for(var i=0;i<regions.length;i++)
				{
					if(regions[i].Province)
					{
						rtn.push(trim(regions[i].Province));
					}
				}
				//rtn = array_unique(rtn);

				return rtn;
			},
			_GetCitiesByProvinceName:function(province_name)
			{
				regions = this._regions;
				rtn = new Array();
				for(var i=0;i<regions.length;i++)
				{
					if(regions[i].Province.Trim()==province_name.Trim())
					{
						var city_entities = regions[i].CityList;
						for(var j=0;j<city_entities.length;j++)
						{
							if(city_entities[j].City)
							{
								rtn.push(trim(city_entities[j].City));
							}
						}
					}
				}
				return rtn;
			}
	}

	jiyiri.ui.SecondRegionSelector = SecondRegionSelector;
}
)();

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/secondregionselector.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/simpletemplate.js -----*/jiyiri.register_namespace('jiyiri.ui');

( function() {

	/* Codes Start Here */

    // BELOW CODE IS FROMhttp://ejohn.org/blog/javascript-micro-templating/
    // Simple JavaScript Templating
    // John Resig - http://ejohn.org/ - MIT Licensed
    var t = (function(){
      var cache = {};

      this.tmpl = function tmpl(str, data){
        // Figure out if we're getting a template, or if we need to
        // load the template - and be sure to cache the result.
        var fn = !/\W/.test(str) ?
          cache[str] = cache[str] ||
            tmpl(document.getElementById(str).innerHTML) :

          // Generate a reusable function that will serve as a template
          // generator (and which will be cached).
          new Function("obj",
            "var p=[],print=function(){p.push.apply(p,arguments);};" +

            // Introduce the data as local variables using with(){}
            "with(obj){p.push('" +

            // Convert the template into pure JavaScript
            str
              .replace(/[\r\t\n]/g, " ")
              .split("<%").join("\t")
              .replace(/((^|%>)[^\t]*)'/g, "$1\r")
              .replace(/\t=(.*?)%>/g, "',$1,'")
              .split("\t").join("');")
              .split("%>").join("p.push('")
              .split("\r").join("\\'")
          + "');}return p.join('');");

        // Provide some basic currying to the user
        return data ? fn( data ) : fn;
      };
      return this;
    })();
    var SimpleTemplate = {};
    SimpleTemplate.parse = t.tmpl;
    SimpleTemplate.display = function(srcEle,dstEle,data)
    {
        var html = SimpleTemplate.parse(srcEle,data);
        $(dstEle).innerHTML = html;
        return html;
    }


	/* Codes End Here */

	/* Register Start Here */
	jiyiri.ui.SimpleTemplate = SimpleTemplate;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/simpletemplate.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/thirdregionselector.js -----*/jiyiri.register_namespace('jiyiri.ui');

/* jiyiri.require_once('jiyiri.helper.eventhelper.eventhelper'); */
/* jiyiri.require_once('jiyiri.helper.htmlelementhelper.htmlelementhelper'); */


(
function()
{
	var ThirdRegionSelector = {};
	var s = [];

	//安装控件 s是传入的3个地区控件id
	ThirdRegionSelector.setup = function(region_ctls)
	{
		s = region_ctls;
		for(i=0;i<s.length-1;i++)
		document.getElementById(s[i]).onchange=new Function("jiyiri.ui.ThirdRegionSelector.change("+(i+1)+")");
		change(0);
	}

	//改变上级地区后 下级地区相应改变刷新
	ThirdRegionSelector.change = function(v)
	{
		change(v);
	}

	var opt0 = ["选择省","选择市","选择区"];

	function Dsy()
	{
		this.Items = {};
	};
	Dsy.prototype.add = function(id, iArray)
	{
		this.Items[id] = iArray;
	};
	Dsy.prototype.Exists = function(id)
	{
		if (typeof (this.Items[id]) == "undefined")
			return false;
		return true;
	};

	function change(v)
	{
		var str = "0";
		for (i = 0; i < v; i++) {
			str += ("_" + (document.getElementById(s[i]).selectedIndex - 1));
		}
		;
		var ss = document.getElementById(s[v]);
		with (ss) {
			length = 0;
			options[0] = new Option(opt0[v], opt0[v]);
			if (v && document.getElementById(s[v - 1]).selectedIndex > 0 || !v) {
				if (dsy.Exists(str)) {
					ar = dsy.Items[str];
					for (i = 0; i < ar.length; i++)
						options[length] = new Option(ar[i], ar[i]);
					if (v)
						options[1].selected = true;
				}
			}
			if (++v < s.length) {
				change(v);
			}
		}
	};

	var dsy = new Dsy();

	dsy.add("0", [ "安徽", "北京", "福建", "甘肃", "广东", "广西", "贵州", "海南", "河北", "河南",
			"黑龙江", "湖北", "湖南", "吉林", "江苏", "江西", "辽宁", "内蒙古", "宁夏", "青海", "山东",
			"山西", "陕西", "上海", "四川", "天津", "西藏", "新疆", "云南", "浙江", "重庆" ]);

	dsy.add("0_0", [ "安庆", "蚌埠", "巢湖", "池州", "滁州", "阜阳", "合肥", "淮北", "淮南", "黄山",
			"六安", "马鞍山", "宿州", "铜陵", "芜湖", "宣城", "亳州" ]);
	dsy.add("0_0_0", [ "安庆市", "怀宁县", "潜山县", "宿松县", "太湖县", "桐城市", "望江县", "岳西县",
			"枞阳县" ]);
	dsy.add("0_0_1", [ "蚌埠市", "固镇县", "怀远县", "五河县" ]);
	dsy.add("0_0_2", [ "巢湖市", "含山县", "和县", "庐江县", "无为县" ]);
	dsy.add("0_0_3", [ "池州市", "东至县", "青阳县", "石台县" ]);
	dsy.add("0_0_4", [ "滁州市", "定远县", "凤阳县", "来安县", "明光市", "全椒县", "天长市" ]);
	dsy.add("0_0_5", [ "阜南县", "阜阳市", "界首市", "临泉县", "太和县", "颖上县" ]);
	dsy.add("0_0_6", [ "长丰县", "肥东县", "肥西县" ]);
	dsy.add("0_0_7", [ "淮北市", "濉溪县" ]);
	dsy.add("0_0_8", [ "凤台县", "淮南市" ]);
	dsy.add("0_0_9", [ "黄山市", "祁门县", "休宁县", "歙县", "黟县" ]);
	dsy.add("0_0_10", [ "霍邱县", "霍山县", "金寨县", "六安市", "寿县", "舒城县" ]);
	dsy.add("0_0_11", [ "当涂县", "马鞍山市" ]);
	dsy.add("0_0_12", [ "灵璧县", "宿州市", "萧县", "泗县", "砀山县" ]);
	dsy.add("0_0_13", [ "铜陵市", "铜陵县" ]);
	dsy.add("0_0_14", [ "繁昌县", "南陵县", "芜湖市", "芜湖县" ]);
	dsy.add("0_0_15", [ "广德县", "绩溪县", "郎溪县", "宁国市", "宣城市", "泾县", "旌德县" ]);
	dsy.add("0_0_16", [ "利辛县", "蒙城县", "涡阳县", "亳州市" ]);

	dsy.add("0_1", [ "北京" ]);
	dsy.add("0_1_0", [ "北京市", "密云县", "延庆县" ]);

	dsy.add("0_2", [ "福州", "龙岩", "南平", "宁德", "莆田", "泉州", "三明", "厦门", "漳州" ]);
	dsy.add("0_2_0", [ "长乐市", "福清市", "福州市", "连江县", "罗源县", "闽侯县", "闽清县", "平潭县",
			"永泰县" ]);
	dsy.add("0_2_1", [ "长汀县", "连城县", "龙岩市", "上杭县", "武平县", "永定县", "漳平市" ]);
	dsy.add("0_2_2", [ "光泽县", "建阳市", "建瓯市", "南平市", "浦城县", "邵武市", "顺昌县", "松溪县",
			"武夷山市", "政和县" ]);
	dsy.add("0_2_3", [ "福安市", "福鼎市", "古田县", "宁德市", "屏南县", "寿宁县", "霞浦县", "周宁县",
			"柘荣县" ]);
	dsy.add("0_2_4", [ "莆田市", "仙游县" ]);
	dsy.add("0_2_5", [ "安溪县", "德化县", "惠安县", "金门县", "晋江市", "南安市", "泉州市", "石狮市",
			"永春县" ]);
	dsy.add("0_2_6", [ "大田县", "建宁县", "将乐县", "明溪县", "宁化县", "清流县", "三明市", "沙县",
			"泰宁县", "永安市", "尤溪县" ]);
	dsy.add("0_2_7", [ "厦门市" ]);
	dsy.add("0_2_8", [ "长泰县", "东山县", "华安县", "龙海市", "南靖县", "平和县", "云霄县", "漳浦县",
			"漳州市", "诏安县" ]);

	dsy.add("0_3", [ "白银", "定西", "甘南藏族自治州", "嘉峪关", "金昌", "酒泉", "兰州", "临夏回族自治州",
			"陇南", "平凉", "庆阳", "天水", "武威", "张掖" ]);
	dsy.add("0_3_0", [ "白银市", "会宁县", "景泰县", "靖远县" ]);
	dsy.add("0_3_1", [ "定西县", "临洮县", "陇西县", "通渭县", "渭源县", "漳县", "岷县" ]);
	dsy.add("0_3_2", [ "迭部县", "合作市", "临潭县", "碌曲县", "玛曲县", "夏河县", "舟曲县", "卓尼县" ]);
	dsy.add("0_3_3", [ "嘉峪关市" ]);
	dsy.add("0_3_4", [ "金昌市", "永昌县" ]);
	dsy.add("0_3_5",
			[ "阿克塞哈萨克族自治县", "安西县", "敦煌市", "金塔县", "酒泉市", "肃北蒙古族自治县", "玉门市" ]);
	dsy.add("0_3_6", [ "皋兰县", "兰州市", "永登县", "榆中县" ]);
	dsy.add("0_3_7", [ "东乡族自治县", "广河县", "和政县", "积石山保安族东乡族撒拉族自治县", "康乐县", "临夏市",
			"临夏县", "永靖县" ]);
	dsy.add("0_3_8", [ "成县", "徽县", "康县", "礼县", "两当县", "文县", "武都县", "西和县", "宕昌县" ]);
	dsy.add("0_3_9", [ "崇信县", "华亭县", "静宁县", "灵台县", "平凉市", "庄浪县", "泾川县" ]);
	dsy.add("0_3_10", [ "合水县", "华池县", "环县", "宁县", "庆城县", "庆阳市", "镇原县", "正宁县" ]);
	dsy.add("0_3_11", [ "甘谷县", "秦安县", "清水县", "天水市", "武山县", "张家川回族自治县" ]);
	dsy.add("0_3_12", [ "古浪县", "民勤县", "天祝藏族自治县", "武威市" ]);
	dsy.add("0_3_13", [ "高台县", "临泽县", "民乐县", "山丹县", "肃南裕固族自治县", "张掖市" ]);

	dsy.add("0_4", [ "潮州", "东莞", "佛山", "广州", "河源", "惠州", "江门", "揭阳", "茂名", "梅州",
			"清远", "汕头", "汕尾", "韶关", "深圳", "阳江", "云浮", "湛江", "肇庆", "中山", "珠海" ]);
	dsy.add("0_4_0", [ "潮安县", "潮州市", "饶平县" ]);
	dsy.add("0_4_1", [ "东莞市" ]);
	dsy.add("0_4_2", [ "佛山市" ]);
	dsy.add("0_4_3", [ "从化市", "广州市", "增城市" ]);
	dsy.add("0_4_4", [ "东源县", "和平县", "河源市", "连平县", "龙川县", "紫金县" ]);
	dsy.add("0_4_5", [ "博罗县", "惠东县", "惠阳市", "惠州市", "龙门县" ]);
	dsy.add("0_4_6", [ "恩平市", "鹤山市", "江门市", "开平市", "台山市" ]);
	dsy.add("0_4_7", [ "惠来县", "揭东县", "揭西县", "揭阳市", "普宁市" ]);
	dsy.add("0_4_8", [ "电白县", "高州市", "化州市", "茂名市", "信宜市" ]);
	dsy.add("0_4_9", [ "大埔县", "丰顺县", "蕉岭县", "梅县", "梅州市", "平远县", "五华县", "兴宁市" ]);
	dsy.add("0_4_10", [ "佛冈县", "连南瑶族自治县", "连山壮族瑶族自治县", "连州市", "清新县", "清远市", "阳山县",
			"英德市" ]);
	dsy.add("0_4_11", [ "潮阳市", "澄海市", "南澳县", "汕头市" ]);
	dsy.add("0_4_12", [ "海丰县", "陆丰市", "陆河县", "汕尾市" ]);
	dsy.add("0_4_13", [ "乐昌市", "南雄市", "曲江县", "仁化县", "乳源瑶族自治县", "韶关市", "始兴县", "翁源县",
			"新丰县" ]);
	dsy.add("0_4_14", [ "深圳市" ]);
	dsy.add("0_4_15", [ "阳春市", "阳东县", "阳江市", "阳西县" ]);
	dsy.add("0_4_16", [ "罗定市", "新兴县", "郁南县", "云安县", "云浮市" ]);
	dsy.add("0_4_17", [ "雷州市", "廉江市", "遂溪县", "吴川市", "徐闻县", "湛江市" ]);
	dsy.add("0_4_18", [ "德庆县", "封开县", "高要市", "广宁县", "怀集县", "四会市", "肇庆市" ]);
	dsy.add("0_4_19", [ "中山市" ]);
	dsy.add("0_4_20", [ "珠海市" ]);

	dsy.add("0_5", [ "百色", "北海", "崇左", "防城港", "桂林", "贵港", "河池", "贺州", "来宾", "柳州",
			"南宁", "钦州", "梧州", "玉林" ]);

	dsy.add("0_5_0", [ "百色市", "德保县", "靖西县", "乐业县", "凌云县", "隆林各族自治县", "那坡县", "平果县",
			"田东县", "田林县", "田阳县", "西林县" ]);
	dsy.add("0_5_1", [ "北海市", "合浦县" ]);
	dsy.add("0_5_2", [ "崇左市", "大新县", "扶绥县", "龙州县", "宁明县", "凭祥市", "天等县" ]);
	dsy.add("0_5_3", [ "东兴市", "防城港市", "上思县" ]);
	dsy.add("0_5_4", [ "恭城瑶族自治县", "灌阳县", "桂林市", "荔浦县", "临桂县", "灵川县", "龙胜各族自治县",
			"平乐县", "全州县", "兴安县", "阳朔县", "永福县", "资源县" ]);
	dsy.add("0_5_5", [ "桂平市", "贵港市", "平南县" ]);
	dsy.add("0_5_6", [ "巴马瑶族自治县", "大化瑶族自治县", "东兰县", "都安瑶族自治县", "凤山县", "河池市",
			"环江毛南族自治县", "罗城仡佬族自治县", "南丹县", "天峨县", "宜州市" ]);
	dsy.add("0_5_7", [ "富川瑶族自治县", "贺州市", "昭平县", "钟山县" ]);
	dsy.add("0_5_8", [ "合山市", "金秀瑶族自治县", "来宾市", "武宣县", "象州县", "忻城县" ]);
	dsy.add("0_5_9", [ "柳城县", "柳江县", "柳州市", "鹿寨县", "融安县", "融水苗族自治县", "三江侗族自治县" ]);
	dsy.add("0_5_10", [ "宾阳县", "横县", "隆安县", "马山县", "南宁市", "上林县", "武鸣县", "邕宁县" ]);
	dsy.add("0_5_11", [ "灵山县", "浦北县", "钦州市" ]);
	dsy.add("0_5_12", [ "苍梧县", "蒙山县", "藤县", "梧州市", "岑溪市" ]);
	dsy.add("0_5_13", [ "北流市", "博白县", "陆川县", "容县", "兴业县", "玉林市" ]);
	dsy.add("0_6", [ "安顺", "毕节", "贵阳", "六盘水", "黔东南苗族侗族自治州", "黔南布依族苗族自治州",
			"黔西南布依族苗族自治州", "铜仁", "遵义" ]);
	dsy.add("0_6_0", [ "安顺市", "关岭布依族苗族自治县", "平坝县", "普定县", "镇宁布依族苗族自治县",
			"紫云苗族布依族自治县" ]);
	dsy.add("0_6_1", [ "毕节市", "大方县", "赫章县", "金沙县", "纳雍县", "黔西县", "威宁彝族回族苗族自治县",
			"织金县" ]);
	dsy.add("0_6_2", [ "贵阳市", "开阳县", "清镇市", "息烽县", "修文县" ]);
	dsy.add("0_6_3", [ "六盘水市", "六枝特区", "盘县", "水城县" ]);
	dsy.add("0_6_4", [ "从江县", "丹寨县", "黄平县", "剑河县", "锦屏县", "凯里市", "雷山县", "黎平县",
			"麻江县", "三穗县", "施秉县", "台江县", "天柱县", "镇远县", "岑巩县", "榕江县" ]);
	dsy.add("0_6_5", [ "长顺县", "都匀市", "独山县", "福泉市", "贵定县", "惠水县", "荔波县", "龙里县",
			"罗甸县", "平塘县", "三都水族自治县", "瓮安县" ]);
	dsy.add("0_6_6", [ "安龙县", "册亨县", "普安县", "晴隆县", "望谟县", "兴仁县", "兴义市", "贞丰县" ]);
	dsy.add("0_6_7", [ "德江县", "江口县", "石阡县", "思南县", "松桃苗族自治县", "铜仁市", "万山特区",
			"沿河土家族自治县", "印江土家族苗族自治县", "玉屏侗族自治县" ]);
	dsy.add("0_6_8", [ "赤水市", "道真仡佬族苗族自治县", "凤冈县", "仁怀市", "绥阳县", "桐梓县",
			"务川仡佬族苗族自治县", "习水县", "余庆县", "正安县", "遵义市", "遵义县", "湄潭县" ]);

	dsy.add("0_7", [ "白沙黎族自治县", "保亭黎族苗族自治县", "昌江黎族自治县", "澄迈县", "定安县", "东方", "海口",
			"乐东黎族自治县", "临高县", "陵水黎族自治县", "琼海", "琼中黎族苗族自治县", "三亚", "屯昌县", "万宁",
			"文昌", "五指山", "儋州" ]);
	dsy.add("0_7_0", [ "白沙黎族自治县" ]);
	dsy.add("0_7_1", [ "保亭黎族苗族自治县" ]);
	dsy.add("0_7_2", [ "昌江黎族自治县" ]);
	dsy.add("0_7_3", [ "澄迈县" ]);
	dsy.add("0_7_4", [ "定安县" ]);
	dsy.add("0_7_5", [ "东方市" ]);
	dsy.add("0_7_6", [ "海口市" ]);
	dsy.add("0_7_7", [ "乐东黎族自治县" ]);
	dsy.add("0_7_8", [ "临高县" ]);
	dsy.add("0_7_9", [ "陵水黎族自治县" ]);
	dsy.add("0_7_10", [ "琼海市" ]);
	dsy.add("0_7_11", [ "琼中黎族苗族自治县" ]);
	dsy.add("0_7_12", [ "三亚市" ]);
	dsy.add("0_7_13", [ "屯昌县" ]);
	dsy.add("0_7_14", [ "万宁市" ]);
	dsy.add("0_7_15", [ "文昌市" ]);
	dsy.add("0_7_16", [ "五指山市" ]);
	dsy.add("0_7_17", [ "儋州市" ]);

	dsy.add("0_8", [ "保定", "沧州", "承德", "邯郸", "衡水", "廊坊", "秦皇岛", "石家庄", "唐山", "邢台",
			"张家口" ]);
	dsy.add("0_8_0", [ "安国市", "安新县", "保定市", "博野县", "定兴县", "定州市", "阜平县", "高碑店市",
			"高阳县", "满城县", "清苑县", "曲阳县", "容城县", "顺平县", "唐县", "望都县", "雄县", "徐水县",
			"易县", "涞水县", "涞源县", "涿州市", "蠡县" ]);
	dsy.add("0_8_1", [ "泊头市", "沧县", "沧州市", "东光县", "海兴县", "河间市", "黄骅市", "孟村回族自治县",
			"南皮县", "青县", "任丘市", "肃宁县", "吴桥县", "献县", "盐山县" ]);
	dsy.add("0_8_2", [ "承德市", "承德县", "丰宁满族自治县", "宽城满族自治县", "隆化县", "滦平县", "平泉县",
			"围场满族蒙古族自治县", "兴隆县" ]);
	dsy.add("0_8_3", [ "成安县", "磁县", "大名县", "肥乡县", "馆陶县", "广平县", "邯郸市", "邯郸县",
			"鸡泽县", "临漳县", "邱县", "曲周县", "涉县", "魏县", "武安市", "永年县" ]);
	dsy.add("0_8_4", [ "安平县", "阜城县", "故城县", "衡水市", "冀州市", "景县", "饶阳县", "深州市",
			"武强县", "武邑县", "枣强县" ]);
	dsy.add("0_8_5", [ "霸州市", "大厂回族自治县", "大城县", "固安县", "廊坊市", "三河市", "文安县", "香河县",
			"永清县" ]);
	dsy.add("0_8_6", [ "昌黎县", "抚宁县", "卢龙县", "秦皇岛市", "青龙满族自治县" ]);
	dsy.add("0_8_7", [ "高邑县", "晋州市", "井陉县", "灵寿县", "鹿泉市", "平山县", "深泽县", "石家庄市",
			"无极县", "辛集市", "新乐市", "行唐县", "元氏县", "赞皇县", "赵县", "正定县", "藁城市", "栾城县" ]);
	dsy.add("0_8_8",
			[ "乐亭县", "滦南县", "滦县", "迁安市", "迁西县", "唐海县", "唐山市", "玉田县", "遵化市" ]);
	dsy.add("0_8_9", [ "柏乡县", "广宗县", "巨鹿县", "临城县", "临西县", "隆尧县", "南宫市", "南和县",
			"内丘县", "宁晋县", "平乡县", "清河县", "任县", "沙河市", "威县", "新河县", "邢台市", "邢台县" ]);
	dsy.add("0_8_10", [ "赤城县", "崇礼县", "沽源县", "怀安县", "怀来县", "康保县", "尚义县", "万全县",
			"蔚县", "宣化县", "阳原县", "张北县", "张家口市", "涿鹿县" ]);

	dsy.add("0_9", [ "安阳", "鹤壁", "济源", "焦作", "开封", "洛阳", "南阳", "平顶山", "三门峡", "商丘",
			"新乡", "信阳", "许昌", "郑州", "周口", "驻马店", "漯河", "濮阳" ]);
	dsy.add("0_9_0", [ "安阳市", "安阳县", "滑县", "林州市", "内黄县", "汤阴县" ]);
	dsy.add("0_9_1", [ "", "鹤壁市", "浚县", "淇县" ]);
	dsy.add("0_9_2", [ "济源市" ]);
	dsy.add("0_9_3", [ "博爱县", "焦作市", "孟州市", "沁阳市", "温县", "武陟县", "修武县" ]);
	dsy.add("0_9_4", [ "开封市", "开封县", "兰考县", "通许县", "尉氏县", "杞县" ]);
	dsy.add("0_9_5", [ "洛宁县", "洛阳市", "孟津县", "汝阳县", "新安县", "伊川县", "宜阳县", "偃师市",
			"嵩县", "栾川县" ]);
	dsy.add("0_9_6", [ "邓州市", "方城县", "南阳市", "南召县", "内乡县", "社旗县", "唐河县", "桐柏县",
			"西峡县", "新野县", "镇平县", "淅川县" ]);
	dsy.add("0_9_7", [ "宝丰县", "鲁山县", "平顶山市", "汝州市", "舞钢市", "叶县", "郏县" ]);
	dsy.add("0_9_8", [ "灵宝市", "卢氏县", "三门峡市", "陕县", "义马市", "渑池县" ]);
	dsy.add("0_9_9", [ "民权县", "宁陵县", "商丘市", "夏邑县", "永城市", "虞城县", "柘城县", "睢县" ]);
	dsy.add("0_9_10", [ "长垣县", "封丘县", "辉县市", "获嘉县", "卫辉市", "新乡市", "新乡县", "延津县",
			"原阳县" ]);
	dsy.add("0_9_11",
			[ "固始县", "光山县", "淮滨县", "罗山县", "商城县", "息县", "新县", "信阳市", "潢川县" ]);
	dsy.add("0_9_12", [ "长葛市", "襄城县", "许昌市", "许昌县", "禹州市", "鄢陵县" ]);
	dsy.add("0_9_13", [ "登封市", "巩义市", "新密市", "新郑市", "郑州市", "中牟县", "荥阳市" ]);
	dsy.add("0_9_14", [ "郸城县", "扶沟县", "淮阳县", "鹿邑县", "商水县", "沈丘县", "太康县", "西华县",
			"项城市", "周口市" ]);
	dsy.add("0_9_15", [ "泌阳县", "平舆县", "确山县", "汝南县", "上蔡县", "遂平县", "西平县", "新蔡县",
			"正阳县", "驻马店市" ]);
	dsy.add("0_9_16", [ "临颍县", "舞阳县", "郾城县", "漯河市" ]);
	dsy.add("0_9_17", [ "范县", "南乐县", "清丰县", "台前县", "濮阳市", "濮阳县" ]);

	dsy.add("0_10", [ "大庆", "大兴安岭", "哈尔滨", "鹤岗", "黑河", "鸡西", "佳木斯", "牡丹江", "七台河",
			"齐齐哈尔", "双鸭山", "绥化", "伊春" ]);
	dsy.add("0_10_0", [ "大庆市", "杜尔伯特蒙古族自治县", "林甸县", "肇源县", "肇州县" ]);
	dsy.add("0_10_1", [ "呼玛县", "漠河县", "塔河县" ]);
	dsy.add("0_10_2", [ "阿城市", "巴彦县", "宾县", "方正县", "哈尔滨市", "呼兰县", "木兰县", "尚志市",
			"双城市", "通河县", "五常市", "延寿县", "依兰县" ]);
	dsy.add("0_10_3", [ "鹤岗市", "萝北县", "绥滨县" ]);
	dsy.add("0_10_4", [ "北安市", "黑河市", "嫩江县", "孙吴县", "五大连池市", "逊克县" ]);
	dsy.add("0_10_5", [ "虎林市", "鸡东县", "鸡西市", "密山市" ]);
	dsy.add("0_10_6", [ "抚远县", "富锦市", "佳木斯市", "汤原县", "同江市", "桦川县", "桦南县" ]);
	dsy.add("0_10_7", [ "东宁县", "海林市", "林口县", "牡丹江市", "穆棱市", "宁安市", "绥芬河市" ]);
	dsy.add("0_10_8", [ "勃利县", "七台河市" ]);
	dsy.add("0_10_9", [ "拜泉县", "富裕县", "甘南县", "克东县", "克山县", "龙江县", "齐齐哈尔市", "泰来县",
			"依安县", "讷河市" ]);
	dsy.add("0_10_10", [ "宝清县", "集贤县", "饶河县", "双鸭山市", "友谊县" ]);
	dsy.add("0_10_11", [ "安达市", "海伦市", "兰西县", "明水县", "青冈县", "庆安县", "绥化市", "绥棱县",
			"望奎县", "肇东市" ]);
	dsy.add("0_10_12", [ "嘉荫县", "铁力市", "伊春市" ]);

	dsy.add("0_11", [ "鄂州", "恩施土家族苗族自治州", "黄冈", "黄石", "荆门", "荆州", "潜江", "神农架林区",
			"十堰", "随州", "天门", "武汉", "仙桃", "咸宁", "襄樊", "孝感", "宜昌" ]);
	dsy.add("0_11_0", [ "鄂州市" ]);
	dsy.add("0_11_1", [ "巴东县", "恩施市", "鹤峰县", "建始县", "来凤县", "利川市", "咸丰县", "宣恩县" ]);
	dsy.add("0_11_2", [ "红安县", "黄冈市", "黄梅县", "罗田县", "麻城市", "团风县", "武穴市", "英山县",
			"蕲春县", "浠水县" ]);
	dsy.add("0_11_3", [ "大冶市", "黄石市", "阳新县" ]);
	dsy.add("0_11_4", [ "荆门市", "京山县", "沙洋县", "钟祥市" ]);
	dsy.add("0_11_5", [ "公安县", "洪湖市", "监利县", "江陵县", "荆州市", "石首市", "松滋市" ]);
	dsy.add("0_11_6", [ "潜江市" ]);
	dsy.add("0_11_7", [ "神农架林区" ]);
	dsy.add("0_11_8", [ "丹江口市", "房县", "十堰市", "郧西县", "郧县", "竹山县", "竹溪县" ]);
	dsy.add("0_11_9", [ "广水市", "随州市" ]);
	dsy.add("0_11_10", [ "天门市" ]);
	dsy.add("0_11_11", [ "武汉市" ]);
	dsy.add("0_11_12", [ "仙桃市" ]);
	dsy.add("0_11_13", [ "赤壁市", "崇阳县", "嘉鱼县", "通城县", "通山县", "咸宁市" ]);
	dsy.add("0_11_14", [ "保康县", "谷城县", "老河口市", "南漳县", "襄樊市", "宜城市", "枣阳市" ]);
	dsy.add("0_11_15", [ "安陆市", "大悟县", "汉川市", "孝昌县", "孝感市", "应城市", "云梦县" ]);
	dsy.add("0_11_16", [ "长阳土家族自治县", "当阳市", "五峰土家族自治县", "兴山县", "宜昌市", "宜都市", "远安县",
			"枝江市", "秭归县" ]);

	dsy.add("0_12", [ "常德", "长沙", "郴州", "衡阳", "怀化", "娄底", "邵阳", "湘潭", "湘西土家族苗族自治州",
			"益阳", "永州", "岳阳", "张家界", "株洲" ]);
	dsy.add("0_12_0", [ "安乡县", "常德市", "汉寿县", "津市市", "临澧县", "石门县", "桃源县", "澧县" ]);
	dsy.add("0_12_1", [ "长沙市", "长沙县", "宁乡县", "望城县", "浏阳市" ]);
	dsy.add("0_12_2", [ "安仁县", "郴州市", "桂东县", "桂阳县", "嘉禾县", "临武县", "汝城县", "宜章县",
			"永兴县", "资兴市" ]);
	dsy.add("0_12_3", [ "常宁市", "衡东县", "衡南县", "衡山县", "衡阳市", "衡阳县", "祁东县", "耒阳市" ]);
	dsy.add("0_12_4", [ "辰溪县", "洪江市", "怀化市", "会同县", "靖州苗族侗族自治县", "麻阳苗族自治县",
			"通道侗族自治县", "新晃侗族自治县", "中方县", "芷江侗族自治县", "沅陵县", "溆浦县" ]);
	dsy.add("0_12_5", [ "冷水江市", "涟源市", "娄底市", "双峰县", "新化县" ]);
	dsy.add("0_12_6", [ "城步苗族自治县", "洞口县", "隆回县", "邵东县", "邵阳市", "邵阳县", "绥宁县", "武冈市",
			"新宁县", "新邵县" ]);
	dsy.add("0_12_7", [ "韶山市", "湘潭市", "湘潭县", "湘乡市" ]);
	dsy.add("0_12_8", [ "保靖县", "凤凰县", "古丈县", "花垣县", "吉首市", "龙山县", "永顺县", "泸溪县" ]);
	dsy.add("0_12_9", [ "安化县", "南县", "桃江县", "益阳市", "沅江市" ]);
	dsy.add("0_12_10", [ "道县", "东安县", "江华瑶族自治县", "江永县", "蓝山县", "宁远县", "祁阳县", "双牌县",
			"新田县", "永州市" ]);
	dsy.add("0_12_11", [ "华容县", "临湘市", "平江县", "湘阴县", "岳阳市", "岳阳县", "汨罗市" ]);
	dsy.add("0_12_12", [ "慈利县", "桑植县", "张家界市" ]);
	dsy.add("0_12_13", [ "茶陵县", "炎陵县", "株洲市", "株洲县", "攸县", "醴陵市" ]);

	dsy.add("0_13", [ "白城", "白山", "长春", "吉林", "辽源", "四平", "松原", "通化", "延边朝鲜族自治州" ]);
	dsy.add("0_13_0", [ "白城市", "大安市", "通榆县", "镇赉县", "洮南市" ]);
	dsy.add("0_13_1", [ "白山市", "长白朝鲜族自治县", "抚松县", "江源县", "靖宇县", "临江市" ]);
	dsy.add("0_13_2", [ "长春市", "德惠市", "九台市", "农安县", "榆树市" ]);
	dsy.add("0_13_3", [ "吉林市", "磐石市", "舒兰市", "永吉县", "桦甸市", "蛟河市" ]);
	dsy.add("0_13_4", [ "东丰县", "东辽县", "辽源市" ]);
	dsy.add("0_13_5", [ "公主岭市", "梨树县", "双辽市", "四平市", "伊通满族自治县" ]);
	dsy.add("0_13_6", [ "长岭县", "扶余县", "乾安县", "前郭尔罗斯蒙古族自治县", "松原市" ]);
	dsy.add("0_13_7", [ "辉南县", "集安市", "柳河县", "梅河口市", "通化市", "通化县" ]);
	dsy.add("0_13_8", [ "安图县", "敦化市", "和龙市", "龙井市", "图们市", "汪清县", "延吉市", "珲春市" ]);

	dsy.add("0_14", [ "常州", "淮安", "连云港", "南京", "南通", "苏州", "宿迁", "泰州", "无锡", "徐州",
			"盐城", "扬州", "镇江" ]);
	dsy.add("0_14_0", [ "常州市", "金坛市", "溧阳市" ]);
	dsy.add("0_14_1", [ "洪泽县", "淮安市", "金湖县", "涟水县", "盱眙县" ]);
	dsy.add("0_14_2", [ "东海县", "赣榆县", "灌南县", "灌云县", "连云港市" ]);
	dsy.add("0_14_3", [ "高淳县", "南京市", "溧水县" ]);
	dsy.add("0_14_4", [ "海安县", "海门市", "南通市", "启东市", "如东县", "如皋市", "通州市" ]);
	dsy.add("0_14_5", [ "常熟市", "昆山市", "苏州市", "太仓市", "吴江市", "张家港市" ]);
	dsy.add("0_14_6", [ "宿迁市", "宿豫县", "沭阳县", "泗洪县", "泗阳县" ]);
	dsy.add("0_14_7", [ "姜堰市", "靖江市", "泰兴市", "泰州市", "兴化市" ]);
	dsy.add("0_14_8", [ "江阴市", "无锡市", "宜兴市" ]);
	dsy.add("0_14_9", [ "丰县", "沛县", "铜山县", "新沂市", "徐州市", "邳州市", "睢宁县" ]);
	dsy.add("0_14_10", [ "滨海县", "大丰市", "东台市", "阜宁县", "建湖县", "射阳县", "响水县", "盐城市",
			"盐都县" ]);
	dsy.add("0_14_11", [ "宝应县", "高邮市", "江都市", "扬州市", "仪征市" ]);
	dsy.add("0_14_12", [ "丹阳市", "句容市", "扬中市", "镇江市" ]);

	dsy.add("0_15", [ "抚州", "赣州", "吉安", "景德镇", "九江", "南昌", "萍乡", "上饶", "新余", "宜春",
			"鹰潭" ]);
	dsy.add("0_15_0", [ "崇仁县", "东乡县", "抚州市", "广昌县", "金溪县", "乐安县", "黎川县", "南城县",
			"南丰县", "宜黄县", "资溪县" ]);
	dsy.add("0_15_1", [ "安远县", "崇义县", "大余县", "定南县", "赣县", "赣州市", "会昌县", "龙南县",
			"南康市", "宁都县", "全南县", "瑞金市", "上犹县", "石城县", "信丰县", "兴国县", "寻乌县", "于都县" ]);
	dsy.add("0_15_2", [ "安福县", "吉安市", "吉安县", "吉水县", "井冈山市", "遂川县", "泰和县", "万安县",
			"峡江县", "新干县", "永丰县", "永新县" ]);
	dsy.add("0_15_3", [ "浮梁县", "景德镇市", "乐平市" ]);
	dsy.add("0_15_4", [ "德安县", "都昌县", "湖口县", "九江市", "九江县", "彭泽县", "瑞昌市", "武宁县",
			"星子县", "修水县", "永修县" ]);
	dsy.add("0_15_5", [ "安义县", "进贤县", "南昌市", "南昌县", "新建县" ]);
	dsy.add("0_15_6", [ "莲花县", "芦溪县", "萍乡市", "上栗县" ]);
	dsy.add("0_15_7", [ "波阳县", "德兴市", "广丰县", "横峰县", "铅山县", "上饶市", "上饶县", "万年县",
			"余干县", "玉山县", "弋阳县", "婺源县" ]);
	dsy.add("0_15_8", [ "分宜县", "新余市" ]);
	dsy.add("0_15_9", [ "丰城市", "奉新县", "高安市", "靖安县", "上高县", "铜鼓县", "万载县", "宜春市",
			"宜丰县", "樟树市" ]);
	dsy.add("0_15_10", [ "贵溪市", "鹰潭市", "余江县" ]);

	dsy.add("0_16", [ "鞍山", "本溪", "朝阳", "大连", "丹东", "抚顺", "阜新", "葫芦岛", "锦州", "辽阳",
			"盘锦", "沈阳", "铁岭", "营口" ]);
	dsy.add("0_16_0", [ "鞍山市", "海城市", "台安县", "岫岩满族自治县" ]);
	dsy.add("0_16_1", [ "本溪满族自治县", "本溪市", "桓仁满族自治县" ]);
	dsy.add("0_16_2", [ "北票市", "朝阳市", "朝阳县", "建平县", "喀喇沁左翼蒙古族自治县", "凌源市" ]);
	dsy.add("0_16_3", [ "长海县", "大连市", "普兰店市", "瓦房店市", "庄河市" ]);
	dsy.add("0_16_4", [ "丹东市", "东港市", "凤城市", "宽甸满族自治县" ]);
	dsy.add("0_16_5", [ "抚顺市", "抚顺县", "清原满族自治县", "新宾满族自治县" ]);
	dsy.add("0_16_6", [ "阜新蒙古族自治县", "阜新市", "彰武县" ]);
	dsy.add("0_16_7", [ "葫芦岛市", "建昌县", "绥中县", "兴城市" ]);
	dsy.add("0_16_8", [ "北宁市", "黑山县", "锦州市", "凌海市", "义县" ]);
	dsy.add("0_16_9", [ "灯塔市", "辽阳市", "辽阳县" ]);
	dsy.add("0_16_10", [ "大洼县", "盘锦市", "盘山县" ]);
	dsy.add("0_16_11", [ "法库县", "康平县", "辽中县", "沈阳市", "新民市" ]);
	dsy.add("0_16_12", [ "昌图县", "调兵山市", "开原市", "铁岭市", "铁岭县", "西丰县" ]);
	dsy.add("0_16_13", [ "大石桥市", "盖州市", "营口市" ]);

	dsy.add("0_17", [ "阿拉善盟", "巴彦淖尔盟", "包头", "赤峰", "鄂尔多斯", "呼和浩特", "呼伦贝尔", "通辽",
			"乌海", "乌兰察布盟", "锡林郭勒盟", "兴安盟" ]);
	dsy.add("0_17_0", [ "阿拉善右旗", "阿拉善左旗", "额济纳旗" ]);
	dsy.add("0_17_1", [ "杭锦后旗", "临河市", "乌拉特后旗", "乌拉特前旗", "乌拉特中旗", "五原县", "磴口县" ]);
	dsy.add("0_17_2", [ "包头市", "达尔罕茂明安联合旗", "固阳县", "土默特右旗" ]);
	dsy.add("0_17_3", [ "阿鲁科尔沁旗", "敖汉旗", "巴林右旗", "巴林左旗", "赤峰市", "喀喇沁旗", "克什克腾旗",
			"林西县", "宁城县", "翁牛特旗" ]);
	dsy.add("0_17_4", [ "达拉特旗", "鄂尔多斯市", "鄂托克旗", "鄂托克前旗", "杭锦旗", "乌审旗", "伊金霍洛旗",
			"准格尔旗" ]);
	dsy.add("0_17_5", [ "和林格尔县", "呼和浩特市", "清水河县", "土默特左旗", "托克托县", "武川县" ]);
	dsy.add("0_17_6", [ "阿荣旗", "陈巴尔虎旗", "额尔古纳市", "鄂伦春自治旗", "鄂温克族自治旗", "根河市",
			"呼伦贝尔市", "满洲里市", "莫力达瓦达斡尔族自治旗", "新巴尔虎右旗", "新巴尔虎左旗", "牙克石市", "扎兰屯市" ]);
	dsy.add("0_17_7", [ "霍林郭勒市", "开鲁县", "科尔沁左翼后旗", "科尔沁左翼中旗", "库伦旗", "奈曼旗", "通辽市",
			"扎鲁特旗" ]);
	dsy.add("0_17_8", [ "乌海市" ]);
	dsy.add("0_17_9", [ "察哈尔右翼后旗", "察哈尔右翼前旗", "察哈尔右翼中旗", "丰镇市", "化德县", "集宁市",
			"凉城县", "商都县", "四子王旗", "兴和县", "卓资县" ]);
	dsy.add("0_17_10", [ "阿巴嘎旗", "东乌珠穆沁旗", "多伦县", "二连浩特市", "苏尼特右旗", "苏尼特左旗",
			"太仆寺旗", "西乌珠穆沁旗", "锡林浩特市", "镶黄旗", "正蓝旗", "正镶白旗" ]);
	dsy.add("0_17_11", [ "阿尔山市", "科尔沁右翼前旗", "科尔沁右翼中旗", "突泉县", "乌兰浩特市", "扎赉特旗" ]);

	dsy.add("0_18", [ "固原", "石嘴山", "吴忠", "银川" ]);
	dsy.add("0_18_0", [ "固原市", "海原县", "隆德县", "彭阳县", "西吉县", "泾源县" ]);
	dsy.add("0_18_1", [ "惠农县", "平罗县", "石嘴山市", "陶乐县" ]);
	dsy.add("0_18_2", [ "青铜峡市", "同心县", "吴忠市", "盐池县", "中宁县", "中卫县" ]);
	dsy.add("0_18_3", [ "贺兰县", "灵武市", "银川市", "永宁县" ]);

	dsy.add("0_19", [ "果洛藏族自治州", "海北藏族自治州", "海东", "海南藏族自治州", "海西蒙古族藏族自治州",
			"黄南藏族自治州", "西宁", "玉树藏族自治州" ]);
	dsy.add("0_19_0", [ "班玛县", "达日县", "甘德县", "久治县", "玛多县", "玛沁县" ]);
	dsy.add("0_19_1", [ "刚察县", "海晏县", "门源回族自治县", "祁连县" ]);
	dsy.add("0_19_2",
			[ "互助土族自治县", "化隆回族自治县", "乐都县", "民和回族土族自治县", "平安县", "循化撒拉族自治县" ]);
	dsy.add("0_19_3", [ "共和县", "贵德县", "贵南县", "同德县", "兴海县" ]);
	dsy.add("0_19_4", [ "德令哈市", "都兰县", "格尔木市", "天峻县", "乌兰县" ]);
	dsy.add("0_19_5", [ "河南蒙古族自治县", "尖扎县", "同仁县", "泽库县" ]);
	dsy.add("0_19_6", [ "大通回族土族自治县", "西宁市", "湟源县", "湟中县" ]);
	dsy.add("0_19_7", [ "称多县", "囊谦县", "曲麻莱县", "玉树县", "杂多县", "治多县" ]);

	dsy.add("0_20", [ "滨州", "德州", "东营", "菏泽", "济南", "济宁", "莱芜", "聊城", "临沂", "青岛",
			"日照", "泰安", "威海", "潍坊", "烟台", "枣庄", "淄博" ]);
	dsy.add("0_20_0", [ "滨州市", "博兴县", "惠民县", "无棣县", "阳信县", "沾化县", "邹平县" ]);
	dsy.add("0_20_1", [ "德州市", "乐陵市", "临邑县", "陵县", "宁津县", "平原县", "齐河县", "庆云县",
			"武城县", "夏津县", "禹城市" ]);
	dsy.add("0_20_2", [ "东营市", "广饶县", "垦利县", "利津县" ]);
	dsy.add("0_20_3",
			[ "曹县", "成武县", "单县", "定陶县", "东明县", "菏泽市", "巨野县", "郓城县", "鄄城县" ]);
	dsy.add("0_20_4", [ "济南市", "济阳县", "平阴县", "商河县", "章丘市" ]);
	dsy.add("0_20_5", [ "济宁市", "嘉祥县", "金乡县", "梁山县", "曲阜市", "微山县", "鱼台县", "邹城市",
			"兖州市", "汶上县", "泗水县" ]);
	dsy.add("0_20_6", [ "莱芜市" ]);
	dsy.add("0_20_7", [ "东阿县", "高唐县", "冠县", "聊城市", "临清市", "阳谷县", "茌平县", "莘县" ]);
	dsy.add("0_20_8", [ "苍山县", "费县", "临沂市", "临沭县", "蒙阴县", "平邑县", "沂南县", "沂水县",
			"郯城县", "莒南县" ]);
	dsy.add("0_20_9", [ "即墨市", "胶南市", "胶州市", "莱西市", "平度市", "青岛市" ]);
	dsy.add("0_20_10", [ "日照市", "五莲县", "莒县" ]);
	dsy.add("0_20_11", [ "东平县", "肥城市", "宁阳县", "泰安市", "新泰市" ]);
	dsy.add("0_20_12", [ "荣成市", "乳山市", "威海市", "文登市" ]);
	dsy.add("0_20_13", [ "安丘市", "昌乐县", "昌邑市", "高密市", "临朐县", "青州市", "寿光市", "潍坊市",
			"诸城市" ]);
	dsy.add("0_20_14", [ "长岛县", "海阳市", "莱阳市", "莱州市", "龙口市", "蓬莱市", "栖霞市", "烟台市",
			"招远市" ]);
	dsy.add("0_20_15", [ "枣庄市", "滕州市" ]);
	dsy.add("0_20_16", [ "高青县", "桓台县", "沂源县", "淄博市" ]);

	dsy.add("0_21", [ "长治", "大同", "晋城", "晋中", "临汾", "吕梁", "朔州", "太原", "忻州", "阳泉",
			"运城" ]);
	dsy.add("0_21_0", [ "长治市", "长治县", "长子县", "壶关县", "黎城县", "潞城市", "平顺县", "沁县",
			"沁源县", "屯留县", "武乡县", "襄垣县" ]);
	dsy.add("0_21_1", [ "大同市", "大同县", "广灵县", "浑源县", "灵丘县", "天镇县", "阳高县", "左云县" ]);
	dsy.add("0_21_2", [ "高平市", "晋城市", "陵川县", "沁水县", "阳城县", "泽州县" ]);
	dsy.add("0_21_3", [ "和顺县", "介休市", "晋中市", "灵石县", "平遥县", "祁县", "寿阳县", "太谷县",
			"昔阳县", "榆社县", "左权县" ]);

	dsy.add("0_21_4", [ "安泽县", "大宁县", "汾西县", "浮山县", "古县", "洪洞县", "侯马市", "霍州市",
			"吉县", "临汾市", "蒲县", "曲沃县", "襄汾县", "乡宁县", "翼城县", "永和县", "隰县" ]);
	dsy.add("0_21_5", [ "方山县", "汾阳市", "交城县", "交口县", "离石市", "临县", "柳林县", "石楼县",
			"文水县", "孝义市", "兴县", "中阳县", "岚县" ]);
	dsy.add("0_21_6", [ "怀仁县", "山阴县", "朔州市", "应县", "右玉县" ]);
	dsy.add("0_21_7", [ "古交市", "娄烦县", "清徐县", "太原市", "阳曲县" ]);
	dsy.add("0_21_8", [ "保德县", "代县", "定襄县", "繁峙县", "河曲县", "静乐县", "宁武县", "偏关县",
			"神池县", "五台县", "五寨县", "忻州市", "原平市", "岢岚县" ]);
	dsy.add("0_21_9", [ "平定县", "阳泉市", "盂县" ]);
	dsy.add("0_21_10", [ "河津市", "临猗县", "平陆县", "万荣县", "闻喜县", "夏县", "新绛县", "永济市",
			"垣曲县", "运城市", "芮城县", "绛县", "稷山县" ]);

	dsy.add("0_22", [ "安康", "宝鸡", "汉中", "商洛", "铜川", "渭南", "西安", "咸阳", "延安", "榆林" ]);
	dsy.add("0_22_0", [ "安康市", "白河县", "汉阴县", "宁陕县", "平利县", "石泉县", "旬阳县", "镇坪县",
			"紫阳县", "岚皋县" ]);
	dsy.add("0_22_1", [ "宝鸡市", "宝鸡县", "凤县", "凤翔县", "扶风县", "陇县", "眉县", "千阳县", "太白县",
			"岐山县", "麟游县" ]);
	dsy.add("0_22_2", [ "城固县", "佛坪县", "汉中市", "留坝县", "略阳县", "勉县", "南郑县", "宁强县",
			"西乡县", "洋县", "镇巴县" ]);
	dsy.add("0_22_3", [ "丹凤县", "洛南县", "山阳县", "商洛市", "商南县", "镇安县", "柞水县" ]);
	dsy.add("0_22_4", [ "铜川市", "宜君县" ]);
	dsy.add("0_22_5", [ "白水县", "澄城县", "大荔县", "富平县", "韩城市", "合阳县", "华县", "华阴市",
			"蒲城县", "渭南市", "潼关县" ]);
	dsy.add("0_22_6", [ "高陵县", "户县", "蓝田县", "西安市", "周至县" ]);
	dsy.add("0_22_7", [ "彬县", "长武县", "淳化县", "礼泉县", "乾县", "三原县", "武功县", "咸阳市",
			"兴平市", "旬邑县", "永寿县", "泾阳县" ]);
	dsy.add("0_22_8", [ "安塞县", "富县", "甘泉县", "黄陵县", "黄龙县", "洛川县", "吴旗县", "延安市",
			"延长县", "延川县", "宜川县", "志丹县", "子长县" ]);
	dsy.add("0_22_9", [ "定边县", "府谷县", "横山县", "佳县", "靖边县", "米脂县", "清涧县", "神木县",
			"绥德县", "吴堡县", "榆林市", "子洲县" ]);

	dsy.add("0_23", [ "上海" ]);
	dsy.add("0_23_0", [ "", "崇明县", "上海市" ]);

	dsy.add("0_24", [ "阿坝藏族羌族自治州", "巴中", "成都", "达州", "德阳", "甘孜藏族自治州", "广安", "广元",
			"乐山", "凉山彝族自治州", "眉山", "绵阳", "南充", "内江", "攀枝花", "遂宁", "雅安", "宜宾", "资阳",
			"自贡", "泸州" ]);
	dsy.add("0_24_0", [ "阿坝县", "黑水县", "红原县", "金川县", "九寨沟县", "理县", "马尔康县", "茂县",
			"壤塘县", "若尔盖县", "松潘县", "小金县", "汶川县" ]);
	dsy.add("0_24_1", [ "巴中市", "南江县", "平昌县", "通江县" ]);
	dsy.add("0_24_2", [ "成都市", "崇州市", "大邑县", "都江堰市", "金堂县", "彭州市", "蒲江县", "双流县",
			"新津县", "邛崃市", "郫县" ]);
	dsy.add("0_24_3", [ "达县", "达州市", "大竹县", "开江县", "渠县", "万源市", "宣汉县" ]);
	dsy.add("0_24_4", [ "德阳市", "广汉市", "罗江县", "绵竹市", "什邡市", "中江县" ]);
	dsy.add("0_24_5", [ "巴塘县", "白玉县", "丹巴县", "稻城县", "道孚县", "德格县", "得荣县", "甘孜县",
			"九龙县", "康定县", "理塘县", "炉霍县", "色达县", "石渠县", "乡城县", "新龙县", "雅江县", "泸定县" ]);
	dsy.add("0_24_6", [ "广安市", "华蓥市", "邻水县", "武胜县", "岳池县" ]);
	dsy.add("0_24_7", [ "苍溪县", "广元市", "剑阁县", "青川县", "旺苍县" ]);
	dsy.add("0_24_8", [ "峨边彝族自治县", "峨眉山市", "夹江县", "井研县", "乐山市", "马边彝族自治县", "沐川县",
			"犍为县" ]);

	dsy.add("0_24_9", [ "布拖县", "德昌县", "甘洛县", "会东县", "会理县", "金阳县", "雷波县", "美姑县",
			"冕宁县", "木里藏族自治县", "宁南县", "普格县", "西昌市", "喜德县", "盐源县", "越西县", "昭觉县" ]);
	dsy.add("0_24_10", [ "丹棱县", "洪雅县", "眉山市", "彭山县", "青神县", "仁寿县" ]);
	dsy.add("0_24_11", [ "安县", "北川县", "江油市", "绵阳市", "平武县", "三台县", "盐亭县", "梓潼县" ]);
	dsy.add("0_24_12", [ "南部县", "南充市", "蓬安县", "西充县", "仪陇县", "营山县", "阆中市" ]);
	dsy.add("0_24_13", [ "隆昌县", "内江市", "威远县", "资中县" ]);
	dsy.add("0_24_14", [ "米易县", "攀枝花市", "盐边县" ]);
	dsy.add("0_24_15", [ "大英县", "蓬溪县", "射洪县", "遂宁市" ]);
	dsy.add("0_24_16", [ "宝兴县", "汉源县", "芦山县", "名山县", "石棉县", "天全县", "雅安市", "荥经县" ]);
	dsy.add("0_24_17", [ "长宁县", "高县", "江安县", "南溪县", "屏山县", "兴文县", "宜宾市", "宜宾县",
			"珙县", "筠连县" ]);
	dsy.add("0_24_18", [ "安岳县", "简阳市", "乐至县", "资阳市" ]);
	dsy.add("0_24_19", [ "富顺县", "荣县", "自贡市" ]);
	dsy.add("0_24_20", [ "古蔺县", "合江县", "叙永县", "泸县", "泸州市" ]);
	// Sheak QQ:7830957 www.sheak.cn
	dsy.add("0_25", [ "天津" ]);
	dsy.add("0_25_0", [ "", "蓟县", "静海县", "宁河县", "天津市" ]);

	dsy.add("0_26", [ "阿里", "昌都", "拉萨", "林芝", "那曲", "日喀则", "山南" ]);
	dsy.add("0_26_0", [ "措勤县", "噶尔县", "改则县", "革吉县", "普兰县", "日土县", "札达县" ]);
	dsy.add("0_26_1", [ "八宿县", "边坝县", "察雅县", "昌都县", "丁青县", "贡觉县", "江达县", "类乌齐县",
			"洛隆县", "芒康县", "左贡县" ]);
	dsy.add("0_26_2",
			[ "达孜县", "当雄县", "堆龙德庆县", "拉萨市", "林周县", "墨竹工卡县", "尼木县", "曲水县" ]);
	dsy.add("0_26_3", [ "波密县", "察隅县", "工布江达县", "朗县", "林芝县", "米林县", "墨脱县" ]);
	dsy.add("0_26_4", [ "安多县", "巴青县", "班戈县", "比如县", "嘉黎县", "那曲县", "尼玛县", "聂荣县",
			"申扎县", "索县" ]);
	dsy.add("0_26_5", [ "昂仁县", "白朗县", "定结县", "定日县", "岗巴县", "吉隆县", "江孜县", "康马县",
			"拉孜县", "南木林县", "聂拉木县", "仁布县", "日喀则市", "萨嘎县", "萨迦县", "谢通门县", "亚东县",
			"仲巴县" ]);
	dsy.add("0_26_6", [ "措美县", "错那县", "贡嘎县", "加查县", "浪卡子县", "隆子县", "洛扎县", "乃东县",
			"琼结县", "曲松县", "桑日县", "扎囊县" ]);

	dsy.add("0_27", [ "阿克苏", "阿拉尔", "巴音郭楞蒙古自治州", "博尔塔拉蒙古自治州", "昌吉回族自治州", "哈密",
			" 和田", "喀什", "克拉玛依", "克孜勒苏柯尔克孜自治州", "石河子", "图木舒克", "吐鲁番", "乌鲁木齐",
			"五家渠", "伊犁哈萨克自治州" ]);
	dsy.add("0_27_0", [ "阿克苏市", "阿瓦提县", "拜城县", "柯坪县", "库车县", "沙雅县", "温宿县", "乌什县",
			"新和县" ]);
	dsy.add("0_27_1", [ "阿拉尔市" ]);
	dsy.add("0_27_2", [ "博湖县", "和静县", "和硕县", "库尔勒市", "轮台县", "且末县", "若羌县", "尉犁县",
			"焉耆回族自治县" ]);
	dsy.add("0_27_3", [ "博乐市", "精河县", "温泉县" ]);
	dsy.add("0_27_4", [ "昌吉市", "阜康市", "呼图壁县", "吉木萨尔县", "玛纳斯县", "米泉市", "木垒哈萨克自治县",
			"奇台县" ]);
	dsy.add("0_27_5", [ "巴里坤哈萨克自治县", "哈密市", "伊吾县" ]);
	dsy.add("0_27_6", [ "策勒县", "和田市", "和田县", "洛浦县", "民丰县", "墨玉县", "皮山县", "于田县" ]);
	dsy.add("0_27_7", [ "巴楚县", "喀什市", "麦盖提县", "莎车县", "疏附县", "疏勒县", "塔什库尔干塔吉克自治县",
			"叶城县", "英吉沙县", "岳普湖县", "泽普县", "伽师县" ]);
	dsy.add("0_27_8", [ "克拉玛依市" ]);
	dsy.add("0_27_9", [ "阿合奇县", "阿克陶县", "阿图什市", "乌恰县" ]);
	dsy.add("0_27_10", [ "石河子市" ]);
	dsy.add("0_27_11", [ "图木舒克市" ]);
	dsy.add("0_27_12", [ "吐鲁番市", "托克逊县", "鄯善县" ]);
	dsy.add("0_27_13", [ "乌鲁木齐市", "乌鲁木齐县" ]);
	dsy.add("0_27_14", [ "五家渠市" ]);
	dsy.add("0_27_15", [ "阿勒泰市", "布尔津县", "察布查尔锡伯自治县", "额敏县", "福海县", "富蕴县", "巩留县",
			"哈巴河县", "和布克赛尔蒙古自治县", "霍城县", "吉木乃县", "奎屯市", "尼勒克县", "青河县", "沙湾县",
			"塔城市", "特克斯县", "托里县", "乌苏市", "新源县", "伊宁市", "伊宁县", "裕民县", "昭苏县" ]);
	// Sheak QQ:7830957 http://www.sheak.cn
	dsy.add("0_28", [ "保山", "楚雄彝族自治州", "大理白族自治州", "德宏傣族景颇族自治州", "迪庆藏族自治州",
			"红河哈尼族彝族自治州", "昆明", "丽江", "临沧", "怒江僳僳族自治州", "曲靖", "思茅", "文山壮族苗族自治州",
			"西双版纳傣族自治州", "玉溪", "昭通" ]);
	dsy.add("0_28_0", [ "保山市", "昌宁县", "龙陵县", "施甸县", "腾冲县" ]);
	dsy.add("0_28_1", [ "楚雄市", "大姚县", "禄丰县", "牟定县", "南华县", "双柏县", "武定县", "姚安县",
			"永仁县", "元谋县" ]);
	dsy.add("0_28_2", [ "宾川县", "大理市", "洱源县", "鹤庆县", "剑川县", "弥渡县", "南涧彝族自治县",
			"巍山彝族回族自治县", "祥云县", "漾濞彝族自治县", "永平县", "云龙县" ]);
	dsy.add("0_28_3", [ "梁河县", "陇川县", "潞西市", "瑞丽市", "盈江县" ]);
	dsy.add("0_28_4", [ "德钦县", "维西僳僳族自治县", "香格里拉县" ]);
	dsy.add("0_28_5", [ "个旧市", "河口瑶族自治县", "红河县", "建水县", "金平苗族瑶族傣族自治县", "开远市",
			"绿春县", "蒙自县", "弥勒县", "屏边苗族自治县", "石屏县", "元阳县", "泸西县" ]);
	dsy.add("0_28_6", [ "安宁市", "呈贡县", "富民县", "晋宁县", "昆明市", "禄劝彝族苗族自治县", "石林彝族自治县",
			"寻甸回族自治县", "宜良县", "嵩明县" ]);
	dsy.add("0_28_7", [ "华坪县", "丽江市", "宁蒗彝族自治县", "永胜县", "玉龙纳西族自治县" ]);
	dsy.add("0_28_8", [ "沧源佤族自治县", "凤庆县", "耿马傣族佤族治县", "临沧县", "双江拉祜族佤族布朗族傣族自治县",
			"永德县", "云县", "镇康县" ]);
	dsy.add("0_28_9", [ "福贡县", "贡山独龙族怒族自治县", "兰坪白族普米族自治县", "泸水县" ]);
	dsy.add("0_28_10", [ "富源县", "会泽县", "陆良县", "罗平县", "马龙县", "曲靖市", "师宗县", "宣威市",
			"沾益县" ]);
	dsy.add("0_28_11", [ "江城哈尼族彝族自治县", "景东彝族自治县", "景谷彝族傣族自治县", "澜沧拉祜族自治县",
			"孟连傣族拉祜族佤族自治县", "墨江哈尼族自治县", "普洱哈尼族彝族自治县", "思茅市", "西盟佤族自治县",
			"镇沅彝族哈尼族拉祜族自治县" ]);
	dsy.add("0_28_12", [ "富宁县", "广南县", "麻栗坡县", "马关县", "丘北县", "文山县", "西畴县", "砚山县" ]);
	dsy.add("0_28_13", [ "景洪市", "勐海县", "勐腊县" ]);
	dsy.add("0_28_14", [ "澄江县", "峨山彝族自治县", "华宁县", "江川县", "通海县", "新平彝族傣族自治县", "易门县",
			"玉溪市", "元江哈尼族彝族傣族自治县" ]);
	dsy.add("0_28_15", [ "大关县", "鲁甸县", "巧家县", "水富县", "绥江县", "威信县", "盐津县", "彝良县",
			"永善县", "昭通市", "镇雄县" ]);
	// Sheak QQ:7830957 http://www.sheak.cn/
	dsy.add("0_29", [ "杭州", "湖州", "嘉兴", "金华", "丽水", "宁波", "绍兴", "台州", "温州", "舟山",
			"衢州" ]);
	dsy.add("0_29_0", [ "淳安县", "富阳市", "杭州市", "建德市", "临安市", "桐庐县" ]);
	dsy.add("0_29_1", [ "安吉县", "长兴县", "德清县", "湖州市" ]);
	dsy.add("0_29_2", [ "海宁市", "海盐县", "嘉善县", "嘉兴市", "平湖市", "桐乡市" ]);
	dsy.add("0_29_3", [ "东阳市", "金华市", "兰溪市", "磐安县", "浦江县", "武义县", "义乌市", "永康市" ]);
	dsy.add("0_29_4", [ "景宁畲族自治县", "丽水市", "龙泉市", "青田县", "庆元县", "松阳县", "遂昌县", "云和县",
			"缙云县" ]);
	dsy.add("0_29_5", [ "慈溪市", "奉化市", "宁波市", "宁海县", "象山县", "余姚市" ]);
	dsy.add("0_29_6", [ "上虞市", "绍兴市", "绍兴县", "新昌县", "诸暨市", "嵊州市" ]);
	dsy.add("0_29_7", [ "临海市", "三门县", "台州市", "天台县", "温岭市", "仙居县", "玉环县" ]);
	dsy.add("0_29_8", [ "苍南县", "洞头县", "乐清市", "平阳县", "瑞安市", "泰顺县", "温州市", "文成县",
			"永嘉县" ]);
	dsy.add("0_29_9", [ "舟山市", "岱山县", "嵊泗县" ]);
	dsy.add("0_29_10", [ "常山县", "江山市", "开化县", "龙游县", "衢州市" ]);

	dsy.add("0_30", [ "重庆" ]);
	dsy.add("0_30_0", [ "城口县", "大足县", "垫江县", "丰都县", "奉节县", "合川市", "江津市", "开县",
			"梁平县", "南川市", "彭水苗族土家族自治县", "荣昌县", "石柱土家族自治县", "铜梁县", "巫山县", "巫溪县",
			"武隆县", "秀山土家族苗族自治县", "永川市", "酉阳土家族苗族自治县", "云阳县", "忠县", "重庆市", "潼南县",
			"璧山县", "綦江县" ]);

	jiyiri.ui.ThirdRegionSelector = ThirdRegionSelector;
}
)();



								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/thirdregionselector.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/tree/tree.js -----*/jiyiri.register_namespace('jiyiri.ui.tree');
jiyiri.require_css(__PUBLIC__ + '/jslib/jiyiri/ui/tree/style.css');

( function() {

	function Node(id, pid, name, url, title, target, icon, iconOpen, open) {
		this.id = id;
		this.pid = pid;
		this.name = name;
		this.url = url;
		this.title = title;
		this.target = target;
		this.icon = icon;
		this.iconOpen = iconOpen;
		this._io = open || false;
		this._is = false;
		this._ls = false;
		this._hc = false;
		this._ai = 0;
		this._p;
	};

	// Tree object
	function dTree(objName) {
		this.config = {
			target					: null,
			folderLinks			: true,
			useSelection		: true,
			useCookies			: true,
			useLines				: true,
			useIcons				: true,
			useStatusText		: false,
			closeSameLevel	: false,
			inOrder					: false
		}
		this.icon = {
			root				: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/base.gif',
			folder			: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/folder.gif',
			folderOpen	: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/folderopen.gif',
			node				: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/page.gif',
			empty				: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/empty.gif',
			line				: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/line.gif',
			join				: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/join.gif',
			joinBottom	: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/joinbottom.gif',
			plus				: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/plus.gif',
			plusBottom	: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/plusbottom.gif',
			minus				: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/minus.gif',
			minusBottom	: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/minusbottom.gif',
			nlPlus			: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/nolines_plus.gif',
			nlMinus			: __PUBLIC__ + '/jslib/jiyiri/ui/tree/img/nolines_minus.gif'
		};
		this.obj = objName;
		this.aNodes = [];
		this.aIndent = [];
		this.root = new Node(-1);
		this.selectedNode = null;
		this.selectedFound = false;
		this.completed = false;
	};

	// Adds a new node to the node array
	dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) {
		this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open);
	};

	// Open/close all nodes
	dTree.prototype.openAll = function() {
		this.oAll(true);
	};
	dTree.prototype.closeAll = function() {
		this.oAll(false);
	};

	// Outputs the tree to the page
	dTree.prototype.toString = function() {
		var str = '<div class="dtree">\n';
		if (document.getElementById) {
			if (this.config.useCookies) this.selectedNode = this.getSelected();
			str += this.addNode(this.root);
		} else str += 'Browser not supported.';
		str += '</div>';
		if (!this.selectedFound) this.selectedNode = null;
		this.completed = true;
		return str;
	};

	// Creates the tree structure
	dTree.prototype.addNode = function(pNode) {
		var str = '';
		var n=0;
		if (this.config.inOrder) n = pNode._ai;
		for (n; n<this.aNodes.length; n++) {
			if (this.aNodes[n].pid == pNode.id) {
				var cn = this.aNodes[n];
				cn._p = pNode;
				cn._ai = n;
				this.setCS(cn);
				if (!cn.target && this.config.target) cn.target = this.config.target;
				if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id);
				if (!this.config.folderLinks && cn._hc) cn.url = null;
				if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) {
						cn._is = true;
						this.selectedNode = n;
						this.selectedFound = true;
				}
				str += this.node(cn, n);
				if (cn._ls) break;
			}
		}
		return str;
	};

	// Creates the node icon, url and text
	dTree.prototype.node = function(node, nodeId) {
		var str = '<div class="dTreeNode">' + this.indent(node, nodeId);
		if (this.config.useIcons) {
			if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);
			if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;
			if (this.root.id == node.pid) {
				node.icon = this.icon.root;
				node.iconOpen = this.icon.root;
			}
			str += '<img id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />';
		}
		if (node.url) {
			str += '<a id="s' + this.obj + nodeId + '" class="' + ((this.config.useSelection) ? ((node._is ? 'nodeSel' : 'node')) : 'node') + '" href="' + node.url + '"';
			if (node.title) str += ' title="' + node.title + '"';
			if (node.target) str += ' target="' + node.target + '"';
			if (this.config.useStatusText) str += ' onmouseover="window.status=\'' + node.name + '\';return true;" onmouseout="window.status=\'\';return true;" ';
			if (this.config.useSelection && ((node._hc && this.config.folderLinks) || !node._hc))
				str += ' onclick="javascript: ' + this.obj + '.s(' + nodeId + ');"';
			str += '>';
		}
		else if ((!this.config.folderLinks || !node.url) && node._hc && node.pid != this.root.id)
			str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');" class="node">';
		str += node.name;
		if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += '</a>';
		str += '</div>';
		if (node._hc) {
			str += '<div id="d' + this.obj + nodeId + '" class="clip" style="display:' + ((this.root.id == node.pid || node._io) ? 'block' : 'none') + ';">';
			str += this.addNode(node);
			str += '</div>';
		}
		this.aIndent.pop();
		return str;
	};

	// Adds the empty and line icons
	dTree.prototype.indent = function(node, nodeId) {
		var str = '';
		if (this.root.id != node.pid) {
			for (var n=0; n<this.aIndent.length; n++)
				str += '<img src="' + ( (this.aIndent[n] == 1 && this.config.useLines) ? this.icon.line : this.icon.empty ) + '" alt="" />';
			(node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
			if (node._hc) {
				str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="';
				if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus;
				else str += ( (node._io) ? ((node._ls && this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls && this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) );
				str += '" alt="" /></a>';
			} else str += '<img src="' + ( (this.config.useLines) ? ((node._ls) ? this.icon.joinBottom : this.icon.join ) : this.icon.empty) + '" alt="" />';
		}
		return str;
	};

	// Checks if a node has any children and if it is the last sibling
	dTree.prototype.setCS = function(node) {
		var lastId;
		for (var n=0; n<this.aNodes.length; n++) {
			if (this.aNodes[n].pid == node.id) node._hc = true;
			if (this.aNodes[n].pid == node.pid) lastId = this.aNodes[n].id;
		}
		if (lastId==node.id) node._ls = true;
	};

	// Returns the selected node
	dTree.prototype.getSelected = function() {
		var sn = this.getCookie('cs' + this.obj);
		return (sn) ? sn : null;
	};

	// Highlights the selected node
	dTree.prototype.s = function(id) {
		if (!this.config.useSelection) return;
		var cn = this.aNodes[id];
		if (cn._hc && !this.config.folderLinks) return;
		if (this.selectedNode != id) {
			if (this.selectedNode || this.selectedNode==0) {
				eOld = document.getElementById("s" + this.obj + this.selectedNode);
				eOld.className = "node";
			}
			eNew = document.getElementById("s" + this.obj + id);
			eNew.className = "nodeSel";
			this.selectedNode = id;
			if (this.config.useCookies) this.setCookie('cs' + this.obj, cn.id);
		}
	};

	// Toggle Open or close
	dTree.prototype.o = function(id) {
		var cn = this.aNodes[id];
		this.nodeStatus(!cn._io, id, cn._ls);
		cn._io = !cn._io;
		if (this.config.closeSameLevel) this.closeLevel(cn);
		if (this.config.useCookies) this.updateCookie();
	};

	// Open or close all nodes
	dTree.prototype.oAll = function(status) {
		for (var n=0; n<this.aNodes.length; n++) {
			if (this.aNodes[n]._hc && this.aNodes[n].pid != this.root.id) {
				this.nodeStatus(status, n, this.aNodes[n]._ls)
				this.aNodes[n]._io = status;
			}
		}
		if (this.config.useCookies) this.updateCookie();
	};

	// Opens the tree to a specific node
	dTree.prototype.openTo = function(nId, bSelect, bFirst) {
		if (!bFirst) {
			for (var n=0; n<this.aNodes.length; n++) {
				if (this.aNodes[n].id == nId) {
					nId=n;
					break;
				}
			}
		}
		var cn=this.aNodes[nId];
		if (cn.pid==this.root.id || !cn._p) return;
		cn._io = true;
		cn._is = bSelect;
		if (this.completed && cn._hc) this.nodeStatus(true, cn._ai, cn._ls);
		if (this.completed && bSelect) this.s(cn._ai);
		else if (bSelect) this._sn=cn._ai;
		this.openTo(cn._p._ai, false, true);
	};

	// Closes all nodes on the same level as certain node
	dTree.prototype.closeLevel = function(node) {
		for (var n=0; n<this.aNodes.length; n++) {
			if (this.aNodes[n].pid == node.pid && this.aNodes[n].id != node.id && this.aNodes[n]._hc) {
				this.nodeStatus(false, n, this.aNodes[n]._ls);
				this.aNodes[n]._io = false;
				this.closeAllChildren(this.aNodes[n]);
			}
		}
	}

	// Closes all children of a node
	dTree.prototype.closeAllChildren = function(node) {
		for (var n=0; n<this.aNodes.length; n++) {
			if (this.aNodes[n].pid == node.id && this.aNodes[n]._hc) {
				if (this.aNodes[n]._io) this.nodeStatus(false, n, this.aNodes[n]._ls);
				this.aNodes[n]._io = false;
				this.closeAllChildren(this.aNodes[n]);		
			}
		}
	}

	// Change the status of a node(open or closed)
	dTree.prototype.nodeStatus = function(status, id, bottom) {
		eDiv	= document.getElementById('d' + this.obj + id);
		eJoin	= document.getElementById('j' + this.obj + id);
		if (this.config.useIcons) {
			eIcon	= document.getElementById('i' + this.obj + id);
			eIcon.src = (status) ? this.aNodes[id].iconOpen : this.aNodes[id].icon;
		}
		eJoin.src = (this.config.useLines)?
		((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus)):
		((status)?this.icon.nlMinus:this.icon.nlPlus);
		eDiv.style.display = (status) ? 'block': 'none';
	};


	// [Cookie] Clears a cookie
	dTree.prototype.clearCookie = function() {
		var now = new Date();
		var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
		this.setCookie('co'+this.obj, 'cookieValue', yesterday);
		this.setCookie('cs'+this.obj, 'cookieValue', yesterday);
	};

	// [Cookie] Sets value in a cookie
	dTree.prototype.setCookie = function(cookieName, cookieValue, expires, path, domain, secure) {
		document.cookie =
			escape(cookieName) + '=' + escape(cookieValue)
			+ (expires ? '; expires=' + expires.toGMTString() : '')
			+ (path ? '; path=' + path : '')
			+ (domain ? '; domain=' + domain : '')
			+ (secure ? '; secure' : '');
	};

	// [Cookie] Gets a value from a cookie
	dTree.prototype.getCookie = function(cookieName) {
		var cookieValue = '';
		var posName = document.cookie.indexOf(escape(cookieName) + '=');
		if (posName != -1) {
			var posValue = posName + (escape(cookieName) + '=').length;
			var endPos = document.cookie.indexOf(';', posValue);
			if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));
			else cookieValue = unescape(document.cookie.substring(posValue));
		}
		return (cookieValue);
	};

	// [Cookie] Returns ids of open nodes as a string
	dTree.prototype.updateCookie = function() {
		var str = '';
		for (var n=0; n<this.aNodes.length; n++) {
			if (this.aNodes[n]._io && this.aNodes[n].pid != this.root.id) {
				if (str) str += '.';
				str += this.aNodes[n].id;
			}
		}
		this.setCookie('co' + this.obj, str);
	};

	// [Cookie] Checks if a node id is in a cookie
	dTree.prototype.isOpen = function(id) {
		var aOpen = this.getCookie('co' + this.obj).split('.');
		for (var n=0; n<aOpen.length; n++)
			if (aOpen[n] == id) return true;
		return false;
	};

	// If Push and pop is not implemented by the browser
	if (!Array.prototype.push) {
		Array.prototype.push = function array_push() {
			for(var i=0;i<arguments.length;i++)
				this[this.length]=arguments[i];
			return this.length;
		}
	};
	if (!Array.prototype.pop) {
		Array.prototype.pop = function array_pop() {
			lastElement = this[this.length-1];
			this.length = Math.max(this.length-1,0);
			return lastElement;
		}
	};
	
	/* Codes End Here */

	/* Register Start Here */
	jiyiri.ui.tree.Tree = dTree;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/tree/tree.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/validateimage.js -----*//**
 * 一个页面只能存在一个验证码
 * 验证码不具备namespace 功能
 */
jiyiri.register_namespace('jiyiri.ui');

( function() {

	/* Codes Start Here */
	var ValidateImage = Class.create();
	ValidateImage._instance = null;
	ValidateImage.GetInstance = function()
	{
		if(null == ValidateImage._instance)
		{
			ValidateImage._instance = new ValidateImage();
		}
		return ValidateImage._instance;
	};


	ValidateImage.prototype=
	{
			initialize:function()
			{
				this._image_url = __APP__+'/Public/ValidateImage';
				this._image_ctl = null;
				this._reload_link = null;
				this._is_shown=false;
			},
			init_show:function(image_ctl,reload_link)
			{
				ValidateImage.GetInstance()._image_ctl = $(image_ctl);
				ValidateImage.GetInstance()._reload_link = $(reload_link);

				if(true == ValidateImage.GetInstance().is_shown)
				{
					throw new Error('Only ONE validate image is allowd in one page.');
					return;
				}

				if(ValidateImage.GetInstance()._image_ctl)
				{
					ValidateImage.GetInstance()._image_ctl.onclick = ValidateImage.GetInstance().reload;
				}
				else
				{
					throw new Error('Validate Image area does not exists.');
					return ;
				}

				if(ValidateImage.GetInstance()._reload_link)
				{
					ValidateImage.GetInstance()._reload_link.onclick = ValidateImage.GetInstance().reload;
				}

				ValidateImage.GetInstance()._show();
				ValidateImage.GetInstance()._is_shown = true;
			},
			reload:function()
			{
				if(false == ValidateImage.GetInstance()._is_shown)
				{
					throw new Error('You have not InitShow the validate image.');
					return;
				}
				ValidateImage.GetInstance()._show();
				return false;
			},
			_show:function()
			{
				ValidateImage.GetInstance()._image_ctl.src = ValidateImage.GetInstance()._get_image_url();
			},
			_get_image_url:function()
			{
				var image_url = ValidateImage.GetInstance()._image_url;
				image_url = image_url + '?ticket=' + Math.random();
				return image_url;
			}
	};
	/* Codes End Here */

	/* Register Start Here */
	jiyiri.ui.ValidateImage = ValidateImage;
	/* Register End Here */
})();

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/validateimage.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/validateimagenamespace.js -----*//**
 * 为一个Namespace生成一个验证码
 * 验证的时候也需要制定验证哪部分的Namespace验证码
 * 一个页面可以有多个验证码存在
 */
jiyiri.register_namespace('jiyiri.ui');

( 
function() 
{
	var ValidateImage_NameSpace = Class.create();

	ValidateImage_NameSpace.prototype =
	{
			initialize:function(){
				this._image_url = __APP__+'/Public/ValidateImage_NameSpace';
				
				/* 验证码的显示控件 */
				this._image_ctl = null;
				/* 重新生成验证码按钮 */
				this._reload_link = null;
				
				this._namespace;
			},
			config:function( namespace , image_ctl , reload_link ){
				
				this._namespace			=	namespace;
				this._image_ctl			=	$(image_ctl);
				this._image_ctl.onclick =	jiyiri.helper.eventhelper.EventHelper.create_callback_function(this,'_reload');
			
				if( reload_link ){
					this._reload_link			=	$(reload_link);
					this._reload_link.onclick 	=	jiyiri.helper.eventhelper.EventHelper.create_callback_function(this,'_reload');
				}
			},
			show:function(){
				this._load_image();
			},
			_reload:function(){
				this._load_image();
			},
			_load_image:function(){
				var image_url 		= 	this._get_image_url();
				this._image_ctl.src	=	image_url;	
			},
			_get_image_url:function(){
				var image_url = this._image_url;
				image_url = image_url + '?ticket=' + Math.random() + '&namespace=' + this._namespace; 
				return image_url;
			}		
	};

	jiyiri.ui.ValidateImage_NameSpace = ValidateImage_NameSpace;
}
)
();

								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/ui/validateimagenamespace.js -----*/
								/* -----begin_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/widget/shareit/shareit.js -----*/jiyiri.register_namespace('jiyiri.widget.shareit');
/* jiyiri.require_once('jiyiri.helper.eventhelper.EventHelper'); */
/* jiyiri.require_once('jiyiri.helper.client.Client'); */

( function() {

	/* Codes Start Here */
	var Shareit = Class.create();
    Shareit.prototype =
    {
    	/**
    	 * options:
    	 * button_container
    	 * textbox_container
    	 * textbox_classname
    	 * url
    	 * title
    	 */
    	_options : [],
    	initialize:function(options)
    	{
    		this._options = options;
    	},
    	config:function( options ){
    		this._options = options;
    	},
    	_get_share_site_list:function()
    	{
	    	var arr = [
	    			{
	    				Url:"javascript:window.open('http://shuqian.qq.com/post?from=3&title={#TITLE#}&uri={#URL#}','favit','width=930,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');void(0)",
	    				Name:'QQ书签',
	    				Img:'qqbookmark.gif'
	    			},
	    			{
	    				Url:"javascript:u=location.href;t='{#TITLE#}';c%20=%20''%20+%20(window.getSelection%20?%20window.getSelection()%20:%20document.getSelection%20?%20document.getSelection()%20:%20document.selection.createRange().text);var%20url='http://cang.baidu.com/do/add?it='+encodeURIComponent(t)+'&iu='+encodeURIComponent(u)+'&dc='+encodeURIComponent(c)+'&fr=ien#nw=1';window.open(url,'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes');void(0)",
		    			Name:'百度收藏',
		    			Img:'baidubookmark.gif'
		    		},
		    		{
				    	Url:"javascript:u='http://share.xiaonei.com/share/buttonshare.do?link={#URL#}&title={#TITLE#}';window.open(u,'xiaonei','toolbar=0,resizable=1,scrollbars=yes,status=1,width=626,height=436');void(0);",
				    	Name:'校内',
				    	Img:'xnbookmark.gif'
			    	},
			    	{
					    Url:"javascript:var%20u='http://www.kaixin001.com/~repaste/repaste.php';window.open(u,'kaixin');void(0)",
					    Name:'开心网',
					    Img:'kxbookmark.gif'
				    },
				    {
						Url:"javascript:var%20u='http://www.douban.com/recommend/?url={#URL#}&title={#TITLE#}';window.open(u,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330');void(0)",
						Name:'豆瓣',
						Img:'dbbookmark.gif'
					},
					{
						Url:"javascript:var%20u='http://twitter.com/home?status={#TITLE#}{#URL#}';window.open(u,'twitter');void(0)",
						Name:'twitter',
						Img:'twitterbookmark.gif'
					},
					{
						Url:"javascript:(function(){window.open('http://v.t.sina.com.cn/share/share.php?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(location.href)+'&source=bookmark','_blank','width=450,height=400');})()",
						Name:'新浪微博',
						Img:'sinabookmark.gif'
					},
					{
						Url:"http://del.icio.us/post?url={#URL#}&title={#TITLE#}",
						Name:'delicious',
						Img:'deliciousbookmark.gif'
					}

	    			];
	    	return arr;

    	}
        ,
        render:function()
        {
            var url = this._get_url();
            var title = this._get_title();
            this._render_textbox(url,title);
            this._render_buttons(url,title);
        },
        _render_textbox:function(url,title)
        {
        	var container = $(this._options['textbox_container']);
        	var textbox_classname = this._options['textbox_classname'];

        	var node = document.createElement('input');
        	node.type = 'text';
        	node.value = url;

        	if(textbox_classname)
        	{
        		node.className = textbox_classname;
        	}
        	container.appendChild(node);
        	node.onclick = jiyiri.helper.eventhelper.EventHelper.create_event_function(this,'_on_textbox_click');
        },
        _render_buttons:function(url,title)
        {
        	var container = $(this._options['button_container']);
        	if(container.tagName.toUpperCase()!='UL')
        	{
        		throw new Error('I need a UL container!');
        	}

        	var share_site_list = this._get_share_site_list();
        	for(var i=0;i<share_site_list.length;i++)
        	{
        		share_site = share_site_list[i];
        		var node_li = document.createElement('li');
        		var node_a = document.createElement('a');
        		node_a.href = this._parse_share_site_url(share_site.Url,url,title);
        		node_a.title = '收藏到 ' + share_site.Name;;
        		var node_img = document.createElement('img');
        		node_img.src = this._parse_share_site_img(share_site.Img);
        		node_img.alt = '收藏到 ' + share_site.Name;
        		node_a.appendChild(node_img);
        		node_li.appendChild(node_a);
        		container.appendChild(node_li);
        	}
        },
        _on_textbox_click:function()
        {
        	var url = this._get_url();
        	jiyiri.helper.client.Client.copy_to_clipboard(url);
        },
        _get_url:function()
        {
        	var url= this._options['url'];
        	if(!url)
        	{
        		url = location.href;
        	}
        	return url;
        },
        _get_title:function()
        {
        	var title = this._options['title'];
        	if(!title)
        	{
        		title = document.title;
        	}
        	return title;
        },
        _parse_share_site_url:function(url_template,url,title)
        {
        	var rtn = url_template;
        	url = encodeURIComponent(url);
        	title = encodeURIComponent(title);
        	rtn = rtn.replace('{#URL#}',url);
        	rtn = rtn.replace('{#TITLE#}',title);
        	return rtn;
        },
        _parse_share_site_img:function(imgurl)
        {
//        	var scripts = document.getElementsByTagName("script");
//			var path = '';
//			for ( var i = 0; i < scripts.length; i++) {
//				if (scripts[i].src.match(/shareit\.js(\?.*)?$/)) {
//					path = scripts[i].src.replace(/shareit\.js(\?.*)?$/,
//							'');
//					break;
//				}
//			}
			var path = '/Public/v6/img/shareit/';
        	return path + imgurl;
        }

    }

	/* Codes End Here */

	/* Register Start Here */
	jiyiri.widget.shareit.Shareit = Shareit;
	/* Register End Here */
})();
								/* -----end_E:\workspace\jiyiri_v6_coupon/Public/jslib/jiyiri/widget/shareit/shareit.js -----*/