/*
 * jQuery UI 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(A,D){A.ui=A.ui||{};if(A.ui.version){return }A.extend(A.ui,{version:"1.8.14",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});A.fn.extend({_focus:A.fn.focus,focus:function(E,F){return typeof E==="number"?this.each(function(){var G=this;setTimeout(function(){A(G).focus();if(F){F.call(G)}},E)}):this._focus.apply(this,arguments)},scrollParent:function(){var E;if((A.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){E=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(A.curCSS(this,"position",1))&&(/(auto|scroll)/).test(A.curCSS(this,"overflow",1)+A.curCSS(this,"overflow-y",1)+A.curCSS(this,"overflow-x",1))}).eq(0)}else{E=this.parents().filter(function(){return(/(auto|scroll)/).test(A.curCSS(this,"overflow",1)+A.curCSS(this,"overflow-y",1)+A.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!E.length?A(document):E},zIndex:function(H){if(H!==D){return this.css("zIndex",H)}if(this.length){var F=A(this[0]),E,G;while(F.length&&F[0]!==document){E=F.css("position");if(E==="absolute"||E==="relative"||E==="fixed"){G=parseInt(F.css("zIndex"),10);if(!isNaN(G)&&G!==0){return G}}F=F.parent()}}return 0},disableSelection:function(){return this.bind((A.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(E){E.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});A.each(["Width","Height"],function(G,E){var F=E==="Width"?["Left","Right"]:["Top","Bottom"],H=E.toLowerCase(),J={innerWidth:A.fn.innerWidth,innerHeight:A.fn.innerHeight,outerWidth:A.fn.outerWidth,outerHeight:A.fn.outerHeight};function I(M,L,K,N){A.each(F,function(){L-=parseFloat(A.curCSS(M,"padding"+this,true))||0;if(K){L-=parseFloat(A.curCSS(M,"border"+this+"Width",true))||0}if(N){L-=parseFloat(A.curCSS(M,"margin"+this,true))||0}});return L}A.fn["inner"+E]=function(K){if(K===D){return J["inner"+E].call(this)}return this.each(function(){A(this).css(H,I(this,K)+"px")})};A.fn["outer"+E]=function(K,L){if(typeof K!=="number"){return J["outer"+E].call(this,K)}return this.each(function(){A(this).css(H,I(this,K,true,L)+"px")})}});function C(G,E){var J=G.nodeName.toLowerCase();if("area"===J){var I=G.parentNode,H=I.name,F;if(!G.href||!H||I.nodeName.toLowerCase()!=="map"){return false}F=A("img[usemap=#"+H+"]")[0];return !!F&&B(F)}return(/input|select|textarea|button|object/.test(J)?!G.disabled:"a"==J?G.href||E:E)&&B(G)}function B(E){return !A(E).parents().andSelf().filter(function(){return A.curCSS(this,"visibility")==="hidden"||A.expr.filters.hidden(this)}).length}A.extend(A.expr[":"],{data:function(G,F,E){return !!A.data(G,E[3])},focusable:function(E){return C(E,!isNaN(A.attr(E,"tabindex")))},tabbable:function(G){var E=A.attr(G,"tabindex"),F=isNaN(E);return(F||E>=0)&&C(G,!F)}});A(function(){var E=document.body,F=E.appendChild(F=document.createElement("div"));A.extend(F.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});A.support.minHeight=F.offsetHeight===100;A.support.selectstart="onselectstart" in F;E.removeChild(F).style.display="none"});A.extend(A.ui,{plugin:{add:function(F,G,I){var H=A.ui[F].prototype;for(var E in I){H.plugins[E]=H.plugins[E]||[];H.plugins[E].push([G,I[E]])}},call:function(E,G,F){var I=E.plugins[G];if(!I||!E.element[0].parentNode){return }for(var H=0;H<I.length;H++){if(E.options[I[H][0]]){I[H][1].apply(E.element,F)}}}},contains:function(F,E){return document.compareDocumentPosition?F.compareDocumentPosition(E)&16:F!==E&&F.contains(E)},hasScroll:function(H,F){if(A(H).css("overflow")==="hidden"){return false}var E=(F&&F==="left")?"scrollLeft":"scrollTop",G=false;if(H[E]>0){return true}H[E]=1;G=(H[E]>0);H[E]=0;return G},isOverAxis:function(F,E,G){return(F>E)&&(F<(E+G))},isOver:function(J,F,I,H,E,G){return A.ui.isOverAxis(J,I,E)&&A.ui.isOverAxis(F,H,G)}})})(jQuery);
/*
 * jQuery UI Widget 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(B,D){if(B.cleanData){var C=B.cleanData;B.cleanData=function(E){for(var F=0,G;(G=E[F])!=null;F++){B(G).triggerHandler("remove")}C(E)}}else{var A=B.fn.remove;B.fn.remove=function(E,F){return this.each(function(){if(!F){if(!E||B.filter(E,[this]).length){B("*",this).add([this]).each(function(){B(this).triggerHandler("remove")})}}return A.call(B(this),E,F)})}}B.widget=function(F,H,E){var G=F.split(".")[0],J;F=F.split(".")[1];J=G+"-"+F;if(!E){E=H;H=B.Widget}B.expr[":"][J]=function(K){return !!B.data(K,F)};B[G]=B[G]||{};B[G][F]=function(K,L){if(arguments.length){this._createWidget(K,L)}};var I=new H();I.options=B.extend(true,{},I.options);B[G][F].prototype=B.extend(true,I,{namespace:G,widgetName:F,widgetEventPrefix:B[G][F].prototype.widgetEventPrefix||F,widgetBaseClass:J},E);B.widget.bridge(F,B[G][F])};B.widget.bridge=function(F,E){B.fn[F]=function(I){var G=typeof I==="string",H=Array.prototype.slice.call(arguments,1),J=this;I=!G&&H.length?B.extend.apply(null,[true,I].concat(H)):I;if(G&&I.charAt(0)==="_"){return J}if(G){this.each(function(){var K=B.data(this,F),L=K&&B.isFunction(K[I])?K[I].apply(K,H):K;if(L!==K&&L!==D){J=L;return false}})}else{this.each(function(){var K=B.data(this,F);if(K){K.option(I||{})._init()}else{B.data(this,F,new E(I,this))}})}return J}};B.Widget=function(E,F){if(arguments.length){this._createWidget(E,F)}};B.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(F,G){B.data(G,this.widgetName,this);this.element=B(G);this.options=B.extend(true,{},this.options,this._getCreateOptions(),F);var E=this;this.element.bind("remove."+this.widgetName,function(){E.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return B.metadata&&B.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(F,G){var E=F;if(arguments.length===0){return B.extend({},this.options)}if(typeof F==="string"){if(G===D){return this.options[F]}E={};E[F]=G}this._setOptions(E);return this},_setOptions:function(F){var E=this;B.each(F,function(G,H){E._setOption(G,H)});return this},_setOption:function(E,F){this.options[E]=F;if(E==="disabled"){this.widget()[F?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",F)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(F,G,H){var J=this.options[F];G=B.Event(G);G.type=(F===this.widgetEventPrefix?F:this.widgetEventPrefix+F).toLowerCase();H=H||{};if(G.originalEvent){for(var E=B.event.props.length,I;E;){I=B.event.props[--E];G[I]=G.originalEvent[I]}}this.element.trigger(G,H);return !(B.isFunction(J)&&J.call(this.element[0],G,H)===false||G.isDefaultPrevented())}}})(jQuery);(function(D,F){var C=0,B=0;function E(){return ++C}function A(){return ++B}D.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(G,H){if(G=="selected"){if(this.options.collapsible&&H==this.options.selected){return }this.select(H)}else{this.options[G]=H;this._tabify()}},_tabId:function(G){return G.title&&G.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+E()},_sanitizeSelector:function(G){return G.replace(/:/g,"\\:")},_cookie:function(){var G=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+A());return D.cookie.apply(null,[G].concat(D.makeArray(arguments)))},_ui:function(H,G){return{tab:H,panel:G,index:this.anchors.index(H)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var G=D(this);G.html(G.data("label.tabs")).removeData("label.tabs")})},_tabify:function(R){var S=this,I=this.options,H=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=D(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return D("a",this)[0]});this.panels=D([]);this.anchors.each(function(V,T){var U=D(T).attr("href");var W=U.split("#")[0],X;if(W&&(W===location.toString().split("#")[0]||(X=D("base")[0])&&W===X.href)){U=T.hash;T.href=U}if(H.test(U)){S.panels=S.panels.add(S.element.find(S._sanitizeSelector(U)))}else{if(U&&U!=="#"){D.data(T,"href.tabs",U);D.data(T,"load.tabs",U.replace(/#.*$/,""));var Z=S._tabId(T);T.href="#"+Z;var Y=S.element.find("#"+Z);if(!Y.length){Y=D(I.panelTemplate).attr("id",Z).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(S.panels[V-1]||S.list);Y.data("destroy.tabs",true)}S.panels=S.panels.add(Y)}else{I.disabled.push(V)}}});if(R){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(I.selected===F){if(location.hash){this.anchors.each(function(U,T){if(T.hash==location.hash){I.selected=U;return false}})}if(typeof I.selected!=="number"&&I.cookie){I.selected=parseInt(S._cookie(),10)}if(typeof I.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length){I.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}I.selected=I.selected||(this.lis.length?0:-1)}else{if(I.selected===null){I.selected=-1}}I.selected=((I.selected>=0&&this.anchors[I.selected])||I.selected<0)?I.selected:0;I.disabled=D.unique(I.disabled.concat(D.map(this.lis.filter(".ui-state-disabled"),function(U,T){return S.lis.index(U)}))).sort();if(D.inArray(I.selected,I.disabled)!=-1){I.disabled.splice(D.inArray(I.selected,I.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(I.selected>=0&&this.anchors.length){S.element.find(S._sanitizeSelector(S.anchors[I.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(I.selected).addClass("ui-tabs-selected ui-state-active");S.element.queue("tabs",function(){S._trigger("show",null,S._ui(S.anchors[I.selected],S.element.find(S._sanitizeSelector(S.anchors[I.selected].hash))[0]))});this.load(I.selected)}D(window).bind("unload",function(){S.lis.add(S.anchors).unbind(".tabs");S.lis=S.anchors=S.panels=null})}else{I.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[I.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(I.cookie){this._cookie(I.selected,I.cookie)}for(var L=0,Q;(Q=this.lis[L]);L++){D(Q)[D.inArray(L,I.disabled)!=-1&&!D(Q).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(I.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(I.event!=="mouseover"){var K=function(U,T){if(T.is(":not(.ui-state-disabled)")){T.addClass("ui-state-"+U)}};var N=function(U,T){T.removeClass("ui-state-"+U)};this.lis.bind("mouseover.tabs",function(){K("hover",D(this))});this.lis.bind("mouseout.tabs",function(){N("hover",D(this))});this.anchors.bind("focus.tabs",function(){K("focus",D(this).closest("li"))});this.anchors.bind("blur.tabs",function(){N("focus",D(this).closest("li"))})}var G,M;if(I.fx){if(D.isArray(I.fx)){G=I.fx[0];M=I.fx[1]}else{G=M=I.fx}}function J(T,U){T.css("display","");if(!D.support.opacity&&U.opacity){T[0].style.removeAttribute("filter")}}var O=M?function(T,U){D(T).closest("li").addClass("ui-tabs-selected ui-state-active");U.hide().removeClass("ui-tabs-hide").animate(M,M.duration||"normal",function(){J(U,M);S._trigger("show",null,S._ui(T,U[0]))})}:function(T,U){D(T).closest("li").addClass("ui-tabs-selected ui-state-active");U.removeClass("ui-tabs-hide");S._trigger("show",null,S._ui(T,U[0]))};var P=G?function(U,T){T.animate(G,G.duration||"normal",function(){S.lis.removeClass("ui-tabs-selected ui-state-active");T.addClass("ui-tabs-hide");J(T,G);S.element.dequeue("tabs")})}:function(U,T,V){S.lis.removeClass("ui-tabs-selected ui-state-active");T.addClass("ui-tabs-hide");S.element.dequeue("tabs")};this.anchors.bind(I.event+".tabs",function(){var U=this,W=D(U).closest("li"),T=S.panels.filter(":not(.ui-tabs-hide)"),V=S.element.find(S._sanitizeSelector(U.hash));if((W.hasClass("ui-tabs-selected")&&!I.collapsible)||W.hasClass("ui-state-disabled")||W.hasClass("ui-state-processing")||S.panels.filter(":animated").length||S._trigger("select",null,S._ui(this,V[0]))===false){this.blur();return false}I.selected=S.anchors.index(this);S.abort();if(I.collapsible){if(W.hasClass("ui-tabs-selected")){I.selected=-1;if(I.cookie){S._cookie(I.selected,I.cookie)}S.element.queue("tabs",function(){P(U,T)}).dequeue("tabs");this.blur();return false}else{if(!T.length){if(I.cookie){S._cookie(I.selected,I.cookie)}S.element.queue("tabs",function(){O(U,V)});S.load(S.anchors.index(this));this.blur();return false}}}if(I.cookie){S._cookie(I.selected,I.cookie)}if(V.length){if(T.length){S.element.queue("tabs",function(){P(U,T)})}S.element.queue("tabs",function(){O(U,V)});S.load(S.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(D.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(G){if(typeof G=="string"){G=this.anchors.index(this.anchors.filter("[href$="+G+"]"))}return G},destroy:function(){var G=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var H=D.data(this,"href.tabs");if(H){this.href=H}var I=D(this).unbind(".tabs");D.each(["href","load","cache"],function(J,K){I.removeData(K+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(D.data(this,"destroy.tabs")){D(this).remove()}else{D(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(G.cookie){this._cookie(null,G.cookie)}return this},add:function(J,I,H){if(H===F){H=this.anchors.length}var G=this,L=this.options,N=D(L.tabTemplate.replace(/#\{href\}/g,J).replace(/#\{label\}/g,I)),M=!J.indexOf("#")?J.replace("#",""):this._tabId(D("a",N)[0]);N.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var K=G.element.find("#"+M);if(!K.length){K=D(L.panelTemplate).attr("id",M).data("destroy.tabs",true)}K.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(H>=this.lis.length){N.appendTo(this.list);K.appendTo(this.list[0].parentNode)}else{N.insertBefore(this.lis[H]);K.insertBefore(this.panels[H])}L.disabled=D.map(L.disabled,function(P,O){return P>=H?++P:P});this._tabify();if(this.anchors.length==1){L.selected=0;N.addClass("ui-tabs-selected ui-state-active");K.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){G._trigger("show",null,G._ui(G.anchors[0],G.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[H],this.panels[H]));return this},remove:function(G){G=this._getIndex(G);var I=this.options,J=this.lis.eq(G).remove(),H=this.panels.eq(G).remove();if(J.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(G+(G+1<this.anchors.length?1:-1))}I.disabled=D.map(D.grep(I.disabled,function(L,K){return L!=G}),function(L,K){return L>=G?--L:L});this._tabify();this._trigger("remove",null,this._ui(J.find("a")[0],H[0]));return this},enable:function(G){G=this._getIndex(G);var H=this.options;if(D.inArray(G,H.disabled)==-1){return }this.lis.eq(G).removeClass("ui-state-disabled");H.disabled=D.grep(H.disabled,function(J,I){return J!=G});this._trigger("enable",null,this._ui(this.anchors[G],this.panels[G]));return this},disable:function(H){H=this._getIndex(H);var G=this,I=this.options;if(H!=I.selected){this.lis.eq(H).addClass("ui-state-disabled");I.disabled.push(H);I.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[H],this.panels[H]))}return this},select:function(G){G=this._getIndex(G);if(G==-1){if(this.options.collapsible&&this.options.selected!=-1){G=this.options.selected}else{return this}}this.anchors.eq(G).trigger(this.options.event+".tabs");return this},load:function(J){J=this._getIndex(J);var H=this,L=this.options,G=this.anchors.eq(J)[0],I=D.data(G,"load.tabs");this.abort();if(!I||this.element.queue("tabs").length!==0&&D.data(G,"cache.tabs")){this.element.dequeue("tabs");return }this.lis.eq(J).addClass("ui-state-processing");if(L.spinner){var K=D("span",G);K.data("label.tabs",K.html()).html(L.spinner)}this.xhr=D.ajax(D.extend({},L.ajaxOptions,{url:I,success:function(N,M){H.element.find(H._sanitizeSelector(G.hash)).html(N);H._cleanup();if(L.cache){D.data(G,"cache.tabs",true)}H._trigger("load",null,H._ui(H.anchors[J],H.panels[J]));try{L.ajaxOptions.success(N,M)}catch(O){}},error:function(O,M,N){H._cleanup();H._trigger("load",null,H._ui(H.anchors[J],H.panels[J]));try{L.ajaxOptions.error(O,M,J,G)}catch(N){}}}));H.element.dequeue("tabs");return this},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(H,G){this.anchors.eq(H).removeData("cache.tabs").data("load.tabs",G);return this},length:function(){return this.anchors.length}});D.extend(D.ui.tabs,{version:"1.8.14"});D.extend(D.ui.tabs.prototype,{rotation:null,rotate:function(I,K){var G=this,L=this.options;var H=G._rotate||(G._rotate=function(M){clearTimeout(G.rotation);G.rotation=setTimeout(function(){var N=L.selected;G.select(++N<G.anchors.length?N:0)},I);if(M){M.stopPropagation()}});var J=G._unrotate||(G._unrotate=!K?function(M){if(M.clientX){G.rotate(null)}}:function(M){t=L.selected;H()});if(I){this.element.bind("tabsshow",H);this.anchors.bind(L.event+".tabs",J);H()}else{clearTimeout(G.rotation);this.element.unbind("tabsshow",H);this.anchors.unbind(L.event+".tabs",J);delete this._rotate;delete this._unrotate}return this}})})(jQuery);(function(F,G){F.ui=F.ui||{};var D=/left|center|right/,E=/top|center|bottom/,A="center",B=F.fn.position,C=F.fn.offset;F.fn.position=function(I){if(!I||!I.of){return B.apply(this,arguments)}I=F.extend({},I);var M=F(I.of),L=M[0],O=(I.collision||"flip").split(" "),N=I.offset?I.offset.split(" "):[0,0],K,H,J;if(L.nodeType===9){K=M.width();H=M.height();J={top:0,left:0}}else{if(L.setTimeout){K=M.width();H=M.height();J={top:M.scrollTop(),left:M.scrollLeft()}}else{if(L.preventDefault){I.at="left top";K=H=0;J={top:I.of.pageY,left:I.of.pageX}}else{K=M.outerWidth();H=M.outerHeight();J=M.offset()}}}F.each(["my","at"],function(){var P=(I[this]||"").split(" ");if(P.length===1){P=D.test(P[0])?P.concat([A]):E.test(P[0])?[A].concat(P):[A,A]}P[0]=D.test(P[0])?P[0]:A;P[1]=E.test(P[1])?P[1]:A;I[this]=P});if(O.length===1){O[1]=O[0]}N[0]=parseInt(N[0],10)||0;if(N.length===1){N[1]=N[0]}N[1]=parseInt(N[1],10)||0;if(I.at[0]==="right"){J.left+=K}else{if(I.at[0]===A){J.left+=K/2}}if(I.at[1]==="bottom"){J.top+=H}else{if(I.at[1]===A){J.top+=H/2}}J.left+=N[0];J.top+=N[1];return this.each(function(){var S=F(this),U=S.outerWidth(),R=S.outerHeight(),T=parseInt(F.curCSS(this,"marginLeft",true))||0,Q=parseInt(F.curCSS(this,"marginTop",true))||0,W=U+T+(parseInt(F.curCSS(this,"marginRight",true))||0),X=R+Q+(parseInt(F.curCSS(this,"marginBottom",true))||0),V=F.extend({},J),P;if(I.my[0]==="right"){V.left-=U}else{if(I.my[0]===A){V.left-=U/2}}if(I.my[1]==="bottom"){V.top-=R}else{if(I.my[1]===A){V.top-=R/2}}V.left=Math.round(V.left);V.top=Math.round(V.top);P={left:V.left-T,top:V.top-Q};F.each(["left","top"],function(Z,Y){if(F.ui.position[O[Z]]){F.ui.position[O[Z]][Y](V,{targetWidth:K,targetHeight:H,elemWidth:U,elemHeight:R,collisionPosition:P,collisionWidth:W,collisionHeight:X,offset:N,my:I.my,at:I.at})}});if(F.fn.bgiframe){S.bgiframe()}S.offset(F.extend(V,{using:I.using}))})};F.ui.position={fit:{left:function(H,I){var K=F(window),J=I.collisionPosition.left+I.collisionWidth-K.width()-K.scrollLeft();H.left=J>0?H.left-J:Math.max(H.left-I.collisionPosition.left,H.left)},top:function(H,I){var K=F(window),J=I.collisionPosition.top+I.collisionHeight-K.height()-K.scrollTop();H.top=J>0?H.top-J:Math.max(H.top-I.collisionPosition.top,H.top)}},flip:{left:function(I,K){if(K.at[0]===A){return }var M=F(window),L=K.collisionPosition.left+K.collisionWidth-M.width()-M.scrollLeft(),H=K.my[0]==="left"?-K.elemWidth:K.my[0]==="right"?K.elemWidth:0,J=K.at[0]==="left"?K.targetWidth:-K.targetWidth,N=-2*K.offset[0];I.left+=K.collisionPosition.left<0?H+J+N:L>0?H+J+N:0},top:function(I,K){if(K.at[1]===A){return }var M=F(window),L=K.collisionPosition.top+K.collisionHeight-M.height()-M.scrollTop(),H=K.my[1]==="top"?-K.elemHeight:K.my[1]==="bottom"?K.elemHeight:0,J=K.at[1]==="top"?K.targetHeight:-K.targetHeight,N=-2*K.offset[1];I.top+=K.collisionPosition.top<0?H+J+N:L>0?H+J+N:0}}};if(!F.offset.setOffset){F.offset.setOffset=function(L,I){if(/static/.test(F.curCSS(L,"position"))){L.style.position="relative"}var K=F(L),N=K.offset(),H=parseInt(F.curCSS(L,"top",true),10)||0,M=parseInt(F.curCSS(L,"left",true),10)||0,J={top:(I.top-N.top)+H,left:(I.left-N.left)+M};if("using" in I){I.using.call(L,J)}else{K.css(J)}};F.fn.offset=function(H){var I=this[0];if(!I||!I.ownerDocument){return null}if(H){return this.each(function(){F.offset.setOffset(this,H)})}return C.call(this)}}}(jQuery));(function(A,B){var C=0;A.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var D=this,F=this.element[0].ownerDocument,E;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(G){if(D.options.disabled||D.element.attr("readonly")){return }E=false;var H=A.ui.keyCode;switch(G.keyCode){case H.PAGE_UP:D._move("previousPage",G);break;case H.PAGE_DOWN:D._move("nextPage",G);break;case H.UP:D._move("previous",G);G.preventDefault();break;case H.DOWN:D._move("next",G);G.preventDefault();break;case H.ENTER:case H.NUMPAD_ENTER:if(D.menu.active){E=true;G.preventDefault()}case H.TAB:if(!D.menu.active){return }D.menu.select(G);break;case H.ESCAPE:D.element.val(D.term);D.close(G);break;default:clearTimeout(D.searching);D.searching=setTimeout(function(){if(D.term!=D.element.val()){D.selectedItem=null;D.search(null,G)}},D.options.delay);break}}).bind("keypress.autocomplete",function(G){if(E){E=false;G.preventDefault()}}).bind("focus.autocomplete",function(){if(D.options.disabled){return }D.selectedItem=null;D.previous=D.element.val()}).bind("blur.autocomplete",function(G){if(D.options.disabled){return }clearTimeout(D.searching);D.closing=setTimeout(function(){D.close(G);D._change(G)},150)});this._initSource();this.response=function(){return D._response.apply(D,arguments)};this.menu=A("<ul></ul>").addClass("ui-autocomplete").appendTo(A(this.options.appendTo||"body",F)[0]).mousedown(function(G){var H=D.menu.element[0];if(!A(G.target).closest(".ui-menu-item").length){setTimeout(function(){A(document).one("mousedown",function(I){if(I.target!==D.element[0]&&I.target!==H&&!A.ui.contains(H,I.target)){D.close()}})},1)}setTimeout(function(){clearTimeout(D.closing)},13)}).menu({focus:function(H,I){var G=I.item.data("item.autocomplete");if(false!==D._trigger("focus",H,{item:G})){if(/^key/.test(H.originalEvent.type)){D.element.val(G.value)}}},selected:function(I,J){var H=J.item.data("item.autocomplete"),G=D.previous;if(D.element[0]!==F.activeElement){D.element.focus();D.previous=G;setTimeout(function(){D.previous=G;D.selectedItem=H},1)}if(false!==D._trigger("select",I,{item:H})){D.element.val(H.value)}D.term=D.element.val();D.close(I);D.selectedItem=H},blur:function(G,H){if(D.menu.element.is(":visible")&&(D.element.val()!==D.term)){D.element.val(D.term)}}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");if(A.fn.bgiframe){this.menu.element.bgiframe()}},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();A.Widget.prototype.destroy.call(this)},_setOption:function(D,E){A.Widget.prototype._setOption.apply(this,arguments);if(D==="source"){this._initSource()}if(D==="appendTo"){this.menu.element.appendTo(A(E||"body",this.element[0].ownerDocument)[0])}if(D==="disabled"&&E&&this.xhr){this.xhr.abort()}},_initSource:function(){var D=this,F,E;if(A.isArray(this.options.source)){F=this.options.source;this.source=function(H,G){G(A.ui.autocomplete.filter(F,H.term))}}else{if(typeof this.options.source==="string"){E=this.options.source;this.source=function(H,G){if(D.xhr){D.xhr.abort()}D.xhr=A.ajax({url:E,data:H,dataType:"json",autocompleteRequest:++C,success:function(J,I){if(this.autocompleteRequest===C){G(J)}},error:function(){if(this.autocompleteRequest===C){G([])}}})}}else{this.source=this.options.source}}},search:function(E,D){E=E!=null?E:this.element.val();this.term=this.element.val();if(E.length<this.options.minLength){return this.close(D)}clearTimeout(this.closing);if(this._trigger("search",D)===false){return }return this._search(E)},_search:function(D){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:D},this.response)},_response:function(D){if(!this.options.disabled&&D&&D.length){D=this._normalize(D);this._suggest(D);this._trigger("open")}else{this.close()}this.pending--;if(!this.pending){this.element.removeClass("ui-autocomplete-loading")}},close:function(D){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",D)}},_change:function(D){if(this.previous!==this.element.val()){this._trigger("change",D,{item:this.selectedItem})}},_normalize:function(D){if(D.length&&D[0].label&&D[0].value){return D}return A.map(D,function(E){if(typeof E==="string"){return{label:E,value:E}}return A.extend({label:E.label||E.value,value:E.value||E.label},E)})},_suggest:function(D){var E=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(E,D);this.menu.deactivate();this.menu.refresh();E.show();this._resizeMenu();E.position(A.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next(new A.Event("mouseover"))}},_resizeMenu:function(){var D=this.menu.element;D.outerWidth(Math.max(D.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(F,E){var D=this;A.each(E,function(G,H){D._renderItem(F,H)})},_renderItem:function(D,E){return A("<li></li>").data("item.autocomplete",E).append(A("<a></a>").text(E.label)).appendTo(D)},_move:function(E,D){if(!this.menu.element.is(":visible")){this.search(null,D);return }if(this.menu.first()&&/^previous/.test(E)||this.menu.last()&&/^next/.test(E)){this.element.val(this.term);this.menu.deactivate();return }this.menu[E](D)},widget:function(){return this.menu.element}});A.extend(A.ui.autocomplete,{escapeRegex:function(D){return D.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(F,D){var E=new RegExp(A.ui.autocomplete.escapeRegex(D),"i");return A.grep(F,function(G){return E.test(G.label||G.value||G)})}})}(jQuery));(function(A){A.widget("ui.menu",{_create:function(){var B=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(C){if(!A(C.target).closest(".ui-menu-item a").length){return }C.preventDefault();B.select(C)});this.refresh()},refresh:function(){var C=this;var B=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");B.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(D){C.activate(D,A(this).parent())}).mouseleave(function(){C.deactivate()})},activate:function(E,D){this.deactivate();if(this.hasScroll()){var F=D.offset().top-this.element.offset().top,B=this.element.scrollTop(),C=this.element.height();if(F<0){this.element.scrollTop(B+F)}else{if(F>=C){this.element.scrollTop(B+F-C+D.height())}}}this.active=D.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",E,{item:D})},deactivate:function(){if(!this.active){return }this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null},next:function(B){this.move("next",".ui-menu-item:first",B)},previous:function(B){this.move("prev",".ui-menu-item:last",B)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(E,D,C){if(!this.active){this.activate(C,this.element.children(D));return }var B=this.active[E+"All"](".ui-menu-item").eq(0);if(B.length){this.activate(C,B)}else{this.activate(C,this.element.children(D))}},nextPage:function(D){if(this.hasScroll()){if(!this.active||this.last()){this.activate(D,this.element.children(".ui-menu-item:first"));return }var E=this.active.offset().top,C=this.element.height(),B=this.element.children(".ui-menu-item").filter(function(){var F=A(this).offset().top-E-C+A(this).height();return F<10&&F>-10});if(!B.length){B=this.element.children(".ui-menu-item:last")}this.activate(D,B)}else{this.activate(D,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))}},previousPage:function(C){if(this.hasScroll()){if(!this.active||this.first()){this.activate(C,this.element.children(".ui-menu-item:last"));return }var D=this.active.offset().top,B=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var E=A(this).offset().top-D+B-A(this).height();return E<10&&E>-10});if(!result.length){result=this.element.children(".ui-menu-item:first")}this.activate(C,result)}else{this.activate(C,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))}},hasScroll:function(){return this.element.height()<this.element[A.fn.prop?"prop":"attr"]("scrollHeight")},select:function(B){this._trigger("selected",B,{item:this.active})}})}(jQuery));$(document).ready(function(){initDynamicLead();attachCarousel()});initDynamicLead=function(){var B=7000;moveCarousel=function(){$("#dynLead .carousel-nav-right a").click()};var A;cycleCarousel=function(){A=setInterval(moveCarousel,B)};$("#dynLead .carousel").hover(function(){clearInterval(A)},function(){cycleCarousel()});cycleCarousel();$("#dynLead .carousel-nav").css("visibility","visible")};fadeDisplay=function(A,J,D){var K=$(A).parents(".carousel");var E=false;if($(K).hasClass("carouselSwitch")){E=true}var H=$(K).find(".carousel-element").length;var G=$(K).find(".carousel-element");var C=$(K).find(".carousel-element.active");var I=$(K).find(".carousel-element").index($(C));if(I==-1){I=0}var B=$(A).parents(".carousel-nav").find(".carousel-nav-left a");var F=$(A).parents(".carousel-nav").find(".carousel-nav-right a");var L=$(A).parents(".carousel-nav").find(".carousel-progress a");fadeInOutEls=function(R,O,M,P,N,Q){$(M).eq(O).hide().removeClass("active");$(P).removeClass("active");var S=(R==undefined)?(O+H+Q)%(H):R;$(M).eq(S).show().addClass("active");$(P).eq(S).addClass("active");if($(M).eq((S+H-1)%(H)).children(".carousel-element-name").length>0){$(F).html($(M).eq((S+H+1)%(H)).children(".carousel-element-name").html());$(B).html($(M).eq((S+H-1)%(H)).children(".carousel-element-name").html())}};if(J!=0){fadeInOutEls(D,I,G,L,A,J)}else{if(D!=I){fadeInOutEls(D,I,G,L,A,0)}}};carouselNavLeftHandler=function(){var A=$(this);fadeDisplay(A,-1);return false};carouselNavRightHandler=function(){var A=$(this);fadeDisplay(A,1);return false};carouselProgressHandler=function(){var A=$(this);clickIndex=$(this).html();if(clickIndex!=0){clickIndex=parseFloat(clickIndex)}fadeDisplay(A,0,clickIndex);return false};attachCarousel=function(){$(".carouselFade .carousel-nav-left a, .carouselSwitch .carousel-nav-left a").live("click",carouselNavLeftHandler);$(".carouselFade .carousel-nav-right a, .carouselSwitch .carousel-nav-right a").live("click",carouselNavRightHandler);$(".carouselFade .carousel-progress a, .carouselSwitch .carousel-progress a").live("click",carouselProgressHandler)};$(document).ready(function(){$(".carouselSlide .carousel-nav-right a").live("click",function(){var A=$(this);slideDisplay(A,+1);return false});$(".carouselSlide .carousel-nav-left a").live("click",function(){var A=$(this);slideDisplay(A,-1);return false});$(".carouselSlide .carousel-progress a").live("click",function(){var A=$(this);clickIndex=$(this).html();slideDisplay(A,0,clickIndex);return false})});slideDisplay=function(B,L,E){var D=$(B).parents(".carousel-nav").find(".carousel-nav-left a");var F=$(B).parents(".carousel-nav").find(".carousel-nav-right a");var P=$(B).parents(".carousel-nav").find(".carousel-progress a");var N=$(B).parents(".carousel");var I=$(B).parents(".carousel").width();var J=$(N).find(".carousel-element").length;var A=$(N).find(".carousel-element").outerWidth({margin:true});var G=$(N).find(".carousel-element");var K=J*A;var M=I/A;$(N).find(".carousel-container").width(K);getContainerOffsetLeft=function(Q){var T=Q.offset();var U=T.left+1;var S=$(Q).find(".carousel-container").offset();var R=U-S.left;return R};var H;if(L==0){if(I*E<K){H=-(I*E-I)}else{H=-(K-I)}}else{var O=getContainerOffsetLeft(N);if(O+2*I>K&&L==1){H=-(K-I)}else{if(O<I&&L==-1){H=0}else{H=-(O+L*I);var C=O%I;if(C&&C<I&&O!=0){H--}}}}$(N).find(".carousel-container").animate({marginLeft:H+"px"},function(){var Q=Math.ceil(getContainerOffsetLeft(N)/I);$(P).removeClass("active");$(P).eq(Q).addClass("active");if(H==0){$(D).addClass("disabled");$(F).removeClass("disabled")}else{if(H-I<=-(K)){$(D).removeClass("disabled");$(F).addClass("disabled")}else{$(D).removeClass("disabled");$(F).removeClass("disabled")}}})};if(location.protocol!="https"){memberAwards_updateMemberTokenBalance=function(A){var D=(parseInt(A/1000000)%100).toString();var B=(parseInt(A/1000)%1000).toString();while(D.length<2){D="0"+D}while(B.length<3){B="0"+B}var C=eventManagerBaseUrl+"/shockwave/member/"+D+"/"+B+"/awards."+A+".dat?callback=?";$.getJSON(C,function(E){})};awardResponseCallback=function(data){var awardData=eval("("+data+")");var trophiesWon=new Array();if(awardData&&awardData.MemberAwards){for(award in awardData.MemberAwards){if(award=="Tokens"){var newTokenBalance=awardData.MemberAwards[award].Value;$.cookie("token_balance_lifetime",awardData.MemberAwards[award].LifetimeValue,{path:"/",domain:".shockwave.com"});if(newTokenBalance!=currentTokenBalance){updateTokens(newTokenBalance);currentTokenBalance=newTokenBalance;$.cookie("token_balance",currentTokenBalance,{path:"/",domain:".shockwave.com"})}}else{if(award=="shockwave-cash"){var newCashBalance=awardData.MemberAwards[award].Value;if(newCashBalance!=currentCashBalance){updateCash(newCashBalance);currentCashBalance=newCashBalance;$.cookie("cash_balance",currentCashBalance,{path:"/",domain:".shockwave.com"})}}else{trophiesWon.push(award)}}}$.cookie("trophies_won","",{path:"/",domain:".shockwave.com"})}else{$.cookie("token_balance_lifetime",0,{path:"/",domain:".shockwave.com"});$.cookie("token_balance",0,{path:"/",domain:".shockwave.com"});$.cookie("trophies_won","",{path:"/",domain:".shockwave.com"})}if(awardData&&awardData.EventData){if(awardData.EventData.Event){var lastEventName=awardData.EventData.Event.Code}var lastEventDate=awardData.EventData.Time;if(awardData.EventData.Element){var lastEventSource=awardData.EventData.Element.SourceElementReference}for(award in awardData.EventData.MemberEventAwards){if(award=="Tokens"){var lastEventTokenCount=awardData.EventData.MemberEventAwards.Tokens.Value}}var memberEventCookieValue=lastEventName+"||"+lastEventDate+"||"+lastEventSource+"||"+lastEventTokenCount;$.cookie("last_member_event",memberEventCookieValue,{path:"/",domain:".shockwave.com"});$("#podMyTokensPrizes").each(function(){})}else{$.cookie("last_member_event","",{path:"/",domain:".shockwave.com"})}};loadLastTokenEvent=function(){var E=$.cookie("last_member_event").split("||");if(E!=null&&E.length==4){var J=E[0];var A=E[1];var H=E[2];var I=E[3];if(J!=null&&A!=null&&H!=null&&I!=null){var K={GameComplete:"You earned <b>{0}</b> tokens for playing <a href='/gamelanding/{1}.jsp'>{2}</a> on {3}",GameStart:"You spent <b>{0}</b> tokens for playing <a href='/gamelanding/{1}.jsp'>{2}</a> on {3}",GameUpdate:"You earned <b>{0}</b> tokens for playing <a href='/gamelanding/{1}.jsp'>{2}</a> on {3}",GameDownload:"You earned <b>{0}</b> tokens for downloading and playing <a href='/gamelanding/{1}.jsp'>{2}</a> on {3}",GamePurchase:"You earned <b>{0}</b> tokens for purchasing <a href='/gamelanding/{1}.jsp'>{2}</a> on {3}",GameRating:"You earned <b>{0}</b> tokens for rating <a href='/gamelanding/{1}.jsp'>{2}</a> on {3}",GameReview:"You earned <b>{0}</b> tokens for reviewing <a href='/gamelanding/{1}.jsp'>{2}</a> on {3}",GameShareConsumer:"You earned <b>{0}</b> tokens for accepting a friend's invitation to play <a href='/gamelanding/{1}.jsp'>{2}</a> on {3}",GameShareProducer:"You earned <b>{0}</b> tokens for sharing <a href='/gamelanding/{1}.jsp'>{2}</a> with a friend on {3}",InstantWin:"You used <b>{0}</b> tokens for playing scratcher <a href='/gamelanding/{1}.jsp'>{2}</a> on {3}",SweepstakeEntry:"You traded <b>{0}</b> tokens for <b>sweepstakes tickets</b> on {3}",ProfileComplete:"You earned <b>{0}</b> tokens for completing your <b>profile</b> on {3}",NewsletterSubscription:"You earned <b>{0}</b> tokens by signing up for the {1} on {3}",MembershipSubscriptionPurchase:"You earned <b>{0}</b> tokens by signing up for a <b>{1}</b> on {3}",MembershipSubscriptionRenewal:"You earned <b>{0}</b> tokens by renewing your <b>{1}</b> on {3}",MembershipSubscriptionUpgrade:"You earned <b>{0}</b> tokens by upgrading to a <b>{1}</b> on {3}",MembershipSubscriptionExisting:"You earned <b>{0}</b> tokens by signing up for a <b>{1}</b> on {3}"};var G={GameComplete:"i/picons/"+H+"_regular.jpg",GameStart:"i/picons/"+H+"_regular.jpg",GameUpdate:"i/picons/"+H+"_regular.jpg",GameDownload:"i/picons/"+H+"_regular.jpg",GamePurchase:"i/picons/"+H+"_regular.jpg",GameRating:"i/picons/"+H+"_regular.jpg",GameReview:"i/picons/"+H+"_regular.jpg",GameShareConsumer:"i/picons/"+H+"_regular.jpg",GameShareProducer:"i/picons/"+H+"_regular.jpg",InstantWin:"/i/picons/non_game_instant_win_regular.jpg",SweepstakeEntry:"/i/picons/non_game_sweepstakes_regular.jpg",ProfileComplete:"/i/picons/non_game_complete_profile_regular.jpg",NewsletterSubscription:"/i/picons/non_game_newsletter_regular.jpg",MembershipSubscriptionPurchase:"/i/picons/{1}.jpg",MembershipSubscriptionRenewal:"/i/picons/{1}.jpg",MembershipSubscriptionUpgrade:"/i/picons/{1}.jpg",MembershipSubscriptionExisting:"/i/picons/{1}.jpg"};var C={SIS:"non_game_free_reg_regular",SIC:"non_game_club_v2_regular",SIP:"non_game_swu_v2_regular"};var B=K[J];if(B!=null){B=B.replace("{0}",I);B=B.replace("{1}",H);B=B.replace("{2}",H);B=B.replace("{3}",A);$("#lastTokenEvent").html(B)}var D=G[J];if(D!=null){var F=C[H];if(F!=null){D=D.replace("{1}",F)}$("#lastTokenEventImage").attr("src",D)}}}}}(function(A){if(A.browser.mozilla){A.fn.disableTextSelect=function(){return this.each(function(){A(this).css({MozUserSelect:"none"})})};A.fn.enableTextSelect=function(){return this.each(function(){A(this).css({MozUserSelect:""})})}}else{if(A.browser.msie){A.fn.disableTextSelect=function(){return this.each(function(){A(this).bind("selectstart.disableTextSelect",function(){return false})})};A.fn.enableTextSelect=function(){return this.each(function(){A(this).unbind("selectstart.disableTextSelect")})}}else{A.fn.disableTextSelect=function(){return this.each(function(){A(this).bind("mousedown.disableTextSelect",function(){return false})})};A.fn.enableTextSelect=function(){return this.each(function(){A(this).unbind("mousedown.disableTextSelect")})}}}})(jQuery);$(document).ready(function(){var A="";var B=null;showMessage=function(E,Q,M,F,H){var L=null;if(B!=null){$(B).html(A);$("#dimmerMessage").remove()}else{iframeLayer='<iframe id="iframeLayer" style="z-index:99;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0;filter: alpha(opacity=0);" src="javascript:\'\'"></iframe>';$('<div id="dimmer"></div>').appendTo(document.body)}B=E;A=$(E).html();$(E).empty();var O='<a class="dimmerBtnClose clearLink" href="#">Close</a>';var R=$(".clearfix").hasClass("bc_scratcherPop");$('<div id="dimmerMessage"><table class="shadowBox"><tr><td class="shtl"></td><td class="shtm"></td><td class="shtr"></td></tr><tr><td class="shml"></td><td class="shmm">'+O+A+'</td><td class="shmr"></td></tr><tr><td class="shbl"></td><td class="shbm"></td><td class="shbr"></td></tr></table></div>').appendTo(document.body);if(R){$(".podTitle").html("<a href='http://www.boxtops4education.com/' target='_blank'><img src='/i/sponsors/bettyCrocker/3_logos_green.png ' class='sw_bcScratcherNSI' alt='Betty Crocker Fruit Snacks | Shockwave.com Sign-In' />").css({height:"228px","margin-bottom":"0px",background:"url(/i/sponsors/bettyCrocker/chalkboard_nsi.png )","background-repeat":"no-repeat"})}$(".dimmerBtnClose").click(function(){if(R){window.location="fruitsnacks.jsp"}hideMessage();return false});hideFlashObjects();var I=0;if(typeof document.body.style.maxHeight==="undefined"){I=document.documentElement.scrollTop;if(L!=null){$(iframeLayer).appendTo(document.body)}}if(Q){var J=Q;$("#dimmerMessage").width(Q+"px")}else{var J=$("#dimmerMessage").width()}var N=(J/2)-J;$("#dimmerMessage").css("marginLeft",N);var G=$("#dimmerMessage").height();var S=(G/2)-G+I;$("#dimmerMessage").css("marginTop",S);if($.browser.opera){$("#flashItem").css("visibility","hidden");$("#dimmer, #dimmerMessage").show();$("#flashItem").css("visibility","visible")}else{$("#dimmer").fadeIn("fast",function(){$("#dimmerMessage").fadeIn("fast",function(){if(M){$("#dimmerMessage").find(".btnOnlinePlain").attr("href",M)}if(F){$("#screenShotsWrapper .carousel-container li").each(function(T){imgURL="url(/content/screenshots/"+F+"_billboard_"+(T+1)+".jpg)";$(this).css("background",imgURL)})}})})}if(H){var P=$("#dimmerMessage").height();var C=$(window).height();var D=$("html").scrollTop();var K=P>C?D+10:D+(C/2-P/2);$("#dimmerMessage").css("position","absolute").css("margin-top",0).css("top",K)}};hideMessage=function(C){if($.browser.msie){$("#dimmer, #dimmerMessage").remove();$("#iframeLayer").remove()}else{if(typeof C!="undefined"&&C==true){$("#dimmer, #dimmerMessage").remove()}else{$("#dimmer, #dimmerMessage").fadeOut("fast",function(){$("#dimmer, #dimmerMessage").remove()})}}showFlashObjects();$(B).html(A);B=null}});showAjaxMessage=function(E,H,F,D,G,A,C,B){if($(H).length==0||F){$(H).remove();$.post(E,function(I){$("#dynamicContent").append(I);showMessage(H,D,G,A,C);if(typeof B!="undefined"){B()}})}else{showMessage(H,D,G,A,C);if(typeof B!="undefined"){B()}}};$(document).ready(function(){$("#footer").after('<div id="hoverBox"><table class="shadowBox"><tr><td class="shtl"></td><td class="shtm"></td><td class="shtr"></td></tr><tr><td class="shml"></td><td class="shmm"></td><td class="shmr"></td></tr><tr><td class="shbl"></td><td class="shbm"></td><td class="shbr"></td></tr></table><div id="hoverBoxArrow"></div></div>');showHoverBox=function(D){var F=new Object;var G=new Object;$("#hoverBox #hoverBoxArrow").removeClass("arrowTopLft").removeClass("arrowTopRit").removeClass("arrowBotLft").removeClass("arrowBotRit");$("#hoverBox .shmm").empty();var H=$(D).attr("class");G.width=H.split(" ")[1];G.width=G.width.split("-")[1];G.imageTypeClass=H.split(" ")[2];$("#hoverBox").width(G.width+"px");var C=$(window).width();D.width=$(D).width();D.height=$(D).height();D.offset=$(D).offset();$(D).parent("a").clone().appendTo("#hoverBox .shmm");$(D).parent().nextAll(".hoverBoxContent").clone().appendTo("#hoverBox .shmm");var I=$("#hoverBox .hoverable").attr("src");if(D.width=="122"){$("#hoverBox").addClass("piconLrgLft");var B=I.replace("regular","large");$("#hoverBox .hoverable").attr("src",B).css("height","182px").removeClass("hoverable")}else{if(D.width=="272"){$("#hoverBox").addClass("piconLrgLft");var B=I.replace("xl","large");$("#hoverBox .hoverable").attr("src",B).css({height:"182px",width:"122px"}).removeClass("hoverable")}else{if(D.width=="92"){$("#hoverBox").addClass("piconLrgLft");var B=I.replace("small","large");$("#hoverBox .hoverable").attr("src",B).css({height:"182px",width:"122px"}).removeClass("hoverable")}else{if(D.width=="73"&&G.imageTypeClass=="dailyGame"){$("#hoverBox").addClass("jigsaws");var B=I.replace("_tiny.png",".jpg");$("#hoverBox .hoverable").attr("src",B).css({height:"182px",width:"272px"}).removeClass("hoverable")}else{if(D.width=="40"){$("#hoverBox").addClass("avatar");var B=I.replace("small","large");$("#hoverBox .hoverable").attr("src",B).css({height:"140px",width:"140px"}).removeClass("hoverable")}}}}}F.width=$("#hoverBox").width();F.height=$("#hoverBox").height();var K=window.pageYOffset||document.documentElement.scrollTop;var E;if(D.offset.left+D.width+F.width-110>C){var E=true;F.left=D.offset.left-F.width+92+(D.width/2)}else{F.left=D.offset.left-90+(D.width/2)}var J;if(D.offset.top-K+30<F.height){var J=true;if(E==true){$("#hoverBox #hoverBoxArrow").addClass("arrowTopRit")}else{$("#hoverBox #hoverBoxArrow").addClass("arrowTopLft")}F.top=D.offset.top+(D.height/2)+20}else{if(E==true){$("#hoverBox #hoverBoxArrow").addClass("arrowBotRit")}else{$("#hoverBox #hoverBoxArrow").addClass("arrowBotLft")}F.top=D.offset.top+(D.height/2)-F.height-19}$("#hoverBox").css("left",F.left);$("#hoverBox").css("top",F.top);$("#hoverBox").show()};hoverComplete=function(){$("#hoverBox").hide();clearTimeout(hoverTimeoutID)};var A=false;initHoverBox=function(){$(".hoverable").live("mouseover",function(){var B=$(this);if(A==true){showHoverBox(B)}else{hoverTimeoutID=setTimeout(function(){showHoverBox(B)},800)}});$(".hoverable").live("mouseout",function(){A=false;hoverComplete()})};initHoverBox();$("#hoverBox table, #hoverBox #hoverBoxArrow").hover(function(){$("#hoverBox").show()},function(){A=true;hoverComplete()})});(function(C){var A=C.scrollTo=function(F,E,D){C(window).scrollTo(F,E,D)};A.defaults={axis:"xy",duration:parseFloat(C.fn.jquery)>=1.3?0:1};A.window=function(D){return C(window)._scrollable()};C.fn._scrollable=function(){return this.map(function(){var E=this,D=!E.nodeName||C.inArray(E.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!D){return E}var F=(E.contentWindow||E).document||E.ownerDocument||E;return C.browser.safari||F.compatMode=="BackCompat"?F.body:F.documentElement})};C.fn.scrollTo=function(F,E,D){if(typeof E=="object"){D=E;E=0}if(typeof D=="function"){D={onAfter:D}}if(F=="max"){F=9000000000}D=C.extend({},A.defaults,D);E=E||D.speed||D.duration;D.queue=D.queue&&D.axis.length>1;if(D.queue){E/=2}D.offset=B(D.offset);D.over=B(D.over);return this._scrollable().each(function(){var L=this,J=C(L),K=F,I,G={},M=J.is("html,body");switch(typeof K){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(K)){K=B(K);break}K=C(K,this);case"object":if(K.is||K.style){I=(K=C(K)).offset()}}C.each(D.axis.split(""),function(Q,R){var S=R=="x"?"Left":"Top",U=S.toLowerCase(),P="scroll"+S,O=L[P],N=A.max(L,R);if(I){G[P]=I[U]+(M?0:O-J.offset()[U]);if(D.margin){G[P]-=parseInt(K.css("margin"+S))||0;G[P]-=parseInt(K.css("border"+S+"Width"))||0}G[P]+=D.offset[U]||0;if(D.over[U]){G[P]+=K[R=="x"?"width":"height"]()*D.over[U]}}else{var T=K[U];G[P]=T.slice&&T.slice(-1)=="%"?parseFloat(T)/100*N:T}if(/^\d+$/.test(G[P])){G[P]=G[P]<=0?0:Math.min(G[P],N)}if(!Q&&D.queue){if(O!=G[P]){H(D.onAfterFirst)}delete G[P]}});H(D.onAfter);function H(N){J.animate(G,E,D.easing,N&&function(){N.call(this,F,D)})}}).end()};A.max=function(J,I){var H=I=="x"?"Width":"Height",E="scroll"+H;if(!C(J).is("html,body")){return J[E]-C(J)[H.toLowerCase()]()}var G="client"+H,F=J.ownerDocument.documentElement,D=J.ownerDocument.body;return Math.max(F[E],D[E])-Math.min(F[G],D[G])};function B(D){return typeof D=="object"?D:{top:D,left:D}}})(jQuery);(function(A){A.fn.alphanumeric=function(B){B=A.extend({ichars:"!@#$%^&*()+=[]\\';,/{}|\":<>?~`.- ",nchars:"",allow:""},B);return this.each(function(){if(B.nocaps){B.nchars+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"}if(B.allcaps){B.nchars+="abcdefghijklmnopqrstuvwxyz"}s=B.allow.split("");for(i=0;i<s.length;i++){if(B.ichars.indexOf(s[i])!=-1){s[i]="\\"+s[i]}}B.allow=s.join("|");var D=new RegExp(B.allow,"gi");var C=B.ichars+B.nchars;C=C.replace(D,"");A(this).keypress(function(E){if(!E.charCode){k=String.fromCharCode(E.which)}else{k=String.fromCharCode(E.charCode)}if(C.indexOf(k)!=-1){E.preventDefault()}if(E.ctrlKey&&k=="v"){E.preventDefault()}});A(this).bind("contextmenu",function(){return false})})};A.fn.numeric=function(C){var B="abcdefghijklmnopqrstuvwxyz";B+=B.toUpperCase();C=A.extend({nchars:B},C);return this.each(function(){A(this).alphanumeric(C)})};A.fn.alpha=function(C){var B="1234567890";C=A.extend({nchars:B},C);return this.each(function(){A(this).alphanumeric(C)})}})(jQuery);
/*
 * jQuery Form Plugin
 * version: 2.83 (11-JUL-2011)
 * @requires jQuery v1.3.2 or later
 *
 * Examples and documentation at: http://malsup.com/jquery/form/
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
(function(B){B.fn.ajaxSubmit=function(D){if(!this.length){A("ajaxSubmit: skipping submit process - no element selected");return this}var C,N,F,G=this;if(typeof D=="function"){D={success:D}}C=this.attr("method");N=this.attr("action");F=(typeof N==="string")?B.trim(N):"";F=F||window.location.href||"";if(F){F=(F.match(/^([^#]+)/)||[])[1]}D=B.extend(true,{url:F,success:B.ajaxSettings.success,type:C||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},D);var J={};this.trigger("form-pre-serialize",[this,D,J]);if(J.veto){A("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(D.beforeSerialize&&D.beforeSerialize(this,D)===false){A("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var M,I,S=this.formToArray(D.semantic);if(D.data){D.extraData=D.data;for(M in D.data){if(D.data[M] instanceof Array){for(var O in D.data[M]){S.push({name:M,value:D.data[M][O]})}}else{I=D.data[M];I=B.isFunction(I)?I():I;S.push({name:M,value:I})}}}if(D.beforeSubmit&&D.beforeSubmit(S,this,D)===false){A("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[S,this,D,J]);if(J.veto){A("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var L=B.param(S);if(D.type.toUpperCase()=="GET"){D.url+=(D.url.indexOf("?")>=0?"&":"?")+L;D.data=null}else{D.data=L}var T=[];if(D.resetForm){T.push(function(){G.resetForm()})}if(D.clearForm){T.push(function(){G.clearForm()})}if(!D.dataType&&D.target){var E=D.success||function(){};T.push(function(V){var U=D.replaceTarget?"replaceWith":"html";B(D.target)[U](V).each(E,arguments)})}else{if(D.success){T.push(D.success)}}D.success=function(Y,V,Z){var X=D.context||D;for(var W=0,U=T.length;W<U;W++){T[W].apply(X,[Y,V,Z||G,G])}};var Q=B("input:file",this).length>0;var P="multipart/form-data";var K=(G.attr("enctype")==P||G.attr("encoding")==P);if(D.iframe!==false&&(Q||D.iframe||K)){if(D.closeKeepAlive){B.get(D.closeKeepAlive,function(){H(S)})}else{H(S)}}else{if(B.browser.msie&&C=="get"){var R=G[0].getAttribute("method");if(typeof R==="string"){D.type=R}}B.ajax(D)}this.trigger("form-submit-notify",[this,D]);return this;function H(z){var X=G[0],W,v,m,x,q,Z,e,c,d,r,w,j;var b=!!B.fn.prop;if(z){for(v=0;v<z.length;v++){W=B(X[z[v].name]);W[b?"prop":"attr"]("disabled",false)}}if(B(":input[name=submit],:input[id=submit]",X).length){alert('Error: Form elements must not have name or id of "submit".');return }m=B.extend(true,{},B.ajaxSettings,D);m.context=m.context||m;q="jqFormIO"+(new Date().getTime());if(m.iframeTarget){Z=B(m.iframeTarget);r=Z.attr("name");if(r==null){Z.attr("name",q)}else{q=r}}else{Z=B('<iframe name="'+q+'" src="'+m.iframeSrc+'" />');Z.css({position:"absolute",top:"-1000px",left:"-1000px"})}e=Z[0];c={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(a){var g=(a==="timeout"?"timeout":"aborted");A("aborting upload... "+g);this.aborted=1;Z.attr("src",m.iframeSrc);c.error=g;m.error&&m.error.call(m.context,c,g,a);x&&B.event.trigger("ajaxError",[c,m,g]);m.complete&&m.complete.call(m.context,c,g)}};x=m.global;if(x&&!B.active++){B.event.trigger("ajaxStart")}if(x){B.event.trigger("ajaxSend",[c,m])}if(m.beforeSend&&m.beforeSend.call(m.context,c,m)===false){if(m.global){B.active--}return }if(c.aborted){return }d=X.clk;if(d){r=d.name;if(r&&!d.disabled){m.extraData=m.extraData||{};m.extraData[r]=d.value;if(d.type=="image"){m.extraData[r+".x"]=X.clk_x;m.extraData[r+".y"]=X.clk_y}}}var l=1;var f=2;function h(g){var a=g.contentWindow?g.contentWindow.document:g.contentDocument?g.contentDocument:g.document;return a}function u(){var AD=G.attr("target"),g=G.attr("action");X.setAttribute("target",q);if(!C){X.setAttribute("method","POST")}if(g!=m.url){X.setAttribute("action",m.url)}if(!m.skipEncodingOverride&&(!C||/post/i.test(C))){G.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(m.timeout){j=setTimeout(function(){w=true;p(l)},m.timeout)}function AE(){try{var a=h(e).readyState;A("state = "+a);if(a.toLowerCase()=="uninitialized"){setTimeout(AE,50)}}catch(n){A("Server abort: ",n," (",n.name,")");p(f);j&&clearTimeout(j);j=undefined}}var AC=[];try{if(m.extraData){for(var AF in m.extraData){AC.push(B('<input type="hidden" name="'+AF+'" />').attr("value",m.extraData[AF]).appendTo(X)[0])}}if(!m.iframeTarget){Z.appendTo("body");e.attachEvent?e.attachEvent("onload",p):e.addEventListener("load",p,false)}setTimeout(AE,15);X.submit()}finally{X.setAttribute("action",g);if(AD){X.setAttribute("target",AD)}else{G.removeAttr("target")}B(AC).remove()}}if(m.forceSync){u()}else{setTimeout(u,10)}var AA,AB,y=50,Y;function p(AE){if(c.aborted||Y){return }try{AB=h(e)}catch(AH){A("cannot access response document: ",AH);AE=f}if(AE===l&&c){c.abort("timeout");return }else{if(AE==f&&c){c.abort("server abort");return }}if(!AB||AB.location.href==m.iframeSrc){if(!w){return }}e.detachEvent?e.detachEvent("onload",p):e.removeEventListener("load",p,false);var AC="success",AG;try{if(w){throw"timeout"}var n=m.dataType=="xml"||AB.XMLDocument||B.isXMLDoc(AB);A("isXml="+n);if(!n&&window.opera&&(AB.body==null||AB.body.innerHTML=="")){if(--y){A("requeing onLoad callback, DOM not available");setTimeout(p,250);return }}var AI=AB.body?AB.body:AB.documentElement;c.responseText=AI?AI.innerHTML:null;c.responseXML=AB.XMLDocument?AB.XMLDocument:AB;if(n){m.dataType="xml"}c.getResponseHeader=function(AL){var AK={"content-type":m.dataType};return AK[AL]};if(AI){c.status=Number(AI.getAttribute("status"))||c.status;c.statusText=AI.getAttribute("statusText")||c.statusText}var a=m.dataType||"";var AF=/(json|script|text)/.test(a.toLowerCase());if(AF||m.textarea){var AD=AB.getElementsByTagName("textarea")[0];if(AD){c.responseText=AD.value;c.status=Number(AD.getAttribute("status"))||c.status;c.statusText=AD.getAttribute("statusText")||c.statusText}else{if(AF){var g=AB.getElementsByTagName("pre")[0];var AJ=AB.getElementsByTagName("body")[0];if(g){c.responseText=g.textContent?g.textContent:g.innerHTML}else{if(AJ){c.responseText=AJ.innerHTML}}}}}else{if(m.dataType=="xml"&&!c.responseXML&&c.responseText!=null){c.responseXML=o(c.responseText)}}try{AA=U(c,m.dataType,m)}catch(AE){AC="parsererror";c.error=AG=(AE||AC)}}catch(AE){A("error caught: ",AE);AC="error";c.error=AG=(AE||AC)}if(c.aborted){A("upload aborted");AC=null}if(c.status){AC=(c.status>=200&&c.status<300||c.status===304)?"success":"error"}if(AC==="success"){m.success&&m.success.call(m.context,AA,"success",c);x&&B.event.trigger("ajaxSuccess",[c,m])}else{if(AC){if(AG==undefined){AG=c.statusText}m.error&&m.error.call(m.context,c,AC,AG);x&&B.event.trigger("ajaxError",[c,m,AG])}}x&&B.event.trigger("ajaxComplete",[c,m]);if(x&&!--B.active){B.event.trigger("ajaxStop")}m.complete&&m.complete.call(m.context,c,AC);Y=true;if(m.timeout){clearTimeout(j)}setTimeout(function(){if(!m.iframeTarget){Z.remove()}c.responseXML=null},100)}var o=B.parseXML||function(a,g){if(window.ActiveXObject){g=new ActiveXObject("Microsoft.XMLDOM");g.async="false";g.loadXML(a)}else{g=(new DOMParser()).parseFromString(a,"text/xml")}return(g&&g.documentElement&&g.documentElement.nodeName!="parsererror")?g:null};var V=B.parseJSON||function(a){return window["eval"]("("+a+")")};var U=function(AE,AC,n){var g=AE.getResponseHeader("content-type")||"",a=AC==="xml"||!AC&&g.indexOf("xml")>=0,AD=a?AE.responseXML:AE.responseText;if(a&&AD.documentElement.nodeName==="parsererror"){B.error&&B.error("parsererror")}if(n&&n.dataFilter){AD=n.dataFilter(AD,AC)}if(typeof AD==="string"){if(AC==="json"||!AC&&g.indexOf("json")>=0){AD=V(AD)}else{if(AC==="script"||!AC&&g.indexOf("javascript")>=0){B.globalEval(AD)}}}return AD}}};B.fn.ajaxForm=function(C){if(this.length===0){var D={s:this.selector,c:this.context};if(!B.isReady&&D.s){A("DOM not ready, queuing ajaxForm");B(function(){B(D.s,D.c).ajaxForm(C)});return this}A("terminating; zero elements found by selector"+(B.isReady?"":" (DOM not ready)"));return this}return this.ajaxFormUnbind().bind("submit.form-plugin",function(E){if(!E.isDefaultPrevented()){E.preventDefault();B(this).ajaxSubmit(C)}}).bind("click.form-plugin",function(I){var H=I.target;var F=B(H);if(!(F.is(":submit,input:image"))){var E=F.closest(":submit");if(E.length==0){return }H=E[0]}var G=this;G.clk=H;if(H.type=="image"){if(I.offsetX!=undefined){G.clk_x=I.offsetX;G.clk_y=I.offsetY}else{if(typeof B.fn.offset=="function"){var J=F.offset();G.clk_x=I.pageX-J.left;G.clk_y=I.pageY-J.top}else{G.clk_x=I.pageX-H.offsetLeft;G.clk_y=I.pageY-H.offsetTop}}}setTimeout(function(){G.clk=G.clk_x=G.clk_y=null},100)})};B.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};B.fn.formToArray=function(N){var M=[];if(this.length===0){return M}var D=this[0];var G=N?D.getElementsByTagName("*"):D.elements;if(!G){return M}var I,H,F,O,E,K,C;for(I=0,K=G.length;I<K;I++){E=G[I];F=E.name;if(!F){continue}if(N&&D.clk&&E.type=="image"){if(!E.disabled&&D.clk==E){M.push({name:F,value:B(E).val()});M.push({name:F+".x",value:D.clk_x},{name:F+".y",value:D.clk_y})}continue}O=B.fieldValue(E,true);if(O&&O.constructor==Array){for(H=0,C=O.length;H<C;H++){M.push({name:F,value:O[H]})}}else{if(O!==null&&typeof O!="undefined"){M.push({name:F,value:O})}}}if(!N&&D.clk){var J=B(D.clk),L=J[0];F=L.name;if(F&&!L.disabled&&L.type=="image"){M.push({name:F,value:J.val()});M.push({name:F+".x",value:D.clk_x},{name:F+".y",value:D.clk_y})}}return M};B.fn.formSerialize=function(C){return B.param(this.formToArray(C))};B.fn.fieldSerialize=function(D){var C=[];this.each(function(){var H=this.name;if(!H){return }var F=B.fieldValue(this,D);if(F&&F.constructor==Array){for(var G=0,E=F.length;G<E;G++){C.push({name:H,value:F[G]})}}else{if(F!==null&&typeof F!="undefined"){C.push({name:this.name,value:F})}}});return B.param(C)};B.fn.fieldValue=function(H){for(var G=[],E=0,C=this.length;E<C;E++){var F=this[E];var D=B.fieldValue(F,H);if(D===null||typeof D=="undefined"||(D.constructor==Array&&!D.length)){continue}D.constructor==Array?B.merge(G,D):G.push(D)}return G};B.fieldValue=function(C,I){var E=C.name,N=C.type,O=C.tagName.toLowerCase();if(I===undefined){I=true}if(I&&(!E||C.disabled||N=="reset"||N=="button"||(N=="checkbox"||N=="radio")&&!C.checked||(N=="submit"||N=="image")&&C.form&&C.form.clk!=C||O=="select"&&C.selectedIndex==-1)){return null}if(O=="select"){var J=C.selectedIndex;if(J<0){return null}var L=[],D=C.options;var G=(N=="select-one");var K=(G?J+1:D.length);for(var F=(G?J:0);F<K;F++){var H=D[F];if(H.selected){var M=H.value;if(!M){M=(H.attributes&&H.attributes.value&&!(H.attributes.value.specified))?H.text:H.value}if(G){return M}L.push(M)}}return L}return B(C).val()};B.fn.clearForm=function(){return this.each(function(){B("input,select,textarea",this).clearFields()})};B.fn.clearFields=B.fn.clearInputs=function(){var C=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var E=this.type,D=this.tagName.toLowerCase();if(C.test(E)||D=="textarea"){this.value=""}else{if(E=="checkbox"||E=="radio"){this.checked=false}else{if(D=="select"){this.selectedIndex=-1}}}})};B.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};B.fn.enable=function(C){if(C===undefined){C=true}return this.each(function(){this.disabled=!C})};B.fn.selected=function(C){if(C===undefined){C=true}return this.each(function(){var D=this.type;if(D=="checkbox"||D=="radio"){this.checked=C}else{if(this.tagName.toLowerCase()=="option"){var E=B(this).parent("select");if(C&&E[0]&&E[0].type=="select-one"){E.find("option").selected(false)}this.selected=C}}})};function A(){var C="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(C)}else{if(window.opera&&window.opera.postError){window.opera.postError(C)}}}})(jQuery);$(document).ready(function(){$(".exposeComments").each(function(){$(this).html($(this).html().replace(/(<!--)|(-->)/g,""))});googlePlusOne();$(".brand-mamabar-more-link").hover(function(){$(this).addClass("brand-mamabar-more-link-hover");$("td.adWrap").css("position","static");$("td.adWrap").find("div").css("z-index","0")},function(){$(this).removeClass("brand-mamabar-more-link-hover")});$(".rememberMeWrap label").live("click",function(){$(this).toggleClass("active");if(!$("#staticRememberMe").attr("checked")){btg.Controller.sendLinkEvent("rememberMe_userChecked")}else{btg.Controller.sendLinkEvent("rememberMe_userUnchecked")}});if(sw.userInfo.signedInStateCode!="NSI"){$.post("/member/friends/friendsTabList.jsp")}});var isFacebookAutoPublish=false;var contentBaseUrl="www.shockwave.com";var disabledPermissions=new Array();var facebookUserName="";loginRegCallback=null;var timeoutID;var duration;showLoginError=function(A){$(A).parents("form").find(".error").show();var B=$(A).parents("form").attr("id")};hideLoginError=function(A){$(A).parents("form").find(".error").hide()};$(".loginForm input").live("keyup",function(A){if(A.keyCode==13&&!$(this).find(".formSubmit").hasClass("disabled")){$(this).parents("form").find(".formSubmit").click()}});showUpgradeOrCancel=function(){showAjaxMessage("/ajax/modalUpgradeOrCancel.jsp","#upgradeOrCancelDiv",false,"400")};showStaticSignIn=function(B,C,A){if(userInfo.signedInState!="NotSignedIn"){return }showAjaxMessage("/ajax/modalLogin.jsp","#loginStatic",false,"950",null,null,null,function(){if(typeof A!="undefined"){$("#loginSource").val(A);$("#registerSource").val(A)}sendCustomLinkEvent("modalLoginFormOpen",{eVar14:"modalLoginForm",events:"event28",prop26:"modalLoginForm"});if(typeof B!="undefined"&&B!=null||typeof C!="undefined"&&C!=null){$(".staticRegisterLink").bind("click",function(){showStaticRegister(B,C);return false});$(".facebookConnectPopupLink").bind("click",function(){facebookConnectLink("fbc_btn_modalLogn",B);hideMessage();return false})}if(typeof C!="undefined"&&C!=null){$(".dimmerBtnClose").bind("click",function(){C();hideMessage();return false})}$("#modalLogin input.signInFormLogin, .sw_drSignupContainer input.signInFormLogin").focus();$("#modalLoginForm").bind("submit",function(D){D.preventDefault()});if($.browser.msie){$("#modalLoginForm .formSubmit").live("click",function(){if(typeof B!="undefined"&&B!=null){signIn(this,B)}else{signIn(this)}return false})}else{$("#modalLoginForm .formSubmit").bind("click",function(){if(typeof B!="undefined"&&B!=null){signIn(this,B)}else{signIn(this)}return false})}})};googlePlusOne=function(){};showTransitionStaticSignIn=function(B,C,A){showAjaxMessage("/ajax/modalTransitionLogin.jsp","#loginStatic",false,"620",null,null,null,function(){if(typeof A!="undefined"){$("#loginSource").val(A);$("#registerSource").val(A)}if(typeof B!="undefined"&&B!=null){$(".staticRegisterLink").bind("click",function(){showStaticRegister(B,C);return false});$(".facebookConnectPopupLink").bind("click",function(){facebookConnectLink("fbc_btn_modalTransitionLogin",B);hideMessage();return false})}if(typeof C!="undefined"&&C!=null){$(".dimmerBtnClose").bind("click",function(){C();hideMessage();return false})}$("#modalLogin input.signInFormLogin").focus();$("#modalLoginForm").bind("submit",function(D){D.preventDefault()});$("#modalLoginForm .formSubmit").bind("click",function(){if(typeof B!="undefined"&&B!=null){signIn(this,B)}else{signIn(this)}return false});return false})};showStaticRegister=function(B,C,A){showAjaxMessage("/ajax/modalRegister.jsp","#registerStatic",false,"950",null,null,true,function(){if(typeof A!="undefined"){$("#loginSource").val(A);$("#registerSource").val(A)}sendCustomLinkEvent("modalRegisterOpen",{eVar14:"modalRegister",events:"event28",prop26:"modalRegister"});if(typeof B!="undefined"&&B!=null||typeof C!="undefined"&&C!=null){$("#staticSignInLink").bind("click",function(){showStaticSignIn(B,C);return false});$(".facebookConnectPopupLink").bind("click",function(){facebookConnectLink("fbc_btn_modalRegister",B);hideMessage();return false})}if(typeof C!="undefined"&&C!=null){$(".dimmerBtnClose").bind("click",function(){C();hideMessage();return false})}$("#modalRegister #emailAddress").focus();$("#modalRegister .formSubmit").bind("click",function(){submitStaticRegister(B,this)});return false})};showSetScreenname=function(B,A){showAjaxMessage("/ajax/modalSetScreenname.jsp","#modalSetScreenname",false,"440",null,null,true,function(){$("#screennameForm #screenName").focus();$("#screennameForm #screenName").blur(function(){$("#hiddenCheckScreenName").click()});$("#screennameForm .formSubmit").bind("click",function(){clearFormErrors($("#screennameForm"));$.post("/account/choose-screenname-submit.jsp",{screenName:$("#screennameForm #screenName").val(),agreeToTerms:$("#screennameForm #agreeToTerms").attr("checked"),newsletterSubscription:$("#screennameForm #newsletterSubscription").attr("checked")},function(C,D){showJsonFormErrors(C,$("#screennameForm"),B)})});return false})};signIn=function(trigger,callbackFunction,secondBtn,analyticsFormID){if(!analyticsFormID){analyticsFormID=$(trigger).parents("form").attr("id");if(!analyticsFormID){analyticsFormID="idNotSupplied"}}disableSubmitBtn(trigger);if(typeof secondBtn!="undefined"){disableSubmitBtn(secondBtn)}hideLoginError(trigger);var rememberMe=0;if($(trigger).parents("form").find(":checkbox").is(":checked")){rememberMe=1}$.post("/account/memberLoginAjax.jsp",{source:"JsonRequest",loginSource:$("#loginSource").val(),login:$(trigger).parents("form").find(".signInFormLogin").val(),password:$(trigger).parents("form").find(".signInFormPassword").val(),rememberLogin:rememberMe},function(data,textStatus){var results=eval("("+data+")");var success=(results.status=="ok");if(!success){sendCustomLinkEvent("aLoginFormSubmitError",{events:"event7,event28,event29",prop26:analyticsFormID+":error"});showLoginError(trigger);restoreSubmitBtn(trigger);if(typeof secondBtn!="undefined"){restoreSubmitBtn(secondBtn)}}else{var prop26=analyticsFormID+":success";if(rememberMe==1){prop26+="-remember"}var fbLinkedEvents="";if(analyticsFormID=="signInFacebook"){fbLinkedEvents=",event12,event14"}sendCustomLinkEvent("aLoginFormSubmitSuccess",{events:"event7,event8,event29,event30"+fbLinkedEvents,eVar9:convertSignInState(results.login_state),eVar12:results.member_id,eVar21:results.gender,eVar22:results.birthDateInDays,eVar20:results.creationDateInDays,prop13:results.creationDateInDays,prop14:results.gender,prop16:results.member_id,prop18:results.birthDateInDays,prop26:prop26});if(typeof callbackFunction=="function"){hideMessage(true);updateUserInfo(results);callbackFunction(results)}else{window.location.reload()}}})};convertSignInState=function(A){switch(A){case"SignedInStandard":return"LoggedInFree";break;case"SignedInClub":return"LoggedInClub";break;case"SignedInFreeClub":return"LoggedInFree";break;case"SignedInPremium":return"LoggedInUnlimited";break;default:return"notLoggedIn"}};headerSignOut=function(){var time=new Date().getTime();$.get("/memberLogout.jsp?"+time,null,function(data){var results=eval("("+data+")");if(""!=results.message){location.href=results.message}else{window.location.reload(true)}})};headerSignOutNoRedirect=function(callbackFunction){var time=new Date().getTime();$.get("/memberLogout.jsp",null,function(data){var results=eval("("+data+")");if(callbackFunction){callbackFunction(results)}})};getRequestParameter=function(B){B=B.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var A="[\\?&]"+B+"=([^&#]*)";var D=new RegExp(A);var C=D.exec(window.location.href);if(C==null){return""}else{return C[1]}};var facebookPopupIsOpen=false;facebookPopupVideoAdCheck=function(){if(facebookPopupIsOpen){$("object#preplayMovie").attr("style","");$("object#preplayMovie").css("visibility","hidden");$("object#adLoader_div").attr("style","");$("object#adLoader_div").css("visibility","hidden")}};facebookPopupOpened=function(){facebookPopupIsOpen=true;hideFlashObjects()};facebookPopupClosed=function(){facebookPopupIsOpen=false;showFlashObjects()};var showConfirm=false;showFacebookConnectConfirmation=function(){if(typeof pageLevelLoginCallbackFunction=="function"){clickFacebookConnect(pageLevelLoginCallbackFunction,true)}btg.Controller.sendLinkEvent("fbc_regoverlay_success");showAjaxMessage("/ajax/facebookLinkAccountsConfirmPod.jsp","#facebookLinkAccountsConfirm",false,"600","","","",function(){$("#fbConfirmContinue").click(function(){hideMessage();return false})})};showFacebookError=function(A){alert(A)};facebookLinkNewScreenName=function(){$("#facebookRegistrationForm .screennameError").hide();$("#facebookRegistrationForm .screenName").val("");$("#facebookRegistrationForm .screenName").focus()};facebookLinkExistingScreenName=function(){$("#facebookRegistrationForm .screennameError").hide();var A=$("#facebookRegistrationForm .screenName").val();$("#facebookRegistrationForm .screenName").val("");$("#facebookLinkScreenName").val(A);$("#facebookLinkPassword").focus()};facebookLinkNotYou=function(){};$("#globalSearch input").click(function(){$(this).css("color","#000")});$.extend($.ui.tabs.prototype,{equalize:function(){var B=this.panels;if(B.find(".tabEqualizer").length>0){var B=this.panels.find(".tabEqualizer")}var A=B.map(function(){return $(this).height()}).get().sort(function(D,C){return C-D});B.css("min-height",A[0])}});$("#podHotOnlineGames").tabs().tabs("equalize");$("#podStaffPicks").tabs();$("#podStaffPicks").show();$("#podGameIcons").tabs().tabs("equalize");$("#podClubGames").tabs().tabs("equalize");$("#podCommSettings").tabs().tabs("equalize");$("#podHighScores").tabs();$("#podHighScores").show();$("#podMyGames > .podContent").tabs();$("#podMyGames").show();$("#podGameTrophies").tabs();$("#podGameTrophies ol").tabs();$("#podGameTrophies").show();$("#pokerTabs").tabs();$("#bingoTabs").tabs({selected:1});$(".bingoTypeTabs").tabs();$("#podMyActivity").tabs();formatNumber=function(B){if(isNaN(B)){return B}if(typeof B!="string"){B=B.toString()}for(var A=B.length-2;A>0;A-=3){if(A-1>0){B=B.substring(0,A-1)+","+B.substring(A-1)}}return B};jQuery.preloadImages=function(){for(var A=0;A<arguments.length;A++){jQuery("<img>").attr("src",arguments[A])}};centerVH=function(){$(".centerVH").each(function(){var A=$(this).height();var C=$(this).width();var B=$(this).parent();var E=B.height();var D=B.width();var G=Math.floor((E/2)-(A/2));var F=Math.floor((D/2)-(C/2));$(this).css({position:"absolute",top:G,left:F})})};jQuery.tab=function(A){$(".selector").tabs({selected:A})};disableSubmitBtn=function(A){var B=$(A).clone();B.addClass("disabled").attr("onclick","");$(A).before(B);$(A).hide()};restoreSubmitBtn=function(A){$(A).prev(".disabled").remove();$(A).show()};updateTokens=function(A){if(isNaN(A)){return false}$("#tokenCount span").after("<span style='display:none;'>"+formatNumber(A)+"</span>");$("#tokenCount span").each(function(){$(this).toggle("slow")});$("#tokenCount span:first").remove()};updateCash=function(A){if(isNaN(A)){return false}$("#headerCashBalance span").after("<span style='display:none;'>"+formatNumber(A)+"</span>");$("#headerCashBalance span").each(function(){$(this).toggle("slow")});$("#headerCashBalance span:first").remove();$("#cashBalance span").text(formatNumber(A))};$("#cooliris input").focus(function(){$(this).val("").css("color","#333")});$("#globalSearch a").click(function(){var A=$(this).attr("id");var B=encodeURIComponent($("#globalSearch :text").attr("value"));if(B!="Search..."&&B!=""){if(A=="searchWeb"){document.location.href="http://search.live.com/results.aspx?q="+B+"&mkt=en-us&FORM=VCM019"}else{document.location.href="/search.jsp?q="+B;return false}}});$("#globalSearch").keyup(function(A){if(A.keyCode==13){$("#globalSearch #searchSite").click();return false}});if($("#globalSearchInput, .searchFilter input").length>0){$("#globalSearchInput, .searchFilter input").autocomplete({source:function(B,A){$.ajax({url:"http://search.mtvnservices.com/typeahead/suggest/",dataType:"jsonp",cache:true,jsonpCallback:"typeAhead",data:{siteName:"shockwave",prefix:B.term,format:"json"},success:function(C){A(C)}})},open:function(A,C){hideFlashObjects();$(this).css({"border-bottom-width":"0","padding-bottom":"4px"});var B=$(this).val();$(this).autocomplete("widget").find("a").html(function(D,E){return E.replace(B,"<b>"+B+"</b>").toLowerCase()})},close:function(){showFlashObjects();$(this).css({"border-bottom-width":"1px","padding-bottom":"3px"})},select:function(A,B){$("#globalSearchInput").val(B.item.value);$("#globalSearch #searchSite").click();return false},minLength:2})}ajaxTabLoad=function(C,B,A,E){if(typeof C=="object"){var D=$(C).attr("href")}else{var D=$(C)}$(D).load(B,{},function(G,H,F){if(E){E(G,H,F)}});if(A){$(C).removeAttr("onclick")}return false};ajaxLoad=function(B,A,C){if(typeof A=="string"){A=$(A)}A.load(B,{},function(E,F,D){if(C){C(E,F,D)}})};removeShowAllReviewsLink=function(){$("#showAllReviewsLink").remove()};timedRedirect=function(C,A){var B=setTimeout(function(){document.location.href=C},A*1000)};if(window.FB){FB.provide("UIServer.Methods",{"permissions.request":{size:{width:575,height:240},url:"connect/uiserver.php",transform:function(A){if(A.params.display=="dialog"){A.params.display="iframe";A.params.channel=FB.UIServer._xdChannelHandler(A.id,"parent.parent");A.params.cancel=FB.UIServer._xdNextHandler(A.cb,A.id,"parent.parent",true);A.params.next=FB.UIServer._xdResult(A.cb,A.id,"parent.parent",false)}return A}}})}createCookie=function(C,E,D){if(D){var B=new Date();B.setTime(B.getTime()+(D*1000));var A="; expires="+B.toGMTString()}else{var A=""}document.cookie=C+"="+E+A+"; path=/"};readCookie=function(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null};eraseCookie=function(A){createCookie(A,"",-1)};$(function(){$(".unselectable").disableTextSelect()});checkScreenName=function(trigger){$(trigger).parent().find(".screennameError").hide();$(trigger).parent().next(".error").hide();$(trigger).parent().find(".screennameSuccess").hide();$(trigger).parent().find(".screennameInvalid").hide();var screenname=jQuery.trim($(trigger).parent().find(".screenName").val());if(screenname!=""){$.post("/account/check-screenname.jsp",{screenname:screenname},function(data,textStatus){var response=eval("("+data+")");if(response.status=="ok"){$(trigger).parent().find(".screennameSuccess").show()}else{if(response.message=="invalid"){$(trigger).parent().find(".screennameInvalid").show()}else{$(trigger).parent().find(".screennameError").show()}}})}};$(".checkScreenNameLink").live("click",function(){checkScreenName(this);return false});$("#fbExistingScreenName").live("click",function(){facebookLinkExistingScreenName();return false});$("#fbLinkScreenName").live("click",function(){facebookLinkNewScreenName();return false});$(".staticRegisterLink").live("click",function(){showStaticRegister();return false});$(".staticSignInLink").live("click",function(){showStaticSignIn();return false});$("#linkMyAccountsBtn").live("click",function(){signIn(this,linkMyAccountsSigninCallback,$("#btnJoinNow"),"signInFacebook");return false});$(".removeFriendLink").live("click",function(){var A=$(this).parents(".friendUnhideRemove").find("span").html();showMessage("#removeFriend","400",A);return false});$(".unhideFriendLink").live("click",function(){var A=$(this).parents(".friendUnhideRemove").find("span").html();showMessage("#unhideFriend","400",A);return false});$(".hideMessageBtn").live("click",function(){hideMessage();return false});getWindowUrlBase=function(){var B=window.location.href;var C=B.indexOf("://");var A=B.indexOf("/",8);if(A>-1){B=B.substring(0,A)}return B};tickerCycle=function(){var A=$("#tickerHome").find(".tickerContent li").length-1;var B=0;moveTicker=function(){$("#tickerHome").find(".tickerContent li").eq(B).fadeOut();if(B==A){B=0}else{B=B+1}$("#tickerHome").find(".tickerContent li").eq(B).fadeIn()};var C;cycleTicker=function(){C=setInterval(moveTicker,6000)};moveTicker();cycleTicker()};$(window).load(function(){tickerCycle()});$("li.dropmenu").hover(function(){if($.browser.msie&&$.browser.version==7){$("#mainNav").css({"z-index":"3"})}var A=$(this);$("div",A).show();$(A).addClass("active")},function(){if($.browser.msie&&$.browser.version==7){$("#mainNav").css({"z-index":"0"})}$("div",this).hide();$(this).removeClass("active")});$(".dropmenu div ul li").hover(function(){$(".dropmenu > a").addClass("active");$("ul:first",this).each(function(){$(this).css("top",$(this).parent().position().top);$(this).css("left",$(this).parent().position().left+$(this).parent().width());$(this).css({"z-index":"1000"});$(this).show()})},function(){$("ul:first",this).hide()});$("#moreDropDown").click(function(){$("#moreDropDown a").blur();$("#moreDropDown").toggleClass("active");if($("#moreDropDown").hasClass("active")){$("#moreDropDown span").attr("class","").addClass("arrowUpRit")}else{$("#moreDropDown span").attr("class","").addClass("arrowDownRit")}$("#subNavMore").toggle();return false});$(".tokenTotalToggle").live("click",function(){var A=$(this);$(A).parent("td").parent("tr").next("tr.breakdown").toggle();$(this).toggleClass("btnExpand").toggleClass("btnCollapse");return false});$(".toggleNext").live("click",function(){var A=$(this);$(A).parents("li").eq(0).find(".toggleContent").toggle();$(this).toggleClass("btnExpand").toggleClass("btnCollapse");buttonHTML=$(this).html();if(buttonHTML=="hide"){$(this).html("show")}if(buttonHTML=="show"){$(this).html("hide")}return false});$(".toggleEl").click(function(){var B=$(this).attr("class");var A=B.split(" ")[1];var A=A.split("-")[1];$("#"+A).toggle();$(this).toggleClass("active");if($(this).find("span").hasClass("arrowDownRit")){$(this).find("span").removeClass("arrowDownRit");$(this).find("span").addClass("arrowUpRit")}else{$(this).find("span").removeClass("arrowUpRit");$(this).find("span").addClass("arrowDownRit")}var C=$(this).find("span").html();if(C=="View More"){$(this).find("span").html("View Less")}else{if(C=="View Less"){$(this).find("span").html("View More")}}return false});guestPassFormSubmit=function(){clearFormErrors($("#guestPassForm"));$.post("/myShockwave/sendGuestPass.jsp",{friendEmail:$("#guestPassForm #friendEmail").val(),friendName:$("#guestPassForm #friendName").val(),yourName:$("#guestPassForm #yourName").val(),message:$("#guestPassForm #message").val()},function(A,B){showJsonFormErrors(A,$("#guestPassForm"))});return false};cancelSubscriptionSubmit=function(A){$(A).parent().html("Cancelling your subsciption...");return true};passwordFormSubmit=function(){clearFormErrors($("#changePasswordForm"));$.post("/myShockwave/accountSettings/changePasswordSubmit.jsp",{oldPassword:$("#changePasswordForm #oldPassword").val(),newPassword:$("#changePasswordForm #newPassword").val(),newPassword1:$("#changePasswordForm #newPassword1").val()},function(A,B){showJsonFormErrors(A,$("#changePasswordForm"))});return false};shareGameFormSubmit=function(){clearFormErrors($("#shareGameForm"));$.post("/games/shareGame.jsp",{yourName:$("#shareGameForm #yourName").val(),yourEmail:$("#shareGameForm #yourEmail").val(),recipientEmails:$("#shareGameForm #recipientEmails").val(),message:$("#shareGameForm #message").val(),keyword:$("#shareGameForm #keyword").val()},function(A,B){showJsonFormErrors(A,$("#shareGameForm"),function(){choiceStream.shareGame();toggleTool("#gameShareGameTrigger","#gameShareGame")})});return false};$("#guestPassActivationForm").bind("submit",function(){clearFormErrors($("#guestPassActivationForm"));$(this).ajaxSubmit(function(A){showJsonFormErrors(A,$("#guestPassActivationForm"))});return false});$("#cashCardPinForm").bind("submit",function(){clearFormErrors($("#cashCardPinForm"));$(this).ajaxSubmit(function(A){showJsonFormErrors(A,$("#cashCardPinForm"))});return false});$("#contactUsForm").bind("submit",function(){clearFormErrors($("#contactUsForm"));$(this).ajaxSubmit(function(A){showJsonFormErrors(A,$("#contactUsForm"))});return false});$("#contactUsForm.inGameForm").unbind("submit");$("#contactUsForm.inGameForm").bind("submit",function(){if($("form #computerBrowser").val()==""){alert("Please indicate your browser");return false}if($("form #computerOS").val()==""){alert("Please indicate what your computer uses");return false}if($("form #contactNotes").val()==""){alert("Please provide a suggestion");return false}if($("form #subject").val()==""){alert("Please provide a issue type ");return false}$(this).ajaxSubmit(function(A){alert("thank you for your feedback");$("form #subject option:first").attr("selected","selected");$("form #contactNotes").val("")});return false});$("#registrationForm").bind("submit",function(){siteRegister($(this));return false});$("#photoSubmitForm").bind("submit",function(){clearFormErrors($("#photoSubmitForm"));$(this).ajaxSubmit(function(A){showJsonFormErrors(A,$("#photoSubmitForm"))});return false});$("#developersForm").bind("submit",function(){clearFormErrors($("#developersForm"));$(this).ajaxSubmit(function(A){showJsonFormErrors(A,$("#developersForm"))});return false});$("#billingInfoForm").bind("submit",function(){clearFormErrors($("#billingInfoForm"));$(this).ajaxSubmit(function(A){showJsonFormErrors(A,$("#billingInfoForm"))});return false});$("#friendsSettingForm").bind("submit",function(){clearFormErrors($("#friendsSettingForm"));$(this).ajaxSubmit(function(A){showJsonFormErrors(A,$("#friendsSettingForm"))});return false});$("#newsletterForm").bind("submit",function(){clearFormErrors($("#newsletterForm"));$(this).ajaxSubmit(function(A){showJsonFormErrors(A,$("#newsletterForm"))});return false});$("#staffReviewForm").bind("submit",function(){clearFormErrors($("#staffReviewForm"));$(this).ajaxSubmit(function(A){showJsonFormErrors(A,$("#staffReviewForm"))});return false});$("#personalInfoForm").bind("submit",function(){clearFormErrors($("#personalInfoForm"));$(this).ajaxSubmit(function(A){showJsonFormErrors(A,$("#personalInfoForm"))});return false});submitGameChallengeForm=function(){var A=$("#gameChallengeForm").find("#recipientEmails").val();clearFormErrors($("#gameChallengeForm"));$("#gameChallengeForm").ajaxSubmit(function(B){showJsonFormErrors(B,$("#gameChallengeForm"),function(){showChallengeConfirm(A)})});return false};$(".tagPick3 label").click(function(){var A=$(this);var B=$(".tagPick3 label.active").length;if($(A).hasClass("active")){$(A).removeClass("active");$(".tagPick3label").css("color","#666")}else{if(B<3){$(A).addClass("active")}else{$(".tagPick3label").css("color","red");return false}}});reviewHelpful=function(A,E,D){$.post("/helpful.jsp?id="+A+"&rating="+E+"&s="+D);var F=$("#reviewHelpful_"+A+" span:eq(0)").html();var B=$("#reviewHelpful_"+A+" span:eq(1)").html();if(E){F=F*1+1}B=B*1+1;var C="<div class='results' style='display:none;'><span>"+F+"</span> of <span>"+B+"</span> found this review helpful</div><div class='results'><span>Thank you for voting!</span></div>";$("#reviewHelpful_"+A).html(C);$(this).delay(2000,function(){$("#reviewHelpful_"+A+" .results").toggle("slow")});return false};jumpToScore=function(A){var B=$(A).parents(".podInnerBox").prev("div");var C=$(B).height();var E=$(B).find("td").height();var D=(C/2)-(E/2)-3;$(B).scrollTo("tr.highlight",500,{offset:-D});return false};loadGames=function(B,A){ajaxTabLoad(B,A,true,function(){initHoverBox()})};$("#profileQuestionsEdit").click(function(){$(this).hide();$("#podProfileQuestions .podInnerBox input, #moreProfileQuestions, #profileQuestionsCancel, #profileQuestionsSave").show();$("#podProfileQuestions .podInnerBox p").hide();$("#podProfileQuestions .podInnerBox p.nohide, #podProfileQuestions .podInnerBox h3").show();$("#podProfileQuestions .toggleEl").hide();return false});$("#profileQuestionsSave").click(function(){return false});$("#profileQuestionsCancel").click(function(){$("#podProfileQuestions .podInnerBox p, #profileQuestionsEdit").show();$("#podProfileQuestions .podInnerBox input, #profileQuestionsCancel, #profileQuestionsSave, #podProfileQuestions .podInnerBox h3.titleHide").hide();if($("#moreProfileQuestions").css("display")=="block"){$("#moreProfileQuestions").hide()}$("#podProfileQuestions .toggleEl").show().html("View More");return false});$("#profileHeadlineEdit").click(function(){$(this).hide();$("#profileHeadline").hide();$("#profileHeadlineActionWrap, #profileHeadlineField").show();return false});$("#profileHeadlineSave").click(function(){return false});$("#profileHeadlineCancel").click(function(){$("#profileHeadline, #profileHeadlineEdit").show();$("#profileHeadlineActionWrap, #profileHeadlineField").hide();return false});if($("body.NotSignedIn").length&&document.location.toString().indexOf("nick-arcade-games")>10){$(".pod img[src*='upsell_26']").attr("src","/i/common/upsells/upsell_familyandkids_314x250.jpg");showTransitionStaticSignIn(function(A){if(!A.screenname.length){showSetScreenname(function(){window.location.reload()})}else{window.location.reload()}})}tokenStatementMonthJump=function(A){ajaxLoad("/myShockwave/tokens/tokenData.jsp?mon="+A,$("#tokensData"))};launchWindow=function(D,F,A,E,C){if(!C){C="asw_d"+(Math.floor(Math.random()+100000))}var B=window.open(D,C,"width="+F+",height="+A+",resizable="+E);B.focus();return B};$("#podGameTrophies .multiTrophy li").mouseover(function(){var B=$(this);var C=$(this).parent("ul").find("li");var D=$(C).index(B);var A=$(this).parent("ul").parent("div").find(".podInnerBox");$(C).removeClass("active");$(this).addClass("active");$(A).hide();$(A).eq(D).show()});$(".btt").click(function(){$.scrollTo("0",500);return false});chatWindow=function(A){if(A=="expand"){$("#podChat").addClass("expand")}else{$(this).delay(400,function(){$("#podChat").removeClass("expand")})}};toggleTool=function(B,C){var D=$(B).find("span");var A=$(B).parent("li");if($(D).hasClass("arrowDownRit")){$(".toolBar span.arrowUpRit").each(function(E){$(this).removeClass("arrowUpRit").addClass("arrowDownRit");$(".toolBar li").removeClass("active")});$(".toolShelf").slideUp();$(D).removeClass("arrowDownRit").addClass("arrowUpRit");$(A).addClass("active")}else{$(D).removeClass("arrowUpRit").addClass("arrowDownRit");$(A).removeClass("active")}$(C).slideToggle()};$("#copyURL input, #embedGame input").focus(function(){this.select()});$("#cart select#billingCountry").change(function(){var A=$(this);var C=$(A).parents("li").eq(0).next("li");var B=$("#cart select#billingCountry").val();var D=("paypal"==$("input[name='paymentMethod']:checked").val());if(D||B!="ca"){$(C).hide()}else{$(C).show()}});$("#cart select#shippingCountry").change(function(){var A=$(this);var C=$(A).parents("li").eq(0).next("li");var B=$("#cart select#shippingCountry").val();if(B=="ca"){$(C).show()}else{$(C).hide()}});showGameHelp=function(B){var A="menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes,width=650,height=500";window.open(B,"mywindow",A)};setGameFaceLocation=function(A){if(A>(gameFaceOffset.top-10)){$("#podMyGameFace").css({position:"fixed",top:"10px",left:gameFaceOffset.left})}else{$("#podMyGameFace").css("position","static")}};if($("#podMyGameFace").length>0){gameFaceOffset=$("#podMyGameFace").offset();windowScrollPos=$(window).scrollTop();setGameFaceLocation(windowScrollPos);$(window).scroll(function(){var A=$(window).scrollTop();setGameFaceLocation(A)})}updateGameFace=function(B,E){$.get("/myShockwave/gameFace/makePublic.jsp?avatarId="+E);var C=$(B).parent("span").html();var F=$("#avatars li.active");if(F.length<=0){$("#podVokiIcons li.active").removeClass("active")}var A=$(B).parents("li:eq(0)");var D=$(B).parents("li:eq(0)").find("img").attr("src");$(F).removeClass("active").find("span").html(C);$(A).addClass("active").find("span").html("My Public Game Face");if($("#podMyGameFace .vokiWrap img").length>0){$("#podMyGameFace .vokiWrap img").attr("src",D)}else{$("#podMyGameFace .vokiWrap").empty();$("#podMyGameFace .vokiWrap").append("<img src='"+D+"' alt='' />")}};$("#shipToSameAddress1").click(function(){$("#shippingInputs").toggle()});if($("#sisUpsell").length){setTimeout(function(){$("#sisUpsell").fadeOut("fast")},15000)}showHideState=function(B){var A=$("#country").val();var C=$(B).parents("form").find(".dropdownState");if(A=="us"){$(C).show()}else{$(C).hide()}};unsilenceFriend=function(B,A){if(!B||!A){return false}showAjaxMessage("/html/activityFeed/activityFeedDialogs.html","#activityFeedUnsilence",false,null,null,null,null,function(){$(".unsilenceUserName").text(A);$("#unsilenceUserBtn").unbind();$("#unsilenceUserBtn").bind("click",function(){$.get("/activityFeed/unSilenceFriendMessages.jsp?friendMemberId="+B,null,function(){hideMessage();$(".member"+B).fadeOut("slow",function(){$(".member"+B).remove()})});return false})});return false};silenceConfirm=function(B,A){if(!B||!A){return false}showAjaxMessage("/html/activityFeed/activityFeedDialogs.html","#activityFeedSilence",false,null,null,null,null,function(){$(".silenceUserName").text(A);$("#silenceUserBtn").unbind();$("#silenceUserBtn").bind("click",function(){$.get("/activityFeed/silenceFriendMessages.jsp?friendMemberId="+B,null,function(){hideMessage();$(".member"+B).fadeOut("slow",function(){$(".member"+B).remove()})});return false})});return false};removeConfirm=function(A){showAjaxMessage("/html/activityFeed/activityFeedDialogs.html","#activityFeedRemove",false,null,null,null,null,function(){$("#removeMessageBtn").unbind();$("#removeMessageBtn").bind("click",function(){$.get("/activityFeed/removeMessage.jsp?messageId="+A,null,function(){hideMessage();$(".message"+A).fadeOut("slow",function(){$(".message"+A).remove()})});return false})});return false};growCookie=function(C,A){var B=$.cookie(C);if(B==null||B==""){B=A}else{if(B.indexOf(A)==-1){B+=","+A}else{return }}$.cookie(C,B,{expires:1000,path:"/",domain:".shockwave.com"})};clearFormErrors=function(A){$(A).find("p.error").remove();$(A).find("div.globalError").remove()};showJsonFormErrors=function(jsonResponse,form,successCallbackFunction){var results=eval("("+jsonResponse+")");if(results.success=="false"){$(form).prepend("<div class='globalError'></div>");for(globalError in results.formErrors.globalErrors){$(form).find(".globalError").prepend("<p class='error'>"+results.formErrors.globalErrors[globalError].error+"</p>")}for(fieldError in results.formErrors.fieldErrors){var fieldName=results.formErrors.fieldErrors[fieldError].fieldName;var errorMessage=results.formErrors.fieldErrors[fieldError].error;$(form).find("#"+fieldName).parent().after("<p class='error'>"+errorMessage+"</p>")}if(!$(form).hasClass("noErrorScroll")){$.scrollTo($(form).find(".globalError"),500,{offset:-30})}return false}else{if(results.successUrl=="/member/registrationUnderAge.jsp"){location.href=results.successUrl}if(typeof successCallbackFunction!="undefined"){successCallbackFunction(jsonResponse,results.successUrl)}else{reloadOrRedirect(results.successUrl)}return true}};var concatErrorFields=function(jsonResponse,extraFields){var results=eval("("+jsonResponse+")");var errorFields="";for(fieldError in results.formErrors.fieldErrors){errorFields+=results.formErrors.fieldErrors[fieldError].fieldName+":"}if(extraFields){errorFields+=extraFields+":"}errorFields=errorFields.slice(0,-1);return errorFields};var reportStaticRegisterSuccess=function(){sendCustomLinkEvent("modalRegisterSubmitSuccess",{events:"event9,event11,event29,event30",prop26:"modalRegister:success",eVar9:"LoggedInFree"})};submitStaticRegister=function(successCallbackFunction,e){if(typeof successCallbackFunction!="undefined"&&successCallbackFunction!=null){siteRegister($(e).parents("form"),function(data){reportStaticRegisterSuccess();hideMessage();var results=eval("("+data+")");updateUserInfo(results);successCallbackFunction(results)});return false}else{siteRegister($(e).parents("form"),registerDefaultCallback,true);return false}};siteRegister=function(B,A){clearFormErrors(B);B.ajaxSubmit(function(D){showJsonFormErrors(D,B,A);var C=concatErrorFields(D);sendCustomLinkEvent("modalRegisterSubmitError",{eVar14:"modalRegister",events:"event9,event28,event29",prop26:"modalRegister:error",prop27:C})});return false};registerDefaultCallback=function(B,A){reportStaticRegisterSuccess();showAjaxMessage("/ajax/registrationRecommendations.jsp","#registrationRecommendationsContainer",false,"700","","","",function(){$(".dimmerBtnClose").unbind("click");$(".dimmerBtnClose").live("click",function(){reloadOrRedirect(A)})});$(".continue").live("click",function(){reloadOrRedirect(A)})};reloadOrRedirect=function(A){hideMessage();if(A==""||A==undefined){location.reload()}else{location.href=A}};updateUserInfo=function(A){userInfo.signedInState=A.login_state;userInfo.signedInStateCode=A.login_state_code;userInfo.memberId=A.member_id;userInfo.memberCookie=A.member_cookie;userInfo.screenName=A.screenname;userInfo.email=A.member_email;userInfo.fbId=A.fbId};var omni={cOmniVars:{},setCookie:function(A){jQuery.extend(omni.cOmniVars,A);btg.Cookie.set("swOmni",btg.JSON.stringify(omni.cOmniVars))},setDynamicFeatureVars:function(B){var A={eVar25:B};omni.setCookie(A)},setFindingMethod:function(B,C){var A={prop22:B,prop23:C};omni.setCookie(A)},setGameOverlayRecommendationTracking:function(){var A={events:"event32",eVar18:"overlay_rec_clicker"};omni.setCookie(A);return true}};$("ul.dsGamesList li:last-child").css({"border-bottom":"none"});var sw_membershipLevels=/membershipLevels/.test(self.location.href);var sw_clubShockwave=/clubShockwave/.test(self.location.href);var sw_unlimited=/unlimited/.test(self.location.href);var sw_myShockwave=/myShockwave/.test(self.location.href);var noUpgradeBar=sw_membershipLevels||sw_clubShockwave||sw_unlimited||sw_myShockwave;if((!noUpgradeBar)&&($.cookie("swHideFFUpgrade")!="true")&&($.browser.mozilla&&parseInt($.browser.version)<7)&&(!reskinIsActive)){$("#FFUpgrade").show();$("body").css({backgroundPosition:"center 55px"})}$(".FFUpgradeClose").live("click",function(){$("#FFUpgrade").hide();$("body").css({backgroundPosition:"center 18px"});var A={path:"/",domain:".shockwave.com",expires:14};$.cookie("swHideFFUpgrade","true",A);return false});$(".sw_support a").toggle(function(){$(".plainList").show();$(this).html("[ HIDE ]")},function(){$(".plainList").hide();$(this).html("[ VIEW ]")});setTimeout(function(){$("#podRecommendedGames").show()},2500);googlePlusOneCallback=function(A){plusone_vote=A.state};$(".trackThis").live("click",function(){setTimeout(btg.Controller.sendLinkEvent($(this).attr("rel")),500);return void (0)});var shockwaveHome=/home/.test(self.location.href);if(shockwaveHome){$("#homepageCheck").hide()}var hideFooter=/nickjrholiday/.test(self.location.href)||/spongebob-super-bouncy-fun-time/.test(self.location.href);if(hideFooter){$("#footer h2, #footer p, .moreCoolGames, .footerLinks").hide();$(".footer").addClass("nickjrFooter")}$(document).ready(function(){if(gameKeyword){choiceStream.gamePageView()}});var choiceStream={apiKey:"83a569a3217d4a67",setAuthType:function(B){if(userInfo.memberId){B.setParam("user_id",userInfo.memberId)}if(mtvn.btg.util.Cookie.read("csCID")){B.setParam("cookie_id",mtvn.btg.util.Cookie.read("csCID"))}else{var A=generateUUID();var C=new Date();C.setDate(C.getDate()+1800);mtvn.btg.util.Cookie.set("csCID",A,C.toUTCString(),"/","shockwave.com");B.setParam("cookie_id",A)}},gamePageView:function(){if(!mtvn.btg.util.String.isDefined(gameKeyword)){return }var A=new csRR(this.apiKey,"product_detail");this.setAuthType(A);A.addItem(gameKeyword);if(choicestreamRecs.getGroup()=="choicestream"){if($("#recommend ol.clearfix").hasClass("gamerec3")){$("#podRecommendedGames li a").click(function(){window.opener.location=$(this).attr("href");window.opener.focus()});A.addRecoDisplayRequest("podRecommendedGames",{max:3})}else{if($(".podHeader").hasClass("gamerec4")){A.addRecoDisplayRequest("podRecommendedGames",{max:4})}else{A.addRecoDisplayRequest("podRecommendedGames",{max:5})}}}A.send()},favoriteAdd:function(A){if(!mtvn.btg.util.String.isDefined(A)){return }var B=new csRR(this.apiKey,"custom");this.setAuthType(B);B.addActivity("fav_item_add",{item_id:A});B.send()},rateGame:function(B,C){if(!mtvn.btg.util.String.isDefined(B)||!mtvn.btg.util.String.isDefined(C)){return }var A=new csRR(this.apiKey,"custom");this.setAuthType(A);A.addActivity("item_ratings",{item_id:B,rating:C});A.send()},shareGame:function(){if(!mtvn.btg.util.String.isDefined(gameKeyword)){return }var A=new csRR(this.apiKey,"custom");this.setAuthType(A);A.addActivity("item_shares",{item_id:gameKeyword});A.send()},tryGame:function(A){if(!mtvn.btg.util.String.isDefined(A)){return }var B=new csRR(this.apiKey,"custom");this.setAuthType(B);B.addActivity("item_trials",{item_id:A,unit_price:"0.00"});B.send()},prerollWatched:function(){if(!mtvn.btg.util.String.isDefined(gameKeyword)){return }var A=new csRR(this.apiKey,"custom");this.setAuthType(A);A.addActivity("item_watches",{item_id:gameKeyword});A.send()}};generateUUID=function(){var A="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(D){var C=Math.random()*16|0,B=D=="x"?C:(C&3|8);return B.toString(16)}).toUpperCase();return A};$(document).ready(function(){initRecommendedGamePodAnalytics()});initRecommendedGamePodAnalytics=function(){$(".gameRecommendationsSidePod ol a, #daughter #recommend ol a").live("click",function(){var C="recSideBar";var G=$(this).closest("li").index()+1;var F=gameID;var E=(this).href;var D=E.substring(E.lastIndexOf("/")+1,E.indexOf(".jsp"));var A=C+"_"+G+"_"+F+"_"+D;if(choicestreamRecs.getGroup()=="choicestream"){if(pageGroup=="download"){var B={prop17:A,events:"event40,event23",eVar6:"recommendedSide"}}else{var B={prop17:A,events:"event40",eVar6:"recommendedSide"}}}else{if(pageGroup=="download"){var B={prop17:A,events:"event34",eVar6:"recommendedSide"}}else{var B={prop17:A,events:"event19",eVar6:"recommendedSide"}}}btg.Cookie.set("swOmni",btg.JSON.stringify(B));return })};setupFacebookVars=function(E,D,A,C,B){isFacebookAutoPublish=D;contentBaseUrl=A;disabledPermissions=C;facebookUserName=B};$(document).ready(function(){var facebookConnectClass=new ShareWithFacebook();facebookConnectClass.init();var facebookAccessToken="";var facebookId="";facebookConnectLink=function(linkEventName,callbackFunction){if(!linkEventName){linkEventName="fbc_btn_noSrcLink"}sendCustomLinkEvent(linkEventName,{eVar14:"signInFacebook",prop26:"signInFacebook"});closeCallback=false;FB.login(function(response){if(response.authResponse){facebookAccessToken=response.authResponse.accessToken;facebookId=response.authResponse.userID;clickFacebookConnect(callbackFunction,true);var prodURL=/www/.test(self.location.href);if(prodURL){FB.api("/me/shockwavegames:play","post",{game:document.location.toString(),access_token:"${ facebook_auth_token }"},function(response){if(!response||response.error){console.log("Error occured: "+response.error.message);console.log(response.error.message)}else{console.log("Post ID: "+response.id)}})}else{FB.api("/me/shockwave-devgames:play","post",{game:document.location.toString(),access_token:"${ facebook_auth_token }"},function(response){if(!response||response.error){console.log("Error occured: "+response.error.message)}else{console.log("Post ID: "+response.id)}})}}else{facebookPopupClosed();showAjaxMessage("/ajax/facebookCancelConfirmPod.jsp","#facebookCancelConfirm",false,"700","","","",function(){sendCustomLinkEvent("fbc_AreYouSureShown",{prop26:"signInFacebook:are you sure"});$(".dimmerBtnClose").click(function(){btg.Controller.sendLinkEvent("fbc_regoverlay_alt_close");if(typeof callbackFunction=="function"){closeCallback=true;callbackFunction()}})})}},{scope:"publish_stream,email,user_birthday,publish_actions"});facebookPopupOpened()};$(".facebookConnectPopupLink").live("click",function(){facebookConnectLink($(this).attr("id"));hideMessage();return false});$("#facebookHeaderLogin, a.btnFacebook").show();pageLevelLoginCallbackFunction=null;closeCallback=false;clickFacebookConnect=function(callbackFunction,requireSWLink){var hasCallback=(typeof callbackFunction!="undefined");$.get("/facebook/authenticate.jsp",{has_callback:hasCallback,auth_token:facebookAccessToken,facebook_id:facebookId},function(requireSWLink){return function(data){var results=eval("("+data+")");if(results.needsLogin=="false"){sendCustomLinkEvent("facebookLoginSuccess",{events:"event13",eVar9:convertSignInState(results.login_state),eVar12:results.member_id,eVar20:results.creationDateInDays,eVar21:results.gender,eVar22:results.birthDateInDays,prop13:results.creationDateInDays,prop14:results.gender,prop16:results.member_id,prop18:results.birthDateInDays});if(typeof callbackFunction!="undefined"){hideMessage();updateUserInfo(results);isFacebookConnected=true;callShowInviteCallback(callbackFunction,results)}else{if(requireSWLink){window.location.reload(true)}}}else{pageLevelLoginCallbackFunction=callbackFunction;sendCustomLinkEvent("fbc_regoverlay",{events:"event10,event28",prop26:"signInFacebook:already-have-account"});showAjaxMessage("/ajax/facebookLinkAccountsPod.jsp","#facebookPopup",false,"700","","","",function(){$(".dimmerBtnClose").unbind("click");$(".dimmerBtnClose").click(function(){btg.Controller.sendLinkEvent("fbc_regoverlay_close");hideMessage();removeFacebookAssociation(false);if(typeof pageLevelLoginCallbackFunction=="function"){closeCallback=true;pageLevelLoginCallbackFunction()}return false})})}}}(requireSWLink))};linkMyAccountsSigninCallback=function(){btg.Controller.sendLinkEvent("fbc_regoverlay_linked");if(typeof pageLevelLoginCallbackFunction=="function"){showFacebookConnectConfirmation()}else{location.reload()}};removeFacebookAssociation=function(shouldLogoutFacebook){var time=new Date().getTime();$.get("/facebook/removeShockwaveFromFacebook.jsp",null,function(data){var results=eval("("+data+")");headerSignOutNoRedirect(function(results){if(shouldLogoutFacebook){facebookLogout()}})})};facebookLogout=function(){FB.getLoginStatus(function(response){if(response.authResponse){FB.logout(function(response){window.location.reload(true)})}else{window.location.reload(true)}})};facebookAndShockwaveLogout=function(){headerSignOutNoRedirect();facebookLogout()};getFacebookUserName=function(){return facebookUserName};facebookShareGame=function(shareCode,title,description,callback,customParams){facebookConnectClass.facebookShareGame(shareCode,title,description,callback,customParams)};var wallPostCallback=null;facebookPostToWall=function(postType,comment,gameTitle,description,keyword,trophy,postCallback){if(!isFacebookConnected){if(postCallback){postCallback(null)}return }if(disabledPermissions&&disabledPermissions.length>0){for(i=0;i<disabledPermissions.length;i++){if(postType==disabledPermissions[i]){if(postCallback){postCallback(null)}return }}}var playNowGameLink=null;var attachment=null;var actionLinks=null;if(keyword){var imageSrc=contentBaseUrl+"/i/picons/"+keyword+"_regular.jpg";var gameLinkBaseUrl=contentBaseUrl+"/gamelanding/"+keyword+".jsp?extcmp=fbc_"+postType+"_"+keyword;if(gameArchiveValue=="list"||gameArchiveValue=="picture"){var year=getRequestParameter("year");var day=getRequestParameter("day");var month=getRequestParameter("month");if(day==""){var d=new Date();year=d.getFullYear().toString().substring(2);month=(d.getMonth()+1).toString();day=d.getDate();if(month.length<10){month="0"+month}}gameLinkBaseUrl=gameLinkBaseUrl+"&day="+day+"&month="+month+"&year="+year;if(gameArchiveValue=="picture"){imageSrc=contentBaseUrl+"/content/"+keyword+"/dailyThumbnails/"+month+"_"+year+"/daily"+day+"_tiny.png"}}if(trophy){imageSrc=contentBaseUrl+"/i/trophies/offsite/"+keyword+"/"+trophy+".png"}var imageGameLink=gameLinkBaseUrl;var nameGameLink=gameLinkBaseUrl;var playNowGameLink=gameLinkBaseUrl;var attachment={media:[{type:"image",src:imageSrc,href:imageGameLink}],name:gameTitle,description:description,href:nameGameLink};actionLinks=[{text:"Play Now",href:playNowGameLink}]}postingType=postType;postingKeyword=keyword;wallPostCallback=postCallback;var json={method:"stream.publish",message:"",attachment:attachment,action_links:actionLinks,user_prompt_message:"Post to your wall?"};if(isFacebookAutoPublish){var json={message:"",picture:imageSrc,link:nameGameLink,description:description,caption:gameTitle};var url="/me/feed";FB.api(url,"post",json,facebookWallPostCallback)}else{var json={method:"stream.publish",message:"",attachment:attachment,action_links:actionLinks,user_prompt_message:"Post to your wall?"};FB.ui(json,facebookWallPostCallback)}if(isFacebookAutoPublish){var customLink="fbc_share_"+postType+"_"+keyword;var omniVars={events:"event22",prop12:customLink};sendCustomLinkEvent(customLink,omniVars)}else{if(!postCallback){facebookPopupOpened()}}};var postingType="";var postingKeyword="";facebookWallPostCallback=function(response){if(response&&response.post_id){var customLink="fbc_share_"+postingType+"_prompt_"+postingKeyword;var omniVars={events:"event22",prop12:customLink};sendCustomLinkEvent(customLink,omniVars)}if(wallPostCallback){wallPostCallback(response)}else{if(!isFacebookAutoPublish){facebookPopupClosed()}}};if(window.FB){FB.Event.subscribe("edge.create",function(response){if(typeof gameKeyword!="undefined"){btg.Controller.sendLinkEvent("fblike_click_"+gameKeyword);$.post("/activityFeed/addFbLikeMessage.jsp",{keyword:gameKeyword})}})}$(".inviteFriendsDiv").live("mouseover",function(){if(typeof (gameKeyword)!="undefined"&&gameKeyword!=null){$("#gameKeyword").val(gameKeyword)}if(typeof (bestScore)!="undefined"&&bestScore!=null){$("#bestScore").val(bestScore)}});$(".facebookSignInFromInviteForm").live("click",function(){facebookConnectLink("fbc_btn_mysw_friends_invite");return false});inviteSWFriends={limitText:"- limit is ",maxInvitations:null,highlightCSSClass:"inviteFriendMultiSelected",highlightSelectedElements:function(){$(".avatar4Up").children().each(function(){if(inviteSWFriends.isSelected($(this))){inviteSWFriends.makeActive($(this),false)}})},canSelectMore:function(){if(this.maxInvitations!=null){var accumulator=0;for(var entry in this.selectedList){if(this.selectedList[entry]===true){accumulator++}}if(accumulator<this.maxInvitations){$("#swMultiInviteError").text("");var invitesRemaining=this.maxInvitations-accumulator;if(invitesRemaining>0){$("#swInviteFriendsCount").text(invitesRemaining+" ")}return true}else{$("#swInviteFriendsCount").text("");return false}}else{return true}},highlightElement:function(el){if(!this.isSelected(el)){el.addClass("inviteFriendMultiHighlight")}},init:function(invitesLimit){this.selectedList={};if($("#swInviteFriendsContainer").children().length!==0){if(typeof invitesLimit!="undefined"&&invitesLimit!=null){this.maxInvitations=invitesLimit;this.canSelectMore()}}else{$("#swFriendsInviteDiv").remove();$("#swFriendsFriendsDefault").show()}},isSelected:function(el){var emailAddress=el.attr("name");if(this.selectedList[emailAddress]===undefined||this.selectedList[emailAddress]==false){return false}else{return true}},makeActive:function(el,isUserInitiated){if(!isUserInitiated||this.canSelectMore()){if($.browser.msie&&$.browser.version.substr(0,1)=="7"){el.prepend('<img src="/i/common/site/avatarOverlay.png" alt="" style="position: absolute; margin-left: -50px; margin-top: -3px;" />')}else{el.prepend('<img src="/i/common/site/avatarOverlay.png" alt="" style="position: absolute;" />')}if(isUserInitiated){this.selectedList[el.attr("name")]=true;if(!this.canSelectMore()){$("#swMultiInviteError").text(this.limitText+this.maxInvitations)}}el.addClass(this.highlightCSSClass)}},makeInactive:function(el){el.children(":first").remove();this.selectedList[el.attr("name")]=false;el.removeClass(this.highlightCSSClass);this.canSelectMore()},selectedList:{}};$(".inviteFriendMultiSelect").live("click",function(){if(inviteSWFriends.isSelected($(this))){inviteSWFriends.makeInactive($(this))}else{inviteSWFriends.makeActive($(this),true)}});$("#inviteFriendForm").live("submit",function(){clearFormErrors($("#inviteFriendForm"));$(".inviteFriendsDiv").hide();$(this).ajaxSubmit(function(data){showJsonFormErrors(data,$("#inviteFriendForm"),function(){var successMessage="<div class='mb20'><h4>Your invitation email was sent.</h4><p class='mt20'><a class='btnBig btnOnlineFull' id='sendEmailContinueButton' href='#'>Continue</a></p></div>";$(".inviteBody").html(successMessage);$("#sendEmailContinueButton").bind("click",function(){hideMessage();callShowInviteCallback(facebookConnectClass.options.callback,"success")})});$(".inviteFriendsDiv").show()});return false});submitInviteFriendsForm=function(callBackFunction,swFriendsSubmit){var messageArray=[];$(".personalMessage").each(function(){messageArray.push($(this))});for(var i=0;i<messageArray.length;i++){if(messageArray[i].val()===""){messageArray[i].remove();break}}if(swFriendsSubmit){var recipients="";for(var entry in inviteSWFriends.selectedList){if(inviteSWFriends.selectedList[entry]===true){recipients+=(entry+", ")}}recipients=recipients.substr(0,recipients.length-2);var refForm=null;for(var theForm in document.forms){if(document.forms[theForm].id=="inviteFriendForm"){refForm=document.forms[theForm];break}}refForm.elements.recipientEmails.value=recipients;$("#myName").val($("#defaultName").val());$("#isShockwaveFriends").val("true")}$("#inviteFriendForm").submit();var inviteType=$("#inviteFriendForm #inviteType").val();var recipientEmails=$("#inviteFriendForm #recipientEmails").val();var customInviteParams=$("#inviteFriendForm #customInviteParams").val();callShowInviteCallback(callBackFunction,"success")};friendInviteCallBack=function(){var inviteType=$("#inviteFriendForm #inviteType").val();var recipientEmails=$("#inviteFriendForm #recipientEmails").val();var customInviteParams=$("#inviteFriendForm #customInviteParams").val();var fromSwFriends=$("#isShockwaveFriends").val();var invShort;var localGameKeyword=gameKeyword;var httpParams=getHttpParamsFromParams(customInviteParams);if(inviteType=="gamepageInvite"){invShort="gpi"}else{if(inviteType=="gamepageChallenge"){invShort="gpc"}else{if(inviteType=="overlayChallenge"){invShort="olc"}else{if(inviteType=="friendInvite"){invShort="fri"}}}}var omnitureText="";if(fromSwFriends=="true"){omnitureText="inv_out_sw_"+invShort}else{omnitureText="inv_out_em_"+invShort}if(localGameKeyword!=null){omnitureText=omnitureText+"_"+localGameKeyword}if(recipientEmails!=null){var emails=recipientEmails.split(",");if(emails){for(var i=0;i<emails.length;i++){btg.Controller.sendLinkEvent(omnitureText)}}}};hideMessageAfterEmailConfirmButton=function(){hideMessage();callShowInviteCallback(facebookConnectClass.options.callback,"success")};showInviteFriends=function(customMessage,inviteType,invitesLimit,customParams,callbackFunction){var options={inviteType:inviteType,giftCode:"",giftUuid:"",title:customMessage,description:"",limitParam:invitesLimit,customParams:customParams,callback:callbackFunction,redirectUri:"/facebook/blank.jsp",gameImageUri:""};facebookConnectClass.inviteFriendDialog(options)};var giftInviteCallback;sendGift=function(options){if("giftThankYou"==options.inviteType){if(typeof (options.recipients)=="undefined"){var status={status:"error",error:"No recipientId for thank you gift"};callShowInviteCallback(options.callback,status);return }var links=facebookConnectClass.getLinks(options.inviteType,options.giftCode);var recipients=options.recipients;var recipientIds="";var userName="";for(i=0;i<recipients.length;i++){if(recipientIds.length>0){recipientIds=","}recipientIds=recipientIds+recipients[i].reference;userName=recipients[i].name}$.post("/member/sendInviteMail.jsp",{gameKeyword:gameKeyword,personalMessage:options.description,inviteType:options.inviteType,invitesLimit:options.limitParam,customInviteParams:options.customParams,giftName:options.giftName,recipientIds:recipientIds},function(data){showThankYouGiftConfirm(options.title,links.gameImage,userName,function(){var status={status:"success"};callShowInviteCallback(options.callback,status)})});return }giftInviteCallback=options.callback;options.callback=sendGiftCallback;options.redirectUri="/facebook/sendGiftRecipients.jsp";options.shareCode=options.giftCode;options.customParams="giftName:"+options.giftName+",iUUID:"+options.uuid;facebookConnectClass.inviteFriendDialog(options)};var confirmName="";var confirmImage="";var confirmCallback=null;var closeCallback=null;sendGiftCallback=function(data){if(data.status=="success"||data=="success"){confirmName=facebookConnectClass.options.giftName;confirmImage=facebookConnectClass.options.giftImageUrl;if(data.recipients&&data.recipients.length>0){if(facebookConnectClass.users&&facebookConnectClass.users.length>0){for(i=0;i<data.recipients.length;i++){facebookConnectClass.users.push(data.recipients[i])}}else{facebookConnectClass.users=data.recipients}}var doConfirm=true;var userLimit=facebookConnectClass.options.limitParam;if(facebookConnectClass.users){if(userLimit>0&&userLimit<=facebookConnectClass.users.length){doConfirm=false}}if(doConfirm){confirmCallback=function(){sendGift(facebookConnectClass.options)};closeCallback=function(){if(facebookConnectClass.users){data={status:"success",recipients:facebookConnectClass.users}}callShowInviteCallback(giftInviteCallback,data)};setTimeout("sendGiftConfirmDelayed()",1000)}else{if(facebookConnectClass.users){data={status:"success",recipients:facebookConnectClass.users}}callShowInviteCallback(giftInviteCallback,data)}}else{if(data.status=="cancelled"){if(facebookConnectClass.users){data={status:data.status,recipients:facebookConnectClass.users}}callShowInviteCallback(giftInviteCallback,data)}else{alert("No status, no data")}}};sendGiftConfirmDelayed=function(){showGiftConfirm(confirmName,confirmImage,confirmCallback,closeCallback)};showGiftConfirm=function(giftName,giftImageUrl,confirmCallback,closeCallback){if(!giftName){giftName=""}if(!giftImageUrl){giftImageUrl=""}showAjaxMessage("/html/giftingOverlay/giftingDialogs.html","#modalGiftConfirm",false,580,null,null,null,function(){$(".giftingDialogs .giftImage").attr("alt",giftName);$(".giftingDialogs .giftImage").attr("src",giftImageUrl);$(".giftingDialogs .giftName").html(giftName);$(".btnGiftingClose").unbind();$(".btnGiftingClose").bind("click",function(){hideMessage();closeCallback()});$(".giftSendMore").unbind();$(".giftSendMore").bind("click",function(){hideMessage();confirmCallback()})})};showThankYouGiftConfirm=function(giftName,giftImageUrl,receiverMemberName,callback){if(!giftName||!giftImageUrl||!receiverMemberName){return false}showAjaxMessage("/html/giftingOverlay/giftingDialogs.html","#modalThankYouGiftConfirm",false,580,null,null,null,function(){$(".giftingDialogs .giftImage").attr("alt",giftName);$(".giftingDialogs .giftImage").attr("src",giftImageUrl);$(".giftingDialogs .receiverAvatarImage").attr("src","/member/avatarViewer.jsp?p=1&screenname="+receiverMemberName);$(".giftingDialogs .receiverAvatarImage").attr("alt",receiverMemberName);$(".giftingDialogs .giftName").html(giftName);$(".giftingDialogs .receiverMemberName").html(receiverMemberName);$(".btnGiftingClose").unbind();$(".btnGiftingClose").bind("click",function(){hideMessage();callback();return false})})};callLinkEvents=function(){var omnitureText="inv_out_fb_"+inviteType};callShowInviteCallback=function(callbackFunction,status){if(typeof (callbackFunction)=="undefined"){return }if(typeof callbackFunction=="function"){callbackFunction(status)}else{if(typeof callbackFunction=="string"){var flash=getFlashGameHandle();try{eval("flash."+callbackFunction+"( status );")}catch(e){}}}};inviteFriendDialogCallback=function(response){setTimeout("inviteFriendDialogWrapper()",1000)};inviteFriendDialogWrapper=function(){facebookConnectClass.inviteFriendDialog()};getHttpParamsFromParams=function(customParams){var params="";if(typeof (customParams)!="undefined"&&customParams!=null&&customParams.length>0){var paramsArray=customParams.split(",");if(paramsArray){for(i=0;i<paramsArray.length;i++){var keysArray=paramsArray[i].split(":");if(keysArray){if("keyword"!=keysArray[0]){if(params.length>0){params=params+"&"}params=params+jQuery.trim(keysArray[0])+"="+jQuery.trim(keysArray[1])}}}}}return params}});ShareWithFacebook=function(){this.init=function(){};this.options=null;this.users=null;this.convertTracking=function(originalLink,gameKeyword,shareType,shareCode){var newLink=originalLink.replace(/\{game_keyword\}/g,gameKeyword);newLink=newLink.replace(/\{share_type\}/g,shareType);newLink=newLink.replace(/\{share_code\}/g,shareCode);return newLink};this.getLinks=function(shareType,shareCode,userName,httpParams){var keywordAppend="";var shareCodeAppend="";var gamePicon=gameKeyword+".png";if(gameKeyword){keywordAppend="_"+gameKeyword}if(shareCode&&shareCode.length>0){var folderName="events";gamePicon=folderName+"/"+shareCode+".png";if(shareType.substring(0,4)=="gift"){folderName="gifts";gamePicon=folderName+"/"+shareCode+".png"}shareCodeAppend="&event="+shareCode}var trackingParamGame="inv_bck_fb_{share_type}_lnk_{game_keyword}";var trackingParamButtonGame="inv_bck_fb_{share_type}_btn_{game_keyword}";var trackingParamImage="inv_bck_fb_{share_type}_lnk_{game_keyword}";var trackingParamUser="inv_bck_fb_{share_type}_prf_{game_keyword}";var trackingParamPlayNow="inv_bck_fb_{share_type}_cta_{game_keyword}";var trackingParamShockwave="inv_bck_fb_{share_type}_{game_keyword}";if(typeof (gameKeyword)=="undefined"){trackingParamGame="inv_bck_fb_{share_type}_lnk";trackingParamButtonGame="inv_bck_fb_{share_type}_btn";trackingParamImage="inv_bck_fb_{share_type}_lnk";trackingParamUser="inv_bck_fb_{share_type}_prf";trackingParamPlayNow="inv_bck_fb_{share_type}_cta";trackingParamShockwave="inv_bck_fb_{share_type}"}if("post"==shareType){trackingParamGame="fbc_{game_keyword}_{share_code}";trackingParamButtonGame="fbc_{game_keyword}_{share_code}";trackingParamImage="fbc_{game_keyword}_{share_code}";trackingParamUser="fbc_{game_keyword}_{share_code}";trackingParamPlayNow="fbc_{game_keyword}_{share_code}";trackingParamShockwave="fbc_{game_keyword}_{share_code}"}if(httpParams&&httpParams.length>0){httpParams="&"+httpParams}trackingParamGame=this.convertTracking(trackingParamGame,gameKeyword,shareType,shareCode);trackingParamButtonGame=this.convertTracking(trackingParamButtonGame,gameKeyword,shareType,shareCode);trackingParamImage=this.convertTracking(trackingParamImage,gameKeyword,shareType,shareCode);trackingParamUser=this.convertTracking(trackingParamUser,gameKeyword,shareType,shareCode);trackingParamPlayNow=this.convertTracking(trackingParamPlayNow,gameKeyword,shareType,shareCode);trackingParamShockwave=this.convertTracking(trackingParamShockwave,gameKeyword,shareType,shareCode);var urlBase=getWindowUrlBase();var gameImageUrl=urlBase+"/content/"+gameKeyword+"/sis/"+gamePicon;if(shareType.substring(0,4)=="gift"){gameImageUrl=urlBase+"/content/"+gameKeyword+"/"+gamePicon}var gameLink=urlBase+"/gamelanding/"+gameKeyword+".jsp?extcmp="+trackingParamGame+shareCodeAppend+httpParams;var gameButtonLink=urlBase+"/gamelanding/"+gameKeyword+".jsp?extcmp="+trackingParamButtonGame+shareCodeAppend+httpParams;var gameImageLink=urlBase+"/gamelanding/"+gameKeyword+".jsp?extcmp="+trackingParamImage+shareCodeAppend+httpParams;var userLink=urlBase+"/member/profiles/"+userName+".jsp?extcmp="+trackingParamUser+shareCodeAppend+httpParams;var playNowLink=urlBase+"/gamelanding/"+gameKeyword+".jsp?extcmp="+trackingParamPlayNow+shareCodeAppend+httpParams;var shockwaveLink=urlBase+"/home.jsp?extcmp="+trackingParamShockwave+shareCodeAppend+httpParams;return{gameImage:gameImageUrl,gameLink:gameLink,gameButtonLink:gameButtonLink,gameImageLink:gameImageLink,userLink:userLink,playNowLink:playNowLink,shockwaveLink:shockwaveLink}};this.generateDefaultMessage=function(localGameKeyword,inviteType){var customMessage="";var typeShort="lnk";if("gamepageInvite"==inviteType){customMessage="{user_link} is playing {game_link} on {shockwave_link} and wants you to play, too! {game_description} {cmon_play_now_link}";typeShort="gpi"}if("gamepageChallenge"==inviteType){customMessage="{user_link} is playing {game_link} on {shockwave_link} and is challenging you to play to beat their score! {game_description} Try to beat {user_link}'s score! {play_now_link}";typeShort="gpc"}if("overlayChallenge"==inviteType){customMessage="{user_link} is playing {game_link} on {shockwave_link} and wants you to play, too! {user_link}'s high score is: {high_score}. Think you can beat it?  {play_now_link}";typeShort="olc"}if("friendInvite"==inviteType){customMessage="{user_link} would like to become your friend on {shockwave_com_link} where you can play puzzle, racing, and brain games for free. Add {user_link} as a friend! and be automatically added to {user_link}'s Friends list on {shockwave_com_link}";typeShort="fri"}return{message:customMessage,typeShort:typeShort}};this.parseMessage=function(localGameKeyword,inviteType,inviteTypeShort,customMessage,highScore,httpParams){var swMemberId=$("#swMemberId").html();var swMemberName=$("#swMemberName").html();var swFirstName=$("#swFirstName").html();var swLastName=$("#swLastName").html();if(swFirstName.length==0){swFirstName=swMemberName}var links=this.getLinks(inviteType,"",swMemberName,httpParams);var keywordLinkAppend="";if(localGameKeyword!=""){keywordLinkAppend="_"+localGameKeyword}if(typeof isFacebookConnected!="undefined"&&isFacebookConnected){swFirstName=$("#fbFacebookFirstName").html()}if(typeof inviteType=="undefined"){inviteType="friendInvite"}var typeShort="lnk";var userLink="<a href='"+links.userLink+"'>"+swFirstName+"</a>";var gameLink="<a href='"+links.gameLink+"'>"+gameTitle+"</a>";var playNowLink="<a href='"+links.playNowLink+"'>Play Now!</a>";var cmonPlayNowLink="<a href='"+links.playNowLink+"'>Check it out! C'mon Play Now!</a>";var shockwaveLink="<a href='"+links.shockwaveLink+"'>Shockwave</a>";var shockwaveComLink="<a href='"+links.shockwaveLink+"'>Shockwave.com</a>";customMessage=customMessage.replace(/\{user_link\}/g,userLink);customMessage=customMessage.replace(/\{game_link\}/g,gameLink);customMessage=customMessage.replace(/\{shockwave_link\}/g,shockwaveLink);customMessage=customMessage.replace(/\{shockwave_com_link\}/g,shockwaveComLink);customMessage=customMessage.replace(/\{game_description\}/g,myGameDescription);customMessage=customMessage.replace(/\{cmon_play_now_link\}/g,cmonPlayNowLink);customMessage=customMessage.replace(/\{play_now_link\}/g,playNowLink);customMessage=customMessage.replace(/\{high_score\}/g,highScore);customMessage=customMessage.replace(/\{type\}/g,inviteTypeShort);var facebookMessage="";if(typeof isFacebookConnected!="undefined"&&isFacebookConnected){var facebookButtonUrl=links.gameButtonLink;var facebookButton="<fb:req-choice url='"+facebookButtonUrl+"' label='Go to Shockwave' />";facebookButton=facebookButton.replace(/\{type\}/g,typeShort);facebookMessage=customMessage+" "+facebookButton}return{message:customMessage,facebookMessage:facebookMessage}};this.inviteFriendDialog=function(options){if(typeof (options)=="undefined"){options=this.options}var httpParams=getHttpParamsFromParams(options.customParams);var links=this.getLinks(options.inviteType,options.shareCode,"",httpParams);if(typeof options.limitParam!="undefined"&&options.limitParam!=null&&options.limitParam==0){options.limitParam=null}options.giftImageUrl=links.gameImage;this.options=options;var urlBase=getWindowUrlBase();if("gameNextMove"==options.inviteType){$.post("/member/sendInviteMail.jsp",{personalMessage:options.description,inviteType:options.inviteType,invitesLimit:options.limitParam,customInviteParams:options.customParams});return }if(userInfo.signedInStateCode=="NSI"){showStaticSignIn(inviteFriendDialogCallback);return }var localGameKeyword=gameKeyword;var highScore=typeof (bestScore)!="undefined"?bestScore:"";var cm=options.description;var cmForShockwave="";var typeShort="lnk";var passCm=false;if(cm&&cm.length>0){if("chess-rivals"==localGameKeyword){cm="A Chess Rivals challenge from {user_link} - "+cm}passCm=true}else{var res=this.generateDefaultMessage(localGameKeyword,options.inviteType);typeShort=res.typeShort;cm=res.message}if(passCm){cmForShockwave=cm}var customImageUrl="";var customImageLinkUrl="";var customTitle="";if(options.shareCode&&options.shareCode.length>0){customImageUrl=links.gameImage;customTitle=options.title}if(!(options.inviteType&&options.inviteType.length>0)){options.inviteType="friendInvite"}if(options.limitParam){options.invitesLimit=options.limitParam}var inviteParams="?m="+cmForShockwave+"&t="+((typeof options.inviteType!="undefined"&&options.inviteType!=null)?options.inviteType:"")+"&l="+((typeof options.invitesLimit!="undefined"&&options.invitesLimit!=null)?options.invitesLimit:"")+"&ci="+customImageUrl+"&ct="+customTitle+"&p="+((typeof options.customParams!="undefined"&&options.customParams!=null)?escape(options.customParams):"")+"&giftUuid="+options.uuid+"&giftName="+options.giftName+"&giftCode="+options.shareCode;var requestUrl="/ajax/inviteFriendsFormPod.jsp"+inviteParams;var myObj=this;showAjaxMessage(requestUrl,"#inviteFriend",true,760,null,null,null,function(){var cmRes=myObj.parseMessage(localGameKeyword,options.inviteType,typeShort,cm,highScore,httpParams);$("#isShockwaveFriends").val("false");inviteSWFriends.init(options.limitParam);$(".dimmerBtnClose, .hideMessageBtn").bind("click",function(){callShowInviteCallback(options.callbackFunction,"cancelled")});$(".facebookSignInFromInviteForm").bind("click",function(){hideMessage();facebookConnectLink(inviteFriendDialogCallback);btg.Controller.sendLinkEvent("fbc_btn_mysw_friends_invite");return false});$(".inviteFriendMultiSelect").unbind("mouseover");$(".inviteFriendMultiSelect").bind("mouseover",function(){inviteSWFriends.highlightElement($(this))});$(".inviteFriendMultiSelect").live("mouseout",function(){$(this).removeClass("inviteFriendMultiHighlight")});if(options.inviteType==="friendInvite"){$("#inviteShockwaveFriendTab").remove();$("#comm-2").remove()}$("#challengeFriend").tabs();if(typeof isFacebookConnected!="undefined"&&isFacebookConnected){var facebookInviteLimit=$("#fbFacebookInviteLimit").html();var redirectPage=urlBase+options.redirectUri;var excludeList="";if(myObj.users){for(i=0;i<myObj.users.length;i++){if(myObj.users[i].source=="Facebook"){if(excludeList.length>0){excludeList=excludeList+","}else{excludeList=' exclude_ids="'}excludeList=excludeList+myObj.users[i].reference}}if(excludeList.length>0){excludeList=excludeList+'"'}}var fbml='<fb:fbml><fb:request-form id="fbRequestForm" method="POST" action="'+redirectPage+'" invite="true" type="Shockwave" content="'+cmRes.facebookMessage+'" target="_self"><input type="hidden" name="inviteType" value="'+options.inviteType+'"/><input type="hidden" name="shareCode" value="'+options.shareCode+'"/><input type="hidden" name="giftUuid" value="'+options.giftUuid+'"/><input type="hidden" name="gameKeyword" value="'+localGameKeyword+'"/><fb:multi-friend-selector '+facebookInviteLimit+excludeList+' showborder="false" rows="2" cols="4" bypass="cancel" email_invite="false" actiontext="Send Shockwave Friend Invitation" import_external_friends="false" target="_self"/></fb:request-form></fb:fbml>';$("#fbFriendsContainer").html('<fb:serverfbml id="fbFriends" width="660"></fb:serverfbml>');var new_elm=$("<script>");new_elm.attr("type","text/fbml");new_elm.attr("text",fbml);$("#fbFriends").html(new_elm);FB.XFBML.parse(document.getElementById("fbFriendsContainer"),function(){$("#fbFriendsContainer").find("iframe").load(function(){var json=readCookie("facebookRecipients");var jsonObject="success";if(json&&json.length>0){if(json.substring(0,1)=='"'){json=json.slice(1,json.length-1)}json=json.replace(/\\/g,"");jsonObject=eval("("+json+")");var gameKeywordAppend="";if(gameKeyword){gameKeywordAppend="_"+gameKeyword}var linkEvent="inv_out_fb_"+options.inviteType+gameKeywordAppend;btg.Controller.sendLinkEvent(linkEvent)}hideMessage();callShowInviteCallback(options.callback,jsonObject)})})}var previewTextUrl="/member/inviteCopy.jsp?inviteType="+options.inviteType;if(options.inviteType!=="friendInvite"){previewTextUrl=previewTextUrl+"&gameKeyword="+localGameKeyword}if(options.giftCode!==""){previewTextUrl=previewTextUrl+"&giftCode="+options.giftCode}if(highScore!==""){previewTextUrl=previewTextUrl+"&bestScore="+highScore}if(customImageUrl!==""){previewTextUrl=previewTextUrl+"&customImageUrl="+customImageUrl}if(customImageLinkUrl!==""){previewTextUrl=previewTextUrl+"&customImageLinkUrl="+customImageLinkUrl}if(customTitle!==""){previewTextUrl=previewTextUrl+"&customTitle="+customTitle}if(cmForShockwave!==""){previewTextUrl=previewTextUrl+"&customMessage="+cmForShockwave}$.get(previewTextUrl,function(data){$(".invitePreviewText").html(data)})})};this.facebookShareGame=function(shareCode,title,description,callback,customParams){var myObj=this;FB.getLoginStatus(function(response){if(response.authResponse){myObj.facebookShareGameReturn(shareCode,title,description,callback,customParams)}else{showAjaxMessage("/ajax/facebookConfirmNSIPod.jsp","#facebookConfirmNSIPopup",false,"340","","","",function(){$("#facebookConfirmPopupButton").click(function(){hideMessage();facebookPopupOpened();FB.login(function(response){if(response.authResponse){clickFacebookConnect(function(){hideFlashObjects();notifyServiceManager("LOGIN")});myObj.facebookShareGameReturn(shareCode,title,description,callback,customParams)}else{callShowInviteCallback(callback,"cancelled");facebookPopupClosed()}},false)});$(".dimmerBtnClose").click(function(){callShowInviteCallback(callback,"cancelled");hideMessage();return false})})}})};this.facebookShareGameReturn=function(shareCode,title,description,callback,customParams){facebookPopupOpened();var httpParams=getHttpParamsFromParams(customParams);var links=this.getLinks("post",shareCode,"",httpParams);var imageUrl=links.gameImage;var imageLinkUrl=links.gameImageLink;var linkUrl=links.gameLink;var attachment={media:[{type:"image",src:imageUrl,href:imageLinkUrl}],name:title,description:description,href:linkUrl};var actionLinks=[{text:"Play Now",href:linkUrl}];var json={method:"stream.publish",message:"",attachment:attachment,action_links:actionLinks,user_prompt_message:prompt};FB.ui(json,function(response){if(response&&response.post_id){var customLink="fbc_share_prompt_"+gameID+"_"+shareCode;var omniVars={events:"event22",prop12:customLink};sendCustomLinkEvent(customLink,omniVars);callShowInviteCallback(callback,"success");facebookPopupClosed()}else{callShowInviteCallback(callback,"cancelled");facebookPopupClosed()}})}};function notifyServiceManager(C,B){var A=getFlashObject();A.notifyServiceManager(C,B)}function getFlashObject(){var flashId="FlashContent";if(!jQuery.support.opacity){return document.getElementById(flashId)}else{return eval("document."+flashId)}};
