//  Get Currency
var GetCurrency = function(init_dt) {}

// 初始化資料
GetCurrency.prototype.init = function() {
	this.getCurrency();
};

//reCount
GetCurrency.prototype.getCurrency = function(){	
	var paras=new Object();
	var jsonObj=new Object();
	jsonObj.action="301";
	jsonObj.paras=paras;
	this.sendAjax(jsonObj,0);
};

GetCurrency.prototype.sendAjax = function(jsonObj,m){
	
	var getcurr = this;
	json = JSON.stringify(jsonObj);
	$.ajaxSetup({async:true});
	$.post(ajaxurl,
		{
			data:json
		},
		function(data){
			data = JSON.parse(data);
			switch(m) {
				case 0:
					setCookie("US2TW",data["USDTWD"].Exrate,999);
					setCookie("currdate",data["USDTWD"].UTC,999);			
					break;
				default:
					break;
			}
		},"text"
	);
};