/*
 * file: store/purchase-funds.js
 * author: Karl Eriksson
 *
 * Creating an interactive store to offer funds
 */
(function(a){a(document).ready(function(){if(!(a.site.isModule("store")&&(a.site.isAction("purchaseFunds")))){return}a("#bf-700").show();a(".payment-group").each(function(){if(a(".payment-opt",this).size()==1){a(this).css("width","262px")}if(a(".payment-opt",this).size()==2){a(this).css("width","524px")}});a("#buy-funds-tabs ul li a").each(function(){this.currentHref=a(this).attr("href");a(this).removeAttr("href")}).click(function(b){b.preventDefault();a(".payment-group").hide();a(this.currentHref).show();switch(this.currentHref){case"#bf-700":a("#buy-funds-tabs").css("background-position","0 -483px");break;case"#bf-1400":a("#buy-funds-tabs").css("background-position","0 -420px");break;case"#bf-2800":a("#buy-funds-tabs").css("background-position","0 -357px");break;case"#bf-7000":a("#buy-funds-tabs").css("background-position","0 -294px");break}});a("#purchase-bf-form").click(function(c){var b=a(c.target).parents(".payment-opt");if(b.size()>0){b.find(":radio").attr("checked","checked");a(this).submit()}})})})(jQuery);$("document").ready(function(){$(".select-persona input").hide();$(".select-persona li:not(.disabled) label").click(function(){$(".select-persona li").removeClass("selected");$(this).parent().addClass("selected");$(this).siblings("input").click()})});
/*
 * Hot deals scripts
 * file: store/js/hotdeals.js
 *
 * Adding functions for expiring animation and
 * counting down time until expired.
 *
 * @author	Andreas Lanjerud, alanjerud@ea.com
 * @created	2009-12-08
 */
(function(b){var a=function(c){return(c<10)?"0"+c:c};b.fn.animBg=function(g,c){if(g&&typeof g==="string"){clearInterval(b(this).data("anim"));return this}var e=b(this);var f={interval:100};c=(typeof g==="object"&&typeof c==="undefined")?g:c;var f=jQuery.extend({},f,c);var d;if(!f.step&&!f.steps){return this}d=setInterval(function(){var h=parseInt(e.css("background-position"));e.css("background-position",(-(f.step*f.steps)>=(h-f.step)?0:h-f.step)+"px 0")},f.interval);e.data("anim",d);return this};b.fn.countdownTime=function(){var f=b(this);var d=new Date();var e=new Date();var c=setInterval(function(){var h=f.data("seconds_to_expire");var k=["s","m","h"];if(h===undefined){h=0;var o=0;var m=b.trim(f.html());var q=m.split(" ");for(var l=q.length-1;l>=0;l--){var n=/\d+/.exec(q[l]);if(n!==null){h+=n*Math.pow(60,o);var p=q[l].replace(n,"");if(p.length>0){f.data(k[o],p)}o++}else{f.data(k[o]," "+q[l])}}e.setTime(d.getTime()+parseInt(h)*1000)}if(h<=0){return}h=Math.floor((e-new Date())/1000);f.data("seconds_to_expire",h);var g="";var r;for(var l=0;l<3;l++){var j=Math.floor((l===0?h:h%Math.pow(60,3-l))/Math.pow(60,2-l));if(j>0||l===2||r>0){g=g+a(j)+f.data(k[2-l])+" "}r=j}f.html(g)},998);return this}})(jQuery);$(document).ready(function(){$(".hotdeal_status").click(function(){window.location=$(this).find("h3 a").attr("href")});$(".expires_time").each(function(){$(this).countdownTime()});$(".hotdeal_expiring .hotdeal_icon").animBg({step:120,steps:3,interval:250})});$(window).load(function(){var a=0;$("#hotdeals .item_container").each(function(b){div_height=$(this).height();if(div_height>a){a=div_height}});$("#hotdeals .item_container").height(a)});
