/*
	TERMS OF USE - jQuery Easing
	Open source under the BSD License. 
	Copyright å© 2008 George McGinley Smith
	All rights reserved.
	
		
	TERMS OF USE - Easing Equations
	Open source under the BSD License. 
	Copyright å© 2001 Robert Penner
	All rights reserved.
*/
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{easeOutCubic:function(e,a,b,c,d){return c*((a=a/d-1)*a*a+1)+b},easeOutBounce:function(e,a,b,c,d){return(a/=d)<1/2.75?c*7.5625*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+0.984375)+b}});


/*
	Vodafone Animation Utility Functions
	(c) Vodafone / Sapient Nitro 
	Author:  James Westgate 2011 (www.queryj.com)
 */
if(!Array.indexOf)Array.prototype.indexOf=function(c,a){for(var b=a||0,d=this.length;b<d;b++)if(this[b]==c)return b;return-1};jQuery.fn.reverse=function(c){for(var a=this.length;a;){a--;c.call(this[a],a,this[a])}};


/*
 	Vodafone pngFix plugin
	Author: James Westgate (2010) (http://queryj.com)
	Based on superpng plug-in (http://www.opencomponents.com/superpng/)
	Version 1.0
 */
(function(c){var b,i=true,h;c.fn.superpng=function(l){if(!(!c.browser.msie||parseInt(c.browser.version,10)>6)){if(b==null)b=c.extend({},{cache:true,path:"x.gif",mode:"auto"},l);b.cache&&document.execCommand("BackgroundImageCache",false,true);return this.each(function(){var a=c(this),d=a.css("background-image"),e=this.vml===undefined;if(!e||b.mode!=="filter"&&d.match(/\.png/i)!==null){d=d.substring(5,d.length-2);a.css("backgroundRepeat");var f=a.css("backgroundPositionX"),j=a.css("backgroundPositionY");
a.css("background-image",["url(",b.path,")"].join(""));if(e&&b.mode!=="vml"&&f===undefined&&j===undefined)a.css("filter",["progid:DXImageTransform.Microsoft.AlphaImageLoader(src='",d,"', sizingMethod='crop')"].join(""));else{if(i){i=false;c("head").append('<style media="screen">vml\\:* {behavior:url(#default#vml);} .superpng-vml {position: absolute; top:0; left:0; z-index:0; margin: 0}</style>');h="px"}var g=a.width(),k=a.height();f=[parseFloat(f.replace(h,"")/g),",",parseFloat(j.replace(h,"")/k)].join("");
g=["width:",g,"px; height:",k,"px"].join("");if(e){a.wrapInner(['<vml:rect stroked="f" class="superpng-vml" style="',g,'"><vml:fill type="frame" aspect="atmost" src="',d,'" position="',f,'"/></vml:rect>'].join(""));this.vml=c(".superpng-vml",a);a.css("background-image","url("+b.path+")")}else{a=this.vml.children(":first");this.vml.attr("style",g);a.attr("position",f)}}}else if(a.is("img[src$=png]")){e={width:a.width()+"px",height:a.height()+"px",filter:["progid:DXImageTransform.Microsoft.AlphaImageLoader(src='",
a.attr("src"),"', sizingMethod='scale')"].join("")};a.css(e).attr("src",b.path)}})}}})(jQuery);


/*
	Vodafone Datatoy Function
	Copyright (c) 2011, Vodafone, SapinetNitro
	Author: James Westgate (http://queryj.com)
*/
(function(b){vf.namespace("vf.datatoy",function(){this.init=function(k){function i(g,h){var f=h*3+g,a=l[f],c=b("#state1");if(f===j)return a;j=f;b("dt:first",c).text(a.name);b("dd:first",c).text(a.tenure);b("span.med-number",c).html(a.desc.join("<br/>"));b("p.price",c).html(a.cost[0]+"<br/>Dongle price - "+a.cost[1]);b("#datatoy-tip div.tooltipContent ul").addClass("hidden");b(a.tip).removeClass("hidden");b("#datatoy-buynow").attr("href","//shop.vodafone.co.uk/shop/basket/addToCart.jsp"+a.href);return a}
var l=[{name:"Very occasional user plan",tenure:"pay as you go",desc:["250MB UK data a day"],cost:["&pound;3 / month + &pound;2 per day used","&pound;19"],href:"?skuId=sku140039,sku4040032",tip:"#tooltip2",tab:2},{name:"Occasional user plan",tenure:"30 day plan",desc:["500MB UK data a month","1GB BT Openzone Wi-Fi"],cost:["&pound;7.50 / month","&pound;19"],href:"?skuId=sku140039,sku4040033",tip:"#tooltip3",tab:0},{name:"Regular user pay as you go plan",tenure:"30 day plan",desc:["2GB UK data a month",
"1GB BT Openzone Wi-Fi"],cost:["&pound;15 / month","&pound;9"],href:"?skuId=sku140039,sku4040034",tip:"#tooltip1",tab:0},{name:"Very occasional user plan",tenure:"30 day plan",desc:["500MB UK data a month","1GB BT Openzone Wi-Fi"],cost:["&pound;7.50 / month","&pound;19"],href:"?sku140039,sku4040033",tip:"#tooltip3",tab:0},{name:"Occasional user plan",tenure:"30 day plan",desc:["2GB UK data a month","1GB BT Openzone Wi-Fi"],cost:["&pound;15 / month","&pound;9"],href:"skuId=?sku140039,sku4040034",tip:"#tooltip4",
tab:0},{name:"Regular user plan",tenure:"18 months",desc:["2GB UK data a month","2GB BT Openzone Wi-Fi","1GB off-peak UK data"],cost:["&pound;15 / month","Free"],href:"?skuId=sku140039,sku4040039",tip:"#tooltip1",tab:1},{name:"Very occasional user plan",tenure:"pay as you go",desc:["2GB UK data 30 days"],cost:["&pound;15 TopUp","&pound;25"],href:"?skuId=sku690026,sku840022",tip:"#tooltip1",tab:2},{name:"Occasional user plan",tenure:"18 months",desc:["2GB UK data a month","2GB BT Openzone Wi-Fi","1GB off-peak UK data"],
cost:["&pound;15 / month","Free"],href:"?skuId=sku140039,sku4040039",tip:"#tooltip5",tab:1},{name:"Regular user plan",tenure:"18 months",desc:["2GB UK data a month","4GB BT Openzone Wi-Fi","2GB off-peak UK data"],cost:["&pound;20 / month","Free"],href:"?skuId=sku140038,sku4040040",tip:"#tooltip6",tab:1}],d=b.extend({},{step:83,min:18,max:198},k);b(document).ready(function(){b("#mod-dataTool").removeClass("hidden");i(0,0);b("#data-plan-table").addClass("hidden");b("#mod-dataTool").removeClass("hidden");
b("a.indicator").data("index",0);b("a.indicator").click(function(a){a.preventDefault()});var g=function(a){b(a).closest(".dataTool-sliderControl").addClass("vf-slider-active");b(a).css("opacity","0.8");b("#initState").addClass("hidden");b("#state1").removeClass("hidden")};b("a.indicator").mousedown(function(a){g(this);a.preventDefault()});b("a.indicator").bind("touchstart",function(a){g(this);a.preventDefault()});var h=function(){if(b(".vf-slider-active").length){b(".dataTool-sliderControl").removeClass("vf-slider-active");
b("a.indicator").css("opacity",1);var a=b("#dataTool-q1 a.indicator").data("index"),c=b("#dataTool-q2 a.indicator").data("index");b("#dataTool-q1 a.indicator").animate({left:a*d.step},100,"swing");b("#dataTool-q2 a.indicator").animate({left:c*d.step},100,"swing");b("#dataTool-q1 div.stripe").animate({"background-position":a*d.step-225+"px 0"},100,"swing");b("#dataTool-q2 div.stripe").animate({"background-position":c*d.step-225+"px 0"},100,"swing");a=i(a,c);b("#data-plans div.tabbedContent li").eq(a.tab).find("a").click()}};
b(document).mouseup(function(a){h();a.preventDefault()});b(document).bind("touchend",function(a){h();a.preventDefault()});var f=function(a){var c=b(".vf-slider-active");if(c.length){var e=a.pageX-c.offset().left;a=Math.round((e-24)/d.step);if(a>=0&&a<3){if(e<d.min)e=d.min;if(e>d.max)e=d.max;e=Math.round(e/8)*8-24;b("a.indicator",c).css("left",e);b("a.indicator",c).data("index",a);b("div.stripe",c).css("background-position",e-225+"px 0");b("blockquote.quote",c).hide().eq(a).show();c=b("#dataTool-q1 a.indicator").data("index");
a=b("#dataTool-q2 a.indicator").data("index");i(c,a)}}};b("#mod-dataTool").mousemove(function(a){f(a);a.preventDefault()});b("#mod-dataTool").bind("touchmove",function(a){f(a.originalEvent.touches[0]||a.originalEvent.changedTouches[0]);a.preventDefault()})});var j=-1}})})(jQuery);


/*
	Vodafone Mobile BroadBand Smod Hero Script
	Copyright (c) 2010, Vodafone, SapinetNitro
	Author: James Westgate (http://queryj.com)
*/
(function(a){vf.namespace("vf.mobilebroadband.hero",function(){this.init=function(){function g(){if(f){a("#product-panel").prepend('<div id="smod-phone-fix" style="position: absolute; z-index: 999; cursor: hand; width:115px; height: 57px; left: 330px; top: 50px"/>');a("#smod-phone-fix","#product-panel").mouseenter(function(){a("div.smod-phone span.smod-card","#product-panel ").animate({left:"-15px"},{duration:100})});a("#smod-phone-fix","#product-panel").mouseleave(function(){h()})}a("div.smod-laptop a, div.smod-phone a",
"#product-panel").animateCard({left:"-15px"});a("div.smod-tablet a","#product-panel").animateCard({right:"-30px"});a("div.smod-phone a","#computer-panel").animateCard({top:"-16px"});a("div.smod-dongle a","#computer-panel").animateCard({left:"-10px"});a("div.smod-wireless a","#computer-panel").animateCard({right:"-10px"});a("div.smod-laptop a","#computer-panel").animateCard({top:"-25px"});a("div.smod-phone1 a","#mobile-panel").animateCard({left:"-13px"});a("div.smod-phone2 a","#mobile-panel").animateCard({left:"-5px"});
a("div.smod-phone3 a","#mobile-panel").animateCard({right:"-10px"});a("div.smod-microsim a","#tablet-panel").animateCard({top:"5px"});a("div.smod-wireless a","#tablet-panel").animateCard({top:"-200px"});a("div.smod-tablet a","#tablet-panel").animateCard({top:"-25px"})}function h(){a("span.smod-card").clearQueue();a("div.smod-laptop a, div.smod-phone a","#product-panel").resetCard({left:"-20px"});a("div.smod-tablet a","#product-panel").resetCard({right:"-35px"});a("div.smod-phone a","#computer-panel").resetCard({top:"-20px"});
a("div.smod-dongle a","#computer-panel").resetCard({left:"-15px"});a("div.smod-wireless a","#computer-panel").resetCard({right:"-15px"});a("div.smod-laptop a","#computer-panel").resetCard({top:"-30px"});a("div.smod-phone1 a","#mobile-panel").resetCard({left:"-18px"});a("div.smod-phone2 a","#mobile-panel").resetCard({left:"-10px"});a("div.smod-phone3 a","#mobile-panel").resetCard({right:"-15px"});a("div.smod-microsim a","#tablet-panel").resetCard({top:"0"});a("div.smod-wireless a","#tablet-panel").resetCard({top:"-195px"});
a("div.smod-tablet a","#tablet-panel").resetCard({top:"-30px"})}function j(){a("div.smod-laptop a, div.smod-phone a, div.smod-tablet a","#product-panel").unbind("mouseenter").unbind("mouseleave");f&&a("#smod-phone-fix","#product-panel").unbind("mouseenter").unbind("mouseleave")}function k(c){j();a("#smod-block").delay(100).animate({right:"596px"},{duration:500});a("#product-panel h3.product-heading").fadeOut(200);a("#smod-product-select").fadeOut(300);var b=1;a("#product-panel > div").reverse(function(){a(this).delay(b*
100).fadeOut(100);b++});a("#smod-mobilebroadband").delay(300).queue(function(){a("div.block-left").removeClass("block-left").addClass("block-left-alt");a("div.block-right").removeClass("block-right").addClass("block-right-alt");a("div.block-content-product").eq(c).fadeIn(300);var d=a("div.product-content").eq(c);d.find("div").hide();d.show();b=1;a("div",d).each(function(){a(this).delay(b*100).fadeIn(100);b++});g();a(this).dequeue()});a("a.back").delay(600).queue(function(){a(this).removeClass("hidden");
a(this).dequeue()})}function l(c){j();a("#smod-block").delay(100).animate({right:"0"},{duration:500});a("#product-panel h3.product-heading").delay(400).fadeIn(200);a("div.block-content-product").eq(c).fadeOut(300);c=a("div.product-content").eq(c);var b=1;a("div",c).each(function(){a(this).delay(b*100).fadeOut(100);b++});a("#smod-mobilebroadband").delay(300).queue(function(){a("div.block-left-alt").removeClass("block-left-alt").addClass("block-left");a("div.block-right-alt").removeClass("block-right-alt").addClass("block-right");
a("#smod-product-select").fadeIn(300);b=1;a("#product-panel > div").reverse(function(){a(this).delay(b*100).fadeIn(100);b++});g();a(this).dequeue()});a("a.back").addClass("hidden")}var i=0,f=false;a.fn.animateCard=function(c){return this.each(function(){a(this).mouseenter(function(){h();a("span.smod-card",a(this).closest("div")).animate(c,{duration:100})});a(this).mouseleave(function(){h()})})};a.fn.resetCard=function(c){return this.each(function(){a(this).find("span.smod-card").animate(c,{duration:32})})};
a(document).ready(function(){if(f=a.browser.msie&&parseInt(a.browser.version==6)){var c="/consumption/groups/system/documents/webasset/img_png_x.gif";if(window.location.hostname=="cms-contributor.vodafone.co.uk")c="/contributor/groups/system/documents/webasset/img_png_x.gif";a(".pngFix").superpng({path:c})}g();a("div.smod-laptop a, div.smod-phone a, div.smod-tablet a","#product-panel").click(function(b){for(var d=["smod-laptop","smod-phone","smod-tablet"],m=a(this).parent(),e=0;e<d.length;e++)if(m.hasClass(d[e])){i=
e;k(e);b.preventDefault();break}});f&&a("#smod-phone-fix","#product-panel").click(function(b){i=1;k(1);b.preventDefault()});a("a.back").click(function(b){l(i);b.preventDefault()})})}})})(jQuery);

/*
	Vodafone Bizarre Voice Hero Script
	Copyright (c) 2011, Vodafone, SapinetNitro
	Author: James Westgate (http://queryj.com)
*/
(function($){
			
	vf.namespace('vf.bizarrevoice.hero', function() {
		
		this.init = function(){
			
			$(document).ready(function() {
								
				var i = 0;
				
				$('ul.phone-list li a').each(function() {
					
					var anchor = $(this);
					
					(function(i, anchor){
						
						anchor.click(function() {
							
							$('ul.phone-list li a').removeClass('selected');
							
							//Hide/show panels
							var current = $('div.panel-detail').not('.hidden');
							current.addClass('hidden');
							
							//Set up the panel detail and fade in
							var target = $('div.panel-detail').eq(i);
							var content = target.find('.panel-content');
							
							
							content.hide();
							
							target.css('left', '600px');
							target.animate({left: '0px'}, {duration: 400, easing: 'easeOutCubic'});
							
							var rating = content.find('.star-rating');
							var width = rating.css('width');
							rating.css('width', '0px');
							
							target.removeClass('hidden');
							content.delay(300).fadeIn(200);
							rating.delay(400).animate({width: width}, {duration: 200})
							
							var rating = content.find('.star-rating').css('width');
							
							
							anchor.addClass('selected');
						});
						
					})(i, anchor);
					
					i++;
				});
			});
			
		};
	});
	
})(jQuery);

