/***************************************************************************************************************
* File Name		: region_country_mgr.js
* Usage			: 1. Define function to set Country-Category and Country-Card Relation.
*			: 2. Define function to provide a list of country and a list of  
*			:    card which have relation with input country
*			:
* Author		: e-Crusade
* Creation Date		: 2008-12-16
* Amendment History	:
* Date		By		Description
* ---------	------------	--------------------------------------------------------------------------------
***************************************************************************************************************/


var _region_relation_ = new Array();
var _region_have_init_ = new Array();

/***************************************************************************************************************
* Function		: pws_ha_addRegionRelation(region,country,category,card)
* Description		: Create a Region-Country , Country-Category and Country-Card Relation
*			:
* Parameter Usage	: "region" - a region
			:"country" 	- a country
* 			: "category"	- a list of categroy which have relation to country
*			: "card"	- a list of card which have relation to country
*			:
* Creation Date		: 2008-12-16
* Side effect		: No
* Amendment History	:
* Date		By		Description
* ---------	------------	--------------------------------------------------------------------------------
***************************************************************************************************************/

	function pws_ha_addRegionRelation(region,country){
		_region_relation_[region] = new Array(region,country);
		_region_have_init_[region] = true;
	}


/***************************************************************************************************************
* Function		: pws_ha_queryCountry(region)
* Description		: Provide a list of category and a list of card which have relation with region
*			:
* Parameter Usage	: "region" 	- a region
*			:
* Creation Date		: 2008-12-16
* Side effect		: No
* Amendment History	:
* Date		By		Description
* ---------	------------	--------------------------------------------------------------------------------
***************************************************************************************************************/
		
	function pws_ha_queryRegion(region){
		if(region=="ALL"){
			return new Array(_all_region_list_,_all_country_list_);
		}else if(_region_have_init_[region]!=true){
			return new Array(new Array(),new Array());
		}else{
			return _region_relation_[region];
		}
	}
	