if(typeof KIDS=="undefined"||!KIDS){var KIDS={}
}KIDS.IS_DEV=(window.location.hostname.indexOf("localhost")>=0||window.location.hostname.indexOf("d.mtvi.com")>0||window.location.port==9090);
KIDS.IS_QA=window.location.hostname.indexOf("q.mtvi.com")>0;
KIDS.IS_DEV_ENV=KIDS.IS_DEV||KIDS.IS_QA;
KIDS.IS_LIVE=!KIDS.IS_DEV_ENV;
KIDS.IS_DEBUG=KIDS.IS_DEV_ENV&&window&&typeof window.console!=="undefined";
KIDS.namespace=function(e,c){c=c==null?KIDS:c;
var b=e,k=null,g,f,h;
h=e.split(".");
k=c;
for(f=(h[0]==c)?1:0;
f<h.length;
f++){k[h[f]]=k[h[f]]||{};
k=k[h[f]]
}return k
};
KIDS.namespace("utils",KIDS);
KIDS.utils.URL_DEV_NICK="www.nick-d.mtvi.com";
KIDS.utils.URL_QA_NICK="www.nick-q.mtvi.com";
KIDS.utils.URL_LIVE_NICK="www.nick.com";
KIDS.utils.URL_DEV_NICK_GAMES="games.nick-d.mtvi.com";
KIDS.utils.URL_QA_NICK_GAMES="games.nick-q.mtvi.com";
KIDS.utils.URL_LIVE_NICK_GAMES="games.nick.com";
KIDS.utils.isEmptyString=function(a){return a==null||a==undefined||a==""||a==="undefined"||a=="null"
};
KIDS.utils.trim=function(a){return a==null?"":a.replace(/^\s+|\s+$/g,"")
};
KIDS.utils.isValidEmail=function(b){if(KIDS.utils.isEmptyString(b)){return false
}var a=/^([a-z0-9_\-\.%])+\@([A-Za-z0-9_\-\.])+\.([a-z]{2,4})$/i;
return a.test(b)
};
KIDS.utils.getCookie=function(c){if(KIDS.utils.isEmptyString(c)){return null
}var a=document.cookie.toString();
if(a.length>0){var d=a.indexOf(c+"=");
if(d!=-1){d+=c.length+1;
var b=a.indexOf(";",d);
if(b==-1){b=a.length
}return unescape(a.substring(d,b))
}}return null
};
KIDS.utils.getDomain=function(){return window.location.hostname
};
KIDS.utils.getNickDomain=function(){if(KIDS.IS_LIVE){return KIDS.utils.URL_LIVE_NICK
}else{if(KIDS.IS_QA){return KIDS.utils.URL_QA_NICK
}else{return KIDS.utils.URL_DEV_NICK
}}};
KIDS.utils.getNickGamesDomain=function(){if(KIDS.IS_LIVE){return KIDS.utils.URL_LIVE_NICK_GAMES
}else{if(KIDS.IS_QA){return KIDS.utils.URL_QA_NICK_GAMES
}else{return KIDS.utils.URL_DEV_NICK_GAMES
}}};
KIDS.utils.getQueryString=function(c){if(c==null){return""
}var a="";
for(var b in c){if(!b||!c[b]){continue
}if(a!=""){a+="&"
}a+=b+"="+escape(c[b])
}return a
};
KIDS.utils.getGdcXml=function(d,c){var b='<answers collectionID="'+d+'">';
for(var a in c){b+='<answer tag="'+a+'"><![CDATA['+c[a]+"]]></answer>"
}b+="</answers>";
return b
};
KIDS.utils.getSwf=function(a){if(navigator.appName.indexOf("Microsoft")!=-1){return window[a]
}else{if(document[a]!=null&&document[a].length!=undefined){return document[a][1]
}return document[a]
}};
KIDS.utils.trimArray=function(a,c){if(a==null){return null
}for(var b=0;
b<a.length;
b++){a[b]=c?a[b].toLowerCase():a[b];
a[b]=KIDS.utils.trim(a[b])
}return a
};
KIDS.utils.getParameter=function(b){var d=document.location.search;
if(KIDS.utils.isEmptyString(d)){return null
}d=d.substring(1);
d=d.split("&");
var a=null;
for(var c=0;
c<d.length;
c++){a=d[c].split("=");
if(a!=null&&a[0]==b){return a[1]
}}return null
};
KIDS.utils.getUrlParts=function(b){var a=b.replace("//","/").split("/");
return a
};
KIDS.utils.getUrlPath=function(c){var b=KIDS.utils.getUrlParts(c);
var d;
if(c.indexOf("http://")>-1){d=b.splice(0,2).join("/")
}var a=b.join("/");
return a
};
KIDS.utils.getContextPath=function(a,b,e,f){var d=getUrlPath(a);
if(e&&d.lastIndexOf(".")>=0){d=d.substring(0,d.lastIndexOf("."))
}b=b==null||b==""?"":b;
var c=new RegExp("^"+b+"/","i");
d=d.replace(c,"");
if(f){d=d.replace(/\/index$/i,"")
}d=d.replace(/\/$/,"");
if(d.indexOf("/")>=0){d=d.replace(/\/$/,"")
}if(d==""){d="hub"
}d=b+"_"+d;
return d
};
KIDS.properties=null;
KIDS.add=function(a,b){if(a==null||a==""){return
}if(KIDS.properties==null){KIDS.properties={}
}KIDS.properties[a]=b
};
KIDS.get=function(a){if(a==null||a==""){return null
}if(KIDS.properties==null){return null
}return KIDS.properties[a]
};
KIDS.utils.printObj=function(c){if(!c){NickLog.debug(">PrintObj: ["+c+"] -"+typeof(c))
}NickLog.debug(">PrintObj: type: "+typeof(c));
if(typeof(c)!="object"){return
}for(var b in c){try{NickLog.debug(">PrintObj: key: "+b+" | "+c[b])
}catch(a){NickLog.debug(">PrintObj: error: "+b+" | "+a)
}}};
KIDS.utils.doLog=function(a){NickLog.debug(a,false,arguments)
};
KIDS.utils.isNumeric=function(c){var b=true;
try{b=!isNaN(parseFloat(c))&&isFinite(c)
}catch(a){b=false
}return b
};
KIDS.utils.parseInt=function(c){var a=-1;
try{a=!isNaN(parseInt(c))&&isFinite(c)?parseFloat(c):-1
}catch(b){a=-1
}return a
};
KIDS.utils.parseFloat=function(c){var a=-1;
try{a=!isNaN(parseFloat(c))&&isFinite(c)?parseFloat(c):-1
}catch(b){a=-1
}return a
};
KIDS.utils.openBumper=function(a,e,h,b,g,f,d,c){NickLog.warn("openBumper: site specific override missing!");
window.open(e)
};
if(typeof NICK=="undefined"||!NICK){var NICK={}
}NICK.namespace=function(a){KIDS.namespace(a,NICK)
};
NICK.namespace("utils",NICK);
NICK.utils.isEmptyString=KIDS.utils.isEmptyString;
NICK.utils.trim=KIDS.utils.trim;
NICK.utils.getCookie=KIDS.utils.getCookie;
NICK.utils.getDomain=KIDS.utils.getDomain;
NICK.utils.printObj=KIDS.utils.printObj;
NICK.utils.getQueryString=KIDS.utils.getQueryString;
NICK.utils.getGdcXml=KIDS.utils.getGdcXml;
NICK.utils.getSwf=KIDS.utils.getSwf;
NICK.utils.thisMovie=KIDS.utils.getSwf;
NICK.utils.trimArray=KIDS.utils.trimArray;
NICK.utils.getUrlParts=KIDS.utils.getUrlParts;
NICK.utils.getUrlPath=KIDS.utils.getUrlPath;
NICK.utils.getContextPath=KIDS.utils.getContextPath;
NICK.add=KIDS.add;
NICK.get=KIDS.get;
NICK.utils.getNickDomain=KIDS.utils.getNickDomain;
NICK.IS_DEV=KIDS.IS_DEV;
NICK.IS_QA=KIDS.IS_QA;
NICK.IS_DEV_ENV=KIDS.IS_DEV_ENV;
NICK.IS_LIVE=KIDS.IS_LIVE;
NICK.IS_DEBUG=NICK.IS_DEV_ENV&&window&&typeof window.console!="undefined";
NICK.utils.URL_DEV_NICK=KIDS.utils.URL_DEV_NICK;
NICK.utils.URL_QA_NICK=KIDS.utils.URL_QA_NICK;
NICK.utils.URL_LIVE_NICK=KIDS.utils.URL_LIVE_NICK;
NICK.utils.URL_SPRING_NICK="spring.nick.com";
NICK.utils.URL_MTVN_D="nick.mtvnimages-d.mtvi.com";
NICK.utils.URL_MTVN_Q="nick.mtvnimages-q.mtvi.com";
NICK.utils.URL_MTVN_L="nick.mtvnimages.com";
NICK.utils.URL_MTVN=null;
NICK.utils.initMtvnImageUrl=function(){var a=document.location.href;
var b=NICK.utils.getUrlParts(a);
if(b[1]=="localhost:9090"){b[1]=NICK.utils.URL_DEV_NICK
}switch(b[1]){case NICK.utils.URL_DEV_NICK:NICK.utils.URL_MTVN=NICK.utils.URL_MTVN_D;
break;
case NICK.utils.URL_QA_NICK:NICK.utils.URL_MTVN=NICK.utils.URL_MTVN_Q;
break;
default:NICK.utils.URL_MTVN=NICK.utils.URL_MTVN_L
}};
NICK.utils.getImage=function(b,c,a){c=c||null;
a=a||null;
return NICK.utils.getMtvnImageUrl(b,c,a)
};
NICK.utils.getMtvnImageUrl=function(d,b,a){if(NICK.utils.isEmptyString(NICK.utils.URL_MTVN)){NICK.utils.initMtvnImageUrl()
}var c=NICK.utils.getUrlPath(d);
c=c!=null&&c.indexOf("/")==0?c:"/"+c;
if(b){c+="?height="+b
}if(a&&!b){c+="?"
}else{if(a){c+="&"
}}if(a){c+="width="+a
}return"http://"+NICK.utils.URL_MTVN+c
};
NICK.utils.getStageDomain=function(){if(KIDS.IS_LIVE){return".com"
}if(KIDS.IS_QA){return"-q.mtvi.com"
}if(KIDS.IS_DEV){return"-d.mtvi.com"
}};
NICK.utils.getStageString=function(b,c,a){if(KIDS.IS_LIVE){return a
}if(KIDS.IS_QA){return c
}if(KIDS.IS_DEV){return b
}};
NICK.utils.doLog=function(a){NickLog.debug(a,false,arguments)
};
NICK.utils.getUsername=function(){return NICK.utils.getCookie("loggedInScreenName")
};
getUsername=NICK.utils.getUsername;
NICK.utils.getSessionId=function(){return NICK.utils.getCookie("JSESSIONID")
};
getSessionId=NICK.utils.getSessionId;
NICK.utils.hideElement=function(a){if(!a||!$(a)){return
}$(a).setStyle("visibility","hidden")
};
NICK.utils.showElement=function(a){if(!a||!$(a)){return
}$(a).setStyle("visibility","visible");
if($(a).getStyle("display")=="none"){$(a).setStyle("display","block")
}};
NICK.utils.toggleButton=function(b,a){if(!$(b)){return
}$(b).set("disabled",!a)
};
NICK.utils.validateDivIds=function(){if(!NICK.IS_DEBUG){return
}var d=new Object();
var b=document.getElementsByTagName("div");
for(var a=0;
a<b.length;
a++){if(b[a].id==null||b[a].id==""||b[a].id=="FLASH_AD"){continue
}if(d[b[a].id]!=null){NickLog.warn("Duplicate element ID found: ["+b[a].id+"]")
}d[b[a].id]=b[a].id
}var c=document.getElementsByTagName("object");
for(var a=0;
a<c.length;
a++){if(c[a].id==null||c[a].id==""||c[a].id=="FLASH_AD"){continue
}if(d[c[a].id]!=null){NickLog.warn("Duplicate element ID found: ["+c[a].id+"]")
}d[c[a].id]=c[a].id
}};
NICK.utils.doBookmark=function(){var b="Nick.com";
var a="http://www.nick.com";
if(document.all){window.external.AddFavorite(a,b)
}else{if(window.sidebar){window.sidebar.addPanel(b,a,"")
}else{if(window.sidebar&&window.sidebar.addPanel){window.sidebar.addPanel(b,a,"")
}}}};
NICK.utils.initTooltip=function(){$(".with-nick-tooltip").unbind("mouseenter").unbind("mouseleave");
$(".with-nick-tooltip").tooltip({contentSelector:".tooltip-content",id:"nick-tooltip",allowAccess:false,followMouse:true,lockTo:"side",lockToElement:"img:first",offsetX:-13})
};
NICK.utils.addTooltip=function(){};
NICK.utils.openNewBumper=function(a,b){NICK.utils.openBumper(a,b,null,null,null,true)
};
NICK.utils.openBumper=function(h,d,c,f,l,j,m,k){var i="http://www.nick.com/common/bumpers/bumperFrameset.jhtml?";
if(NICK.config.SITE_NAME=="nicktoons"){var e="http://www.nick.com/common/bumpers/fullpage/nicktoons.jhtml?"
}else{if(NICK.config.SITE_NAME=="nickatnite"){var e="http://www.nick.com/common/bumpers/fullpage/nickatnite.jhtml?"
}else{if(NICK.config.SITE_NAME=="teennick"){var e="http://www.teennick.com/common/bumpers/fullpage/teennick.html?"
}else{var e="http://www.nick.com/common/bumpers/fullpage/index.jhtml?"
}}}var b="wBumper";
var a="advertiser";
c=c!=null&&c;
m=m==undefined?true:m;
switch(h){case"external":i="http://www.nick.com/common/bumpers/go.jhtml?";
i+=f==null?"":("bumper="+escape(f)+"&");
i+=l==null?"":("bumperHeight="+l+"&");
i+=m==undefined?"":("isInHouse="+m+"&");
a="destination";
break;
case"fullPage":i=e;
a="destination";
break;
case"paysite":break;
case"grown-ups":break;
case"launchpad":break;
case"ag":break;
case"sponsor":break;
case"full-redirect":i="/utils/bumper/half-page.html?";
break;
default:h="sponsor";
break
}var g=i+b+"="+h+"&"+a+"="+escape(d);
if(c){g+="&onair_landing=true"
}if(c&&h=="external"){g=e+a+"="+escape(g)
}if(j){window.open(g,"bumper","status=1,scrollbars=1,location=1,resizable=1,toolbar=1,menubar=1")
}else{window.location.href=g
}};
NICK.utils.wrapOPABanner=function(){};
NICK.utils.displayScreenShot=function(){};
KIDS.utils.openBumper=NICK.utils.openBumper;
NICK.utils.hideSwfs=function(a){if(a){a=a+" "
}else{a=""
}$(a+".swf").not(".swfnohide").find("> *").each(function(){obj=$(this);
obj.css("visibility","hidden")
})
};
NICK.utils.showSwfs=function(a){if(a){a=a+" "
}else{a=""
}$(a+".swf > *").each(function(){obj=$(this);
obj.css("visibility","visible")
})
};
NICK.utils.initComcast=function(){if(typeof projX==="undefined"||!projX){NICK.utils.doLog("NICK.utils.initComcast: projX not found");
return
}NICK.utils.doLog("NICK.utils.initComcast:3: overriding functions");
projX.displayEventPre=function(){NICK.utils.doLog("NICK.utils.initComcast: hide swfs");
NICK.utils.hideSwfs();
return true
};
projX.closeEvent=function(){NICK.utils.doLog("NICK.utils.initComcast: close overlay");
NICK.utils.showSwfs()
}
};
doSwfEmbedCompleteNick=function(a){if(a==null||a.id=="GamePlayer"){return
}var b=document.getElementById("projxalert");
if(b==null||b.style.display=="none"){return
}KIDS.utils.doLog("doSwfObjectEmbed (nick override): alert found: hiding swfs");
NICK.utils.hideSwfs()
};
NICK.utils.openOverlay=function(){NICK.utils.doLog("NICK.utils.openOverlay(): Deprecated. Use: NICK.overlay.open().")
};
NICK.utils.closeOverlay=function(){NICK.utils.doLog("NICK.utils.closeOverlay(): Deprecated. Use: NICK.overlay.close().")
};
NICK.utils.initAdFreePage=function(){if(KIDS.get("adfree")!=="true"){return
}$("a").not(".nick-overlay").not(".no-adfree").not(".o_popup_close").not("[href^=javascript]").bind("click",NICK.utils.doBumperOverride);
$(".brand-mamabar-more-list .bumper").remove()
};
NICK.utils.initAdFreeLinks=function(){NICK.utils.initAdFreePage();
$("#top-menu a").bind("click",NICK.utils.doBumperOverride);
$("#page-menu a").bind("click",NICK.utils.doBumperOverride);
$("#submenu-wrapper a").bind("click",NICK.utils.doBumperOverride);
if($(".nick-footer-siteblock")){$(".nick-footer-siteblock a").bind("click",NICK.utils.doBumperOverrideNewWin);
$(".nick-footer-text a").bind("click",NICK.utils.doBumperOverride);
$(".nick-footer-menu a").bind("click",NICK.utils.doBumperOverride)
}$("#carousel-more-games-carousel a").live("click",NICK.utils.doBumperOverride);
$(".UserCommentCollection a").live("click",NICK.utils.doBumperOverride)
};
NICK.utils.initExternalLinks=function(){if($.browser.msie&&$.browser.version==="7.0"){$("a[href^='http']").each(function(){var a=$(this);
if(a.attr("href").indexOf(window.location.hostname)===-1){a.attr("target","_blank")
}})
}else{$("a[href^='http']").attr("target","_blank")
}};
NICK.utils.initAGLinks=function(){$("a[href^='http://www.addictinggames.com']").bind("click",NICK.utils.doAGBumperOverride)
};
NICK.utils.doAGBumperOverride=function(a){NICK.utils.openBumper("ag",this.href,null,null,null,true);
return false
};
NICK.utils.doBumperOverride=function(a){NICK.utils.openBumper("fullPage",this.href,null,null,null,false);
return false
};
NICK.utils.doBumperOverrideNewWin=function(a){NICK.utils.openBumper("fullPage",this.href,null,null,null,true);
return false
};
NICK.utils.random=function(a){return Math.floor(a*(Math.random()%1))
};
NICK.utils.randomBetween=function(b,a){return b+NICK.utils.random(a-b+1)
};
NICK.utils.getNoRepeatRandoms=function(d,c){var b=new Array();
var d=Math.min(d,c);
while(b.length<d){var f=NICK.utils.randomBetween(0,c);
var e=false;
for(var a=0;
a<b.length;
a++){if(b[a]==f){e=true
}}if(e==false){b.push(f)
}}return b
};
NICK.utils.timezone=function(){var i=new Date();
var b=new Date(i.getFullYear(),0,1,0,0,0,0);
var g=new Date(i.getFullYear(),6,1,0,0,0,0);
var h=b.toGMTString();
var j=new Date(h.substring(0,h.lastIndexOf(" ")-1));
h=g.toGMTString();
var f=new Date(h.substring(0,h.lastIndexOf(" ")-1));
var e=(b-j)/(1000*60*60);
var d=(g-f)/(1000*60*60);
var c;
if(e==d){c="0"
}else{var a=e-d;
if(a>=0){e=d
}c="1"
}return e
};
NICK.utils.getTimezone=function(){if(NICK.utils.timezone()==-8){return"west"
}else{return"east"
}};
NICK.utils.getTimezoneKCA=function(){return"east"
};
NICK.utils.goMyNick=function(a){if(KIDS.get("adfree")==="true"){NICK.utils.openBumper("fullPage",a,null,null,null,false)
}else{document.location.href=a
}};
NICK.utils.setCookie=function(a,b){this.setCookie2(a,b,"","","","")
};
NICK.utils.setCookie2=function(c,e,a,g,d,f){var b=c+"="+escape(e)+((a)?"; expires="+a.toGMTString():"")+((g)?"; path="+g:"")+((d)?"; domain="+d:"")+((f)?"; secure":"");
document.cookie=b
};
NICK.utils.getUUID=function(){var a=NICK.utils.getCookie("NICK_UUID");
if(a==null){a=NICK.utils.generateUUID();
NICK.utils.setCookie2("NICK_UUID",a,new Date((new Date).getTime()+(1000*60*60*24*365)))
}return a
};
NICK.utils.generateUUID=function(a,d){var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),c=[],b;
d=d||f.length;
if(a){for(b=0;
b<a;
b++){c[b]=f[0|Math.random()*d]
}}else{var e;
c[8]=c[13]=c[18]=c[23]="-";
c[14]="4";
for(b=0;
b<36;
b++){if(!c[b]){e=0|Math.random()*16;
c[b]=f[(b==19)?(e&3)|8:e]
}}}return c.join("")
};
NICK.utils.containsSpaces=function(a){return(a.search(/\s/g)!==-1)?true:false
};
NICK.utils.relativeDate=function(c){var b=c;
if(typeof c==="string"){c=new Date(c)
}if(isNaN(c.getTime())===true){return b
}var h={suffixPast:"ago",suffixFuture:"from now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years"};
var a=c.getTime()-new Date().getTime();
var j=a<=0?h.suffixPast:h.suffixFuture;
a=Math.abs(a);
var g=a/1000;
var d=g/60;
var f=d/60;
var i=f/24;
var e=i/365;
if(g<45){b=h.seconds
}else{if(g<90){b=h.minute
}else{if(d<45){b=h.minutes;
b=b.replace(/%d/i,Math.round(d))
}else{if(d<90){b=h.hour
}else{if(f<24){b=h.hours;
b=b.replace(/%d/i,Math.round(f))
}else{if(f<48){b=h.day
}else{if(i<30){b=h.days;
b=b.replace(/%d/i,Math.floor(i))
}else{if(i<60){b=h.month
}else{if(i<365){b=h.months;
b=b.replace(/%d/i,Math.floor(i/30))
}else{if(e<2){b=h.year
}else{b=h.years;
b=b.replace(/%d/i,Math.floor(e))
}}}}}}}}}}return b+" "+j
};
NICK.utils.addCommas=function(c){var d=Number(c).toString();
var e="";
if(d.indexOf(".")!==-1){var b=d.split(".");
if(b.length===2){e="."+b[1];
d=d.replace(e,"")
}}var a=/(\d+)(\d{3})/;
while(a.test(d)){d=d.replace(a,"$1,$2")
}return d+e
};
if(typeof NICK=="undefined"||!NICK){var NICK={}
}NICK.namespace("config");
NICK.config.URL_COMMENT_POST="http://"+NICK.utils.getNickDomain()+"/xml/gdc_json.jhtml?jsonCallback=?";
NICK.config.IMX_RATE="/api/ratings/1.0/rate";
NICK.config.IMX_PUT="/api/imx/1.0/put";
NICK.config.IMX_VIEW_COUNT="/api/imx/1.0/report";
NICK.config.SITE_NAME="teennick";
NICK.config.CHANNEL_ID="53";
NICK.config.SID_PREPEND="TeenNick__";
var g_overtureCMSource="viacom_the-n_ctxt";
var g_overtureSearchPartner="viacom_teennick_search";
var NICK_LOG_ERROR=0;
var NICK_LOG_WARNING=2;
var NICK_LOG_DEBUG=4;
var NICK_LOG_INFO=8;
var NICK_LOG_FATAL=22;
var NickLog=function(){var f=KIDS&&(KIDS.IS_DEBUG||KIDS.utils.getParameter("_log")=="on");
var d=f&&typeof window.console.log!="undefined";
var a=f&&!!window.console.firebug;
var b=f&&console.log.apply==="function";
function e(h){var g=h.callee.caller;
var i=[];
while(g!=null){var j=g.name||c(g.toString());
if(j.length!==0){i.push(j)
}g=g.caller
}return"["+i.reverse().join(" -> ")+"]"
}function c(g){var h=/function\s*([\w\-$]+)?\s*\(/i;
return h.test(g)?RegExp.$1:""
}return{addMessage:function(j,i,g,h){if(!f){return
}if(a){var k;
switch(i){case NICK_LOG_FATAL:j="[FATAL]: "+j;
case NICK_LOG_ERROR:k="error";
break;
case NICK_LOG_WARNING:k="warn";
break;
case NICK_LOG_INFO:k="info";
break;
default:k="log"
}console[k](j+"\t%o",h.callee.caller);
if(g===true){console.trace()
}}else{if(d){if(b){window.console.log.apply(window.console,arguments)
}else{console.log(j)
}}}if(g===true&&!b&&!a){console.log("Stack: "+e(h))
}},debug:function(i,g,h){this.addMessage(i,NICK_LOG_DEBUG,g,h||arguments)
},warn:function(g){this.addMessage(g,NICK_LOG_WARNING,false,arguments)
},error:function(g){this.addMessage(g,NICK_LOG_ERROR,false,arguments)
},info:function(g){this.addMessage(g,NICK_LOG_INFO,false,arguments)
},fatal:function(g){this.addMessage(g,NICK_LOG_FATAL,false,arguments)
}}
}();
var NickEvents=function(){var a={};
return{bind:function(b,c){$(document).bind(b,c);
NickLog.info('Bound new method to "'+b+'".')
},trigger:function(b,c){if(a[b]){$(document).trigger(b,c);
a[b].calls++;
NickLog.info('Triggered "'+b+'". ('+a[b].calls+")")
}else{NickLog.warn('Attempting to trigger "'+b+'" when no method has been bound.')
}}}
}();
if(typeof NICK=="undefined"||!NICK){var NICK={}
}NICK.request={lstnrs:{},defaults:{type:"GET",url:null,data:null,dataType:"jsonp",async:true,onSuccess:null,cache:false,onFail:null},messages:{INVALID_RESPONSE:"Invalid reponse",INVALID_URL:"Invalid url requested"},errors:{SERVER:"_ERROR_SERVER",REQUEST:"_ERROR_REQUEST",RESPONSE:"_ERROR_RESPONSE",URL:"_ERROR_URL"},codes:{RESPONSE_OK:"ok",RESPONSE_ERROR:"error"},doRequest:function(a){var b=new NICK.request.NickRequest(a);
b.doRequest()
}};
NICK.request.NickRequest=function(a){this.settings=$.extend({},NICK.request.defaults,a)
};
NICK.request.NickRequest.prototype.sanitizeUrlData=function(){var e=this.settings.url.indexOf("?");
if(e<=0){return
}var d=this.settings.url.substring(e+1);
var c=d.split("&");
var b=null;
for(var a=0;
a<c.length;
a++){b=c[a].split("=");
if(b==null||b[0]==null||b[1]==null){continue
}this.settings.data[b[0]]=b[1]
}this.settings.url=this.settings.url.substring(0,e)
};
NICK.request.NickRequest.prototype.doRequest=function(){this.settings.data=this.settings.data==null?{}:this.settings.data;
if(this.settings.url==null){this.onFail(this.getError(NICK.request.errors.URL,NICK.request.messages.INVALID_URL));
return
}this.sanitizeUrlData();
if(this.settings.dataType=="jsonp"){this.initJsonpHandler()
}else{var b=this;
this.settings.success=function(c){b.doResponse.apply(b,arguments)
};
this.settings.error=function(c){b.doRequestError.apply(b,arguments)
}
}try{$.ajax(this.settings)
}catch(a){NickLog.error("NickRequest: error: "+a);
this.onFail({_ERROR_SERVER:a})
}};
NICK.request.NickRequest.prototype.initJsonpHandler=function(){var b=this;
var a=this.getJsonpKey();
this.settings.jsonpCallback='NICK.request.lstnrs["'+a+'"]';
NICK.request.lstnrs[a]=function(c){this.callback=b;
this.callback.doResponse(c);
NICK.request.lstnrs[a]=undefined;
try{delete NICK.request.lstnrs[a]
}catch(d){}}
};
NICK.request.NickRequest.prototype.getJsonpKey=function(){var a=this.settings.url.replace("http://","");
a=a.replace(/[\.\-/]/g,"");
var b=1;
while(NICK.request.lstnrs[a+b]!=null){b++
}return a+b
};
NICK.request.NickRequest.prototype.doResponse=function(a){switch(this.settings.dataType){case"jsonp":case"json":this.doResponseJson(a);
break;
case"xml":this.doResponseXml(a);
break;
case"html":this.doResponseHtml(a);
break;
default:NickLog.warn(">>NICK.request: No response handler for type: "+this.settings.dataType)
}};
NICK.request.NickRequest.prototype.doResponseJson=function(a){if(a==null){this.onFail(this.getError(NICK.request.errors.RESPONSE,NICK.request.messages.INVALID_RESPONSE))
}else{if(a.code==NICK.request.codes.RESPONSE_OK){this.onSuccess(a)
}else{if(a.code==NICK.request.codes.RESPONSE_ERROR){this.onFail(a.errors)
}else{this.onSuccess(a)
}}}};
NICK.request.NickRequest.prototype.doResponseXml=function(a){if(a==null){this.onFail(this.getError(NICK.request.errors.RESPONSE,NICK.request.messages.INVALID_RESPONSE))
}else{if($(a).find("response").attr("status")==NICK.request.codes.RESPONSE_OK){this.onSuccess(a)
}else{if($(a).find("response").attr("status")==NICK.request.codes.RESPONSE_ERROR){var b={};
$(a).find("error").each(function(){b[$(this).attr("name")]=$(this).text()
});
this.onFail(b)
}}}};
NICK.request.NickRequest.prototype.doResponseHtml=function(a){if(a==null){this.onFail(this.getError(NICK.request.errors.RESPONSE,NICK.request.messages.INVALID_RESPONSE));
return
}else{this.onSuccess(a)
}};
NICK.request.NickRequest.prototype.onFail=function(a){var b=typeof a=="string"?{request:a}:a;
if(this.settings.onFail){this.settings.onFail(b)
}else{NickLog.error("NickRequest: doRequest: Failed: "+a)
}};
NICK.request.NickRequest.prototype.onSuccess=function(a){if(this.settings.onSuccess){this.settings.onSuccess(a)
}else{NickLog.info("NickRequest: doRequest: OK")
}};
NICK.request.NickRequest.prototype.doRequestError=function(c,a,b){this.onFail(this.getError(NICK.request.errors.REQUEST,a))
};
NICK.request.NickRequest.prototype.getError=function(b,c){var a=new Object();
a[b]=c;
return a
};
if(typeof NICK=="undefined"||!NICK){var NICK={}
}NICK.namespace("sendToFriend");
NICK.utils.validateEmail=function(a){return KIDS.utils.isValidEmail(a)
};
NICK.sendToFriend.URL_WORD_FILTER="http://www.nick.com/dynamo/wordfilter/index.jhtml?name=";
NICK.sendToFriend.goodWordsCounter=0;
NICK.sendToFriend.formSubmitting=false;
NICK.sendToFriend.formLoaded=function(){$("#failMsg").hide();
$("#badwordMsg").hide();
$("#bademailMsg").hide();
$("#emailSentMsg").hide();
$("#badnameMsg").hide();
$("#sendToFriendForm").show();
$("#send-to-a-friend div.loadingAnimation").hide()
};
NICK.sendToFriend.validate=function(){$("#failMsg").hide();
$("#badwordMsg").hide();
$("#bademailMsg").hide();
$("#emailSentMsg").hide();
$("#badnameMsg").hide();
$("#send-to-a-friend div.loadingAnimation").show();
$("#send-to-a-friend div.loadingAnimation h4").html("Validating...");
if($("#yourName").attr("value")==""){$("#failMsg").show();
$("#badnameMsg").show();
$("#yourName").removeClass("textboxerror");
$("#yourName").addClass("textboxerror")
}else{$("#yourName").removeClass("textboxwrapper");
$("#yourName").addClass("textboxwrapper")
}if($("#friendsName").attr("value")==""){$("#failMsg").show();
$("#badnameMsg").show();
$("#friendsName").removeClass("textboxerror");
$("#friendsName").addClass("textboxerror")
}else{$("#friendsName").removeClass("textboxerror");
$("#friendsName").addClass("textboxerror")
}if((!NICK.utils.validateEmail($("#friendsEmail").attr("value")))){$("#failMsg").show();
$("#bademailMsg").show();
$("#friendsEmail").removeClass("textboxerror");
$("#friendsEmail").addClass("textboxerror")
}else{$("#friendsEmail").removeClass("textboxerror");
$("#friendsEmail").addClass("textboxerror")
}NICK.sendToFriend.goodWordsCounter=0;
NICK.sendToFriend.checkBadWord($("#yourName"));
NICK.sendToFriend.checkBadWord($("#friendsName"))
};
NICK.sendToFriend.checkBadWord=function(d){var c=d.attr("value");
var a=NICK.utils.getNickDomain();
var b="http://"+a+"/common/wordfilter/json.jhtml";
NICK.request.doRequest({dataType:"jsonp",url:b,data:{v:"1",word:c},onSuccess:function(f){NICK.utils.doLog("Dirty Word Response:"+f.data[0].code);
if(f.data[0].code=="bad"){d.attr("value","");
NICK.sendToFriend.goodWordsCounter=0;
$("#failMsg").css("display","block");
$("#badwordMsg").css("display","block");
$("#send-to-a-friend div.loadingAnimation").hide()
}else{NICK.sendToFriend.goodWordsCounter++;
$("#send-to-a-friend div.loadingAnimation").hide();
if(NICK.sendToFriend.goodWordsCounter==2&&$("#failMsg").css("display")=="none"){NICK.sendToFriend.goodWordsCounter=0;
NICK.sendToFriend.formSubmitting=true;
var i=$("#friendsEmail").val();
var e=$("#yourName").val();
var g=$("#friendsName").val();
var h=window.location;
NICK.sendToFriend.sendEmail(e,g,i,h)
}}},onFail:function(f){for(var e in f){NICK.utils.doLog("Dirty Word Response: Error: "+e+" - "+f[e])
}}})
};
NICK.sendToFriend.sendEmail=function(b,e,g,f){$("#failMsg").hide();
$("#badwordMsg").hide();
$("#bademailMsg").hide();
$("#emailSentMsg").hide();
$("#badnameMsg").hide();
$("#sendToFriendForm").hide();
$("#send-to-a-friend div.loadingAnimation").show();
var d=NICK.utils.getNickDomain();
if(NICK.config.SITE_NAME=="nicktoons"){var a="http://"+d+"/sbcom/data/sendToFriend/send_nicktoons.jhtml"
}else{var a="http://"+d+"/sbcom/data/sendToFriend/send_nick.jhtml"
}var c=$("<div/>").text(f.toString()).html();
if(NICK.sendToFriend.overrideTemplate==undefined){template=NICK.get("type")
}NICK.request.doRequest({dataType:"jsonp",url:a,data:{email:g,senderName:b,friendsName:e,URLpath:c,etype:template,id:NICK.get("cmsId"),domain:window.location.hostname,section:NICK.get("type")},onSuccess:function(h){NICK.utils.doLog("Email Send Success!");
$("#send-to-a-friend div.loadingAnimation").hide();
$("#sentMessage").show().html("Congrats! This has been sent to your friend.")
},onFail:function(i){$("#sentMessage").show().html("There was an error sending your message. Please try again.");
$("#sendToFriendForm").show();
for(var h in i){NICK.utils.doLog("Bad load: Error: "+h+" - "+i[h]);
alert(i[h])
}}})
};
NICK.namespace("search");
NICK.search.validate=function(){var a=KIDS.utils.trim(document.getElementById("search-term").value);
if(a.length<=0){return false
}var b="/search/?term="+escape(a);
if(KIDS.get("adfree")==="true"){NICK.utils.openBumper("fullPage",b,null,null,null,false)
}else{document.location.href=b
}return false
};
$(function(){$("a.bumper, #nick-arcade-bumper a").each(function(){$(this).click(function(b){b.preventDefault();
NICK.utils.openBumper("paysite",$(this).attr("href"));
return false
})
});
$("#global-bar .down-arrow-extra").click(function(){var c=0,b=$(this).parent().parent().next();
if(b.size()>0){var c=b.siblings().andSelf().index(b)
}$(this).parent().parent().parent().animate({top:c*-b.height()},"fast")
});
$("#top-menu-more,#global-sites-more").hover(function(){$(this).addClass("hover")
},function(){$(this).removeClass("hover")
});
if($("#submenu-more").size()>0){$("#submenu-more").click(openMoreSubMenu).children("a").removeClass("active")
}$(".png,h1.icon").supersleight({shim:"/assets/transparent.gif",apply_positioning:false});
$(document).bind("authStatus loggedIn loggedOut",function(){});
var a=function(){NICK.utils.doLog("authStatus: setHeaderStatus:"+NICK.userData.loggedIn+NICK.userData.screenName);
if(NICK.userData.loggedIn=="true"){$(".mynick-noauth").hide();
$(".mynick-auth").show();
var c=NICK.userData.nickName;
var b=0;
var d='<div id="mynick-private">';
d+="<h5><a href='javascript:NICK.club.global.gotoProfile()' class=\"profile\">"+c+"</a></h5>";
d+='<a href="#" onclick="NICK.login.doLogOut();" class="logout">Log Out</a>';
d+="<a href='http://www.nick.com/club/buddies/buddies-request.html'><span id=\"buddyRequestCount\">"+b+"</span></a>";
d+="</div>";
$("#mynick-private").remove();
$("#mynick").append(d)
}else{$(".mynick-auth").hide();
$(".mynick-noauth").show()
}};
if(NICK.get("adfree")=="true"){NICK.utils.initAdFreeLinks()
}});
function openMoreSubMenu(c){c.preventDefault();
var f=$("#submenu-wrapper");
var b=$("#submenu-content");
var d=$("#submenu-more").find("a span");
if(f.hasClass("expanded")){var a="More";
if(d.is(".more-shows")){a="Shows"
}b.slideUp("fast",function(){f.removeClass("expanded")
});
d.text(a);
d.attr("title",a)
}else{f.addClass("expanded");
b.slideDown("fast");
d.text("Close");
d.attr("title","Close")
}}$(document).ready(function(){NICK.utils.doLog("header.js: initLogin!");
$(document).bind("loggedIn",function(){NICK.utils.doLog("header.js: loggedIn")
});
$(document).bind("logInFail",function(){NICK.utils.doLog("header.js: logInFail");
a()
});
var a=function(){$("#loginError").show();
$("#nickLogin").show();
$("#loginLoader").hide()
}
});
function sendLogin(){var a={username:$(".o_popup_login input[name='nickUsername']").val(),password:$(".o_popup_login input[name='nickPassword']").val()};
NICK.login.doLogIn(a)
}$(document).ready(function(){var a=$("#page-btn-shows");
a.children("a:first").click(function(){return false
});
a.hover(function(){$(this).toggleClass("showsActive");
$("ul.submenu").toggleClass("visible")
})
});
if(typeof NICK=="undefined"||!NICK){var NICK={}
}NICK.namespace("pagination");
NICK.pagination.itemOffset=-1;
NICK.pagination.sortOverride="";
NICK.pagination.setItemOffset=function(a){NICK.utils.doLog(">setItemOffSet: "+a);
NICK.pagination.itemOffset=a
};
NICK.pagination.getItemOffset=function(){return NICK.pagination.itemOffset
};
NICK.pagination.goToPage=function(c,a,d,b){NICK.utils.doLog("Pagination!: goToPage: "+d);
d=d==null?"":""+d;
if(NICK.pagination.sortOverride!=""){b=NICK.pagination.sortOverride
}$(document).trigger({type:"pagination_go."+d,page:c,max:a,id:d,sort:b})
};
NICK.pagination.goNext=function(c,a,d,b){NICK.pagination.goToPage(c,a,d,b)
};
NICK.pagination.goPrevious=function(c,a,d,b){NICK.pagination.goToPage(c,a,d,b)
};
NICK.pagination.setSortOverride=function(a){NICK.pagination.sortOverride=a
};
$(document).bind("pagination_go.",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id);
NICK.listings.getDataPages(a.sort,a.page,a.max)
});
$(document).bind("pagination_go.game-browser-pagination",function(b){var c=NICK.pagination.getItemOffset();
if(c<=0){NICK.listings.getDataPages(b.sort,b.page,b.max);
return
}var a=0;
if(b.page==1){a=0
}else{if(b.page<=2){a=c
}else{a=((b.page*b.max-b.max)-c)
}}NICK.utils.doLog("Pagination: "+c+" | "+b.page+" | "+b.max+" | "+a);
NICK.listings.getData(NICK.listings.getUriOverride(),b.sort,a,b.page)
});
$(document).bind("pagination_go.collection-grid-pagination",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id);
NICK.listings.getDataPages(a.sort,a.page,a.max)
});
$(document).bind("pagination_go.collection-grid-paginationfullEpisodeItem",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id);
NICK.listings.getDataPages(a.sort,a.page,a.max,{type:"fullEpisodeItem"})
});
$(document).bind("pagination_go.collection-grid-paginationvideoItem",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id);
NICK.listings.getDataPages(a.sort,a.page,a.max,{type:"videoItem"})
});
$(document).bind("pagination_go.collection-grid-paginationvideoPlaylist",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id);
NICK.listings.getDataPages(a.sort,a.page,a.max,{type:"videoPlaylist"})
});
$(document).bind("pagination_go.collection-grid-all-paginationfullEpisodeItem",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id);
NICK.listings.getDataPages(a.sort,a.page,a.max,{type:"fullEpisodeItem",viewType:"collectionAll"})
});
$(document).bind("pagination_go.collection-grid-all-pagination",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id);
NICK.listings.getDataPages(a.sort,a.page,a.max,{viewType:"collectionAll"})
});
$(document).bind("pagination_go.collection-grid-all-paginationvideoItem",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id);
NICK.listings.getDataPages(a.sort,a.page,a.max,{type:"videoItem",viewType:"collectionAll"})
});
$(document).bind("pagination_go.collection-grid-paginationMovie",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id);
NICK.listings.overrideURI="/videos/movie/";
NICK.listings.getDataPages(a.sort,a.page,a.max)
});
$(document).bind("pagination_go.collection-grid-all-paginationvideoPlaylist",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id);
NICK.listings.getDataPages(a.sort,a.page,a.max,{type:"videoPlaylist",viewType:"collectionAll"})
});
$(document).bind("pagination_go.collection-playlist-all",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id);
NICK.listings.getDataPages(a.sort,a.page,a.max,{type:"videoPlaylist",viewType:"collectionPlaylistAll"})
});
$(document).bind("pagination_go.tag-search-pagination",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id);
l=document.location.href.split("?");
l=l[0];
if(a.page>1){l+="?page="+a.page+"&start="+(a.page-1)*a.max
}document.location.href=l
});
$(document).bind("pagination_go.search-pagination",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id);
l=document.location.href.split("?");
t=l[1].split("&");
t=t[0].split("=");
t=t[1];
getfqterms=l[1].split("&");
fq=0;
for(i=0;
i<getfqterms.length;
i++){fqcheck=getfqterms[i].split("=");
if(fqcheck[0]=="fq"){fq=fqcheck[1]
}}l=l[0];
l+="?term="+t;
if(fq){l+="&fq="+fq
}if(a.page>1){l+="&page="+a.page+"&start="+(a.page-1)*a.max
}document.location.href=l
});
$(document).bind("pagination_go.games-by-show-all-pagination",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id+" | page: "+a.page+" | max: "+a.max);
var b={sort:"",start:(a.page*a.max-a.max),page:a.page};
NICK.request.doRequest({dataType:"html",url:"/ajax/listing-game/games-by-show-all.html",data:b,onSuccess:function(c){$("div.filter-target").html(c)
},onFail:function(d){for(var c in d){NICK.utils.doLog("Sort Response: Error: "+c+" - "+d[c])
}}})
});
$(document).bind("pagination_go.shows-list-pagination",function(a){NICK.utils.doLog("Pagination: event: "+a.type+" | "+a.id+" | page: "+a.page+" | max: "+a.max);
var b={sort:"",start:(a.page*a.max-a.max),page:a.page};
NICK.request.doRequest({dataType:"html",url:"/ajax/listing-video/shows-list.html",data:b,onSuccess:function(c){$("div.filter-target").html(c)
},onFail:function(d){for(var c in d){NICK.utils.doLog("Sort Response: Error: "+c+" - "+d[c])
}}})
});
$(document).bind("pagination_go.comments-pagination",function(a){NICK.utils.doLog("Pagination: Comments event: "+a.type+" | "+a.id+" | page: "+a.page+" | max: "+a.max);
NICK.comments.loadComments(a.type,null,NICK.comments.urlAlias,(a.page*a.max-a.max),20)
});
if(typeof NICK=="undefined"||!NICK){var NICK={}
}NICK.namespace("flux");
NICK.flux={};
NICK.flux.baseURL="http://daapi.flux.com/2.0/00001/JSON/";
NICK.flux.ucid="90C3FFFF01E323B00002FFFFC390";
NICK.flux.location=window.location.href;
NICK.flux.commentsLength=10;
NICK.flux.contributors=Array();
NICK.flux.defaultContributorImage="http://filesll.fluxstatic.com/0000000000000000000100000000/TNV/Jpg/B-15472/AR90x90";
NICK.flux.haloContentUrl="";
NICK.flux.haloContent=false;
$(document).ready(function(){});
NICK.flux.setFBLike=function(){if($("td.flike").length>0){var b=encodeURIComponent(NICK.flux.location)
}};
NICK.flux.getContributors=function(){$.ajax({dataType:"jsonp",url:NICK.flux.baseURL+NICK.flux.ucid+"/feeds/people/members/-/role/contributor/?showOnlyWithPhotos=false",success:function(b){NICK.flux.populateContributors(b.Items)
}})
};
NICK.flux.populateContributors=function(b){for(a=0;
a<b.length;
a++){NICK.flux.contributors[a]=b[a].Title
}$("a.blog_author").each(function(){var c=$(this);
for(a=0;
a<b.length;
a++){if(b[a].Title.toLowerCase()===c.html().toLowerCase()){c.attr("href",b[a].ProfileUrl)
}}})
};
NICK.flux.share=function(c){var b={};
b.contentUri="mgid:cms:item:teennick.com:"+KIDS.get("cmsId");
b.title=" ";
b.template="horizontal";
b.elements=[{id:"Facebook",type:"fblike",layout:"button_count",show_faces:"false",width:"72",action:"like",colorscheme:"light",height:"21"},{id:"Twitter",originalButton:true,urlSettings:{via:"Teennick"}},{id:"MyEmail",title:"email"},{id:"Embed"}];
b.overlayElements=[{id:"EmailTab"},{id:"EmbedTab"}];
Flux4.createWidget("Share",b);
$(".addToMy").find("a").live("click",function(){if(typeof player!=="undefined"&&NICK.videoPlayer.isReady){player.pause()
}});
$("div.share").find("li.myemail").live("click",function(){NICK.utils.hideSwfs();
setTimeout("NICK.flux.closeOverlay()",500)
})
};
NICK.flux.closeOverlay=function(){if($("div.shareOverlay").find(".closeButton").length){$("div.shareOverlay").find(".closeButton").click(function(){NICK.utils.showSwfs()
})
}else{setTimeout("NICK.flux.closeOverlay()",500)
}};
NICK.flux.comments=function(b){Flux4.createWidget("ActivityFeed",{contentId:"mgid:cms:item:teennick.com:"+KIDS.get("cmsId"),maxResults:NICK.flux.commentsLength,activityMap:"disabled",includeTweets:false,enabledFilters:["All","Comments","UserActivity"],showPager:true},function(c){c.onCommented=function(){}
})
};
NICK.flux.contentAction=function(){Flux.createWidget("ContentAction",{contentUri:"mgid:cms:item:teennick.com:"+KIDS.get("cmsId"),layout:"horizontal",size:"small",metricsAsPermalink:false,hideShareToGroup:false,items:[{id:"addToFavorites",title:"Favorite"},{id:"rate",ratingSystem:"thumbsUpDown",title:"Rate it!"},{id:"contentRating",type:"thumbsUpDown",title:{thumbsUpTitle:"",thumbsDownTitle:""}}]},function(b){b.onRated=function(c){}
})
};
NICK.flux.commentsCount=function(b){Flux.createWidget("ContentAction",{contentUri:"mgid:cms:item:teennick.com:"+b,layout:"horizontal",size:"small",metricsAsPermalink:false,hideShareToGroup:false,items:[{id:"commentCount",title:"Comments"}]})
};
NICK.flux.content=function(c,e,b){var d=NICK.flux.baseURL+NICK.flux.ucid+c;
Flux.createWidget("Content",{title:e,dataSourceUrl:d,layout:"list",numberOfColumns:1,contentThumbnail:{enabled:true,size:"90x90",videoSize:"120x90"},numberOfItemsPerPage:5,actionLink:{title:"View All",url:"http://community.mtv.com/VideoCategories"},items:b})
};
NICK.flux.chart=function(c,b){Flux.createWidget("Chart",{defaultView:b,numberOfItemsPerPage:5,contentTypes:c})
};
NICK.flux.communityActivity=function(c,d,b){b=(typeof b==="undefined")?8:b;
Flux.createWidget("CommunityActivity",{alternativeTitle:c,members:{title:c,numberOfItemsPerPage:b,numberOfPages:1,updateInterval:30,subjectFilter:d}})
};
NICK.flux.createSignInWidget=function(){Flux.createWidget("Authentication",{fluxHosted:true},function(b){b.showSignInForm()
})
},NICK.flux.createSignUpWidget=function(){Flux.createWidget("Authentication",{fluxHosted:true},function(b){b.showSignUpForm()
})
},NICK.flux.createInterimWidget=function(){Flux.createWidget("Authentication",{fluxHosted:true},function(b){b.showInterimForm()
})
};
NICK.flux.getQuizRatings=function(){$(".quiz-item-rating-container").each(function(c){var b=$(this);
var d=b.children(".itemid").val();
$.ajax({dataType:"jsonp",url:NICK.flux.baseURL+NICK.flux.ucid+"/feeds/content/?q="+d,success:function(e){NICK.flux.setRating(e,b)
}})
})
};
NICK.flux.setRating=function(c,b){b.html(c.Rating.ThumbUp+"%")
};
NICK.flux.createFacebookButton=function(){Flux.createWidget("Rpx",{elements:[{id:"FacebookConnectButton",size:"medium",length:"long"}],containerId:"facebookConnectHolder"},function(b){b.onConnected=function(){showSettingsOverlay=false;
[RegisterAfterSignUpHandler]
}
})
};
NICK.flux.UserBar=function(){Flux4.createWidget("UserBar",{displayMode:"EmbeddedTop"})
};
if(typeof NICK=="undefined"||!NICK){var NICK={}
}NICK.Poll=function(a){this.urlStandard="/sbcom/data/poll/pkcav.jhtml";
this.urlAkamai="http://www.nick.com/sbcom/data/poll/fcdm/kca/";
this.urlResults="/sbcom/data/poll/success.jhtml";
this.pollNameParam="pollName";
this.ballotNameParam="ballotName";
this.lineItemIdParam="lineItemId";
this.lineIndexParam="vote";
this.defaults={type:"GET",dataType:"jsonp",useAkamai:false};
this.settings=$.extend({},this.defaults,a);
this.getUrl=function(c){var b="";
if(this.settings.useAkamai){b=this.urlAkamai+c+"/"
}else{b="http://"+KIDS.utils.getNickDomain()+this.urlStandard
}return b
};
this.getResultsUrl=function(){return"http://"+KIDS.utils.getNickDomain()+this.urlResults
};
this.doSubmit=function(f,c,b,e){var d={};
d[this.pollNameParam]=f;
d[this.ballotNameParam]=c;
d[this.lineItemIdParam]=b;
d[this.lineIndexParam]=e;
NICK.request.doRequest({dataType:this.settings.dataType,type:this.settings.type,url:this.getUrl(f),data:d,onSuccess:function(g){NICK.utils.doLog("Poll: doSubmit: onSuccess")
},onFail:function(g){NICK.utils.doLog("Poll: doSubmit: onFail")
}})
};
this.getResults=function(c){var b={};
b[this.pollNameParam]=c;
NICK.utils.doLog("getResults: "+this.getResultsUrl());
NICK.request.doRequest({dataType:this.settings.dataType,url:this.getResultsUrl(),data:b,onSuccess:function(d){NICK.utils.doLog("Poll: getResults: onSuccess")
},onFail:function(d){NICK.utils.doLog("Poll: getResults: onFail")
}})
}
};
NICK.polls={};
NICK.polls.resultsListeners=null;
NICK.polls.doVoteResults=function(b,a,c){if(NICK.polls.resultsListeners==null||NICK.polls.resultsListeners[a]==null){NICK.utils.doLog("Polls: doVoteResults: no listener found: "+a);
return
}NICK.utils.doLog("Polls: doVoteResults: executing results: "+a+" | "+b+" | "+c);
NICK.polls.resultsListeners[a].callback(b,c,NICK.polls.resultsListeners[a].data)
};
NICK.polls.addListener=function(a,b,c){if(NICK.polls.resultsListeners==null){NICK.polls.resultsListeners={}
}NICK.polls.resultsListeners[a]={callback:b,data:c}
};
NICK.polls.removeListener=function(a){if(NICK.polls.resultsListeners==null){return
}NICK.polls.resultsListeners[a]=null
};

