$(document).ready(function(){$('.currency').each(function(i,domEle){$(domEle).convertCurrency(false);return true;})});;(function(){var $$;$$=jQuery.fn.convertCurrency=function(currencycode){var $this=$(this)
if($this.attr('rel')){var prms=$this.attr('rel').split(':');var fAmnt=parseFloat($this.text());var cCode=currencycode?' '+prms[1]:'';var cookieVal=$.cookie('currencyrate'+prms[0]+prms[1]);if(cookieVal!=null)
{frmtCurrency($this,prms[2],fAmnt*parseFloat(cookieVal),cCode,prms[1]);}else{try{reqAjax=$.ajax({type:"POST",url:'/scripts/currency-ajax.php',dataType:"json",data:"action=rate"+"&currfrom="+prms[0]+"&currto="+prms[1],success:function(json){switch(json.errcode){case'ERR-100':$.cookie('currencyrate'+prms[0]+prms[1],json.result,{expires:6,path:'/'});frmtCurrency($this,prms[2],fAmnt*parseFloat(json.result),cCode,prms[1]);break;case'ERR-200':break;default:break}},error:function(xhr,msg,ex){reqAjax=null}})}catch(e){}}}
return this;function frmtCurrency(ele,symb,val,code,cls){val*=2.0;val=val.toFixed(1)/2.0;val=val.toFixed(2);ele.text(symb+val+code);ele.addClass(cls);};};})();