/**
	TERMS OF USE - jQuery Easing
 
	Open source under the BSD License. 

	Copyright å© 2008 George McGinley Smith
	All rights reserved.
	
	Redistribution and use in source and binary forms, with or without modification, 
	are permitted provided that the following conditions are met:
	
	Redistributions of source code must retain the above copyright notice, this list of 
	conditions and the following disclaimer.
	Redistributions in binary form must reproduce the above copyright notice, this list 
	of conditions and the following disclaimer in the documentation and/or other materials 
	provided with the distribution.
	
	Neither the name of the author nor the names of contributors may be used to endorse 
	or promote products derived from this software without specific prior written permission.
	
	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
	EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
	MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
	COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
	EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
	GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
	AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
	NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
	OF THE POSSIBILITY OF SUCH DAMAGE.
	
	
	
	TERMS OF USE - Easing Equations
	
	Open source under the BSD License. 
	
	Copyright å© 2001 Robert Penner
	All rights reserved.
	
	Redistribution and use in source and binary forms, with or without modification, 
	are permitted provided that the following conditions are met:
	
	Redistributions of source code must retain the above copyright notice, this list of 
	conditions and the following disclaimer.
	Redistributions in binary form must reproduce the above copyright notice, this list 
	of conditions and the following disclaimer in the documentation and/or other materials 
	provided with the distribution.
	
	Neither the name of the author nor the names of contributors may be used to endorse 
	or promote products derived from this software without specific prior written permission.
	
	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
	EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
	MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
	COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
	EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
	GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
	AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
	NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
	OF THE POSSIBILITY OF SUCH DAMAGE. 
*/

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}});

/**
	Animations Namespaces and utility functions 
*/

if(window.vf==null)window.vf={};if(vf.datatoy==null)vf.datatoy={};if(vf.mobilebroadband==null)vf.mobilebroadband={};if(vf.mobilebroadband.hero==null)vf.mobilebroadband.hero={};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://www.sapient.com)
 * Version 0.9
 * 
 */

(function(d){d.fn.newsleight=function(c){c=d.extend({imgs:true,backgrounds:true,shim:"x.gif",apply_positioning:true},c);var e=d.browser.msie&&parseInt(d.browser.version,10)<7;return this.each(function(){if(e){var a=d(this);if(c.backgrounds&&a.css("background-image").match(/\.png/i)!==null){var b=a.css("background-image");b=b.substring(5,b.length-2);var f=a.css("background-repeat")=="no-repeat"?"crop":"scale";b={filter:["progid:DXImageTransform.Microsoft.AlphaImageLoader(src='",b,".html', sizingMethod='",
f,"')"].join(""),"background-image":["url(",c.shim,")"].join("")};a.css(b)}else if(c.imgs&&a.is("img[src$=png]")){b={width:a.width()+"px",height:a.height()+"px",filter:["progid:DXImageTransform.Microsoft.AlphaImageLoader(src='",a.attr("src"),"', sizingMethod='scale')"].join("")};a.css(b).attr("src",c.shim)}else if(c.apply_positioning&&a.is("a, input")&&(a.css("position")===""||a.css("position")=="static"))a.css("position","relative");a.css("visibility","visible")}})}})(jQuery);


/**
	Vodafone Datatoy Function
	
	Copyright (c) 2010, Vodafone, SapinetNitro
	
	Author: James Westgate
*/

vf.datatoy.init=function(a,h){function g(c,d){var b=a("#dataTool-result").text(),f=i[c*3+d];b!=f&&a("#dataTool-result").fadeOut(100,function(){a("#dataTool-result").text(f);a("#dataTool-result").fadeIn(200)})}var i=[1,1,3,1,3,3,3,5,5],e=a.extend({},{step:80,min:10,max:200,active:false,showclose:true},h);a(document).ready(function(){a("a.indicator").data("index",0);if(e.active){a("#mod-dataTool-intro").addClass("hidden");a("#mod-dataTool-body").removeClass("hidden")}e.showclose||a("#deactivateDataTool").hide();
a("#activateDataTool").click(function(c){a("#dataTool-overlay").fadeIn(300,function(){a("#mod-dataTool-intro").addClass("hidden");a("#mod-dataTool-body").removeClass("hidden");a("#dataTool-overlay").fadeOut(600)});c.preventDefault()});a("#deactivateDataTool").click(function(c){a("#dataTool-overlay").fadeIn(300,function(){a("#mod-dataTool-intro").removeClass("hidden");a("#mod-dataTool-body").addClass("hidden");a("#dataTool-overlay").fadeOut(600)});c.preventDefault()});a("a.indicator").click(function(c){c.preventDefault()});
a("a.indicator").mousedown(function(c){a(this).closest(".dataTool-sliderControl").addClass("vf-slider-active");a(this).css("opacity","0.8");c.preventDefault()});a(document).mouseup(function(c){if(a(".vf-slider-active").length){a(".dataTool-sliderControl").removeClass("vf-slider-active");a("a.indicator").css("opacity",1);var d=a("#dataTool-q1 a.indicator").data("index"),b=a("#dataTool-q2 a.indicator").data("index");a("#dataTool-q1 a.indicator").animate({left:d*e.step},100,"swing");a("#dataTool-q2 a.indicator").animate({left:b*
e.step},100,"swing");a("#dataTool-q1 div.stripe").animate({"background-position":d*e.step-225+"px 0"},100,"swing");a("#dataTool-q2 div.stripe").animate({"background-position":b*e.step-225+"px 0"},100,"swing");g(d,b);c.preventDefault()}});a("#mod-dataTool").mousemove(function(c){var d=a(".vf-slider-active");if(d.length){var b=c.pageX-d.offset().left,f=Math.round((b-24)/e.step);if(f>=0&&f<3){if(b<e.min)b=e.min;if(b>e.max)b=e.max;b=Math.round(b/8)*8-24;a("a.indicator",d).css("left",b);a("a.indicator",
d).data("index",f);a("div.stripe",d).css("background-position",b-225+"px 0");a("blockquote.quote",d).hide().eq(f).show();d=a("#dataTool-q1 a.indicator").data("index");f=a("#dataTool-q2 a.indicator").data("index");g(d,f)}c.preventDefault()}})})};

/**
	Vodafone Mobile BroadBand Smod Hero Script
	
	Copyright (c) 2010, Vodafone, SapinetNitro
	
	Author: James Westgate
*/	

vf.mobilebroadband.hero.init=function(a){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)){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").newsleight({shim: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()})})};



