/*
* jQuery JavaScript Library v1.3.2
* http://jquery.com/
*
* Copyright (c) 2009 John Resig
* Dual licensed under the MIT and GPL licenses.
* http://docs.jquery.com/License
*
* Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
* Revision: 6246
*/
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
* Sizzle CSS Selector Engine - v0.9.3
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*/
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();

/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Version 2.1.2
*/
(function(a){a.fn.bgiframe=(a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+';"/>';return this.each(function(){if(a(this).children("iframe.bgiframe").length===0){this.insertBefore(document.createElement(c),this.firstChild)}})}:function(){return this});a.fn.bgIframe=a.fn.bgiframe;function b(c){return c&&c.constructor===Number?c+"px":c}})(jQuery);

/**
* Ajax Queue Plugin
* 
* Homepage: http://jquery.com/plugins/project/ajaxqueue
* Documentation: http://docs.jquery.com/AjaxQueue
*/

/**

<script>
$(function(){
jQuery.ajaxQueue({
url: "test.php",
success: function(html){ jQuery("ul").append(html); }
});
jQuery.ajaxQueue({
url: "test.php",
success: function(html){ jQuery("ul").append(html); }
});
jQuery.ajaxSync({
url: "test.php",
success: function(html){ jQuery("ul").append("<b>"+html+"</b>"); }
});
jQuery.ajaxSync({
url: "test.php",
success: function(html){ jQuery("ul").append("<b>"+html+"</b>"); }
});
});
</script>
<ul style="position: absolute; top: 5px; right: 5px;"></ul>

*/
/*
* Queued Ajax requests.
* A new Ajax request won't be started until the previous queued 
* request has finished.
*/

/*
* Synced Ajax requests.
* The Ajax request will happen as soon as you call this method, but
* the callbacks (success/error/complete) won't fire until all previous
* synced requests have been completed.
*/

(function($) {

var ajax = $.ajax;

var pendingRequests = {};

var synced = [];
var syncedData = [];

$.ajax = function(settings) {
// create settings for compatibility with ajaxSetup
settings = jQuery.extend(settings, jQuery.extend({}, jQuery.ajaxSettings, settings));

var port = settings.port;

switch(settings.mode) {
case "abort": 
if ( pendingRequests[port] ) {
pendingRequests[port].abort();
}
return pendingRequests[port] = ajax.apply(this, arguments);
case "queue": 
var _old = settings.complete;
settings.complete = function(){
if ( _old )
_old.apply( this, arguments );
jQuery([ajax]).dequeue("ajax" + port );;
};

jQuery([ ajax ]).queue("ajax" + port, function(){
ajax( settings );
});
return;
case "sync":
var pos = synced.length;

synced[ pos ] = {
error: settings.error,
success: settings.success,
complete: settings.complete,
done: false
};

syncedData[ pos ] = {
error: [],
success: [],
complete: []
};

settings.error = function(){ syncedData[ pos ].error = arguments; };
settings.success = function(){ syncedData[ pos ].success = arguments; };
settings.complete = function(){
syncedData[ pos ].complete = arguments;
synced[ pos ].done = true;

if ( pos == 0 || !synced[ pos-1 ] )
for ( var i = pos; i < synced.length && synced[i].done; i++ ) {
if ( synced[i].error ) synced[i].error.apply( jQuery, syncedData[i].error );
if ( synced[i].success ) synced[i].success.apply( jQuery, syncedData[i].success );
if ( synced[i].complete ) synced[i].complete.apply( jQuery, syncedData[i].complete );

synced[i] = null;
syncedData[i] = null;
}
};
}
return ajax.apply(this, arguments);
};

})(jQuery);

/*
* Autocomplete - jQuery plugin 1.0.2
*
* Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, JÃ¶rn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $
*
*/

; (function($) {

$.fn.extend({
autocomplete: function(urlOrData, options) {
var isUrl = typeof urlOrData == "string";
options = $.extend({},
$.Autocompleter.defaults, {
url: isUrl ? urlOrData: null,
data: isUrl ? null: urlOrData,
delay: isUrl ? $.Autocompleter.defaults.delay: 10,
max: options && !options.scroll ? 10: 150
},
options);

// if highlight is set to false, replace it with a do-nothing function
options.highlight = options.highlight ||
function(value) {
return value;
};

// if the formatMatch option is not specified, then use formatItem for backwards compatibility
options.formatMatch = options.formatMatch || options.formatItem;

return this.each(function() {
new $.Autocompleter(this, options);
});
},
result: function(handler) {
return this.bind("result", handler);
},
search: function(handler) {
return this.trigger("search", [handler]);
},
flushCache: function() {
return this.trigger("flushCache");
},
setOptions: function(options) {
return this.trigger("setOptions", [options]);
},
unautocomplete: function() {
return this.trigger("unautocomplete");
}
});

$.Autocompleter = function(input, options) {

var KEY = {
UP: 38,
DOWN: 40,
DEL: 46,
TAB: 9,
RETURN: 13,
ESC: 27,
COMMA: 188,
PAGEUP: 33,
PAGEDOWN: 34,
BACKSPACE: 8
};

// Create $ object for input element
var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);

var timeout;
var previousValue = "";
var cache = $.Autocompleter.Cache(options);
var hasFocus = 0;
var lastKeyPressCode;
var config = {
mouseDownOnSelect: false
};
var select = $.Autocompleter.Select(options, input, selectAndSearchCurrent, config);

var blockSubmit;

// prevent form submit in opera when selecting with return key
$.browser.opera && $(input.form).bind("submit.autocomplete",
function() {
if (blockSubmit) {
blockSubmit = false;
return false;
}
});

// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
$input.bind(($.browser.opera ? "keypress": "keydown") + ".autocomplete",
function(event) {
// track last key pressed
lastKeyPressCode = event.keyCode;
switch (event.keyCode) {

case KEY.UP:
event.preventDefault();
if (select.visible()) {
select.prev();
} else {
onChange(0, true);
}
selectCurrent();
break;

case KEY.DOWN:
event.preventDefault();
if (select.visible()) {
select.next();
} else {
onChange(0, true);
}
selectCurrent();
break;

case KEY.PAGEUP:
event.preventDefault();
if (select.visible()) {
select.pageUp();
} else {
onChange(0, true);
}
selectCurrent();
break;

case KEY.PAGEDOWN:
event.preventDefault();
if (select.visible()) {
select.pageDown();
} else {
onChange(0, true);
}
selectCurrent();
break;

// matches also semicolon
case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
case KEY.TAB:
case KEY.RETURN:
if (searchCurrent()) {
// stop default to prevent a form submit, Opera needs special handling
event.preventDefault();
blockSubmit = true;
return false;
}
break;

case KEY.ESC:
select.hide();
break;

default:
clearTimeout(timeout);
timeout = setTimeout(onChange, options.delay);
break;
}
}).focus(function() {
// track whether the field has focus, we shouldn't process any
// results if the field no longer has focus
hasFocus++;
}).blur(function() {
hasFocus = 0;
if (!config.mouseDownOnSelect) {
hideResults();
}
}).click(function() {
// show select when clicking in a focused field
if (hasFocus++>1 && !select.visible()) {
onChange(0, true);
}
}).bind("search",
function() {
// TODO why not just specifying both arguments?
var fn = (arguments.length > 1) ? arguments[1] : null;
function findValueCallback(q, data) {
var result;
if (data && data.length) {
for (var i = 0; i < data.length; i++) {
if (data[i].result.toLowerCase() == q.toLowerCase()) {
result = data[i];
break;
}
}
}
if (typeof fn == "function") fn(result);
else $input.trigger("result", result && [result.data, result.value]);
}
$.each(trimWords($input.val()),
function(i, value) {
request(value, findValueCallback, findValueCallback);
});
}).bind("flushCache",
function() {
cache.flush();
}).bind("setOptions",
function() {
$.extend(options, arguments[1]);
// if we've updated the data, repopulate
if ("data" in arguments[1])
cache.populate();
}).bind("unautocomplete",
function() {
select.unbind();
$input.unbind();
$(input.form).unbind(".autocomplete");
});

function selectAndSearchCurrent() {
selectCurrent();
searchCurrent();
}

function searchCurrent() {
var selected = select.selected();
if (!selected)
return false;

hideResultsNow();
$input.trigger("result", [selected.data, selected.value]);
return true;
}

function selectCurrent() {
var selected = select.selected();
if (!selected)
return false;

var v = selected.result;
previousValue = v;

if (options.multiple) {
var words = trimWords($input.val());
if (words.length > 1) {
v = words.slice(0, words.length - 1).join(options.multipleSeparator) + options.multipleSeparator + v;
}
v += options.multipleSeparator;
}

$input.val(v);
}

function onChange(crap, skipPrevCheck) {
if (lastKeyPressCode == KEY.DEL) {
select.hide();
return;
}

var currentValue = $input.val();

if (!skipPrevCheck && currentValue == previousValue)
return;

previousValue = currentValue;

currentValue = lastWord(currentValue);
if (currentValue.length >= options.minChars) {
$input.addClass(options.loadingClass);
if (!options.matchCase)
currentValue = currentValue.toLowerCase();
request(currentValue, receiveData, hideResultsNow);
} else {
stopLoading();
select.hide();
}
};

function trimWords(value) {
if (!value) {
return [""];
}
var words = value.split(options.multipleSeparator);
var result = [];
$.each(words,
function(i, value) {
if ($.trim(value))
result[i] = $.trim(value);
});
return result;
}

function lastWord(value) {
if (!options.multiple)
return value;
var words = trimWords(value);
return words[words.length - 1];
}

// fills in the input box w/the first match (assumed to be the best match)
// q: the term entered
// sValue: the first matching result
function autoFill(q, sValue) {
// autofill in the complete box w/the first match as long as the user hasn't entered in more data
// if the last user key pressed was backspace, don't autofill
if (options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE) {
// fill in the value (keep the case the user has typed)
$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
// select the portion of the value not typed by the user (so the next character will erase)
$.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length);
}
};

function hideResults() {
clearTimeout(timeout);
timeout = setTimeout(hideResultsNow, 200);
};

function hideResultsNow() {
var wasVisible = select.visible();
select.hide();
clearTimeout(timeout);
stopLoading();
if (options.mustMatch) {
// call search and run callback
$input.search(
function(result) {
// if no value found, clear the input box
if (!result) {
if (options.multiple) {
var words = trimWords($input.val()).slice(0, -1);
$input.val(words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator: ""));
}
else
$input.val("");
}
}
);
}
if (wasVisible)
// position cursor at end of input field
$.Autocompleter.Selection(input, input.value.length, input.value.length);
};

function receiveData(q, data) {
if (data && data.length && hasFocus) {
stopLoading();
select.display(data, q);
autoFill(q, data[0].value);
select.show();
} else {
hideResultsNow();
}
};

function request(term, success, failure) {
if (!options.matchCase)
term = term.toLowerCase();
var data = cache.load(term);
// recieve the cached data
if (data && data.length) {
success(term, data);
// if an AJAX url has been supplied, try loading the data now
} else if ((typeof options.url == "string") && (options.url.length > 0)) {

var extraParams = {};

$.each(options.extraParams,
function(key, param) {
extraParams[key] = typeof param == "function" ? param() : param;
});

if(options.jsonpCallback) {
extraParams['callback'] = options.jsonpCallback;

/* define global function to handle callback */
window[options.jsonpCallback] = function(data) {
var parsed = options.parse && options.parse(data) || parse(data);
cache.add(term, parsed);
success(term, parsed);
}

}

var dataType = options.jsonpCallback ? "script" : options.dataType;

onSuccess = options.jsonpCallback ? function(){} : function (data) {
var parsed = options.parse && options.parse(data) || parse(data);
cache.add(term, parsed);
success(term, parsed);
}

$.ajax({
// try to leverage ajaxQueue plugin to abort previous requests
mode: "abort",
// limit abortion to this input
port: "autocomplete" + input.name,
dataType: dataType,
url: options.url,
data: $.extend({
q: lastWord(term),
limit: options.max
},
extraParams),
beforeSend: options.beforeSend,
complete: options.complete,
success: onSuccess
});

} else {
// if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
select.emptyList();
failure(term);
}
};

function parse(data) {
var parsed = [];
var rows = data.split("\n");
for (var i = 0; i < rows.length; i++) {
var row = $.trim(rows[i]);
if (row) {
row = row.split("|");
parsed[parsed.length] = {
data: row,
value: row[0],
result: options.formatResult && options.formatResult(row, row[0]) || row[0]
};
}
}
return parsed;
};

function stopLoading() {
$input.removeClass(options.loadingClass);
};

};

$.Autocompleter.defaults = {
inputClass: "ac_input",
resultsClass: "ac_results",
loadingClass: "ac_loading",
minChars: 1,
delay: 400,
beforeSend: function() {},
complete: function() {},
matchCase: false,
matchSubset: true,
matchContains: false,
cacheLength: 10,
max: 100,
mustMatch: false,
extraParams: {},
selectFirst: true,
formatItem: function(row) {
return row[0];
},
formatMatch: null,
autoFill: false,
width: 0,
multiple: false,
multipleSeparator: ", ",
highlight: function(value, term) {
return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
},
scroll: true,
scrollHeight: 180
};

$.Autocompleter.Cache = function(options) {

var data = {};
var length = 0;

function matchSubset(s, sub) {
if (!options.matchCase)
s = s.toLowerCase();
var i = s.indexOf(sub);
if (i == -1) return false;
return i == 0 || options.matchContains;
};

function add(q, value) {
if (length > options.cacheLength) {
flush();
}
if (!data[q]) {
length++;
}
data[q] = value;
}

function populate() {
if (!options.data) return false;
// track the matches
var stMatchSets = {},
nullData = 0;

// no url was specified, we need to adjust the cache length to make sure it fits the local data store
if (!options.url) options.cacheLength = 1;

// track all options for minChars = 0
stMatchSets[""] = [];

// loop through the array and create a lookup structure
for (var i = 0, ol = options.data.length; i < ol; i++) {
var rawValue = options.data[i];
// if rawValue is a string, make an array otherwise just reference the array
rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;

var value = options.formatMatch(rawValue, i + 1, options.data.length);
if (value === false)
continue;

var firstChar = value.charAt(0).toLowerCase();
// if no lookup array for this character exists, look it up now
if (!stMatchSets[firstChar])
stMatchSets[firstChar] = [];

// if the match is a string
var row = {
value: value,
data: rawValue,
result: options.formatResult && options.formatResult(rawValue) || value
};

// push the current match into the set list
stMatchSets[firstChar].push(row);

// keep track of minChars zero items
if (nullData++<options.max) {
stMatchSets[""].push(row);
}
};

// add the data items to the cache
$.each(stMatchSets,
function(i, value) {
// increase the cache size
options.cacheLength++;
// add to the cache
add(i, value);
});
}

// populate any existing data
setTimeout(populate, 25);

function flush() {
data = {};
length = 0;
}

return {
flush: flush,
add: add,
populate: populate,
load: function(q) {
if (!options.cacheLength || !length)
return null;
/* 
* if dealing w/local data and matchContains than we must make sure
* to loop through all the data collections looking for matches
*/
if (!options.url && options.matchContains) {
// track all matches
var csub = [];
// loop through all the data grids for matches
for (var k in data) {
// don't search through the stMatchSets[""] (minChars: 0) cache
// this prevents duplicates
if (k.length > 0) {
var c = data[k];
$.each(c,
function(i, x) {
// if we've got a match, add it to the array
if (matchSubset(x.value, q)) {
csub.push(x);
}
});
}
}
return csub;
} else
// if the exact item exists, use it
if (data[q]) {
return data[q];
} else
if (options.matchSubset) {
for (var i = q.length - 1; i >= options.minChars; i--) {
var c = data[q.substr(0, i)];
if (c) {
var csub = [];
$.each(c,
function(i, x) {
if (matchSubset(x.value, q)) {
csub[csub.length] = x;
}
});
return csub;
}
}
}
return null;
}
};
};

$.Autocompleter.Select = function(options, input, select, config) {
var CLASSES = {
ACTIVE: "ac_over"
};

var listItems,
active = -1,
data,
term = "",
needsInit = true,
element,
list;

// Create results
function init() {
if (!needsInit)
return;
element = $("<div/>")
.hide()
.addClass(options.resultsClass)
.css("position", "absolute")
.appendTo(document.body);

list = $("<ul/>").appendTo(element).mouseover(function(event) {
if (target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
$(target(event)).addClass(CLASSES.ACTIVE);
}
}).click(function(event) {
$(target(event)).addClass(CLASSES.ACTIVE);
select();
// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
input.focus();
return false;
}).mousedown(function() {
config.mouseDownOnSelect = true;
}).mouseup(function() {
config.mouseDownOnSelect = false;
});

if (options.width > 0)
element.css("width", options.width);

needsInit = false;
}

function target(event) {
var element = event.target;
while (element && element.tagName != "LI")
element = element.parentNode;
// more fun with IE, sometimes event.target is empty, just ignore it then
if (!element)
return [];
return element;
}

function moveSelect(step) {
listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
movePosition(step);
var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
if (options.scroll) {
var offset = 0;
listItems.slice(0, active).each(function() {
offset += this.offsetHeight;
});
if ((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
} else if (offset < list.scrollTop()) {
list.scrollTop(offset);
}
}
};

function movePosition(step) {
active += step;
if (active < 0) {
active = listItems.size() - 1;
} else if (active >= listItems.size()) {
active = 0;
}
}

function limitNumberOfItems(available) {
return options.max && options.max < available
? options.max
: available;
}

function fillList() {
list.empty();
var max = limitNumberOfItems(data.length);
for (var i = 0; i < max; i++) {
if (!data[i])
continue;
var formatted = options.formatItem(data[i].data, i + 1, max, data[i].value, term);
if (formatted === false)
continue;
var li = $("<li/>").html(options.highlight(formatted, term)).addClass(i % 2 == 0 ? "ac_even": "ac_odd").appendTo(list)[0];
$.data(li, "ac_data", data[i]);
}
listItems = list.find("li");
if (options.selectFirst) {
listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
active = 0;
}
// apply bgiframe if available
if ($.fn.bgiframe)
list.bgiframe();
}

return {
display: function(d, q) {
init();
data = d;
term = q;
fillList();
},
next: function() {
moveSelect(1);
},
prev: function() {
moveSelect( - 1);
},
pageUp: function() {
if (active != 0 && active - 8 < 0) {
moveSelect( - active);
} else {
moveSelect( - 8);
}
},
pageDown: function() {
if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
moveSelect(listItems.size() - 1 - active);
} else {
moveSelect(8);
}
},
hide: function() {
element && element.hide();
listItems && listItems.removeClass(CLASSES.ACTIVE);
active = -1;
},
visible: function() {
return element && element.is(":visible");
},
current: function() {
return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
},
show: function() {
var offset = $(input).offset();
element.css({
width: typeof options.width == "string" || options.width > 0 ? options.width: $(input).width(),
top: offset.top + input.offsetHeight + (options.offsetTop || 0),
left: offset.left + (options.offsetLeft || 0)
}).show();
if (options.scroll) {
list.scrollTop(0);
list.css({
maxHeight: options.scrollHeight,
overflow: 'auto'
});

if ($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
var listHeight = 0;
listItems.each(function() {
listHeight += this.offsetHeight;
});
var scrollbarsVisible = listHeight > options.scrollHeight;
list.css('height', scrollbarsVisible ? options.scrollHeight: listHeight);
if (!scrollbarsVisible) {
// IE doesn't recalculate width when scrollbar disappears
listItems.width(list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")));
}
}

}
},
selected: function() {
/* var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);*/
var selected = listItems && listItems.filter("." + CLASSES.ACTIVE);
return selected && selected.length && $.data(selected[0], "ac_data");
},
emptyList: function() {
list && list.empty();
},
unbind: function() {
element && element.remove();
}
};
};

$.Autocompleter.Selection = function(field, start, end) {
if (field.createTextRange) {
var selRange = field.createTextRange();
selRange.collapse(true);
selRange.moveStart("character", start);
selRange.moveEnd("character", end);
selRange.select();
} else if (field.setSelectionRange) {
field.setSelectionRange(start, end);
} else {
if (field.selectionStart) {
field.selectionStart = start;
field.selectionEnd = end;
}
}
field.focus();
};

})(jQuery);

(function($j){
$j.fn.jTruncate = function(options) {

var defaults = {
length: 300,
minTrail: 20,
moreText: "Read Full Summary" + String.fromCharCode (187),
lessText: String.fromCharCode (171) + "Hide Full Summary" ,
ellipsisText: "...",
moreAni: "",
lessAni: ""
};

var options = $j.extend(defaults, options);

return this.each(function() {
obj = $j(this);
var body = obj.html();

if(body.length > options.length + options.minTrail) {
var splitLocation = body.indexOf(' ', options.length);
if(splitLocation != -1) {
// truncate tip
var splitLocation = body.indexOf(' ', options.length);
var str1 = body.substring(0, splitLocation);
var str2 = body.substring(splitLocation, body.length - 1);
obj.html(str1 + '<span class="truncate_ellipsis">' + options.ellipsisText + 
'</span>' + '<span class="truncate_more">' + str2 + '</span>');
obj.find('.truncate_more').css("display", "none");

// insert more link
obj.append(
' <a href="#" class="truncate_more_link">' + options.moreText +'</a>'
);

// set onclick event for more/less link
var moreLink = $j('.truncate_more_link', obj);
var moreContent = $j('.truncate_more', obj);
var ellipsis = $j('.truncate_ellipsis', obj);
moreLink.click(function() {
if(moreLink.text() == options.moreText) {
moreContent.show(options.moreAni);
moreLink.text(options.lessText);
ellipsis.css("display", "none");
} else {
moreContent.hide(options.lessAni);
moreLink.text(options.moreText);
ellipsis.css("display", "inline");
}
return false;
});
}
} // end if

});
};
})(jQuery);

var $j = jQuery.noConflict();

$j.ajaxSetup({
'cache' : true
});

$j(document).ready(function(){
MTV.init();
});

MTV = new function(){
this.initArray = new Array();
var hat;
var theme;

this.init = function(){

MTV.Events.addLinkEvents();
MTV.Voting.init();
MTV.Typeahead.init();
MTV.Search.init();

for(var i=0; i<MTV.initArray.length; i++){
MTV.initArray[i]();
}

return true;
}

this.hatTrick = function(hatNumber) {
if(hat != undefined) hatNumber = hat;
var total = 66;
var bodyTag = document.getElementsByTagName('body')[0];
var classList = bodyTag.className;

if (classList.indexOf("hat") > -1) {	
var tempClasses = new Array();
var classes = classList.split(" ");
var j = 0;
for(i = 0; i < classes.length; i++) {
if(classes[i].substr(0,3) != "hat") tempClasses[j++] = classes[i];
}
classList = tempClasses.join(" ");
}
if (!hatNumber) hatNumber = Math.floor(total*Math.random());
var newHat = (hat) ? " " + hatNumber : " hat" + hatNumber;
bodyTag.className = classList + newHat + "";
}

this.setHat = function(h){
hat = h;
}
this.getHat = function(){
return hat;
}

this.setTheme = function(t){
theme = t;
}
this.getTheme = function(){
return theme;
}

this.renderHeader = function(path){
document.write("<script src='" + path + "'><\/script>");
}

}

// Source: CODA/builds/mtv.com/CODA.js
// CODA 2.39 dated 25-Apr-2011 Mon 11:53 AM

var mtvn=typeof mtvn==='object'?mtvn:{};mtvn.btg=typeof mtvn.btg==='object'?mtvn.btg:{};mtvn.btg.config=typeof mtvn.btg.config==='object'?mtvn.btg.config:{};mtvn.btg.managers=typeof mtvn.btg.managers==='object'?mtvn.btg.managers:{};mtvn.btg.ads=typeof mtvn.btg.ads==='object'?mtvn.btg.ads:{};mtvn.btg.ads.games=typeof mtvn.btg.ads.games==='object'?mtvn.btg.ads.games:{};mtvn.btg.ads.doubleclick=typeof mtvn.btg.ads.doubleclick==='object'?mtvn.btg.ads.doubleclick:{};mtvn.btg.ads.freewheel=typeof mtvn.btg.ads.freewheel==='object'?mtvn.btg.ads.freewheel:{};mtvn.btg.reporting=typeof mtvn.btg.reporting==='object'?mtvn.btg.reporting:{};mtvn.btg.reporting.omniture=typeof mtvn.btg.reporting.omniture==='object'?mtvn.btg.reporting.omniture:{};mtvn.btg.util=typeof mtvn.btg.util==='object'?mtvn.btg.util:{};mtvn.btg.globalvars=typeof mtvn.btg.globalvars==='object'?mtvn.btg.globalvars:{};mtvn.btg.reporting.player=typeof mtvn.btg.reporting.player==='object'?mtvn.btg.reporting.player:{};mtvn.btg.reporting.games=typeof mtvn.btg.reporting.games==='object'?mtvn.btg.reporting.games:{};mtvn.btg.html5=typeof mtvn.btg.html5==='object'?mtvn.btg.html5:{};mtvn.btg.html5.reporting=typeof mtvn.btg.html5.reporting==='object'?mtvn.btg.html5.reporting:{};mtvn.btg.html5.ads=typeof mtvn.btg.html5.ads==='object'?mtvn.btg.html5.ads:{};mtvn.btg.plugins=typeof mtvn.btg.plugins==='object'?mtvn.btg.plugins:{};mtvn.btg.globalvars={VISITOR_NAMESPACE:"mtvn",IS_CODA_ADS_USED:false,VERSION:"2.39",IS_TOP_ACCESSIBLE:function(){try{return(typeof top.location.search!='undefined'&&typeof top.location.search!='unknown');}catch(e){return false;}}(),PAGE_URL:function(){try{var retVal='';retVal=self.location.pathname;if(retVal=='')retVal='/';return retVal;}catch(e){}}(),IS_UNIT_TEST:function(){try{return(location.href.toLowerCase().indexOf("/api/jsunittest/tests/")!=-1);}catch(e){return false}}(),FORCE_AD_WAIT_TIME:{PLAYER_LOADED:10000,PLAYER_FAILED:10000,PLAYER_LOAD_WAIT_TIME:10000},VALID_DCOPT:["ist"]};mtvn.btg.Controller=new function(){var _btgGv=mtvn.btg.globalvars;var _btgCfg=mtvn.btg.config;var _btgRep=mtvn.btg.reporting;var _btgRepG=_btgRep.games;var _btgAds=mtvn.btg.ads;var _btgAdsG=_btgAds.games;var hasReporting=false;var hasAds=false;var hasGame=false;var hasHtml5=false;var reportingData;var adsData;var defaultPageName="";this.init=function(){_btgGv.IS_LIVE_ENV=function(){var retVal=true;try{if(mtvn.btg.util.String.isDefined(_btgCfg.ReportSettings.Omniture.dynamicAccountList)){var dal=_btgCfg.ReportSettings.Omniture.dynamicAccountList;var b=dal.indexOf("=");if(b>-1){dal=dal.substring(b+1);dal=dal.split(",");var url=self.location.hostname;if(_btgGv.IS_TOP_ACCESSIBLE){url=top.location.hostname;}
for(var i=0,len=dal.length;i<len;i++){if(url.indexOf(dal[i])>-1){retVal=false;break;}}}}}catch(e){}
return retVal;}();defaultPageName=(typeof _btgGv.PAGE_URL=="string"&&_btgGv.PAGE_URL!="")?_btgGv.PAGE_URL:location.pathname;if(defaultPageName.charAt(defaultPageName.length-1)=="/"){defaultPageName+=typeof _btgCfg.ReportSettings.indexFileName=="string"?_btgCfg.ReportSettings.indexFileName:"index";}
if(_btgCfg.ReportSettings){_btgCfg.ReportSettings._defaultPageName=defaultPageName;_btgRep.ReportingManager.init();hasReporting=true;}
if(_btgCfg.AdSettings){_btgCfg.AdSettings.defaultPageName=defaultPageName;_btgAds.AdManager.init();hasAds=true;}
if(typeof _btgRep.TestAndTarget!="undefined")_btgRep.TestAndTarget.init();return true;};this.gameInit=function(){if(!hasReporting&&_btgCfg.ReportSettings){_btgRep.ReportingManager.init();hasReporting=true;}
if(!hasAds&&_btgCfg.AdSettings){_btgAds.AdManager.init();hasAds=true;}
if(!hasGame&&com.mtvnet.games.GameSettings){_btgRepG.GameReportingManager.init();_btgAdsG.GameAdManager.init();hasGame=true;}
return true;}
this.html5Init=function(playerObj){if(!hasHtml5){var btgH5Rep=mtvn.btg.html5.reporting;var btgH5Ads=mtvn.btg.html5.ads;if(btgH5Rep.ReportingManager)btgH5Rep.ReportingManager.init(playerObj);if(btgH5Ads.AdManager)btgH5Ads.AdManager.init(playerObj);hasHtml5=true;}
return true;}
this.loadGame=function(status){if(hasGame){_btgAdsG.GameAdManager.loadGame(status);_btgRepG.GameReportingManager.gameLoad(status);}}
this.sendPageCall=function(data){if(hasReporting){if(typeof data=="undefined"||!data)data={};_btgRep.ReportingManager.sendPageCall(data);reportingData=_btgRep.ReportingManager.getData();}};this.sendLinkEvent=function(data){if(hasReporting){if(typeof data=="undefined"||!data)data={};_btgRep.ReportingManager.sendLinkEvent(data);}};this.placeAd=function(data){if(hasAds){_btgAds.AdManager.placeAd(data);adsData=_btgAds.AdManager.getData();}};this.placeIFrameAd=function(adHtml,a_data){_btgAds.AdManager.placeIFrameAd(adHtml,a_data);}
this.getAdUrl=function(data){if(hasAds){return _btgAds.AdManager.getAdUrl(data);}};this.getVersion=function(){return _btgGv.VERSION;};this.createMboxes=function(map){if(typeof mboxDefine=="function"&&typeof _btgCfg.ReportSettings.Omniture.enableTestAndTarget=="boolean"&&_btgCfg.ReportSettings.Omniture.enableTestAndTarget&&typeof _btgRep.TestAndTarget!="undefined")
_btgRep.TestAndTarget.createMboxes(map);};this.setChoiceStreamRequest=function(data,isActivity){if(hasReporting)
mtvn.btg.reporting.ReportingManager.setChoiceStreamRequest(data,isActivity);}};mtvn.btg.util.Beacon=function(url){this.url=url;this.data=null;};mtvn.btg.util.Beacon.prototype={setData:function(data){this.data=mtvn.btg.util.Object.toString(data,'&');},formatSrc:function(){if(this.data){if(this.url.indexOf('?')>-1){this.url+='&'+this.data;}else{this.url+='?'+this.data;}}
return this.url;},send:function(){var http=new Image(1,1);http.src=this.formatSrc();http.onload=function(){return;};http.onabort=function(){return;};http.onerror=function(){return;};}};mtvn.btg.util.Alert=function(text,type){if(!text)return;var _DEPENDENCY_FLAG_NAME="ga_script_load";var _WAIT=100;switch(type){case 1:var category="Warning";break;case 2:var category="Alert";break;default:var category="Error";break;}
this.dependencies=new mtvn.btg.managers.DependencyManager();this.dependencies.add(_DEPENDENCY_FLAG_NAME,function(){return typeof(_gat)=="object";},_WAIT);this.dependencies.checkDependency(_DEPENDENCY_FLAG_NAME);if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,function(){new mtvn.btg.util.Alert(text,type)});return;}
var pageTracker=_gat._createTracker("UA-18578264-1","coda_alerts_tracker");pageTracker._setDomainName("");pageTracker._trackEvent(location.hostname,location.pathname,category+": "+text);};mtvn.btg.util.Cookie={read:function(name){var name=name+"=";var ca=document.cookie.split(';');for(var i=0,len=ca.length;i<len;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1,c.length)};if(c.indexOf(name)==0){return unescape(c.substring(name.length,c.length))};}
return null;},set:function(name,value,expy,path,domain){var cookie=name+"="+escape(value)+"; path=/";if(expy)cookie+=";expires="+expy;if(!domain){var domain=document.domain.split(".");domain=domain.length>2?domain[domain.length-2]+"."+domain[domain.length-1]:document.domain;}
if(domain!="localhost")cookie+=";domain="+domain;cookie+=";path="+(path?path:"/");document.cookie=cookie;},remove:function(name,path,domain){var cookie=name+"=";if(!domain){var domain=document.domain.split(".");domain=domain.length>2?domain[domain.length-2]+"."+domain[domain.length-1]:document.domain;}
if(domain!="localhost")cookie+=";domain="+domain;cookie+=";path="+(path?path:"/");cookie+=";expires=Thu, 01-Jan-1970 00:00:01 GMT";document.cookie=cookie;}};mtvn.btg.util.DOM={Events:{addListener:function(obj,type,fn){if(obj.attachEvent)
obj.attachEvent('on'+type,fn);else if(obj.addEventListener)
obj.addEventListener(type,fn,false);else obj['on'+type]=fn;},removeListener:function(obj,type,fn){if(obj.detachEvent)
obj.detachEvent('on'+type,fn);else if(obj.removeEventListener)
obj.removeEventListener(type,fn,false);else obj['on'+type]=null;}},loadScript:function(a_url,a_appendToBody){if(mtvn.btg.util.String.isDefined(a_url)){try{var scriptObj=document.createElement('script');scriptObj.setAttribute("type","text/javascript");scriptObj.setAttribute("src",a_url);if(a_appendToBody)document.body.appendChild(scriptObj);else document.getElementsByTagName("head")[0].appendChild(scriptObj);}catch(e){}}},loadScriptOnHead:function(a_url){if(mtvn.btg.util.String.isDefined(a_url)){try{var scriptObj=document.createElement('script');scriptObj.setAttribute("type","text/javascript");scriptObj.setAttribute("src",a_url);document.getElementsByTagName("head")[0].appendChild(scriptObj);}catch(e){}}}}
mtvn.btg.util.Events=new function(){var _event=function(){this.callbacks=[];this.subscribe=function(callback){if(typeof callback=="function")this.callbacks[this.callbacks.length]=callback;};this.remove=function(callback){for(var s=0,len=this.callbacks.length;s<len;s++){if(this.callbacks[s]==callback)delete this.callbacks[s];}
if(typeof callback=="function")this.callbacks[this.callbacks.length]=callback;};this.fire=function(){for(var s=0,len=this.callbacks.length;s<len;s++){try{if(typeof this.callbacks[s]=="function")this.callbacks[s].apply(this,arguments);}catch(e){new mtvn.btg.util.Alert('An event callback has failed. \"'+e.number+': '+e.message+'\".');}}};};this.add=function(name){this[name]=new _event();return this;}
this.flipBookView=new _event();this.adLoaded=new _event();this.Player_Freewheel_failsafe=new _event();this.Player_HTML5_play=new _event();this.Player_HTML5_pause=new _event();this.Player_HTML5_end=new _event();this.Player_HTML5_seek=new _event();this.Player_HTML5_milestone=new _event();this.ABTest_Group_Assigned=new _event();this.ON_GAME_CONFIG_LOADED=new _event();this.ON_GAME_LOAD=new _event();this.ON_GAME_PLAY=new _event();this.ON_GAME_LEVELSTART=new _event();};if(!this.mtvn.btg.util.JSON){mtvn.btg.util.JSON=function(){function f(n){return n<10?'0'+n:n;}
Date.prototype.toJSON=function(){return this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z';};var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case'string':return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c;}
c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+
(c%16).toString(16);})+'"':'"'+value+'"';case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
if(typeof value.toJSON==='function'){return stringify(value.toJSON());}
a=[];if(typeof value.length==='number'&&!(value.propertyIsEnumerable('length'))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i],whitelist)||'null');}
return'['+a.join(',')+']';}
if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==='string'){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+':'+v);}}}}else{for(k in value){if(typeof k==='string'){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+':'+v);}}}}
return'{'+a.join(',')+'}';}}
return{stringify:stringify,parse:function(text,filter){var j;function walk(k,v){var i,n;if(v&&typeof v==='object'){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n;}}}}
return filter(k,v);}
if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof filter==='function'?walk('',j):j;}
throw new SyntaxError('parseJSON');}};}();}
mtvn.btg.util.Math={random:function(){var min;var max;if(arguments.length>1){min=arguments[0];max=arguments[1];}else{min=0;max=arguments[0];}
return Math.floor(Math.random()*(max-min+1)+min);}};mtvn.btg.util.Object={isDefined:function(object){if(typeof object=="object"&&object!==null){return true;}else{return false;}},toString:function(object,delimiter){var delimiter=delimiter?delimiter:',';var array=[];for(var i in object){if(mtvn.btg.util.String.isDefined(object[i])){array.push(i+"="+object[i]);}}
return array.join(delimiter);},copyProperties:function(a_sourceObj,a_destinationObj,a_forceOverwrite){if(this.isDefined(a_sourceObj)&&this.isDefined(a_destinationObj)){for(var i in a_sourceObj){if(this.isDefined(a_destinationObj[i])||mtvn.btg.util.String.isDefined(a_destinationObj[i])){if(a_forceOverwrite=="forceOverwrite")a_destinationObj[i]=a_sourceObj[i];}
else{a_destinationObj[i]=a_sourceObj[i];}}}},isConfigDefined:function(object){if(typeof object=="object"&&object!==null&&object.enabled==true){return true;}else{return false;}}};mtvn.btg.util.Sections={getAdSections:function(){var btgU=mtvn.btg.util;var btgCfg=mtvn.btg.config;var retVal=self.location.pathname;if(retVal=='')retVal='/';if(retVal.lastIndexOf("/")==(retVal.length-1)){retVal+=(btgU.Object.isDefined(btgCfg.AdSettings)&&btgU.String.isDefined(btgCfg.AdSettings.defaultIndexFileName))?btgCfg.AdSettings.defaultIndexFileName:"index";}
if(retVal!='/'&&retVal.indexOf('/')==0)retVal=retVal.substring(1);return retVal;},getReportingSections:function(){return self.location.pathname;}};mtvn.btg.util.Session={btgCk:mtvn.btg.util.Cookie,Variables:{config:[],add:function(config){if(typeof config=="undefined")return false;for(var c1=0,len=this.config.length;c1<len;c1++){if(typeof this.config[c1].varName!="string")continue;for(var c2=0,len=config.length;c2<len;c2++){if(typeof config[c2].varName!="string")continue;if(config[c2].varName==this.config[c1].varName)this.config.splice(c1,1);}}
this.config=this.config.concat(config);return true;},setData:function(data){var isStr=mtvn.btg.util.String.isDefined;if(!isStr(data))return null;for(var c=0,len=this.config.length;c<len;c++){var _config=this.config[c];if(typeof data[_config.varName]!="undefined"){data[_config.varName]=this.saveToCookie(_config,data[_config.varName]);}
else{var cookieName=isStr(_config.cookieName)?_config.cookieName:"mtvn_btg_"+_config.varName;var cookie=this.btgCk.read(cookieName);if(isStr(cookie)){cookie=cookie.replace(/\+/gim,";");data[_config.varName]=cookie;}}}
return data;},saveToCookie:function(config,value){var isStr=mtvn.btg.util.String.isDefined;if(typeof value=="string"&&typeof config.varName=="string"){value=value.replace(/\;/gim,"+");var varName=config.varName;var cookieName=typeof config.cookieName=="string"?config.cookieName:"mtvn_btg_"+varName;var neverDie=typeof config.neverDie=="boolean"?config.neverDie:0;var appendOnly=typeof config.appendOnly=="boolean"||typeof config.appendOnly=="number"?config.appendOnly:0;if(appendOnly){var cookie=this.btgCk.read(cookieName);if(isStr(cookie)){values=value.split(",");for(var v=0,len=values.length;v<len;v++){var current_value=values[v];if(!isStr(current_value))continue;if(cookie.indexOf(current_value)>-1)continue;if(cookie.length>0)cookie+=",";cookie+=current_value;}
value=cookie;}}
var year=new Date().getYear();var expy=neverDie?"Thu, 01-Jan-"+(year+10)+" 23:59:59 GMT":null;this.btgCk.set(cookieName,value,expy);}
return isStr(value)?value.replace(/\+/gim,";"):null;}}}
mtvn.btg.util.String={isDefined:function(value){if(typeof value==='undefined'||value===null||value==''){return false;}else{return true;}},random:function(length){var chars='ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';var string='';length=length?length:8;for(var x=0;x<length;x++){var num=Math.floor(Math.random()*chars.length);string+=chars.substring(num,num+1);}
return string;},toObject:function(string,delimiter){var delimiter=delimiter?delimiter:',';var array=string.split(delimiter);var object={};for(var x=0,len=array.length;x<len;x++){var pairs=array[x].split('=');object[pairs[0]]=pairs[1];}
return object;},queryStringToObject:function(string){var string=string.indexOf('?')>-1?string.split('?')[1]:string;return this.toObject(string,'&');},stripFileExtension:function(string){var lastIndex=string.lastIndexOf('.');if(lastIndex>0){return string.substring(0,lastIndex);}else{return string;}},charLtrim:function(string,character){var trimIndex=string.indexOf(character)
if(trimIndex==0){string=string.substring(1);}
return string;},charRtrim:function(string,character){var trimIndex=string.lastIndexOf(character);var stringLength=string.length;if(trimIndex==stringLength-1){string=string.substring(0,stringLength-1);}
return string;},charTrim:function(string,character){string=this.charLtrim(string,character);string=this.charRtrim(string,character);return string;},mockItUp:function(string){string=string.replace(/[<]/g,"&lt;");string=string.replace(/[>]/g,"&gt;");return string;},getFileName:function(a_pathString){var retVal=(this.isDefined(a_pathString))?a_pathString:'';retVal=retVal.substring(retVal.lastIndexOf('/')+1);return retVal;},getBetween:function(a_source,a_markStart,a_markEnd){var retVal="";if(this.isDefined(a_source)){if(this.isDefined(a_markStart)){var cutStart=a_source.indexOf(a_markStart);if(cutStart>=0){retVal=a_source.substring(cutStart+a_markStart.length);}}
if(this.isDefined(a_markEnd)){var cutEnd=retVal.indexOf(a_markEnd);if(cutEnd>=0){retVal=retVal.substring(0,cutEnd);}}}
return retVal;}};mtvn.btg.util.Window={getNodeLinkName:function(node){var linkName=null;for(var x=0,len=node.childNodes.length;x<len;x++){var childnode=node.childNodes[x];switch(childnode.nodeType){case 3:linkName=childnode.nodeValue;break;case 1:if(node.attributes['title']&&node.attributes['title'].nodeValue!=''){linkName=node.attributes['title'].nodeValue;}else if(node.attributes['alt']&&node.attributes['alt'].nodeValue!=''){linkName=node.attributes['alt'].nodeValue;}
break;};}
return linkName;},debug:function(message){var debugElement=document.getElementById("debug");if(!debugElement){debugElement=document.createElement("div");debugElement.setAttribute("id","debug");document.getElementsByTagName("body")[0].appendChild(debugElement);}
debugElement.innerHTML=debugElement.innerHTML+message+"<br>";}};mtvn.btg.util.swfobject=function(){try{function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return!a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y};var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in mtvn.btg.util.swfobject){mtvn.btg.util.swfobject[X]=null}mtvn.btg.util.swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}catch(e){}}();mtvn.btg.util.Class={inheritFrom:function(a_superClass,a_subClass){function subClass(){if(arguments.length>0&&typeof(a_superClass)==="function"){a_superClass.apply(this,arguments);}}
if(typeof(a_superClass)==="function"||typeof(a_superClass)==="object"){if(typeof(a_subClass)==="function"||typeof(a_subClass)==="object"){var tempPrototype=a_subClass.prototype;a_subClass.prototype=(typeof(a_superClass)==="function")?new a_superClass:a_superClass;for(var i in tempPrototype){a_subClass.prototype[i]=tempPrototype[i];}
a_subClass.prototype.constructor=a_subClass;subClass.prototype=(typeof(a_subClass)==="function")?new a_subClass:a_subClass;subClass.prototype.constructor=subClass;}
else{subClass.prototype=(typeof(a_superClass)==="function")?new a_superClass:a_superClass;subClass.prototype.constructor=subClass;}}
else{throw"Coda ERROR: mtvn.btg.util.Class.inheritFrom(a_superClass,a_subClass) requires at least a_superClass argument!";}
return subClass;}};mtvn.btg.util.Timer=function(id,milliseconds){this.id=id;this.isRunning=false;this.currentCount=0;this.milliseconds=milliseconds?milliseconds:100;this.intervalId=null;this.listeners=[];};mtvn.btg.util.Timer.prototype={on:function(eventName,func){if(typeof func=="function"){this.listeners[eventName]=func;}},execListener:function(eventName){if(typeof(this.listeners[eventName])=="function")this.listeners[eventName]();},start:function(){if(!this.isRunning){this.isRunning=true;this.intervalId=setInterval(this.id+".count()",this.milliseconds);}},count:function(){this.currentCount=this.currentCount+this.milliseconds;this.execListener('count');},stop:function(){clearInterval(this.intervalId);this.isRunning=false;},reset:function(){this.stop();this.currentCount=0;this.start();}};mtvn.btg.util.TimeTracker=function(a_cookieName){var _btgU=mtvn.btg.util;var _btgIsStr=_btgU.String.isDefined;var _btgCk=_btgU.Cookie;var _data="";var _startTime=null;var _cookieName=(_btgIsStr(a_cookieName))?a_cookieName:"";this.init=function(){_startTime=(new Date()).getTime();_btgU.DOM.Events.addListener(window,"unload",this.saveTimeSpent);return true;};this.setData=function(a_data){if(_btgIsStr(a_data)){_data=a_data;}};this.getTimeSpentOnPage=function(){var retVal="";var endTime=(new Date()).getTime();retVal=Math.round((endTime-_startTime)/100);if(retVal<1)retVal="";_startTime=(new Date()).getTime();return retVal;};this.saveTimeSpent=function(){if(_btgIsStr(_cookieName)){var endTime=(new Date()).getTime();var elapsedSeconds=Math.round((endTime-_startTime)/100);if(elapsedSeconds<1)elapsedSeconds=1;var cookieVal=elapsedSeconds;cookieVal+=(_btgIsStr(_data))?","+_data:"";_btgCk.set(_cookieName,cookieVal);}};this.getTimespent=function(){if(_btgIsStr(_cookieName)){var timerCookie=_btgCk.read(_cookieName);_btgCk.remove(_cookieName);_startTime=(new Date()).getTime();return(_btgIsStr(timerCookie))?timerCookie:"";}};};mtvn.btg.managers.DependencyManager=function(ttl){var _btgCfg=mtvn.btg.config;var _btgU=mtvn.btg.util;var _btgIsStr=_btgU.String.isDefined;var _failsafeTTL=ttl?ttl:8000;var _failsafeTimerStarted=false;var _timeout=null;var _callQueue=[];var _dependencies=[];var _startFailSafeTimer=function(dm){if(!_failsafeTimerStarted){_failsafeTimerStarted=true;window.setTimeout(dm.sendCalls,_failsafeTTL);return true;}
return false;}
this.add=function(flagname,callback,interval,checkImmediately){if(typeof flagname=="undefined"||typeof callback=="undefined")return false;for(var e=0,len=_dependencies.length;e<len;e++){if(_dependencies[e].flagname==flagname)return false;}
_dependencies[_dependencies.length]={flagname:flagname,callback:callback,interval:(interval?interval:100)};_startFailSafeTimer(this);if(checkImmediately)this.checkDependency(flagname);return true;};this.remove=function(flagname){if(typeof flagname=="string"&&flagname!=""){for(var d=0,len=_dependencies.length;d<len;d++){if(_dependencies[d].flagname==flagname)_dependencies.splice(d,1);}}
if(!this.hasDependency())this.sendCalls();};this.checkDependency=function(flagname){var _dependency=null;for(var d=0,len=_dependencies.length;d<len;d++){if(_dependencies[d].flagname==flagname)_dependency=_dependencies[d];}
if(!_dependency)return false;if(_dependency.callback.apply()){this.remove(flagname);}
else{var _this=this;window.setTimeout(function(){_this.checkDependency(flagname);},_dependency.interval);}};this.hasDependency=function(flagname){if(_btgIsStr(flagname)){var _len=_dependencies.length;for(var d=0;d<_len;d++){if(_dependencies[d].flagname==flagname)return true;}
return false;}
return _dependencies.length>=1;};this.addToCallQueue=function(context,callback){if(!callback)return false;var args=new Array();for(var i=2,len=arguments.length;i<len;i++)
args.push(arguments[i]);_callQueue[_callQueue.length]={context:context?context:this,callback:callback,args:args,config:_btgCfg.ReportSettings};return true;};this.sendCalls=function(){_dependencies=[];var settings=_btgCfg.ReportSettings;for(var q=0,len=_callQueue.length;q<len;q++){_btgCfg.ReportSettings=_callQueue[q].config;_callQueue[q].callback.apply(_callQueue[q].context,_callQueue[q].args);}
_btgCfg.ReportSettings=settings;_callQueue=[];};};mtvn.btg.managers.PluginManager=function(_plugin_list){var _plugins=_plugin_list;var args=new Array();for(var i=1,len=arguments.length;i<len;i++)
args.push(arguments[i]);for(var p=0,len=_plugins.length;p<len;p++){if(typeof _plugins[p].init=="function")_plugins[p].init.apply(this,args);}
this.run=function(_data){for(var p=0,len=_plugins.length;p<len;p++){if(mtvn.btg.util.Object.isDefined(_plugins[p])&&typeof _plugins[p].run=="function")_data=_plugins[p].run(_data);}
return _data;};};mtvn.btg.managers.QueueManager=function(options){this.id=options.id;this.timeToWait=!isNaN(options.timeToWait)?options.timeToWait:1;this.handler=typeof options.handler=="function"?options.handler:function(i){};this.notificationHandler=typeof options.notificationHandler=="function"?options.notificationHandler:function(i){};this.intervalId=null;this.isProcessing=false;this.queue=[];this.processedQueue=[];this.maxNumItems=options.maxNumItems;this.maxElapsed=options.maxElapsed;this.elapsed=0;this.totalItems=0;this.itemsAdded=0;};mtvn.btg.managers.QueueManager.prototype={init:function(){this.isProcessing=true;this.processQueue();this.intervalId=setInterval(this.id+".processQueue()",this.timeToWait);},addToQueue:function(){this.queue.push(arguments);this.itemsAdded++;if(!this.isProcessing)this.init();},processQueue:function(){if(this.isProcessing==true){if(this.queue.length>0){var nextItem=this.queue.shift();this.elapsed=this.elapsed+this.timeToWait;this.totalItems++;if(!this.hasLimit()){this.handler(nextItem);this.processedQueue.push(nextItem);}else{this.notificationHandler(this);this.clearQueue();this.stop();}}else{this.stop();}}},stop:function(){clearInterval(this.intervalId);this.isProcessing=false;this.elapsed=0;this.totalItems=0;this.itemsAdded=0;},hasLimit:function(){return(this.elapsed==this.maxElapsed||this.totalItems>this.maxNumItems);},clearQueue:function(){this.queue=[];this.processedQueue=[];}};mtvn.btg.plugins.Meteor=new function(){var _btgCfg=mtvn.btg.config;var _btgU=mtvn.btg.util;var _btgP=mtvn.btg.plugins;var _DEPENDENCY_FLAG_NAME="meteor_script_load";var _WAIT=100;var _config=null;var _wom=null;var _appId="";this.getWOM=function(){var _cookies=document.cookie.split(";");var _meteorCookie=null;for(var c=0,len=_cookies.length;c<len;c++){var _cookie=_cookies[c].split("=");if(_cookie[0].match(/[a-zA-Z0-9]{8}\-[a-zA-Z0-9]{4}\-[a-zA-Z0-9]{4}\-[a-zA-Z0-9]{4}\-[a-zA-Z0-9]{12}/)){_meteorCookie=unescape(_cookie[1]);eval("var _meteor_settings = "+_meteorCookie);if(typeof _meteor_settings.wom=="undefined")return null;return typeof _meteor_settings.wom=="boolean"?_meteor_settings.wom:null;break;}}
return null;};var _isEnabled=function(){return(mtvn.btg.util.Object.isConfigDefined(_btgCfg.ReportSettings.Meteor)&&_appId!="");}
this.isWOMReported=false;this.init=function(_cfg,_dependencies){_config=_cfg;if(mtvn.btg.util.Object.isDefined(_btgCfg.ReportSettings.Meteor))
_appId=(_btgU.String.isDefined(_btgCfg.ReportSettings.Meteor.applicationId)?_btgCfg.ReportSettings.Meteor.applicationId:"")
if(typeof _config.womVarMap=="undefined")
_config.womVarMap=["prop32","eVar55"];if(typeof _config.womVarMap=="string")
_config.womVarMap=_config.womVarMap.split(",");if(!_isEnabled())return false;_btgP.Meteor.multiTrackTimer.on('count',mtvn.btg.plugins.Meteor.multiTrackScript);_btgP.Meteor.multiTrackTimer.start();_wom=_btgP.Meteor.getWOM();return true;};this.run=function(_data){if(!_isEnabled())return _data;var _wom_value=null;if(typeof _wom=="undefined"||_wom===null){_wom_value="Unknown";new _btgU.Alert('Failed to find Meteor Word-of-Mouth ("wom") value.');}
else if(_wom===true){this.isWOMReported=true;_wom_value="Word of mouth";}
else if(_wom===false){this.isWOMReported=true;_wom_value="Not word of mouth";}
for(var m=0,len=_config.womVarMap.length;m<len;m++){_data[_config.womVarMap[m]]=_wom_value;}
return _data;};this.sendLinkEventCall=function(){var self=_btgCfg.ReportSettings.Meteor;var data={linkName:'Meteor reporting',linkType:'o'};_wom=_btgP.Meteor.getWOM();if((typeof self.enabled=="boolean"&&self.enabled&&self.applicationId!=""))mtvn.btg.Controller.sendLinkEvent(data);}
this.multiTrackScript=function(){var self=(mtvn.btg.util.Object.isDefined(_btgCfg.ReportSettings)?_btgCfg.ReportSettings.Meteor:null);if(typeof meteor!='undefined'){if((mtvn.btg.util.Object.isConfigDefined(self)&&self.applicationId!="")){_btgU.DOM.loadScript('http'+('https:'==document.location.protocol?"s":"")+'://cdnt.meteorsolutions.com/api/multi_track?application_id='+self.applicationId+'&url_storage_source=hash&hash_join=true');}
_btgP.Meteor.multiTrackTimer.stop();}}
this.multiTrackTimer=new _btgU.Timer('mtvn.btg.plugins.Meteor.multiTrackTimer',500);this.womScript=function(){var wom=_btgP.Meteor.getWOM();var self=_btgP.Meteor;if(wom!=null){self.sendLinkEventCall();self.isWOMReported=true;self.womTimer.stop();}}
this.womTimer=new _btgU.Timer('mtvn.btg.plugins.Meteor.womTimer',500);this.multiDomainScript=function(){if(_btgP.Meteor.isWOMReported&&typeof meteor!='undefined'&&typeof meteor.orion!='undefined'&&meteor.orion.init!='undefined'){meteor.orion.init();_btgP.Meteor.multiDomainTimer.stop();}}
this.multiDomainTimer=new _btgU.Timer('mtvn.btg.plugins.Meteor.multiDomainTimer',500);};try{mtvn.btg.util.DOM.loadScript("http"+("https:"==document.location.protocol?"s":"")+"://btg.mtvnservices.com/aria/metsol-mtv.js");mtvn.btg.plugins.Meteor.multiTrackTimer.on('count',mtvn.btg.plugins.Meteor.multiTrackScript);mtvn.btg.plugins.Meteor.multiTrackTimer.start();}catch(e){}
try{mtvn.btg.util.DOM.Events.addListener(window,"load",function(){var btgCfg=mtvn.btg.config;var self=mtvn.btg.plugins.Meteor;if(!self.isWOMReported){self.womTimer.on('count',self.womScript);self.womTimer.start();}
if((mtvn.btg.util.Object.isConfigDefined(self)&&self.applicationId!="")){if(typeof btgCfg.ReportSettings.Meteor.multiDomain=="boolean"&&btgCfg.ReportSettings.Meteor.multiDomain){self.multiDomainTimer.on('count',self.multiDomainScript);self.multiDomainTimer.start();}}});}catch(e){}
mtvn.btg.plugins.GUID=new function(){var _btgU=mtvn.btg.util;var _btgP=mtvn.btg.plugins;var _config=null;var _value=null;var _dependsOn=function(){var _cookie=_btgU.Cookie.read("mtvn_guid");if(typeof _cookie=="string")_value=_cookie;return typeof _value=="string";}
var _isEnabled=function(){return(typeof _config.enableGuidPlugin=="boolean"&&_config.enableGuidPlugin);}
this.isGUIDReported=false;this.hasGUIDCookie=function(){return _dependsOn();}
this.init=function(_cfg,_dependencies){_config=_cfg;if(!_isEnabled())return false;if(typeof _config.guidIdVarMap=="undefined")
_config.guidIdVarMap=["eVar18"];if(typeof _config.guidIdVarMap=="string")
_config.guidIdVarMap=_config.guidIdVarMap.split(",");return true;};this.run=function(_data){if(!_isEnabled())return _data;if(!_dependsOn()){new _btgU.Alert('Failed to find the GUID value.');return _data;}
for(var m=0,len=_config.guidIdVarMap.length;m<len;m++){_data[_config.guidIdVarMap[m]]=_value;}
this.isGUIDReported=true;return _data;};this.guidScript=function(){var self=_btgP.GUID;if(self.hasGUIDCookie()&&!self.isGUIDReported){self.sendLinkEventCall();self.isGUIDReported=true;return true;}
return false;}
this.sendLinkEventCall=function(){var data={linkName:'GUID reporting',linkType:'o'};data=_btgP.GUID.run(data)
if(_isEnabled)mtvn.btg.Controller.sendLinkEvent(data);};};try{if(!mtvn.btg.plugins.GUID.hasGUIDCookie())
mtvn.btg.util.DOM.loadScript("http"+('https:'==document.location.protocol?"s":"")+"://btg.mtvnservices.com/aria/guid.html");}catch(e){}
try{mtvn.btg.util.DOM.Events.addListener(window,"load",function(){var btgCfg=mtvn.btg.config;var btgP=mtvn.btg.plugins;var isConfigDefined=mtvn.btg.util.Object.isConfigDefined;if(isConfigDefined(btgCfg.ReportSettings.Omniture)){if(btgCfg.ReportSettings.Omniture.enableGuidPlugin&&btgCfg.ReportSettings.Omniture.enableGuidAuxiliaryCall&&!btgP.GUID.isGUIDReported){var _dependency=new mtvn.btg.managers.DependencyManager();_dependency.add("mtvn_guid",btgP.GUID.guidScript);_dependency.checkDependency("mtvn_guid");}}});}catch(e){}
mtvn.btg.reporting.ABTest=function(id,groups,callback){var _btgCk=mtvn.btg.util.Cookie;if(typeof id!=="string"||mtvn.btg.util.String.charTrim(id," ")==""){throw new Error("mtvn.btg.reporting.ABTest: The first argument to the constructor must be a unique ID of the type {String}.");return null;}
if(typeof groups!="object"||groups.length<2){throw new Error("mtvn.btg.reporting.ABTest: The second argument to the constructor must be an Array of 2 or more Objects, each with a \"name\" and a \"weight\" property.");return null;}
var _floor=0;var _RANDOM_NUM=Math.floor(Math.random()*(100-1+1)+1);var _COOKIE_NAME="MTVN_ABTest_"+id;var _cookie=_btgCk.read(_COOKIE_NAME);var _id=id;var _group=null;this.getId=function(){return _id;};this.getGroup=function(){return _group;};if(_cookie&&_cookie!=""){_group=_cookie;}
else{groups.sort(function(a,b){return b.weight-a.weight;});for(var g=0,len=groups.length;g<len;g++){var _ceiling=_floor+groups[g].weight;if(_RANDOM_NUM>_floor&&_RANDOM_NUM<=_ceiling){_group=groups[g].name;}
_floor+=groups[g].weight;};if(!_group){throw new Error("mtvn.btg.reporting.ABTest: Couldn't assign user to an A/B Test group.");return null;}
if(_floor!=100){throw new Error("mtvn.btg.reporting.ABTest: The sum of the weights of your A/B Test groups must equal 100 exactly.");return null;}
_btgCk.set(_COOKIE_NAME,_group,"Thu, 31-Dec-2038 11:59:59 GMT");}
mtvn.btg.reporting.UserSegment.set(_id+": "+_group);mtvn.btg.util.Events.ABTest_Group_Assigned.fire(_id,_group);if(typeof callback=="function")callback.call(this);};mtvn.btg.reporting.ComScore=function(config){this.btgIsStr=mtvn.btg.util.String.isDefined;this.btgU=mtvn.btg.util;this.btgGv=mtvn.btg.globalvars;this.config=config;this.c1=(this.btgIsStr(this.config.c1))?this.config.c1:"2";this.c2=(this.btgIsStr(this.config.c2))?this.config.c2:"6036034";this.c3=(this.btgIsStr(this.config.c3))?this.config.c3:'';this.c4=(this.btgIsStr(this.config.c4))?this.config.c4:(this.btgU.Object.isDefined(this.btgU.Sections))?escape(this.btgU.Sections.getReportingSections()):(this.btgGv.IS_TOP_ACCESSIBLE)?escape(top.document.location.hostname+top.document.location.pathname):escape(document.location.hostname+document.location.pathname);this.c5=(this.btgIsStr(this.config.c5))?this.config.c5:'20000';this.c6=(this.btgIsStr(this.config.c6))?this.config.c6:'';this.c15=(this.btgIsStr(this.config.c15))?this.config.c15:'';this.sendPageCall();};mtvn.btg.reporting.ComScore.prototype={sendPageCall:function(data){var rm=mtvn.btg.reporting.ReportingManager;if(typeof(data)==='object'){if(this.btgIsStr(data.comScore1))this.c1=data.comScore1;if(this.btgIsStr(data.comScore2))this.c2=data.comScore2;if(this.btgIsStr(data.comScore3))this.c3=data.comScore3;if(this.btgIsStr(data.comScore4))this.c4=data.comScore4;if(this.btgIsStr(data.comScore5))this.c5=data.comScore5;if(this.btgIsStr(data.comScore6))this.c6=data.comScore6;if(this.btgIsStr(data.comScore15))this.c15=data.comScore15;}
var cs_params=["c1=",this.c1,"&c2=",this.c2,"&c3=",this.c3,"&c4=",this.c4,"&c5=",this.c5,"&c6=",this.c6,"&c15=",this.c15].join('');try{if(!this.btgGv.IS_UNIT_TEST&&!rm.isScriptIncluded.comscore){this.btgU.DOM.loadScript((document.location.protocol=='https:'?'https://sb':'http://b')+'.scorecardresearch.com/beacon.js?'+cs_params);rm.isScriptIncluded.comscore=true;}}catch(e){}}};mtvn.btg.reporting.FluxHosted={sendCall:function(){var _chkContextObjectExists=function(){if(typeof Flux!="object"||typeof Flux.Context!="object")return false;return true;};var _chkCommunityObjectsExist=function(){if(typeof FluxReporting!="object"||typeof FluxReporting.Standard!="object")return false;return true;};var _getMemberState=function(){if(!_chkContextObjectExists())return null;return Flux.Context.isCommunityMember()?"member":"non-member";};var _getLoginState=function(){if(!_chkContextObjectExists())return null;return Flux.Context.isUserAuthenticated()?"logged-in":"not logged-in";};var _mapVars=function(){var isStr=mtvn.btg.util.String.isDefined;var frs=FluxReporting.Standard;var _data={};if(!_chkContextObjectExists()&&!_chkCommunityObjectsExist())return false;var pageName=location.pathname.substring(1);pageName=pageName=="/"||pageName==""?"main.aspx":pageName;pageName=pageName.substring(0,2)=='-/'?pageName.substring(2):pageName;var pathsToTrim=["/profile","/Topic"];for(var i=0,len=pathsToTrim.length;i<len;i++){if(pageName.indexOf(pathsToTrim[i])>-1){pageName=pageName.substring(0,pageName.indexOf(pathsToTrim[i])+pathsToTrim[i].length);}}
_data["pageName"]=_data["hier1"]=pageName;if(_chkContextObjectExists()){_data["prop10"]=_data["eVar10"]=_getMemberState();_data["prop11"]=_data["eVar11"]=_getLoginState();};if(_chkCommunityObjectsExist()){_data["prop3"]=_data["eVar3"]=(isStr(frs.Community_Name)?frs.Community_Name:null);_data["prop4"]=_data["eVar4"]=(isStr(frs.Content_UCID)?frs.Content_UCID:null);_data["prop5"]=_data["eVar5"]=(isStr(frs.Content_Title)?frs.Content_Title:null);_data["prop6"]=_data["eVar6"]=(isStr(frs.Content_Section)?frs.Content_Section:null);_data["prop7"]=_data["eVar7"]=(isStr(frs.Content_Page)?frs.Content_Page:null);_data["prop8"]=_data["eVar8"]=(isStr(frs.Content_Details)?frs.Content_Details:null);_data["prop9"]=_data["eVar9"]=(isStr(frs.Content_Subtype)?frs.Content_Subtype:null);};_data["prop12"]=_data["eVar12"]=location.host;if(typeof FluxReporting.Overrides!="undefined"){for(i in FluxReporting.Overrides){_data[i]=FluxReporting.Overrides[i];}}
return _data;};var data=_mapVars();var oldConfig=mtvn.btg.config.ReportSettings;mtvn.btg.config.ReportSettings={Omniture:{enabled:true,account:'viafluxrollup',dynamicAccountSelection:'true',dynamicAccountList:'viafluxrollupdev=mtv-d,mtv-q,mtvi.com',linkInternalFilters:'javascript:,flux.com,mtvi.com,'+location.hostname,trackExternalLinks:true,trackDownloadLinks:true,isFluxHosted:true},GoogleAnalytics:{enabled:false},Comscore:{enabled:false},QuantCast:{enabled:false},Nielsen:{enabled:false}};var ctrlr=mtvn.btg.Controller;ctrlr.init();ctrlr.sendPageCall(data);mtvn.btg.config.ReportSettings=oldConfig;return true;}};if(typeof FluxReporting!="undefined"){mtvn.btg.util.DOM.Events.addListener(window,"load",function(){mtvn.btg.reporting.FluxHosted.sendCall();})};mtvn.btg.reporting.FluxState=new function(){var _chkFluxVersion=function(){if(typeof Flux!="object"||Flux==null){return null;}
else if(typeof Flux.context=="object"&&Flux.context!=null&&typeof Flux.context.user=="object"&&Flux.context.user!=null){return 3;}
else if(typeof Flux.Context=="object"&&Flux.Context!=null){return 2;}
return null;};var _getMemberState=function(){var fv=_chkFluxVersion();var memberState=null;switch(fv){case 3:memberState=Flux.context.user.communityMember;break;case 2:memberState=Flux.Context.isCommunityMember();break;}
return memberState?"member":"non-member";};var _getLoginState=function(context){var us=mtvn.btg.reporting.UserSegment;var fv=_chkFluxVersion();var loginState=null;switch(fv){case 3:if(Flux.context.user.memberType){loginState=Flux.context.user.memberType;us.add(context,loginState+" User");}
else if(Flux.context.user.facebookOnly){loginState="FB Only";us.add(context,"FB Connect Only User");}
else if(Flux.context.user.facebookConnected){loginState="Flux + FB";us.add(context,"Flux & FB Connect User");}
else if(typeof Flux.context.user.ucid=="string"&&Flux.context.user.ucid.length>0){loginState="Flux Only";us.add(context,"Flux Only User");}
else loginState="not logged-in";break;case 2:loginState=Flux.Context.isUserAuthenticated()?"logged-in":"not logged-in";break;default:loginState="not logged-in";}
if(loginState&&loginState!="not logged-in")us.add(context,"LoggedIn");return loginState;};this.setData=function(context,data){data[context.config.fluxVarMap.memberState]=_getMemberState();data[context.config.fluxVarMap.loginState]=_getLoginState(context);return data;};};mtvn.btg.reporting.GoogleAnalytics=function(config){var _DEPENDENCY_FLAG_NAME="ga_script_load";var _WAIT=100;var timeout=null;this.btgGv=mtvn.btg.globalvars;this.btgIsStr=mtvn.btg.util.String.isDefined;this.config=config;if(config.iframeAccount!=''&&!this.btgGv.IS_UNIT_TEST){document.write(unescape("%3Cdiv id='btg_ga_div'%3E%3C/div%3E"));}
this.account=config.account;this.dependencies=new mtvn.btg.managers.DependencyManager();this.dependencies.add(_DEPENDENCY_FLAG_NAME,function(){return typeof(_gat)=="object";},_WAIT);this.dependencies.checkDependency(_DEPENDENCY_FLAG_NAME);};mtvn.btg.reporting.GoogleAnalytics.prototype={sendPageCall:function(data){if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,this.sendPageCall,data);return;}
if(this.btgIsStr(this.config.iframeAccount)){var instances=[];if(this.config.iframeAccount.indexOf(",")>-1)
{instances=this.config.iframeAccount.split(",");}else{instances[0]=this.config.iframeAccount;}
for(var i=0,len=instances.length;i<len;i++)
{var _div=document.getElementById("btg_ga_div");var _wl=window.location;var uri=data.pageName;var _uri=uri.substring(0,1)!="/"?"/"+uri:uri;var _refer=document.referrer;var _ga="//btg.mtvnservices.com/aria/ga.html?ga="+instances[i]+"&uri=";_refer="&ref="+escape(_refer);if(_div){var newChild=document.createElement("iframe");newChild.src=_wl.protocol+_ga+_wl.hostname+_uri+_refer;newChild.style.width=1+'px';newChild.style.height=1+'px';newChild.style.visibility='hidden';newChild.style.left=-50+'px';newChild.style.top=-50+'px';newChild.style.position='absolute';_div.appendChild(newChild);}}}
if(this.btgIsStr(this.config.account))
{try
{if(!this.btgGv.IS_UNIT_TEST){if(typeof(_gat)=="object"){var pageTracker=_gat._getTracker(this.config.account);pageTracker._trackPageview();};}}
catch(e){}}},sendLinkEvent:function(data){if(!data||!this.btgIsStr(data.category)||!this.btgIsStr(data.action)||!this.btgIsStr(data.label))return;if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,this.sendLinkEvent,data);return;}
data.value=typeof data.value!="undefined"&&typeof parseInt(data.value)=="number"?parseInt(data.value):null;var pageTracker=_gat._createTracker(this.config.account,"event_tracker");pageTracker._setDomainName("");pageTracker._trackEvent(data.category,data.action,data.label,data.value);}};try{if(!mtvn.btg.globalvars.IS_UNIT_TEST){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);}}catch(e){};mtvn.btg.reporting.Nielsen=function(config){this.config=config;this.sendPageCall();};mtvn.btg.reporting.Nielsen.prototype={sendPageCall:function(data){var btgU=mtvn.btg.util;var isStr=btgU.String.isDefined;var isObj=btgU.Object.isDefined;var ci=null;if(!ci&&isStr(this.config.cid))ci=this.config.cid;if(!ci)return false;var d=new Image(1,1);d.onerror=d.onload=function(){d.onerror=d.onload=null;};d.src=["//secure-us.imrworldwide.com/cgi-bin/m?ci="+ci+"&cg=0&cc=1&si=",escape(window.location.href),"&rp=",escape(document.referrer),"&ts=compact&rnd=",(new Date()).getTime()].join('');}};mtvn.btg.reporting.Omniture=function(config){this.pageViewEventSet=false;this.btgStr=mtvn.btg.util.String;this.btgIsStr=this.btgStr.isDefined;var _btgMgrs=mtvn.btg.managers;var _btgPlgs=mtvn.btg.plugins;this.btgCfg=mtvn.btg.config;this.btgRep=mtvn.btg.reporting;this.btgSv=mtvn.btg.util.Session.Variables;this.btgCk=mtvn.btg.util.Cookie;this.name="Omniture";this.values=[];this.newRepeatProp=this.btgIsStr(config.newRepeatProp)?config.newRepeatProp:"prop41";this.config=config;this.hcode=this.btgRep.omniture.Hcode;this.hcode.setAccount(this.config.account);if(this.config.enableFirstPartyCookie&&this.btgIsStr(this.config.cName)){this.hcode.trackingServer=this.config.cName;}
for(var i in this.config)this.hcode[i]=this.config[i];this.url="http"+(this.hcode.ssl?"s":"")+"://"+this.hcode.un+".112.2o7.net/b/ss/"+this.hcode.un+"/1/";this.dependencies=new _btgMgrs.DependencyManager();this.plugins=new _btgMgrs.PluginManager([_btgPlgs.Meteor,_btgPlgs.GUID],this.config,this.dependencies);if(typeof this.config.userSegmentVarMap=="undefined"){this.config.userSegmentVarMap={traffic:"prop31",commerce:"products"}
this.btgCfg.ReportSettings.Omniture.userSegmentVarMap=this.config.userSegmentVarMap;}
if(typeof this.btgRep.UserSegment=="object")
this.btgRep.UserSegment.init(this);if(typeof this.config.fluxVarMap=="undefined"){this.config.fluxVarMap={memberState:"prop5",loginState:"prop6"}
this.btgCfg.ReportSettings.Omniture.fluxVarMap=this.config.fluxVarMap;}
if(typeof this.config.timePartingVarMap=="undefined"){this.config.timePartingVarMap={trafficDay:"prop33",trafficHour:"prop34",commerceDay:"eVar45",commerceHour:"eVar46"}}
if(typeof this.config.photosVarMap=="undefined"){this.config.photosVarMap={application:["prop48","eVar31"],gallery:"eVar16",photoId:"eVar17",flipbookView:"event57",photoView:"event58",adView:"event59",timeSpent:"event60"}}
if(typeof mtvn_btg_Photos=="object"&&mtvn_btg_Photos!=null)
this.btgRep.Photos.init(this.config.photosVarMap);if(typeof this.config.pageViewEvent!="string"){this.config.pageViewEvent="event16";};if(typeof this.btgRep.player.MediaPlayer=="object")
this.btgRep.player.MediaPlayer.init(this);if(typeof this.config.sessionVars!="undefined")this.btgSv.add(this.config.sessionVars);};mtvn.btg.reporting.Omniture.prototype={setAttribute:function(k,v){if(this.btgIsStr(k)){this.hcode[k]=(this.btgIsStr(v)?v:'');return true;}
else{return false;}},getAttribute:function(k){return this.hcode[k];},setValues:function(data){for(var i in data){this.setAttribute(i,data[i]);this.values.push(i);}
return true;},clearValues:function(){for(var x=0,len=this.values.length;x<len;x++){if(this.values[x]!="pageName"){this.setAttribute(this.values[x],"");}}
this.clearNewRepeat();this.values=this.getPageName()?["pageName"]:[];return true;},setNewRepeat:function(){this.setAttribute(this.newRepeatProp,this.hcode.getNewRepeat());return true;},clearNewRepeat:function(){this.setAttribute(this.newRepeatProp,"");return true;},getValOnce:function(v,c,e){return this.hcode.getValOnce(v,c,e);},getNewRepeat:function(){return this.hcode.getNewRepeat();},getPageName:function(){return this.getAttribute("pageName");},preprocessData:function(data){if(typeof mboxDefine=="function"&&typeof this.config.enableTestAndTarget=="boolean"&&this.config.enableTestAndTarget){data["tnt"]=this.hcode.trackTNT();if(data["tnt"]=="")
data["tnt"]=this.btgRep.TestAndTarget.getCampaignId();}
if(typeof this.btgCfg.ReportSettings.Omniture.enableVisitorNamespace=="boolean"&&this.btgCfg.ReportSettings.Omniture.enableVisitorNamespace)
data["visitorNamespace"]=mtvn.btg.globalvars.VISITOR_NAMESPACE;if(typeof this.btgRep.UserSegment!="undefined"){data=this.btgRep.UserSegment.setData(this,data);}
if(typeof mtvn.btg.util.Session!="undefined")
data=this.btgSv.setData(data);return data;},sendPageCall:function(data){var btgGms=mtvn.btg.reporting.games;if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,this.sendPageCall,data);return;}
data=typeof data!="object"?{}:data;data=this.plugins.run(data);if(typeof data.pageName!="string"||data.pageName==""){data.pageName=typeof this.hcode.pageName==="string"&&this.hcode.pageName!=""?this.hcode.pageName:this.btgCfg.ReportSettings._defaultPageName;}
if(typeof this.config.noPagenameSlash!="undefined"&&this.config.noPagenameSlash&&data.pageName.charAt(0)=="/"){data.pageName=data.pageName.substring(1);}
if(typeof this.config.defaultHier=="string"&&this.config.defaultHier!=""){if(typeof data[this.config.defaultHier]!=="string"||data[this.config.defaultHier]==""){if(typeof this.hcode[this.config.defaultHier]==="string"&&this.hcode[this.config.defaultHier]!="")
var _hier=this.hcode[this.config.defaultHier];else if(typeof data.docHierarchy==="string"&&data.docHierarchy!="")
var _hier=data.docHierarchy;else var _hier=data.pageName;if(_hier.charAt(_hier.length-1)=="/"){if(typeof this.btgCfg.ReportSettings.indexFileName==="string")
data[this.config.defaultHier]=_hier+this.btgCfg.ReportSettings.indexFileName;else
data[this.config.defaultHier]=_hier+"index";}
else data[this.config.defaultHier]=_hier;data[this.config.defaultHier]=this.btgStr.charLtrim(data[this.config.defaultHier],"/");}}
if(typeof data.channel!="string"||data.channel==""){if(typeof this.hcode.channel=="string"){data.channel=this.hcode.channel;}
else if(data.pageName=="/"){data.channel=data.pageName;}else{var parts=data.pageName.split("/");for(var p=0,len=parts.length;p<len;p++){if(parts[p]!=""){data.channel=parts[p];break;}}}}
if(typeof data.channel=="string")data["eVar49"]=data["channel"];if(typeof this.btgRep.SEO!="undefined")data=this.btgRep.SEO.setData(this,data);if(typeof this.btgRep.BrowserToolbar!="undefined")data=this.btgRep.BrowserToolbar.setData(this,data);if((typeof this.config.isFluxHosted=="undefined"||(typeof this.config.isFluxHosted!="undefined"&&this.config.isFluxHosted!=true))&&typeof this.btgRep.FluxState!="undefined")data=this.btgRep.FluxState.setData(this,data);if(typeof this.btgRep.Search!="undefined")data=this.btgRep.Search.setData(data);if(typeof this.btgRep.Search!="undefined")data=this.btgRep.Search.chkConversions(data);if(typeof this.btgRep.Photos!="undefined")data=this.btgRep.Photos.setData(data);if(typeof this.btgRep.RecsABTesting!="undefined")data=this.btgRep.RecsABTesting.setData(this,data);if(typeof this.config.enableTimeParting!="undefined"&&this.config.enableTimeParting==true&&typeof this.config.timePartingVarMap!="undefined"){var tz=typeof this.btgCfg.ReportSettings.Omniture.timezone!="undefined"?this.btgCfg.ReportSettings.Omniture.timezone:"-5";data[this.config.timePartingVarMap.commerceHour]=data[this.config.timePartingVarMap.trafficHour]=this.hcode.getTimeParting('h',tz);data[this.config.timePartingVarMap.commerceDay]=data[this.config.timePartingVarMap.trafficDay]=this.hcode.getTimeParting('d',tz);}
if(typeof this.config.percentPageViewedVarMap!="undefined"){if(typeof this.config.percentPageViewedVarMap.previousPage!="undefined")
data[this.config.percentPageViewedVarMap.previousPage]=this.hcode.getPreviousValue(data["pageName"],"s_pn");if(typeof this.config.percentPageViewedVarMap.percentage!="undefined"){if(this.config.percentPageViewedVarMap.percentage.indexOf("event")>=0){if(typeof data["events"]=="string"&&data["events"]!="")data["events"]+=",";else data["events"]="";data["events"]+=this.config.percentPageViewedVarMap.percentage;if(typeof data["products"]=="string"&&data["products"]!="")data["products"]+=",";else data["products"]="";data["products"]+=";;;;"+this.config.percentPageViewedVarMap.percentage+"="+this.hcode.getPercentPageViewed();}
else data[this.config.percentPageViewedVarMap.percentage]=this.hcode.getPercentPageViewed();}}
if(!this.pageViewEventSet){var _events=typeof data["events"]==="string"?data["events"]:"";if(typeof this.config.pageViewEvent==="string"&&_events.indexOf(this.config.pageViewEvent)<0){if(_events!="")_events+=",";_events+=this.config.pageViewEvent;data["events"]=_events;this.pageViewEventSet=true;}}
if(typeof btgGms.GameReporter!="undefined"){btgGms.GameReporter.gtsEvent="event74";data=btgGms.GameReporter.setData(data);}
data=this.preprocessData(data);this.setValues(data);this.setNewRepeat();this.attachLoggedEvent();this.hcode.t();this.clearValues();return true;},sendLinkEvent:function(data){if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,this.sendPageCall,data);return;}
data=typeof data!="object"?{}:data;data=this.plugins.run(data);var sessionPageName=this.getPageName();data.lnk=data.lnk?this.hcode.co(data.lnk):true;data.linkType=data.linkType?data.linkType:"o";data.referrer=location.href;data=this.preprocessData(data);this.setValues(data);this.setAttribute("pageName","");this.attachLoggedEvent();this.hcode.t();this.clearValues();this.setAttribute("pageName",sessionPageName);return true;},setAccountVars:function(o){this.setAttribute("un",o.name);this.setAttribute("dynamicAccountSelection",o.dynamic);this.setAttribute("dynamicAccountList",o.list);this.setAttribute("linkInternalFilters",o.filters);this.setAttribute("charSet",o.chartset);for(var i in o){if(this.btgIsStr(i))
this.setAttribute(i,(this.btgIsStr(o[i])?o[i]:''));};},logEvent:function(data){var btgCk_set=this.btgCk.set;if(this.btgIsStr(data)){if(this.btgIsStr(data['UIEvent'])){btgCk_set('UIEvent',data['UIEvent']);}
if(this.btgIsStr(data['UIEventName'])){btgCk_set('UIEventName',data['UIEventName']);}
if(this.btgIsStr(data['UITrackingCode'])){btgCk_set('UITrackingCode',data['UITrackingCode']);}}},attachLoggedEvent:function(){var btgCk_read=this.btgCk.read;var btgCk_remove=this.btgCk.remove;if(this.btgIsStr(btgCk_read('UIEvent'))){this.setAttribute('events',btgCk_read('UIEvent'));btgCk_remove('UIEvent');}
if(this.btgIsStr(btgCk_read('UIEventName'))){this.setAttribute('eVar40',btgCk_read('UIEventName'));btgCk_remove('UIEventName');}
if(this.btgIsStr(btgCk_read('UITrackingCode'))){this.setAttribute('campaign',btgCk_read('UITrackingCode'));btgCk_remove('UITrackingCode');}
return true;},clearAllVars:function(){for(var i=1;i<=50;i++){this.setAttribute("eVar"+i,'');this.setAttribute("prop"+i,'');if(i<6){this.setAttribute("hier"+i,"");}}
this.setAttribute("pageName","");this.setAttribute("channel","");return true;}};mtvn.btg.reporting.QuantCast=function(config){var _btgCfg=mtvn.btg.config;var _btgRm=mtvn.btg.reporting.ReportingManager;var _btgDomEv=mtvn.btg.util.DOM.Events;this.labels="";this.config=config;var _qacct="p-94wNw88f65Rhk";var qcHost=(("https:"==document.location.protocol)?"https://secure":"http://edge");var qcModuleExists=typeof _btgCfg.AdSettings!="undefined"&&typeof _btgCfg.AdSettings.QuantCast!="undefined";var demoTargetingFlag=qcModuleExists&&typeof _btgCfg.AdSettings.QuantCast.enableDemoTargeting=="boolean"?_btgCfg.AdSettings.QuantCast.enableDemoTargeting:true;if(demoTargetingFlag&&!mtvn.btg.globalvars.IS_UNIT_TEST&&!_btgRm.isScriptIncluded.quantcast){_btgDomEv.addListener(window,"load",function(){mtvn.btg.util.DOM.loadScript(qcHost+".quantserve.com/quant.js",true);});if(demoTargetingFlag&&!mtvn.btg.util.String.isDefined(mtvn.btg.util.Cookie.read('qcDemo'))){try{_btgDomEv.addListener(window,"load",function(){mtvn.btg.util.DOM.loadScript("http"+('https:'==document.location.protocol?"s":"")+"://pixel.quantserve.com/api/segments.json?a="+_qacct+"&callback=mtvn.btg.reporting.QuantCast.Ads.setCookieDemoTargetVal");});}catch(e){}}
_btgRm.isScriptIncluded.quantcast=true;}
this.labels=this.config.labels;};mtvn.btg.reporting.QuantCast.prototype={sendPageCall:function(data){if(this.config.reportMode=='direct')
{try
{_qoptions={labels:this.labels};_qacct="p-94wNw88f65Rhk";quantserve();}
catch(e){};}}};mtvn.btg.reporting.QuantCast.Ads=new function(){this.setLabels=function(data,adsections){try{var _labels="";var dartSite="";var sections="";dartSite=data.dartSite.replace(/\./g,'_');sections=adsections.replace(/^\//m,'');sections=sections.replace(/\//g,'.');_labels=mtvn.btg.config.ReportSettings.QuantCast.labels+",Viacom Global Digital Network.MTVN Digital Ad Sales.Content.Pages."+dartSite+"."+sections;_qoptions={labels:_labels};_qacct="p-94wNw88f65Rhk";quantserve();}
catch(e){};};this.setCookieDemoTargetVal=function(result){var demoTokenStr=[];for(var i=0,len=result.segments.length;i<len;i++)
demoTokenStr[i]="demo="+result.segments[i].id;mtvn.btg.util.Cookie.set('qcDemo',escape(demoTokenStr.join(";")));};};mtvn.btg.reporting.ReportingManager=new function(){var hasOmniture=false;var hasNielsen=false;var hasQuantCast=false;var hasComScore=false;var hasGoogleAnalytics=false;var hasChoiceStream=false;var pageName;var config;var omniture;var nielsen;var quantcast;var comscore;var googleAnalytics;this.isScriptIncluded={comscore:false,quantcast:false,googleAnalytics:false};this.init=function(){var btgRep=mtvn.btg.reporting;config=mtvn.btg.config.ReportSettings;var isConfigDefined=mtvn.btg.util.Object.isConfigDefined;if(isConfigDefined(config.Omniture)&&btgRep.Omniture){omniture=new btgRep.Omniture(config.Omniture);hasOmniture=true;}
if(isConfigDefined(config.Nielsen)&&btgRep.Nielsen){nielsen=new btgRep.Nielsen(config.Nielsen);hasNielsen=true;}
if(isConfigDefined(config.GoogleAnalytics)&&btgRep.GoogleAnalytics){googleAnalytics=new btgRep.GoogleAnalytics(config.GoogleAnalytics);hasGoogleAnalytics=true;}
if(isConfigDefined(config.QuantCast)&&btgRep.QuantCast){quantcast=new btgRep.QuantCast(config.QuantCast);hasQuantCast=true;}
if(isConfigDefined(config.ComScore)&&btgRep.ComScore){comscore=new btgRep.ComScore(config.ComScore);hasComScore=true;}
if(btgRep.GUID)
btgRep.GUID.init();if(config.ChoiceStream&&config.ChoiceStream.enabled&&mtvn.btg.reporting.ChoiceStream){choicestream=new mtvn.btg.reporting.ChoiceStream(config.ChoiceStream);hasChoiceStream=true;}};this.sendPageCall=function(data){if(hasOmniture){var omniData=typeof data.omniture=="object"&&data.omniture!=null?data.omniture:data;omniture.sendPageCall(omniData);pageName=omniture.getPageName();}
if(hasQuantCast){var qcData=typeof data.quantCast=="object"&&data.quantCast!=null?data.quantCast:data;quantcast.sendPageCall(qcData);}
if(hasGoogleAnalytics){var gaData=typeof data.googleAnalytics=="object"&&data.googleAnalytics!=null?data.googleAnalytics:data;googleAnalytics.sendPageCall(gaData);}};this.sendLinkEvent=function(data){if(hasOmniture){var omniData=typeof data.omniture=="object"&&data.omniture!=null?data.omniture:data;omniture.sendLinkEvent(omniData);}
if(hasGoogleAnalytics&&mtvn.btg.util.Object.isDefined(data.googleAnalytics)){googleAnalytics.sendLinkEvent(data.googleAnalytics);}};this.getData=function(){return{pageName:pageName};};this.getOmniture=function(){return hasOmniture?omniture:null;};this.setChoiceStreamRequest=function(data,isActivity){if(hasChoiceStream)
choicestream.setChoiceStreamRequest(data,isActivity);}};mtvn.btg.reporting.TestAndTarget={btgIsStr:mtvn.btg.util.String.isDefined,btgCfg:mtvn.btg.config,campaignId:"",isEnabled:function(){return(this.btgIsStr(this.btgCfg.ReportSettings.Omniture.enableTestAndTarget)&&this.btgCfg.ReportSettings.Omniture.enableTestAndTarget);},init:function(){if(!this.isEnabled())
return false;var map=(typeof this.btgCfg.ReportSettings.Omniture.mboxMap!="undefined"?this.btgCfg.ReportSettings.Omniture.mboxMap:"");for(var i=0,len=map.length;i<len;i++){var tempId="temp_"+map[i].elementId;var tempDiv=document.createElement("div");tempDiv.setAttribute("id",tempId);document.getElementsByTagName("body")[0].appendChild(tempDiv);var mboxId=map[i].mboxId;var params=map[i].params;if(this.btgIsStr(map[i].params)){mboxDefine(tempId,mboxId,params);mboxUpdate(mboxId,map[i].params);}
else{mboxDefine(tempId,mboxId);mboxUpdate(mboxId);}}},convertMbox:function(mboxId){if(!this.isEnabled())
return false;var tempId="div_"+mtvn.btg.util.Math.random(100000000000000000,999999999999999999);;var tempDiv=document.createElement("div");document.getElementsByTagName("body")[0].appendChild(tempDiv);mboxDefine(tempId,mboxId);mboxUpdate(mboxId);},createMboxes:function(map){if(!this.isEnabled())
return false;if(typeof this.btgCfg.ReportSettings.Omniture.mboxMap=="object"){if(typeof map!="object")
map=this.btgCfg.ReportSettings.Omniture.mboxMap;else
map=map.concat(this.btgCfg.ReportSettings.Omniture.mboxMap);}
for(i in map){var elementId=map[i].elementId;if(!document.getElementById(elementId))continue;var mboxId=map[i].mboxId;var params=map[i].params;var tempId="temp_"+elementId;var mboxDivId="mboxImported-default-"+mboxId+"-0";if(document.getElementById(mboxDivId).childNodes.length>3){document.getElementById(elementId).innerHTML="";document.getElementById(elementId).appendChild(document.getElementById(mboxDivId));}}},getCampaignId:function(){return this.campaignId;},setCampaignId:function(id){this.campaignId=id;}};mtvn.btg.reporting.Search=new function(){var _btgCk=mtvn.btg.util.Cookie;var _events="";var _setEvent=function(evt){if(_events.indexOf(evt)<0){if(_events!="")_events+=",";_events+=evt;}
return _events;};this.init=function(context){};this.setData=function(_data){if(typeof com_mtvi_SSDC!="object")return _data;var linkTrackVars="events,prop31";_setEvent("event36");_data["eVar3"]=typeof com_mtvi_SSDC.srchtype=="string"?com_mtvi_SSDC.srchtype:"GENERAL";if(typeof com_mtvi_SSDC.srchsyn!="undefined"){_setEvent("event33");if(typeof com_mtvi_SSDC.srchsyn=="object"){for(var s=0,len=com_mtvi_SSDC.srchsyn.length;s<len;s++)com_mtvi_SSDC.srchsyn[s]=com_mtvi_SSDC.srchsyn[s].replace(/\,/,"");com_mtvi_SSDC.srchsyn=com_mtvi_SSDC.srchsyn.join(",");}
_data["eVar36"]=com_mtvi_SSDC.srchsyn;linkTrackVars+=",eVar36";}
if(typeof com_mtvi_SSDC.srchterm=="string"){_setEvent("event38");_data["eVar2"]=com_mtvi_SSDC.srchterm;linkTrackVars+=",eVar2";}
else if(typeof com_mtvi_SSDC.srchfail=="string"){_setEvent("event37");_data["eVar4"]=typeof com_mtvi_SSDC.appfailure=="boolean"&&com_mtvi_SSDC.appfailure?"APP_FAILURE":com_mtvi_SSDC.srchfail;linkTrackVars+=",eVar4";}
mtvn.btg.reporting.UserSegment.set("SiteSearcher");_data["linkTrackVars"]=linkTrackVars;_data["linkTrackEvents"]=_events;return _data;};this.sendLinkEvent=function(){if(!com_mtvi_SSDC)return false;var _data={linkName:"SITE_SEARCH_RESULTS",linkType:"o"}
_data=this.setData(_data);mtvn.btg.Controller.sendLinkEvent(_data);return true;};this.chkConversions=function(_data){var btgCk_read=_btgCk.read;var btgCk_remove=_btgCk.remove;if(typeof _data.events=="string")_events=_data.events;if(btgCk_read("mtvn_btg_SSDC_conv")){_setEvent("event35");btgCk_remove("mtvn_btg_SSDC_conv");}
if(btgCk_read("mtvn_btg_SSDC_syn_conv")){_setEvent("event34");btgCk_remove("mtvn_btg_SSDC_syn_conv");}
if(btgCk_read("mtvn_btg_SSDC_typeahead_conv")){_setEvent("event39");btgCk_remove("mtvn_btg_SSDC_typeahead_conv");}
_data.events=_events;return _data;};this.setConversion=function(){_btgCk.set("mtvn_btg_SSDC_conv",1);};this.setSynConversion=function(){_btgCk.set("mtvn_btg_SSDC_syn_conv",1);};this.setTypeAheadConversion=function(){_btgCk.set("mtvn_btg_SSDC_typeahead_conv",1);};};mtvn.btg.reporting.SEO=new function(){this.setData=function(context,data){_setUserSegments();return data;};var _setUserSegments=function(){var btgRep=mtvn.btg.reporting;var engines=[["google.com","GoogleUser"],["msn.com","MSNUser"],["yahoo.com","YahooUser"]];for(var e=0,len=engines.length;e<len;e++){var referrer=document.referrer;if(referrer.indexOf(engines[e][0])>-1){if(typeof btgRep.UserSegment!="undefined"){btgRep.UserSegment.set(engines[e][1]);}}}}};mtvn.btg.reporting.UserSegment=new function(){var _btgCk=mtvn.btg.util.Cookie;var _COOKIE_NAME="mtvn_btg_userSegments";this.init=function(context){var usCookie=_btgCk.read(_COOKIE_NAME);context.userSegments=usCookie?usCookie.split(","):[];return true;};this.set=function(segment,context){if(!context)context=mtvn.btg.reporting.ReportingManager.getOmniture();for(var s=0,len=context.userSegments.length;s<len;s++){if(context.userSegments[s]==segment)return false;}
context.userSegments[context.userSegments.length]=segment;_btgCk.set(_COOKIE_NAME,context.userSegments.join(","));return true;};this.add=function(context,segment){this.set(segment,context);return true;};this.getSegments=function(context){return context.userSegments};this.getStr=function(context,pre,post){if(!pre)pre="";if(!post)post="";var str=typeof context.userSegments=="object"&&context.userSegments.length>0?pre+context.userSegments.join(post+","+pre)+post:"";return str;};this.setData=function(context,data){data[context.config.userSegmentVarMap.traffic]=data[context.config.userSegmentVarMap.traffic]?data[context.config.userSegmentVarMap.traffic]+(this.getStr(context)!=""?",":"")+this.getStr(context):this.getStr(context);data[context.config.userSegmentVarMap.commerce]=data[context.config.userSegmentVarMap.commerce]?data[context.config.userSegmentVarMap.commerce]+(this.getStr(context,"User Segment;")!=""?",":"")+this.getStr(context,"User Segment;"):this.getStr(context,"User Segment;");return data;};}
mtvn.btg.reporting.RecsABTesting={btgCk:mtvn.btg.util.Cookie,setData:function(context,data){var isStr=mtvn.btg.util.String.isDefined;var us=mtvn.btg.reporting.UserSegment;var vendorCookie=this.btgCk.read("RecsVendor");if(isStr(vendorCookie)){var segment=null;switch(vendorCookie){case"0":segment="RecsAB_ChoiceStream";break;case"1":segment="RecsAB_Control";break;}
if(segment)
us.add(context,segment);}
if(isStr(this.btgCk.read("RecsConversion"))){us.add(context,"RecsAB_ChoiceStream_Clickthrough");if(typeof data["events"]==="string"&&data["events"].length>0)data["events"]+=",event40";else data["events"]="event40";this.btgCk.remove("RecsConversion");}
return data;},setConversion:function(){this.btgCk.set("RecsConversion",1);}};mtvn.btg.reporting.ESIVars=new function(){var _chkObjectExists=function(){if(typeof mtvn_btg_ESIVars!="object")return false;return true;};this.setData=function(context,data){if(!_chkObjectExists())return data;if(typeof context.config.ESIVarMap.network=="string")mtvn.btg.reporting.UserSegment.add(context,mtvn_btg_ESIVars.network);if(typeof context.config.ESIVarMap.asnum=="string")data[context.config.ESIVarMap.asnum]=mtvn_btg_ESIVars.asnum;if(typeof context.config.ESIVarMap.proxy=="string")data[context.config.ESIVarMap.proxy]=mtvn_btg_ESIVars.proxy;if(typeof context.config.ESIVarMap.countryCode=="string")data[context.config.ESIVarMap.countryCode]=mtvn_btg_ESIVars.countryCode;return data;};};mtvn.btg.reporting.Photos=new function(){var _btgU=mtvn.btg.util;var _btgCk=mtvn.btg.util.Cookie;var _btgCk_set=_btgCk.set;var _btgCk_read=_btgCk.read;var _btgClr=mtvn.btg.Controller;_TIMESPENT_COOKIE_NAME="mtvn_btg_photos_timespent";_FLIPBOOKVIEW_COOKIE_NAME="mtvn_btg_photos_flipbook";_startTime=null;_varMap=null;_events="";var _setEvent=function(evt){if(_events.indexOf(evt)<0){if(_events!="")_events+=",";_events+=evt;}
return _events;};this.init=function(_varMap){_startTime=(new Date()).getTime();this._varMap=_varMap;_btgU.DOM.Events.addListener(window,"unload",function(){mtvn.btg.reporting.Photos.setTimespent()});return true;};this.setTimespent=function(){var endTime=(new Date()).getTime();var elapsedSeconds=Math.round((endTime-_startTime)/100);if(elapsedSeconds<1)elapsedSeconds=1;_btgCk_set(_TIMESPENT_COOKIE_NAME,elapsedSeconds);};this.getTimespent=function(){var timerCookie=_btgCk_read(_TIMESPENT_COOKIE_NAME);_btgCk.remove(_TIMESPENT_COOKIE_NAME);_startTime=(new Date()).getTime();return timerCookie?timerCookie:0;};this.setData=function(data){_events=typeof data.events=="string"&&data.events.length>0?data.events:"";if(typeof mtvn_btg_Photos=="object"&&mtvn_btg_Photos!=null&&typeof _varMap=="object"&&_varMap!=null){if((typeof mtvn_btg_Photos.isPhotoView=="boolean"&&mtvn_btg_Photos.isPhotoView)||(typeof mtvn_btg_Photos.photoId=="string"&&mtvn_btg_Photos.photoId!="")){mtvn.btg.reporting.UserSegment.set("Photo Viewer");}
else if(typeof mtvn_btg_Photos.isAd=="boolean"&&typeof mtvn_btg_Photos.isAd)
_setEvent(_varMap.adView);if(typeof mtvn_btg_Photos.application!="undefined"&&typeof mtvn_btg_Photos.gallery!="undefined"&&(typeof mtvn_btg_Photos.photoId!="undefined"||(typeof mtvn_btg_Photos.isAd=="boolean"&&typeof mtvn_btg_Photos.isAd))){var aVars=typeof _varMap.application=="string"?_varMap.application.split(","):_varMap.application;for(var a=0,len=aVars.length;a<len;a++)data[aVars[a]]=mtvn_btg_Photos.application;var gVars=typeof _varMap.gallery=="string"?_varMap.gallery.split(","):_varMap.gallery;for(var g=0,len=gVars.length;g<len;g++)data[gVars[g]]=mtvn_btg_Photos.gallery;var pVars=typeof _varMap.photoId=="string"?_varMap.photoId.split(","):_varMap.photoId;for(var p=0,len=pVars.length;p<len;p++)data[pVars[p]]=mtvn_btg_Photos.photoId;if(typeof mtvn_btg_Photos.photoId!="undefined")
_setEvent(_varMap.photoView);var flipbookViewCookie=_btgCk_read(_FLIPBOOKVIEW_COOKIE_NAME);if(mtvn_btg_Photos.gallery!=flipbookViewCookie){_setEvent(_varMap.flipbookView);_btgCk_set(_FLIPBOOKVIEW_COOKIE_NAME,mtvn_btg_Photos.gallery);if(typeof _btgU.Events["flipBookView"]!="undefined")_btgU.Events["flipBookView"].fire();}
if(typeof data["products"]=="string"&&data["products"]!="")data["products"]+=",";else data["products"]="";data["products"]+=";;;;"+_varMap.timeSpent+"="+this.getTimespent();_setEvent(_varMap.timeSpent);}}
data.events=_events;return data;};this.sendCall=function(_photoObj){if(typeof _photoObj=="object"){if(typeof mtvn_btg_Photos!="object")mtvn_btg_Photos={};if(typeof _photoObj.application=="string")mtvn_btg_Photos.application=_photoObj.application;if(typeof _photoObj.gallery=="string")mtvn_btg_Photos.gallery=_photoObj.gallery;if(typeof _photoObj.photoId=="string")mtvn_btg_Photos.photoId=_photoObj.photoId;if(typeof _photoObj.isAd=="boolean")mtvn_btg_Photos.isAd=_photoObj.isAd;}
this.setTimespent();_btgClr.sendPageCall();};this.trackShareButton=function(){_btgClr.sendLinkEvent({linkName:"Photo Share Button",linkType:"o"});};this.trackRSSButton=function(){_btgClr.sendLinkEvent({linkName:"Photo RSS Button",linkType:"o"});};};mtvn.btg.reporting.BrowserToolbar={setData:function(context,data){var c_read=mtvn.btg.util.Cookie.read;var c_remove=mtvn.btg.util.Cookie.remove;var isStr=mtvn.btg.util.String.isDefined;var us=mtvn.btg.reporting.UserSegment;var user_cookie=c_read("mtvn_btg_Toolbar");if(isStr(user_cookie)){us.add(context,"Toolbar - Main - User");c_remove("mtvn_btg_Toolbar");}
var subscriber_cookie=c_read("mtvn_btg_ToolbarSubscriber");if(isStr(subscriber_cookie)){us.add(context,"Toolbar - Main - Subscriber");c_remove("ToolBarSubscriber");}
var hpuser_cookie=c_read("mtvn_btg_ToolbarHpUser");if(isStr(hpuser_cookie)){us.add(context,"Toolbar - Main - HP User");}
return data;}};mtvn.btg.reporting.ChoiceStream=function(config){this.config=config;this.apiKey=(this.config.apiKey?this.config.apiKey:"");this.profileId=(this.config.profileId?this.config.profileId:"");this.CSRR=null;if(this.config.enabled){try{mtvn.btg.util.DOM.loadScript("http"+('https:'==document.location.protocol?"s":"")+"://stgapi.choicestream.com/instr/csanywhere.js");}catch(e){}}};mtvn.btg.reporting.ChoiceStream.prototype={setChoiceStreamRequest:function(data,isActivity){var _self=this;var _data=(mtvn.btg.util.Object.isDefined(data)?data:{});if(!mtvn.btg.util.Object.isConfigDefined(this.config))return;var _dependency=new mtvn.btg.managers.DependencyManager();_dependency.add("mtvn_csrr",function(){if(typeof csRR=='undefined')
return false;_self.CSRR=new csRR(_self.apiKey,"custom");_self.CSRR.addRecoDisplayRequest(_data.pageType,{"appcontext":_data.pageType});_self.CSRR.setParameter("cookie_id",_self.profileId);for(var i=0,j=(_data.items?_data.items.length:0);i<j;i++)
_self.CSRR.addItem(_data.items[i]);for(var param in _data.parameters){if(_data.hasOwnProperty(param))
_self.CSRR.setParameter(param,_data.parameters[param]);}
if(!isActivity)(_self.CSRR.getRequest()).setSuccessCallback(_self.setPlayerEndSlate);_self.CSRR.send();return true;});_dependency.checkDependency("mtvn_csrr");},setPlayerEndSlate:function(data){var status=data.getStatus();var recoSet=data.getRecoSet(0);var recoStatus=recoSet.getStatus();var numRecos=recoSet.getNumRecos();var items=[];if(recoStatus.getCode()==99){if(numRecos!=0){for(var i=0;i<numRecos;i++){var reco=recoSet.getReco(i);var item={};item.title=reco.getAttribute("name");item.description=reco.getAttribute("description");item.displayData={thumbnail:{url:reco.getAttribute("image_link"),width:70,height:53},source:reco.getAttribute("name")};item.link=reco.getAttribute("link");items.push(item);}}}
window["getEndSlateFeed"]=function(){return{title:"Related Videos",items:items};}}};mtvn.btg.reporting.player.Loadtime={initTime:Number(new Date()),initFlag:0,timeRangeArr:[0,.9,2.9,4.9,6.9,9.9,12.9,15.9,19.9,24.9,30],reportURL:'http://{suiteName}.112.2o7.net/b/ss/{suiteName}/1/H.1-pdv-2/{ord}?pageName={siteName}&c11=PLAYER-LOAD-TEST&c12={delta}&events=event1&products=;;;;event1={playerLoadTime}',suiteName:'viarnd',siteNameVal:'media.mtvnservices.com',timerStateCheck:function(state){if(typeof siteName!="undefined"){this.siteNameVal=siteName;}
if(state=="connected"&&this.initFlag==0){this.initFlag++;var tsPlaying=Number(new Date());var tsPlayDiff=tsPlaying-this.initTime;var secsPlayDiff=tsPlayDiff/1000;var playerLoadTime=secsPlayDiff;secsPlayDiff=(secsPlayDiff>30?30:secsPlayDiff);var delta=0;switch(secsPlayDiff)
{case 0:delta='0-1';break;case 30:delta='30';break;default:for(var i=1,len=this.timeRangeArr.length;i<len;i++)
if(this.timeRangeArr[i-1]<secsPlayDiff&&this.timeRangeArr[i]>=secsPlayDiff){delta=Math.ceil(this.timeRangeArr[i-1])+'-'+Math.ceil(this.timeRangeArr[i]);break;}}
this.reportURL=this.reportURL.replace(/http:/,('https:'==document.location.protocol?"https:":"http:")).replace(/\{suiteName\}/g,this.suiteName).replace(/\{ord\}/,Math.floor(Math.random()*1000000000000)).replace(/\{siteName\}/g,this.siteNameVal).replace(/\{delta\}/,delta).replace(/\{playerLoadTime\}/,playerLoadTime);var reportReq=new Image();reportReq.src=this.reportURL;}}}
mtvn.btg.reporting.player.MediaPlayer={btgC:mtvn.btg.util.Cookie,btgMp:mtvn.btg.reporting.player.MediaPlayer,context:null,playerCommandQueue:null,init:function(context){this.context=context;this.playerCommandQueue=new mtvn.btg.managers.QueueManager({id:"mtvn.btg.reporting.player.MediaPlayer.playerCommandQueue",timeToWait:100,maxNumItems:10,maxElapsed:1000,handler:this.execute})},playStarted:false,players:[],addPlayer:function(id,onLoadFunctionName){this.players[id]=new this.Player(id,onLoadFunctionName);return this.players[id];},setEndSlateClick:function(flag){var btgC_set=this.btgC.set;btgC_set("mtvn_btg_tnt",(flag?mtvn.btg.reporting.TestAndTarget.getCampaignId():"")+"_"+(typeof feedEndslate!='undefined'&&feedEndslate));btgC_set("mtvn_btg_esclicked",flag);},getEndSlateClick:function(flag){return this.btgC.read("mtvn_btg_esclicked");},PlayerController:function(id,onLoadFunctionName){return this.addPlayer(id,onLoadFunctionName);},pause:function(){var self=mtvn.btg.reporting.player.MediaPlayer;for(var p in self.players)
if(self.players.hasOwnProperty(p))
self.players[p].player.pause();},unpause:function(){var self=mtvn.btg.reporting.player.MediaPlayer;for(var p in self.players)
if(self.players.hasOwnProperty(p))
self.players[p].player.unpause();},execute:function(command){var self=mtvn.btg.reporting.player.MediaPlayer;var btgAL=mtvn.btg.html5.ads.AdLoader;try{if(btgAL.html5Player){self.playStarted=true;}}catch(e){}
if(self.playStarted){switch(command){case"unpause":if(mtvn.btg.html5&&btgAL.html5Player){if(self.pausedPlay){btgAL.html5Player.play();}}
else{self.unpause();}
break;case"pause":if(mtvn.btg.html5&&btgAL.html5Player){self.pausedPlay=!btgAL.html5Player.paused;btgAL.html5Player.pause();}
else{self.pause();}
break;}}
else{self.playerCommandQueue.queue.push(command);}},Player:function(id,onLoadFunctionName){var _btgC=mtvn.btg.Controller;var _btgCk=mtvn.btg.util.Cookie;var _btgR=mtvn.btg.reporting;var _btgTaT=mtvn.btg.reporting.TestAndTarget;var _btgP=mtvn.btg.reporting.player.MediaPlayer;var _btgCfg=mtvn.btg.config;var config=_btgCfg.ReportSettings;this.playerId=id;this.lastGuid=null;this.player=null;this.playerLoaded=false;this.onLoadFunctionName=onLoadFunctionName;this.onLoaded=function(){this.player=(navigator.appName.indexOf("Microsoft")!=-1)?window[this.playerId]:document[this.playerId];if(typeof this.player.length!='undefined')this.player=this.player[0];this.player.addEventListener('METADATA','mtvn.btg.reporting.player.MediaPlayer.players[\"'+this.playerId+'\"].onMetaData');this.player.addEventListener('ENDSLATE_CLICK','mtvn.btg.reporting.player.MediaPlayer.players[\"'+this.playerId+'\"].onEndslateLoad');this.player.addEventListener('PLAYHEAD_UPDATE','mtvn.btg.reporting.player.MediaPlayer.players[\"'+this.playerId+'\"].onPlayHeadUpdate');this.playerLoaded=true;var onLoadFunctionName=eval(this.onLoadFunctionName);if(typeof onLoadFunctionName=='function')onLoadFunctionName(this);};this.onDump=function(){};this.dump=function(){var temp="";if(this.playerLoaded){temp=this.player.getLogDump();}
else{temp="player not loaded";}
this.onDump(temp);};this.onPlayHeadUpdate=function(){var self=mtvn.btg.reporting.player.MediaPlayer;if(!self.playStarted){self.playStarted=true;self.playerCommandQueue.init();}},this.onMetaData=function(metadata){if(location.search.match(/showMetaData\=true/)){str="";for(m in metadata)str+=m+": "+metadata[m]+"\n";alert(this.lastGuid+"\n\n\n"+str);};var esCampaign="";var url=document.location.search;var isEndSlate=(url.toLowerCase().indexOf("xrs=mpes_")!=-1?true:false);var isC3Content=metadata["contentType"]==="c3_adpod";if(isEndSlate){var paramArr=url.replace(/^\?/g,'').split("&");for(var i=0,len=paramArr.length;i<len;i++){if(paramArr[i].split('=')[0]=='xrs'){esCampaign=(mtvn.btg.util.String.isDefined(paramArr[i].split('=')[1])?paramArr[i].split('=')[1]:"");}}}
if(metadata["guid"]&&this.lastGuid!==metadata["guid"]){var _data={linkName:"Video View",linkType:"o",eVar28:metadata["contentType"],events:"event15"+(_btgP.getEndSlateClick()=='true'?",event45":""),campaign:esCampaign};if(typeof _btgCfg.ReportSettings.Omniture.enableTestAndTargetTrial!='undefined'&&_btgCfg.ReportSettings.Omniture.enableTestAndTargetTrial){var tntString=_btgCk.read("mtvn_btg_tnt");var tnt=(tntString?tntString.split('_')[0]:"");var feed=(tntString?tntString.split('_')[1]:"false");if(_btgP.getEndSlateClick()=='true'&&tnt!=""){if(feed.toString()=="true")
_btgTaT.convertMbox((location.href&&location.href.match(/[\?#&]id=[^&]/gi)?"editorialplaylist":"dynamicplaylist"));else
_btgTaT.convertMbox("endslatevideoloaded");}
_btgTaT.convertMbox("endSlateGating");}
_btgCk.set("mtvn_btg_tnt","");if(typeof _btgR.UserSegment!="undefined"){_btgR.UserSegment.add(_btgP.context,"VideoViewer");if(isC3Content){_btgR.UserSegment.add(_btgR.MediaPlayer.context,"C3VideoViewer");}}
if(typeof _btgCfg.ReportSettings.Omniture.videoViewEventDisable!="undefined"&&_btgCfg.ReportSettings.Omniture.videoViewEventDisable){_data.events=_data.events.replace(/event15(,)?/gi,"");_data.eVar28="";}
else{_btgP.setEndSlateClick('false');_btgC.sendLinkEvent(_data);}};this.lastGuid=metadata["guid"];};this.onEndslateLoad=function(){var _data={linkName:"Endslate View",linkType:"o",events:"event44"};if(typeof this.onEndslateFired!='undefined'){return;}else{this.onEndslateFired=true;}
if(typeof _btgR.UserSegment!="undefined"){_btgR.UserSegment.add(_btgP.context,"EndslateViewer");}
_btgC.sendLinkEvent(_data);if(typeof _btgCfg.ReportSettings.Omniture.enableTestAndTargetTrial!='undefined'&&_btgCfg.ReportSettings.Omniture.enableTestAndTargetTrial)
_btgTaT.convertMbox("endslateload");};},onWindowLoaded:function(e){var self=mtvn.btg.reporting.player.MediaPlayer;var oldMtvnPlayerLoaded=window["mtvnPlayerLoaded"];var mtvnPlayerLoaded=function(id){if(typeof oldMtvnPlayerLoaded!="undefined")oldMtvnPlayerLoaded(id);if(typeof document.getElementById(id)=="undefined")return;if(typeof self.players[id]=='undefined')
self.addPlayer(id);self.players[id].onLoaded();};window["mtvnPlayerLoaded"]=mtvnPlayerLoaded;}};try{mtvn.btg.reporting.player.MediaPlayer.onWindowLoaded();}catch(e){}
mtvn.btg.reporting.player.Preload=function(){this.playUpUrl='http://media.mtvnservices.com/player/images/Button_playBig_upSkin.png';this.playOverUrl='http://media.mtvnservices.com/player/images/Button_playBig_overSkin.png';this.playButtonWidth=92;this.playButtonHeight=70;this.embedCount=0;this.getElementsByClassName=function(elementType,swapClass){var retnode=[];var myclass=new RegExp('\\b'+swapClass+'\\b');var elem=document.getElementsByTagName(elementType);for(var i=0,len=elem.length;i<len;i++){var classes=elem[i].className;if(myclass.test(classes))retnode.push(elem[i]);}
return retnode;}
this.attachClickToWrappers=function(swapDivName,h,w){var holders=this.getElementsByClassName("div",swapDivName);for(var i=0,len=holders.length;i<len;i++){var currentHolder=holders[i];this.onClickWrapper(currentHolder,h,w);}}
this.attachToWrappers=function(swapDivName,h,w){var holders=this.getElementsByClassName("div",swapDivName);for(var i=0,len=holders.length;i<len;i++){var currentHolder=holders[i];this.attachToWrapper(currentHolder,h,w);}}
this.attachToWrapper=function(swapDivO,h,w){var embedCount=this.embedCount;var upName="pUp"+this.embedCount;var overName="pOver"+this.embedCount;var images=swapDivO.getElementsByTagName('img');var placeHolder=images[0];swapDivO.style.position="relative";var playOver=document.createElement('img');playOver.src=this.playOverUrl;playOver.style.position="absolute";playOver.style.zIndex=15;playOver.style.left=placeHolder.width/2-this.playButtonWidth/2;playOver.style.top=placeHolder.height/2-this.playButtonHeight/2;playOver.style.display="none";playOver.className="pOver";playOver.id=overName;var playUp=document.createElement('img');playUp.src=this.playUpUrl;playUp.style.position="absolute";playUp.style.zIndex=15;playUp.style.left=placeHolder.width/2-this.playButtonWidth/2;playUp.style.top=placeHolder.height/2-this.playButtonHeight/2;playUp.style.display="block";playUp.className="pUp";playUp.id=upName;swapDivO.m=new Object();swapDivO.m.idNumber=embedCount;swapDivO.m.overIdName=overName;swapDivO.m.upIdName=upName;swapDivO.appendChild(playOver);swapDivO.appendChild(playUp);this.onClickWrapper(swapDivO,h,w);this.onEnterWrapper(swapDivO);this.onExitWrapper(swapDivO);this.embedCount++;}
this.onEnterWrapper=function(o){o.onmouseover=function(){var overId=this.m["overIdName"];var pOver=document.getElementById(overId);pOver.style.display="block";var upId=this.m["upIdName"];var pUp=document.getElementById(upId);pUp.style.display="none";}}
this.onExitWrapper=function(o){o.onmouseout=function(){var overId=this.m["overIdName"];var pOver=document.getElementById(overId);pOver.style.display="none";var upId=this.m["upIdName"];var pUp=document.getElementById(upId);pUp.style.display="block";}}
this.createEmbedTag=function(id,h,w,flashVars){var embed=document.createElement('embed');embed.setAttribute('src','http://media.mtvnservices.com/'+id);embed.setAttribute('height',h);embed.setAttribute('width',w);embed.setAttribute('id',id);embed.setAttribute('flashVars',flashVars);embed.setAttribute('wmode','window');embed.setAttribute('allowFullScreen',true);embed.setAttribute('allowScriptAccess','always');embed.setAttribute('type','application/x-shockwave-flash');embed.style.backgroundColor='black';return embed;}
this.onClickWrapper=function(o,h,w){o.onclick=function(){var id=this.id;var flashVars;if(this.getElementsByTagName('q').length>0){var qValue=this.getElementsByTagName('q');flashVars=qValue[0].innerHTML;}
if(this.getAttribute('flashVars')){flashVars=this.getAttribute('flashVars');}
if(h==0){var elemArray=this.getElementsByTagName('img');var elem=elemArray[0];h=elem.height;w=elem.width;}
var overId=this.m["overIdName"];pOver=document.getElementById(overId);this.removeChild(pOver);var upId=this.m["upIdName"];pUp=document.getElementById(upId);this.removeChild(pUp);var images=this.getElementsByTagName('img');for(var i=0,len=images.length;i<len;i++){var dropNode=images[i];this.removeChild(dropNode);}
var embed=MTVNPlayerPreload.createEmbedTag(id,h,w,flashVars);this.appendChild(embed);o.onmouseout=function(){};o.onmouseover=function(){};o.onclick=function(){};}}}();mtvn.btg.reporting.games.GameEventMediator={gameSwf:null,gameLoad:function(id){this.gameSwf=(navigator.appName.indexOf("Microsoft")!=-1&&window[id])?window[id]:document[id];if(this.gameSwf&&this.gameSwf.addEventListener){this.gameSwf.addEventListener('ON_GAME_EVENT','mtvn.btg.reporting.games.GameReporter.onGameEvent');}}}
mtvn.btg.reporting.games.GameEventVO={ON_GAME_LOAD:"event51",ON_GAME_PLAY:"event52",ON_GAME_LEVELSTART:"event54"}
mtvn.btg.reporting.games.GameReporter={config:{},metadata:{},gtsEvent:"event74",gtsTracker:new mtvn.btg.util.TimeTracker("gtsTracker"),omniVarMap:{linkName:"linkName",linkURL:"gameURL",prop39:"gameGenre",prop40:"gameTitle",eVar53:"gameTitle",eVar54:"franchise",eVar41:"gameGenre",eVar42:"level",eVar31:"applicationName",prop48:"applicationName",eVar30:"applicationOrigin",prop47:"applicationOrigin",eVar32:"applicationContext",prop49:"applicationContext",products:"products",events:"events"},gaVarMap:{category:"gameTitle",action:"eventName"},init:function(obj){this.mapConfig(obj);this.gameReporterQueue=new mtvn.btg.managers.QueueManager({id:"mtvn.btg.reporting.games.GameReporter.gameReporterQueue",timeToWait:300,maxNumItems:10,maxElapsed:3000,handler:this.gameEvent,notificationHandler:this.notify});},onGameLoad:function(data){if(data=="embed"&&mtvn.btg.reporting.games.GameEventMediator.gameSwf!=null){return;}
this.onGameEvent("ON_GAME_LOAD",data);},onGameEvent:function(eventName,data){this.gameReporterQueue.addToQueue(eventName,data);},notify:function(a_qmObj){var notifyMsg="";notifyMsg+="QueueManager/GameReporter processed ";notifyMsg+=a_qmObj.processedQueue.length+" Game Events out of "+a_qmObj.itemsAdded+" before aborting.";notifyMsg+="QM settings:timeToWait="+a_qmObj.timeToWait;notifyMsg+=";maxNumItems="+a_qmObj.maxNumItems;notifyMsg+=";maxElapsed="+a_qmObj.maxElapsed+".";notifyMsg+="Events processed:";for(var i=0,len=a_qmObj.processedQueue.length;i<len;i++){notifyMsg+=a_qmObj.processedQueue[i][0];notifyMsg+=(i<a_qmObj.processedQueue.length-1)?";":"";}
new mtvn.btg.util.Alert(notifyMsg);},gameEvent:function(e){var btgGms=mtvn.btg.reporting.games;var isObj=mtvn.btg.util.Object.isDefined;var btgClr=mtvn.btg.Controller;var btgU=mtvn.btg.util;var isStr=mtvn.btg.util.String.isDefined;var omniData,gaData,pageTracker;var metadata=btgGms.GameReporter.metadata;var config=btgGms.GameReporter.config;var eventName=e[0];var data=isObj(e[1])?e[1]:{};var eventVO=btgGms.GameEventVO;var wasEventFired=false;if(typeof eventVO[eventName]!="undefined"){omniData=data;omniData["events"]=eventVO[eventName];switch(eventName){case"ON_GAME_LOAD":btgGms.GameReporter.gtsTracker.init();break;}
omniData=btgGms.GameReporter.mapOmniData(omniData);btgClr.sendLinkEvent(omniData);}
else{if(isObj(data)&&typeof data.varmap!="undefined"){omniData=data;if(typeof omniData.varmap=="string"){omniData.varmap=omniData.varmap.replace(/\s/,"");omniData.varmap=omniData.varmap.split(",");}
for(var m=0,len=omniData.varmap.length;m<len;m++){if(omniData.varmap[m].match(/event/)){if(isNaN(parseFloat(eventName))){omniData["events"]=typeof omniData["events"]=="string"?omniData["events"]+=",":"";omniData["events"]+=omniData.varmap[m];}
else{omniData["products"]=typeof omniData["products"]=="string"?omniData["events"]+=",":"";omniData["products"]+=";;;;"+omniData.varmap[m]+"="+eventName;}}
else omniData[omniData.varmap[m]]=eventName;}
delete omniData.varmap;omniData=btgGms.GameReporter.mapOmniData(omniData);btgClr.sendLinkEvent(omniData);wasEventFired=true;}
else if(isObj(config.omnitureEventMap)&&isObj(config.omnitureEventMap[eventName])){omniData=data;var origOmniVarMap={};btgU.Object.copyProperties(btgGms.GameReporter.omniVarMap,origOmniVarMap);btgGms.GameReporter.appendOmniVarMap(config.omnitureEventMap[eventName]);omniData=btgGms.GameReporter.mapOmniData(omniData);btgGms.GameReporter.omniVarMap=origOmniVarMap;btgClr.sendLinkEvent(omniData);wasEventFired=true;}
if(isStr(config.gaAccount)&&isObj(config.googleEventMap)&&isObj(config.googleEventMap[eventName])&&isStr(config.googleEventMap[eventName].label)&&isStr(config.googleEventMap[eventName].value)&&isStr(data[config.googleEventMap[eventName].label])&&isStr(data[config.googleEventMap[eventName].value])){gaData=data;btgGms.GameReporter.appendGaVarMap(config.googleEventMap[eventName]);gaData["eventName"]=eventName;gaData=btgGms.GameReporter.mapGaData(gaData);gaData.label=typeof gaData.label!="undefined"&&gaData.label!=""?gaData.label:"General";gaData.value=typeof gaData.value!="undefined"&&typeof parseInt(gaData.value)=="number"?parseInt(gaData.value):null;pageTracker=_gat._createTracker(config.gaAccount,"event_tracker");pageTracker._setDomainName("");pageTracker._trackEvent(gaData.category,gaData.action,gaData.label,gaData.value);wasEventFired=true;}
if(!wasEventFired){new btgU.Alert("GameReporter: Unrecognized event "+eventName+". Game Title = "+metadata.gameTitle+" Game URL= "+metadata.gameURL+".");return;}}
if(typeof btgU.Events[eventName]!="undefined")btgU.Events[eventName].fire(data);},mapOmniData:function(data){var omniVarMap=this.omniVarMap;var isStr=mtvn.btg.util.String.isDefined;var dataObj={};if(typeof data=="object"&&data!=null){for(var key in data){if(data.hasOwnProperty(key)&&!isStr(this.metadata[key]))
dataObj[key]=data[key];}}
for(var key in omniVarMap){if(!omniVarMap.hasOwnProperty(key))continue;if(isStr(this.metadata[omniVarMap[key]]))
dataObj[key]=this.metadata[omniVarMap[key]];else if(isStr(data[omniVarMap[key]]))
dataObj[key]=data[omniVarMap[key]];}
mtvn.btg.reporting.games.GameReporter.gtsTracker.setData(dataObj["eVar53"]+","+dataObj["eVar54"]);dataObj=this.addGtsData(dataObj);return dataObj;},appendOmniVarMap:function(map){var btgGms=mtvn.btg.reporting.games;if(typeof map!="undefined"){for(var key in map){if(!map.hasOwnProperty(key))continue;if(/prop(((0|1|3|4|5|6|7|8|9|10|11|12|30|31|33|34|35|36|37|38|43|45|46|47|48|49)$)|([5-9][0-9]|[1-9][0-9]{2,})$)/.test(key)||/eVar(((0|2|3|4|5|6|7|8|9|10|11|12|18|26|27|28|29|30|31|32|33|34|36|42|45|46|49)$)|([5-9][0-9]|[1-9][0-9]{2,})$)/.test(key)||/event(((0|15|16|24|25|26|27|28|29|33|34|35|36|37|38|39|40|44|45|49)$)|([5-9][0-9]|[1-9][0-9]{2,})$)/.test(key)){new mtvn.btg.util.Alert("GameReporter error nonstandard event call. Omniture variable '"+key+"' is reserved and cannot be overriden. Game Title = "+btgGms.GameReporter.metadata.gameTitle+". Game URL= "+btgGms.GameReporter.metadata.gameURL+".");continue;}
if(!mtvn.btg.util.String.isDefined(this.omniVarMap[key]))
this.omniVarMap[key]=map[key];}}},mapGaData:function(data){var gaVarMap=this.gaVarMap;var isStr=mtvn.btg.util.String.isDefined;var dataObj={};for(var key in gaVarMap){if(!gaVarMap.hasOwnProperty(key))continue;if(isStr(this.metadata[gaVarMap[key]]))
dataObj[key]=this.metadata[gaVarMap[key]];else if(isStr(data[gaVarMap[key]]))
dataObj[key]=data[gaVarMap[key]];}
return dataObj;},appendGaVarMap:function(map){if(typeof map!="undefined"){for(var key in map){if(!map.hasOwnProperty(key))continue;this.gaVarMap[key]=map[key];}}},mapConfig:function(data){this.config={gaAccount:(data.Reporting.GoogleAnalytics&&data.Reporting.GoogleAnalytics.enabled?data.Reporting.GoogleAnalytics.account:''),googleEventMap:data.googleEventMap,omnitureEventMap:data.omnitureEventMap};this.metadata.gameURL=data.Game.metadata.gameURL;this.metadata.gameGenre=data.Game.metadata.gameGenre;this.metadata.gameTitle=data.Game.metadata.gameTitle;this.metadata.franchise=data.Game.metadata.franchise;this.metadata.applicationName=data.Game.metadata.type;this.metadata.applicationOrigin=data.Game.metadata.orig;this.metadata.applicationContext=data.Game.metadata.ref;this.metadata.products="User Segment;Game Player";this.metadata.events="";this.metadata.linkName="Game Link Event";},getGtsVals:function(a_gtsVal,a_data){if(mtvn.btg.util.String.isDefined(a_gtsVal)){a_gtsVal+="";a_gtsVal=a_gtsVal.split(",");var gts=parseInt(a_gtsVal[0]);if(!isNaN(gts)&&gts>0){a_data["products"]=(typeof a_data["products"]=="string")?a_data["products"]+=",":"";a_data["products"]+=";;;;"+this.gtsEvent+"="+gts;a_data["events"]=(typeof a_data["events"]=="string")?a_data["events"]+=",":"";a_data["events"]+=this.gtsEvent;if(a_gtsVal.length==3){a_data["eVar53"]=a_gtsVal[1];a_data["eVar54"]=a_gtsVal[2];}}}
return a_data;},addGtsData:function(data){return this.getGtsVals(mtvn.btg.reporting.games.GameReporter.gtsTracker.getTimeSpentOnPage(),data);},setData:function(data){return this.getGtsVals(mtvn.btg.reporting.games.GameReporter.gtsTracker.getTimespent(),data);}};mtvn.btg.reporting.games.GameReportingManager=new function(){var _btgGms=mtvn.btg.reporting.games;var hasOmniture=false;var config;this.init=function(){config=com.mtvnet.games.GameSettings;if(config.Reporting.omniture.enabled.toString()=="true")
hasOmniture=true;_btgGms.GameReporter.init(config);}
this.gameLoad=function(id){if(mtvn.btg.util.String.isDefined(id)){if(id=="embed"){setTimeout('mtvn.btg.reporting.games.GameReporter.onGameLoad("embed")',10000);}else if(id!="load")
_btgGms.GameEventMediator.gameLoad(id);}}}
var s_code='',s_objectID;function s_gi(un,pg,ss){try{var c="s._c='s_c';s.wd=window;if(!s.wd.s_c_in){s.wd.s_c_il=new Array;s.wd.s_c_in=0;}s._il=s.wd.s_c_il;s._in=s.wd.s_c_in;s._il[s._in]=s;s.wd.s_c_in++;s"
+".an=s_an;s.cls=function(x,c){var i,y='';if(!c)c=this.an;for(i=0;i<x.length;i++){n=x.substring(i,i+1);if(c.indexOf(n)>=0)y+=n}return y};s.fl=function(x,l){return x?(''+x).substring(0,l):x};s.co=func"
+"tion(o){if(!o)return o;var n=new Object,x;for(x in o)if(x.indexOf('select')<0&&x.indexOf('filter')<0)n[x]=o[x];return n};s.num=function(x){x=''+x;for(var p=0;p<x.length;p++)if(('0123456789').indexO"
+"f(x.substring(p,p+1))<0)return 0;return 1};s.rep=s_rep;s.sp=s_sp;s.jn=s_jn;s.ape=function(x){var s=this,h='0123456789ABCDEF',i,c=s.charSet,n,l,e,y='';c=c?c.toUpperCase():'';if(x){x=''+x;if(s.em==3)"
+"return encodeURIComponent(x);else if(c=='AUTO'&&('').charCodeAt){for(i=0;i<x.length;i++){c=x.substring(i,i+1);n=x.charCodeAt(i);if(n>127){l=0;e='';while(n||l<4){e=h.substring(n%16,n%16+1)+e;n=(n-n%"
+"16)/16;l++}y+='%u'+e}else if(c=='+')y+='%2B';else y+=escape(c)}return y}else{x=s.rep(escape(''+x),'+','%2B');if(c&&s.em==1&&x.indexOf('%u')<0&&x.indexOf('%U')<0){i=x.indexOf('%');while(i>=0){i++;if"
+"(h.substring(8).indexOf(x.substring(i,i+1).toUpperCase())>=0)return x.substring(0,i)+'u00'+x.substring(i);i=x.indexOf('%',i)}}}}return x};s.epa=function(x){var s=this;if(x){x=''+x;return s.em==3?de"
+"codeURIComponent(x):unescape(s.rep(x,'+',' '))}return x};s.pt=function(x,d,f,a){var s=this,t=x,z=0,y,r;while(t){y=t.indexOf(d);y=y<0?t.length:y;t=t.substring(0,y);r=s[f](t,a);if(r)return r;z+=y+d.l"
+"ength;t=x.substring(z,x.length);t=z<x.length?t:''}return ''};s.isf=function(t,a){var c=a.indexOf(':');if(c>=0)a=a.substring(0,c);if(t.substring(0,2)=='s_')t=t.substring(2);return (t!=''&&t==a)};s.f"
+"sf=function(t,a){var s=this;if(s.pt(a,',','isf',t))s.fsg+=(s.fsg!=''?',':'')+t;return 0};s.fs=function(x,f){var s=this;s.fsg='';s.pt(x,',','fsf',f);return s.fsg};s.si=function(){var s=this,i,k,v,c="
+"s_gi+'var s=s_gi(\"'+s.oun+'\");s.sa(\"'+s.un+'\");';for(i=0;i<s.va_g.length;i++){k=s.va_g[i];v=s[k];if(v!=undefined){if(typeof(v)=='string')c+='s.'+k+'=\"'+s_fe(v)+'\";';else c+='s.'+k+'='+v+';'}}"
+"c+=\"s.lnk=s.eo=s.linkName=s.linkType=s.wd.s_objectID=s.ppu=s.pe=s.pev1=s.pev2=s.pev3='';\";return c};s.c_d='';s.c_gdf=function(t,a){var s=this;if(!s.num(t))return 1;return 0};s.c_gd=function(){var"
+" s=this,d=s.wd.location.hostname,n=s.fpCookieDomainPeriods,p;if(!n)n=s.cookieDomainPeriods;if(d&&!s.c_d){n=n?parseInt(n):2;n=n>2?n:2;p=d.lastIndexOf('.');if(p>=0){while(p>=0&&n>1){p=d.lastIndexOf('"
+".',p-1);n--}s.c_d=p>0&&s.pt(d,'.','c_gdf',0)?d.substring(p):d}}return s.c_d};s.c_r=function(k){var s=this;k=s.ape(k);var c=' '+s.d.cookie,i=c.indexOf(' '+k+'='),e=i<0?i:c.indexOf(';',i),v=i<0?'':s."
+"epa(c.substring(i+2+k.length,e<0?c.length:e));return v!='[[B]]'?v:''};s.c_w=function(k,v,e){var s=this,d=s.c_gd(),l=s.cookieLifetime,t;v=''+v;l=l?(''+l).toUpperCase():'';if(e&&l!='SESSION'&&l!='NON"
+"E'){t=(v!=''?parseInt(l?l:0):-60);if(t){e=new Date;e.setTime(e.getTime()+(t*1000))}}if(k&&l!='NONE'){s.d.cookie=k+'='+s.ape(v!=''?v:'[[B]]')+'; path=/;'+(e&&l!='SESSION'?' expires='+e.toGMTString()"
+"+';':'')+(d?' domain='+d+';':'');return s.c_r(k)==v}return 0};s.eh=function(o,e,r,f){var s=this,b='s_'+e+'_'+s._in,n=-1,l,i,x;if(!s.ehl)s.ehl=new Array;l=s.ehl;for(i=0;i<l.length&&n<0;i++){if(l[i]."
+"o==o&&l[i].e==e)n=i}if(n<0){n=i;l[n]=new Object}x=l[n];x.o=o;x.e=e;f=r?x.b:f;if(r||f){x.b=r?0:o[e];x.o[e]=f}if(x.b){x.o[b]=x.b;return b}return 0};s.cet=function(f,a,t,o,b){var s=this,r,tcf;if(s.apv"
+">=5&&(!s.isopera||s.apv>=7)){tcf=new Function('s','f','a','t','var e,r;try{r=s[f](a)}catch(e){r=s[t](e)}return r');r=tcf(s,f,a,t)}else{if(s.ismac&&s.u.indexOf('MSIE 4')>=0)r=s[b](a);else{s.eh(s.wd,"
+"'onerror',0,o);r=s[f](a);s.eh(s.wd,'onerror',1)}}return r};s.gtfset=function(e){var s=this;return s.tfs};s.gtfsoe=new Function('e','var s=s_c_il['+s._in+'],c;s.eh(window,\"onerror\",1);s.etfs=1;c=s"
+".t();if(c)s.d.write(c);s.etfs=0;return true');s.gtfsfb=function(a){return window};s.gtfsf=function(w){var s=this,p=w.parent,l=w.location;s.tfs=w;if(p&&p.location!=l&&p.location.host==l.host){s.tfs="
+"p;return s.gtfsf(s.tfs)}return s.tfs};s.gtfs=function(){var s=this;if(!s.tfs){s.tfs=s.wd;if(!s.etfs)s.tfs=s.cet('gtfsf',s.tfs,'gtfset',s.gtfsoe,'gtfsfb')}return s.tfs};s.mrq=function(u){var s=this,"
+"l=s.rl[u],n,r;s.rl[u]=0;if(l)for(n=0;n<l.length;n++){r=l[n];s.mr(0,0,r.r,0,r.t,r.u)}};s.br=function(id,rs){var s=this;if(s.disableBufferedRequests||!s.c_w('s_br',rs))s.brl=rs};s.flushBufferedReques"
+"ts=function(){this.fbr(0)};s.fbr=function(id){var s=this,br=s.c_r('s_br');if(!br)br=s.brl;if(br){if(!s.disableBufferedRequests)s.c_w('s_br','');s.mr(0,0,br)}s.brl=0};s.mr=function(sess,q,rs,id,ta,u"
+"){var s=this,dc=s.dc,t1=s.trackingServer,t2=s.trackingServerSecure,tb=s.trackingServerBase,p='.sc',ns=s.visitorNamespace,un=s.cls(u?u:(ns?ns:s.fun)),r=new Object,l,imn='s_i_'+(un),im,b,e;if(!rs){if"
+"(t1){if(t2&&s.ssl)t1=t2}else{if(!tb)tb='2o7.net';if(dc)dc=(''+dc).toLowerCase();else dc='d1';if(tb=='2o7.net'){if(dc=='d1')dc='112';else if(dc=='d2')dc='122';p=''}t1=un+'.'+dc+'.'+p+tb}rs='http'+(s"
+".ssl?'s':'')+'://'+t1+'/b/ss/'+s.un+'/'+(s.mobile?'5.1':'1')+'/H.22.1/'+sess+'?AQB=1&ndh=1'+(q?q:'')+'&AQE=1';if(s.isie&&!s.ismac)rs=s.fl(rs,2047);if(id){s.br(id,rs);return}}if(s.d.images&&s.apv>=3"
+"&&(!s.isopera||s.apv>=7)&&(s.ns6<0||s.apv>=6.1)){if(!s.rc)s.rc=new Object;if(!s.rc[un]){s.rc[un]=1;if(!s.rl)s.rl=new Object;s.rl[un]=new Array;setTimeout('if(window.s_c_il)window.s_c_il['+s._in+']."
+"mrq(\"'+un+'\")',750)}else{l=s.rl[un];if(l){r.t=ta;r.u=un;r.r=rs;l[l.length]=r;return ''}imn+='_'+s.rc[un];s.rc[un]++}im=s.wd[imn];if(!im)im=s.wd[imn]=new Image;im.s_l=0;im.onload=new Function('e',"
+"'this.s_l=1;var wd=window,s;if(wd.s_c_il){s=wd.s_c_il['+s._in+'];s.mrq(\"'+un+'\");s.nrs--;if(!s.nrs)s.m_m(\"rr\")}');if(!s.nrs){s.nrs=1;s.m_m('rs')}else s.nrs++;im.src=rs;if((!ta||ta=='_self'||ta="
+"='_top'||(s.wd.name&&ta==s.wd.name))&&rs.indexOf('&pe=')>=0){b=e=new Date;while(!im.s_l&&e.getTime()-b.getTime()<500)e=new Date}return ''}return '<im'+'g sr'+'c=\"'+rs+'\" width=1 height=1 border=0"
+" alt=\"\">'};s.gg=function(v){var s=this;if(!s.wd['s_'+v])s.wd['s_'+v]='';return s.wd['s_'+v]};s.glf=function(t,a){if(t.substring(0,2)=='s_')t=t.substring(2);var s=this,v=s.gg(t);if(v)s[t]=v};s.gl="
+"function(v){var s=this;if(s.pg)s.pt(v,',','glf',0)};s.rf=function(x){var s=this,y,i,j,h,l,a,b='',c='',t;if(x){y=''+x;i=y.indexOf('?');if(i>0){a=y.substring(i+1);y=y.substring(0,i);h=y.toLowerCase()"
+";i=0;if(h.substring(0,7)=='http://')i+=7;else if(h.substring(0,8)=='https://')i+=8;h=h.substring(i);i=h.indexOf(\"/\");if(i>0){h=h.substring(0,i);if(h.indexOf('google')>=0){a=s.sp(a,'&');if(a.lengt"
+"h>1){l=',q,ie,start,search_key,word,kw,cd,';for(j=0;j<a.length;j++){t=a[j];i=t.indexOf('=');if(i>0&&l.indexOf(','+t.substring(0,i)+',')>=0)b+=(b?'&':'')+t;else c+=(c?'&':'')+t}if(b&&c){y+='?'+b+'&'"
+"+c;if(''+x!=y)x=y}}}}}}return x};s.hav=function(){var s=this,qs='',fv=s.linkTrackVars,fe=s.linkTrackEvents,mn,i;if(s.pe){mn=s.pe.substring(0,1).toUpperCase()+s.pe.substring(1);if(s[mn]){fv=s[mn].tr"
+"ackVars;fe=s[mn].trackEvents}}fv=fv?fv+','+s.vl_l+','+s.vl_l2:'';for(i=0;i<s.va_t.length;i++){var k=s.va_t[i],v=s[k],b=k.substring(0,4),x=k.substring(4),n=parseInt(x),q=k;if(v&&k!='linkName'&&k!='l"
+"inkType'){if(s.pe||s.lnk||s.eo){if(fv&&(','+fv+',').indexOf(','+k+',')<0)v='';if(k=='events'&&fe)v=s.fs(v,fe)}if(v){if(k=='dynamicVariablePrefix')q='D';else if(k=='visitorID')q='vid';else if(k=='pa"
+"geURL'){q='g';v=s.fl(v,255)}else if(k=='referrer'){q='r';v=s.fl(s.rf(v),255)}else if(k=='vmk'||k=='visitorMigrationKey')q='vmt';else if(k=='visitorMigrationServer'){q='vmf';if(s.ssl&&s.visitorMigra"
+"tionServerSecure)v=''}else if(k=='visitorMigrationServerSecure'){q='vmf';if(!s.ssl&&s.visitorMigrationServer)v=''}else if(k=='charSet'){q='ce';if(v.toUpperCase()=='AUTO')v='ISO8859-1';else if(s.em="
+"=2||s.em==3)v='UTF-8'}else if(k=='visitorNamespace')q='ns';else if(k=='cookieDomainPeriods')q='cdp';else if(k=='cookieLifetime')q='cl';else if(k=='variableProvider')q='vvp';else if(k=='currencyCode"
+"')q='cc';else if(k=='channel')q='ch';else if(k=='transactionID')q='xact';else if(k=='campaign')q='v0';else if(k=='resolution')q='s';else if(k=='colorDepth')q='c';else if(k=='javascriptVersion')q='j"
+"';else if(k=='javaEnabled')q='v';else if(k=='cookiesEnabled')q='k';else if(k=='browserWidth')q='bw';else if(k=='browserHeight')q='bh';else if(k=='connectionType')q='ct';else if(k=='homepage')q='hp'"
+";else if(k=='plugins')q='p';else if(s.num(x)){if(b=='prop')q='c'+n;else if(b=='eVar')q='v'+n;else if(b=='list')q='l'+n;else if(b=='hier'){q='h'+n;v=s.fl(v,255)}}if(v)qs+='&'+q+'='+(k.substring(0,3)"
+"!='pev'?s.ape(v):v)}}}return qs};s.ltdf=function(t,h){t=t?t.toLowerCase():'';h=h?h.toLowerCase():'';var qi=h.indexOf('?');h=qi>=0?h.substring(0,qi):h;if(t&&h.substring(h.length-(t.length+1))=='.'+t"
+")return 1;return 0};s.ltef=function(t,h){t=t?t.toLowerCase():'';h=h?h.toLowerCase():'';if(t&&h.indexOf(t)>=0)return 1;return 0};s.lt=function(h){var s=this,lft=s.linkDownloadFileTypes,lef=s.linkExt"
+"ernalFilters,lif=s.linkInternalFilters;lif=lif?lif:s.wd.location.hostname;h=h.toLowerCase();if(s.trackDownloadLinks&&lft&&s.pt(lft,',','ltdf',h))return 'd';if(s.trackExternalLinks&&h.substring(0,1)"
+"!='#'&&(lef||lif)&&(!lef||s.pt(lef,',','ltef',h))&&(!lif||!s.pt(lif,',','ltef',h)))return 'e';return ''};s.lc=new Function('e','var s=s_c_il['+s._in+'],b=s.eh(this,\"onclick\");s.lnk=s.co(this);s.t"
+"();s.lnk=0;if(b)return this[b](e);return true');s.bc=new Function('e','var s=s_c_il['+s._in+'],f,tcf;if(s.d&&s.d.all&&s.d.all.cppXYctnr)return;s.eo=e.srcElement?e.srcElement:e.target;tcf=new Functi"
+"on(\"s\",\"var e;try{if(s.eo&&(s.eo.tagName||s.eo.parentElement||s.eo.parentNode))s.t()}catch(e){}\");tcf(s);s.eo=0');s.oh=function(o){var s=this,l=s.wd.location,h=o.href?o.href:'',i,j,k,p;i=h.inde"
+"xOf(':');j=h.indexOf('?');k=h.indexOf('/');if(h&&(i<0||(j>=0&&i>j)||(k>=0&&i>k))){p=o.protocol&&o.protocol.length>1?o.protocol:(l.protocol?l.protocol:'');i=l.pathname.lastIndexOf('/');h=(p?p+'//':'"
+"')+(o.host?o.host:(l.host?l.host:''))+(h.substring(0,1)!='/'?l.pathname.substring(0,i<0?0:i)+'/':'')+h}return h};s.ot=function(o){var t=o.tagName;t=t&&t.toUpperCase?t.toUpperCase():'';if(t=='SHAPE'"
+")t='';if(t){if((t=='INPUT'||t=='BUTTON')&&o.type&&o.type.toUpperCase)t=o.type.toUpperCase();else if(!t&&o.href)t='A';}return t};s.oid=function(o){var s=this,t=s.ot(o),p,c,n='',x=0;if(t&&!o.s_oid){p"
+"=o.protocol;c=o.onclick;if(o.href&&(t=='A'||t=='AREA')&&(!c||!p||p.toLowerCase().indexOf('javascript')<0))n=s.oh(o);else if(c){n=s.rep(s.rep(s.rep(s.rep(''+c,\"\\r\",''),\"\\n\",''),\"\\t\",''),' '"
+",'');x=2}else if(t=='INPUT'||t=='SUBMIT'){if(o.value)n=o.value;else if(o.innerText)n=o.innerText;else if(o.textContent)n=o.textContent;x=3}else if(o.src&&t=='IMAGE')n=o.src;if(n){o.s_oid=s.fl(n,100"
+");o.s_oidt=x}}return o.s_oid};s.rqf=function(t,un){var s=this,e=t.indexOf('='),u=e>=0?t.substring(0,e):'',q=e>=0?s.epa(t.substring(e+1)):'';if(u&&q&&(','+u+',').indexOf(','+un+',')>=0){if(u!=s.un&&"
+"s.un.indexOf(',')>=0)q='&u='+u+q+'&u=0';return q}return ''};s.rq=function(un){if(!un)un=this.un;var s=this,c=un.indexOf(','),v=s.c_r('s_sq'),q='';if(c<0)return s.pt(v,'&','rqf',un);return s.pt(un,'"
+",','rq',0)};s.sqp=function(t,a){var s=this,e=t.indexOf('='),q=e<0?'':s.epa(t.substring(e+1));s.sqq[q]='';if(e>=0)s.pt(t.substring(0,e),',','sqs',q);return 0};s.sqs=function(un,q){var s=this;s.squ[u"
+"n]=q;return 0};s.sq=function(q){var s=this,k='s_sq',v=s.c_r(k),x,c=0;s.sqq=new Object;s.squ=new Object;s.sqq[q]='';s.pt(v,'&','sqp',0);s.pt(s.un,',','sqs',q);v='';for(x in s.squ)if(x&&(!Object||!Ob"
+"ject.prototype||!Object.prototype[x]))s.sqq[s.squ[x]]+=(s.sqq[s.squ[x]]?',':'')+x;for(x in s.sqq)if(x&&(!Object||!Object.prototype||!Object.prototype[x])&&s.sqq[x]&&(x==q||c<2)){v+=(v?'&':'')+s.sqq"
+"[x]+'='+s.ape(x);c++}return s.c_w(k,v,0)};s.wdl=new Function('e','var s=s_c_il['+s._in+'],r=true,b=s.eh(s.wd,\"onload\"),i,o,oc;if(b)r=this[b](e);for(i=0;i<s.d.links.length;i++){o=s.d.links[i];oc=o"
+".onclick?\"\"+o.onclick:\"\";if((oc.indexOf(\"s_gs(\")<0||oc.indexOf(\".s_oc(\")>=0)&&oc.indexOf(\".tl(\")<0)s.eh(o,\"onclick\",0,s.lc);}return r');s.wds=function(){var s=this;if(s.apv>3&&(!s.isie|"
+"|!s.ismac||s.apv>=5)){if(s.b&&s.b.attachEvent)s.b.attachEvent('onclick',s.bc);else if(s.b&&s.b.addEventListener)s.b.addEventListener('click',s.bc,false);else s.eh(s.wd,'onload',0,s.wdl)}};s.vs=func"
+"tion(x){var s=this,v=s.visitorSampling,g=s.visitorSamplingGroup,k='s_vsn_'+s.un+(g?'_'+g:''),n=s.c_r(k),e=new Date,y=e.getYear();e.setYear(y+10+(y<1900?1900:0));if(v){v*=100;if(!n){if(!s.c_w(k,x,e)"
+")return 0;n=x}if(n%10000>v)return 0}return 1};s.dyasmf=function(t,m){if(t&&m&&m.indexOf(t)>=0)return 1;return 0};s.dyasf=function(t,m){var s=this,i=t?t.indexOf('='):-1,n,x;if(i>=0&&m){var n=t.subst"
+"ring(0,i),x=t.substring(i+1);if(s.pt(x,',','dyasmf',m))return n}return 0};s.uns=function(){var s=this,x=s.dynamicAccountSelection,l=s.dynamicAccountList,m=s.dynamicAccountMatch,n,i;s.un=s.un.toLowe"
+"rCase();if(x&&l){if(!m)m=s.wd.location.host;if(!m.toLowerCase)m=''+m;l=l.toLowerCase();m=m.toLowerCase();n=s.pt(l,';','dyasf',m);if(n)s.un=n}i=s.un.indexOf(',');s.fun=i<0?s.un:s.un.substring(0,i)};"
+"s.sa=function(un){var s=this;s.un=un;if(!s.oun)s.oun=un;else if((','+s.oun+',').indexOf(','+un+',')<0)s.oun+=','+un;s.uns()};s.m_i=function(n,a){var s=this,m,f=n.substring(0,1),r,l,i;if(!s.m_l)s.m_"
+"l=new Object;if(!s.m_nl)s.m_nl=new Array;m=s.m_l[n];if(!a&&m&&m._e&&!m._i)s.m_a(n);if(!m){m=new Object,m._c='s_m';m._in=s.wd.s_c_in;m._il=s._il;m._il[m._in]=m;s.wd.s_c_in++;m.s=s;m._n=n;m._l=new Ar"
+"ray('_c','_in','_il','_i','_e','_d','_dl','s','n','_r','_g','_g1','_t','_t1','_x','_x1','_rs','_rr','_l');s.m_l[n]=m;s.m_nl[s.m_nl.length]=n}else if(m._r&&!m._m){r=m._r;r._m=m;l=m._l;for(i=0;i<l.le"
+"ngth;i++)if(m[l[i]])r[l[i]]=m[l[i]];r._il[r._in]=r;m=s.m_l[n]=r}if(f==f.toUpperCase())s[n]=m;return m};s.m_a=new Function('n','g','e','if(!g)g=\"m_\"+n;var s=s_c_il['+s._in+'],c=s[g+\"_c\"],m,x,f=0"
+";if(!c)c=s.wd[\"s_\"+g+\"_c\"];if(c&&s_d)s[g]=new Function(\"s\",s_ft(s_d(c)));x=s[g];if(!x)x=s.wd[\\'s_\\'+g];if(!x)x=s.wd[g];m=s.m_i(n,1);if(x&&(!m._i||g!=\"m_\"+n)){m._i=f=1;if((\"\"+x).indexOf("
+"\"function\")>=0)x(s);else s.m_m(\"x\",n,x,e)}m=s.m_i(n,1);if(m._dl)m._dl=m._d=0;s.dlt();return f');s.m_m=function(t,n,d,e){t='_'+t;var s=this,i,x,m,f='_'+t,r=0,u;if(s.m_l&&s.m_nl)for(i=0;i<s.m_nl."
+"length;i++){x=s.m_nl[i];if(!n||x==n){m=s.m_i(x);u=m[t];if(u){if((''+u).indexOf('function')>=0){if(d&&e)u=m[t](d,e);else if(d)u=m[t](d);else u=m[t]()}}if(u)r=1;u=m[t+1];if(u&&!m[f]){if((''+u).indexO"
+"f('function')>=0){if(d&&e)u=m[t+1](d,e);else if(d)u=m[t+1](d);else u=m[t+1]()}}m[f]=1;if(u)r=1}}return r};s.m_ll=function(){var s=this,g=s.m_dl,i,o;if(g)for(i=0;i<g.length;i++){o=g[i];if(o)s.loadMo"
+"dule(o.n,o.u,o.d,o.l,o.e,1);g[i]=0}};s.loadModule=function(n,u,d,l,e,ln){var s=this,m=0,i,g,o=0,f1,f2,c=s.h?s.h:s.b,b,tcf;if(n){i=n.indexOf(':');if(i>=0){g=n.substring(i+1);n=n.substring(0,i)}else "
+"g=\"m_\"+n;m=s.m_i(n)}if((l||(n&&!s.m_a(n,g)))&&u&&s.d&&c&&s.d.createElement){if(d){m._d=1;m._dl=1}if(ln){if(s.ssl)u=s.rep(u,'http:','https:');i='s_s:'+s._in+':'+n+':'+g;b='var s=s_c_il['+s._in+'],"
+"o=s.d.getElementById(\"'+i+'\");if(s&&o){if(!o.l&&s.wd.'+g+'){o.l=1;if(o.i)clearTimeout(o.i);o.i=0;s.m_a(\"'+n+'\",\"'+g+'\"'+(e?',\"'+e+'\"':'')+')}';f2=b+'o.c++;if(!s.maxDelay)s.maxDelay=250;if(!"
+"o.l&&o.c<(s.maxDelay*2)/100)o.i=setTimeout(o.f2,100)}';f1=new Function('e',b+'}');tcf=new Function('s','c','i','u','f1','f2','var e,o=0;try{o=s.d.createElement(\"script\");if(o){o.type=\"text/javas"
+"cript\";'+(n?'o.id=i;o.defer=true;o.onload=o.onreadystatechange=f1;o.f2=f2;o.l=0;':'')+'o.src=u;c.appendChild(o);'+(n?'o.c=0;o.i=setTimeout(f2,100)':'')+'}}catch(e){o=0}return o');o=tcf(s,c,i,u,f1,"
+"f2)}else{o=new Object;o.n=n+':'+g;o.u=u;o.d=d;o.l=l;o.e=e;g=s.m_dl;if(!g)g=s.m_dl=new Array;i=0;while(i<g.length&&g[i])i++;g[i]=o}}else if(n){m=s.m_i(n);m._e=1}return m};s.vo1=function(t,a){if(a[t]"
+"||a['!'+t])this[t]=a[t]};s.vo2=function(t,a){if(!a[t]){a[t]=this[t];if(!a[t])a['!'+t]=1}};s.dlt=new Function('var s=s_c_il['+s._in+'],d=new Date,i,vo,f=0;if(s.dll)for(i=0;i<s.dll.length;i++){vo=s.d"
+"ll[i];if(vo){if(!s.m_m(\"d\")||d.getTime()-vo._t>=s.maxDelay){s.dll[i]=0;s.t(vo)}else f=1}}if(s.dli)clearTimeout(s.dli);s.dli=0;if(f){if(!s.dli)s.dli=setTimeout(s.dlt,s.maxDelay)}else s.dll=0');s.d"
+"l=function(vo){var s=this,d=new Date;if(!vo)vo=new Object;s.pt(s.vl_g,',','vo2',vo);vo._t=d.getTime();if(!s.dll)s.dll=new Array;s.dll[s.dll.length]=vo;if(!s.maxDelay)s.maxDelay=250;s.dlt()};s.t=fun"
+"ction(vo,id){var s=this,trk=1,tm=new Date,sed=Math&&Math.random?Math.floor(Math.random()*10000000000000):tm.getTime(),sess='s'+Math.floor(tm.getTime()/10800000)%10+sed,y=tm.getYear(),vt=tm.getDate("
+")+'/'+tm.getMonth()+'/'+(y<1900?y+1900:y)+' '+tm.getHours()+':'+tm.getMinutes()+':'+tm.getSeconds()+' '+tm.getDay()+' '+tm.getTimezoneOffset(),tcf,tfs=s.gtfs(),ta=-1,q='',qs='',code='',vb=new Objec"
+"t;s.gl(s.vl_g);s.uns();s.m_ll();if(!s.td){var tl=tfs.location,a,o,i,x='',c='',v='',p='',bw='',bh='',j='1.0',k=s.c_w('s_cc','true',0)?'Y':'N',hp='',ct='',pn=0,ps;if(String&&String.prototype){j='1.1'"
+";if(j.match){j='1.2';if(tm.setUTCDate){j='1.3';if(s.isie&&s.ismac&&s.apv>=5)j='1.4';if(pn.toPrecision){j='1.5';a=new Array;if(a.forEach){j='1.6';i=0;o=new Object;tcf=new Function('o','var e,i=0;try"
+"{i=new Iterator(o)}catch(e){}return i');i=tcf(o);if(i&&i.next)j='1.7'}}}}}if(s.apv>=4)x=screen.width+'x'+screen.height;if(s.isns||s.isopera){if(s.apv>=3){v=s.n.javaEnabled()?'Y':'N';if(s.apv>=4){c="
+"screen.pixelDepth;bw=s.wd.innerWidth;bh=s.wd.innerHeight}}s.pl=s.n.plugins}else if(s.isie){if(s.apv>=4){v=s.n.javaEnabled()?'Y':'N';c=screen.colorDepth;if(s.apv>=5){bw=s.d.documentElement.offsetWid"
+"th;bh=s.d.documentElement.offsetHeight;if(!s.ismac&&s.b){tcf=new Function('s','tl','var e,hp=0;try{s.b.addBehavior(\"#default#homePage\");hp=s.b.isHomePage(tl)?\"Y\":\"N\"}catch(e){}return hp');hp="
+"tcf(s,tl);tcf=new Function('s','var e,ct=0;try{s.b.addBehavior(\"#default#clientCaps\");ct=s.b.connectionType}catch(e){}return ct');ct=tcf(s)}}}else r=''}if(s.pl)while(pn<s.pl.length&&pn<30){ps=s.f"
+"l(s.pl[pn].name,100)+';';if(p.indexOf(ps)<0)p+=ps;pn++}s.resolution=x;s.colorDepth=c;s.javascriptVersion=j;s.javaEnabled=v;s.cookiesEnabled=k;s.browserWidth=bw;s.browserHeight=bh;s.connectionType=c"
+"t;s.homepage=hp;s.plugins=p;s.td=1}if(vo){s.pt(s.vl_g,',','vo2',vb);s.pt(s.vl_g,',','vo1',vo)}if((vo&&vo._t)||!s.m_m('d')){if(s.usePlugins)s.doPlugins(s);var l=s.wd.location,r=tfs.document.referrer"
+";if(!s.pageURL)s.pageURL=l.href?l.href:l;if(!s.referrer&&!s._1_referrer){s.referrer=r;s._1_referrer=1}s.m_m('g');if(s.lnk||s.eo){var o=s.eo?s.eo:s.lnk;if(!o)return '';var p=s.pageName,w=1,t=s.ot(o)"
+",n=s.oid(o),x=o.s_oidt,h,l,i,oc;if(s.eo&&o==s.eo){while(o&&!n&&t!='BODY'){o=o.parentElement?o.parentElement:o.parentNode;if(!o)return '';t=s.ot(o);n=s.oid(o);x=o.s_oidt}oc=o.onclick?''+o.onclick:''"
+";if((oc.indexOf(\"s_gs(\")>=0&&oc.indexOf(\".s_oc(\")<0)||oc.indexOf(\".tl(\")>=0)return ''}if(n)ta=o.target;h=s.oh(o);i=h.indexOf('?');h=s.linkLeaveQueryString||i<0?h:h.substring(0,i);l=s.linkName"
+";t=s.linkType?s.linkType.toLowerCase():s.lt(h);if(t&&(h||l))q+='&pe=lnk_'+(t=='d'||t=='e'?s.ape(t):'o')+(h?'&pev1='+s.ape(h):'')+(l?'&pev2='+s.ape(l):'');else trk=0;if(s.trackInlineStats){if(!p){p="
+"s.pageURL;w=0}t=s.ot(o);i=o.sourceIndex;if(s.gg('objectID')){n=s.gg('objectID');x=1;i=1}if(p&&n&&t)qs='&pid='+s.ape(s.fl(p,255))+(w?'&pidt='+w:'')+'&oid='+s.ape(s.fl(n,100))+(x?'&oidt='+x:'')+'&ot="
+"'+s.ape(t)+(i?'&oi='+i:'')}}if(!trk&&!qs)return '';s.sampled=s.vs(sed);if(trk){if(s.sampled)code=s.mr(sess,(vt?'&t='+s.ape(vt):'')+s.hav()+q+(qs?qs:s.rq()),0,id,ta);qs='';s.m_m('t');if(s.p_r)s.p_r("
+");s.referrer=''}s.sq(qs);}else{s.dl(vo);}if(vo)s.pt(s.vl_g,',','vo1',vb);s.lnk=s.eo=s.linkName=s.linkType=s.wd.s_objectID=s.ppu=s.pe=s.pev1=s.pev2=s.pev3='';if(s.pg)s.wd.s_lnk=s.wd.s_eo=s.wd.s_link"
+"Name=s.wd.s_linkType='';if(!id&&!s.tc){s.tc=1;s.flushBufferedRequests()}return code};s.tl=function(o,t,n,vo){var s=this;s.lnk=s.co(o);s.linkType=t;s.linkName=n;s.t(vo)};if(pg){s.wd.s_co=function(o)"
+"{var s=s_gi(\"_\",1,1);return s.co(o)};s.wd.s_gs=function(un){var s=s_gi(un,1,1);return s.t()};s.wd.s_dc=function(un){var s=s_gi(un,1);return s.t()}}s.ssl=(s.wd.location.protocol.toLowerCase().inde"
+"xOf('https')>=0);s.d=document;s.b=s.d.body;if(s.d.getElementsByTagName){s.h=s.d.getElementsByTagName('HEAD');if(s.h)s.h=s.h[0]}s.n=navigator;s.u=s.n.userAgent;s.ns6=s.u.indexOf('Netscape6/');var ap"
+"n=s.n.appName,v=s.n.appVersion,ie=v.indexOf('MSIE '),o=s.u.indexOf('Opera '),i;if(v.indexOf('Opera')>=0||o>0)apn='Opera';s.isie=(apn=='Microsoft Internet Explorer');s.isns=(apn=='Netscape');s.isope"
+"ra=(apn=='Opera');s.ismac=(s.u.indexOf('Mac')>=0);if(o>0)s.apv=parseFloat(s.u.substring(o+6));else if(ie>0){s.apv=parseInt(i=v.substring(ie+5));if(s.apv>3)s.apv=parseFloat(i)}else if(s.ns6>0)s.apv="
+"parseFloat(s.u.substring(s.ns6+10));else s.apv=parseFloat(v);s.em=0;if(s.em.toPrecision)s.em=3;else if(String.fromCharCode){i=escape(String.fromCharCode(256)).toUpperCase();s.em=(i=='%C4%80'?2:(i=="
+"'%U0100'?1:0))}s.sa(un);s.vl_l='dynamicVariablePrefix,visitorID,vmk,visitorMigrationKey,visitorMigrationServer,visitorMigrationServerSecure,ppu,charSet,visitorNamespace,cookieDomainPeriods,cookieLi"
+"fetime,pageName,pageURL,referrer,currencyCode';s.va_l=s.sp(s.vl_l,',');s.vl_t=s.vl_l+',variableProvider,channel,server,pageType,transactionID,purchaseID,campaign,state,zip,events,products,linkName,"
+"linkType';for(var n=1;n<76;n++)s.vl_t+=',prop'+n+',eVar'+n+',hier'+n+',list'+n;s.vl_l2=',tnt,pe,pev1,pev2,pev3,resolution,colorDepth,javascriptVersion,javaEnabled,cookiesEnabled,browserWidth,browse"
+"rHeight,connectionType,homepage,plugins';s.vl_t+=s.vl_l2;s.va_t=s.sp(s.vl_t,',');s.vl_g=s.vl_t+',trackingServer,trackingServerSecure,trackingServerBase,fpCookieDomainPeriods,disableBufferedRequests"
+",mobile,visitorSampling,visitorSamplingGroup,dynamicAccountSelection,dynamicAccountList,dynamicAccountMatch,trackDownloadLinks,trackExternalLinks,trackInlineStats,linkLeaveQueryString,linkDownloadF"
+"ileTypes,linkExternalFilters,linkInternalFilters,linkTrackVars,linkTrackEvents,linkNames,lnk,eo,_1_referrer';s.va_g=s.sp(s.vl_g,',');s.pg=pg;s.gl(s.vl_g);if(!ss)s.wds()",w=window,l=w.s_c_il,n=navigator,u=n.userAgent,v=n.appVersion,e=v.indexOf('MSIE '),m=u.indexOf('Netscape6/'),a,i,s;if(un){un=un.toLowerCase();if(l)for(i=0;i<l.length;i++){s=l[i];if(!s._c||s._c=='s_c'){if(s.oun==un)return s;else if(s.fs&&s.sa&&s.fs(s.oun,un)){s.sa(un);return s}}}}w.s_an='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';w.s_sp=new Function("x","d","var a=new Array,i=0,j;if(x){if(x.split)a=x.split(d);else if(!d)for(i=0;i<x.length;i++)a[a.length]=x.substring(i,i+1);else while(i>=0){j=x.indexOf(d,i);a[a.length]=x.subst"
+"ring(i,j<0?x.length:j);i=j;if(i>=0)i+=d.length}}return a");w.s_jn=new Function("a","d","var x='',i,j=a.length;if(a&&j>0){x=a[0];if(j>1){if(a.join)x=a.join(d);else for(i=1;i<j;i++)x+=d+a[i]}}return x");w.s_rep=new Function("x","o","n","return s_jn(s_sp(x,o),n)");w.s_d=new Function("x","var t='`^@$#',l=s_an,l2=new Object,x2,d,b=0,k,i=x.lastIndexOf('~~'),j,v,w;if(i>0){d=x.substring(0,i);x=x.substring(i+2);l=s_sp(l,'');for(i=0;i<62;i++)l2[l[i]]=i;t=s_sp(t,'');d"
+"=s_sp(d,'~');i=0;while(i<5){v=0;if(x.indexOf(t[i])>=0) {x2=s_sp(x,t[i]);for(j=1;j<x2.length;j++){k=x2[j].substring(0,1);w=t[i]+k;if(k!=' '){v=1;w=d[b+l2[k]]}x2[j]=w+x2[j].substring(1)}}if(v)x=s_jn("
+"x2,'');else{w=t[i]+' ';if(x.indexOf(w)>=0)x=s_rep(x,w,t[i]);i++;b+=62}}}return x");w.s_fe=new Function("c","return s_rep(s_rep(s_rep(c,'\\\\','\\\\\\\\'),'\"','\\\\\"'),\"\\n\",\"\\\\n\")");w.s_fa=new Function("f","var s=f.indexOf('(')+1,e=f.indexOf(')'),a='',c;while(s>=0&&s<e){c=f.substring(s,s+1);if(c==',')a+='\",\"';else if((\"\\n\\r\\t \").indexOf(c)<0)a+=c;s++}return a?'\"'+a+'\"':"
+"a");w.s_ft=new Function("c","c+='';var s,e,o,a,d,q,f,h,x;s=c.indexOf('=function(');while(s>=0){s++;d=1;q='';x=0;f=c.substring(s);a=s_fa(f);e=o=c.indexOf('{',s);e++;while(d>0){h=c.substring(e,e+1);if(q){i"
+"f(h==q&&!x)q='';if(h=='\\\\')x=x?0:1;else x=0}else{if(h=='\"'||h==\"'\")q=h;if(h=='{')d++;if(h=='}')d--}if(d>0)e++}c=c.substring(0,s)+'new Function('+(a?a+',':'')+'\"'+s_fe(c.substring(o+1,e))+'\")"
+"'+c.substring(e+1);s=c.indexOf('=function(')}return c;");c=s_d(c);if(e>0){a=parseInt(i=v.substring(e+5));if(a>3)a=parseFloat(i)}else if(m>0)a=parseFloat(u.substring(m+10));else a=parseFloat(v);if(a>=5&&v.indexOf('Opera')<0&&u.indexOf('Opera')<0){w.s_c=new Function("un","pg","ss","var s=this;"+c);return new s_c(un,pg,ss)}else s=new Function("un","pg","ss","var s=new Object;"+s_ft(c)+";return s");return s(un,pg,ss)}catch(e){}}
var mboxCopyright="Copyright 1996-2009. Adobe Systems Incorporated. All rights reserved";mboxUrlBuilder=function(a,b){this.a=a;this.b=b;this.c=new Array();this.d=function(e){return e;};this.f=null;};mboxUrlBuilder.prototype.addParameter=function(g,h){var i=new RegExp('(\'|")');if(i.exec(g)){throw"Parameter '"+g+"' contains invalid characters";}for(var j=0;j<this.c.length;j++){var k=this.c[j];if(k.name==g){k.value=h;return this;}}var l=new Object();l.name=g;l.value=h;this.c[this.c.length]=l;return this;};mboxUrlBuilder.prototype.addParameters=function(c){if(!c){return this;}for(var j=0;j<c.length;j++){var m=c[j].indexOf('=');if(m==-1||m==0){continue;}this.addParameter(c[j].substring(0,m),c[j].substring(m+1,c[j].length));}return this;};mboxUrlBuilder.prototype.setServerType=function(n){this.o=n;};mboxUrlBuilder.prototype.setBasePath=function(f){this.f=f;};mboxUrlBuilder.prototype.setUrlProcessAction=function(p){this.d=p;};mboxUrlBuilder.prototype.buildUrl=function(){var q=this.f?this.f:'/m2/'+this.b+'/mbox/'+this.o;var r=document.location.protocol=='file:'?'http:':document.location.protocol;var e=r+"//"+this.a+q;var s=e.indexOf('?')!=-1?'&':'?';for(var j=0;j<this.c.length;j++){var k=this.c[j];e+=s+encodeURIComponent(k.name)+'='+encodeURIComponent(k.value);s='&';}return this.t(this.d(e));};mboxUrlBuilder.prototype.getParameters=function(){return this.c;};mboxUrlBuilder.prototype.setParameters=function(c){this.c=c;};mboxUrlBuilder.prototype.clone=function(){var u=new mboxUrlBuilder(this.a,this.b);u.setServerType(this.o);u.setBasePath(this.f);u.setUrlProcessAction(this.d);for(var j=0;j<this.c.length;j++){u.addParameter(this.c[j].name,this.c[j].value);}return u;};mboxUrlBuilder.prototype.t=function(v){return v.replace(/\"/g,'&quot;').replace(/>/g,'&gt;');};mboxStandardFetcher=function(){};mboxStandardFetcher.prototype.getType=function(){return'standard';};mboxStandardFetcher.prototype.fetch=function(w){w.setServerType(this.getType());document.write('<'+'scr'+'ipt src="'+w.buildUrl()+'" language="JavaScript"><'+'\/scr'+'ipt>');};mboxStandardFetcher.prototype.cancel=function(){};mboxAjaxFetcher=function(){};mboxAjaxFetcher.prototype.getType=function(){return'ajax';};mboxAjaxFetcher.prototype.fetch=function(w){w.setServerType(this.getType());var e=w.buildUrl();this.x=document.createElement('script');this.x.src=e;document.body.appendChild(this.x);};mboxAjaxFetcher.prototype.cancel=function(){};mboxMap=function(){this.y=new Object();this.z=new Array();};mboxMap.prototype.put=function(A,h){if(!this.y[A]){this.z[this.z.length]=A;}this.y[A]=h;};mboxMap.prototype.get=function(A){return this.y[A];};mboxMap.prototype.remove=function(A){this.y[A]=undefined;};mboxMap.prototype.each=function(p){for(var j=0;j<this.z.length;j++){var A=this.z[j];var h=this.y[A];if(h){var B=p(A,h);if(B===false){break;}}}};mboxFactory=function(C,b,D){this.E=false;this.C=C;this.D=D;this.F=new mboxList();mboxFactories.put(D,this);this.G=typeof document.createElement('div').replaceChild!='undefined'&&(function(){return true;})()&&typeof document.getElementById!='undefined'&&typeof(window.attachEvent||document.addEventListener||window.addEventListener)!='undefined'&&typeof encodeURIComponent!='undefined';this.H=this.G&&mboxGetPageParameter('mboxDisable')==null;var I=D=='default';this.J=new mboxCookieManager('mbox'+(I?'':('-'+D)),(function(){return mboxCookiePageDomain();})());this.H=this.H&&this.J.isEnabled()&&(this.J.getCookie('disable')==null);if(this.isAdmin()){this.enable();}this.K=mboxGenerateId();this.L=mboxScreenHeight();this.M=mboxScreenWidth();this.N=mboxBrowserWidth();this.O=mboxBrowserHeight();this.P=mboxScreenColorDepth();this.Q=mboxBrowserTimeOffset();this.R=new mboxSession(this.K,'mboxSession','session',31*60,this.J);this.S=new mboxPC('PC',1209600,this.J);this.w=new mboxUrlBuilder(C,b);this.T(this.w,I);this.U=new Date().getTime();this.V=this.U;var W=this;this.addOnLoad(function(){W.V=new Date().getTime();});if(this.G){this.addOnLoad(function(){W.E=true;W.getMboxes().each(function(X){X.setFetcher(new mboxAjaxFetcher());X.finalize();});});this.limitTraffic(100,10368000);if(this.H){this.Y();this.Z=new mboxSignaler(function(_,c){return W.create(_,c);},this.J);}}};mboxFactory.prototype.isEnabled=function(){return this.H;};mboxFactory.prototype.getDisableReason=function(){return this.J.getCookie('disable');};mboxFactory.prototype.isSupported=function(){return this.G;};mboxFactory.prototype.disable=function(ab,bb){if(typeof ab=='undefined'){ab=60*60;}if(typeof bb=='undefined'){bb='unspecified';}if(!this.isAdmin()){this.H=false;this.J.setCookie('disable',bb,ab);}};mboxFactory.prototype.enable=function(){this.H=true;this.J.deleteCookie('disable');};mboxFactory.prototype.isAdmin=function(){return document.location.href.indexOf('mboxEnv')!=-1;};mboxFactory.prototype.limitTraffic=function(cb,ab){};mboxFactory.prototype.addOnLoad=function(p){if(window.addEventListener){window.addEventListener('load',p,false);}else if(document.addEventListener){document.addEventListener('load',p,false);}else if(document.attachEvent){window.attachEvent('onload',p);}};mboxFactory.prototype.getEllapsedTime=function(){return this.V-this.U;};mboxFactory.prototype.getEllapsedTimeUntil=function(db){return db-this.U;};mboxFactory.prototype.getMboxes=function(){return this.F;};mboxFactory.prototype.get=function(_,eb){return this.F.get(_).getById(eb||0);};mboxFactory.prototype.update=function(_,c){if(!this.isEnabled()){return;}if(this.F.get(_).length()==0){throw"Mbox "+_+" is not defined";}this.F.get(_).each(function(X){X.getUrlBuilder().addParameter('mboxPage',mboxGenerateId());X.load(c);});};mboxFactory.prototype.create=function(_,c,fb){if(!this.isSupported()){return null;}var e=this.w.clone();e.addParameter('mboxCount',this.F.length()+1);e.addParameters(c);var eb=this.F.get(_).length();var gb=this.D+'-'+_+'-'+eb;var hb;if(fb){hb=new mboxLocatorNode(fb);}else{if(this.E){throw'The page has already been loaded, can\'t write marker';}hb=new mboxLocatorDefault(gb);}try{var W=this;var ib='mboxImported-'+gb;var X=new mbox(_,eb,e,hb,ib);if(this.H){X.setFetcher(this.E?new mboxAjaxFetcher():new mboxStandardFetcher());}X.setOnError(function(jb,n){X.setMessage(jb);X.activate();if(!X.isActivated()){W.disable(60*60,jb);window.location.reload(false);}});this.F.add(X);}catch(kb){this.disable();throw'Failed creating mbox "'+_+'", the error was: '+kb;}var lb=new Date();e.addParameter('mboxTime',lb.getTime()-(lb.getTimezoneOffset()*60000));return X;};mboxFactory.prototype.getCookieManager=function(){return this.J;};mboxFactory.prototype.getPageId=function(){return this.K;};mboxFactory.prototype.getPCId=function(){return this.S;};mboxFactory.prototype.getSessionId=function(){return this.R;};mboxFactory.prototype.getSignaler=function(){return this.Z;};mboxFactory.prototype.getUrlBuilder=function(){return this.w;};mboxFactory.prototype.T=function(e,I){e.addParameter('mboxHost',document.location.hostname).addParameter('mboxSession',this.R.getId());if(!I){e.addParameter('mboxFactoryId',this.D);}if(this.S.getId()!=null){e.addParameter('mboxPC',this.S.getId());}e.addParameter('mboxPage',this.K);e.addParameter('screenHeight',this.L);e.addParameter('screenWidth',this.M);e.addParameter('browserWidth',this.N);e.addParameter('browserHeight',this.O);e.addParameter('browserTimeOffset',this.Q);e.addParameter('colorDepth',this.P);e.setUrlProcessAction(function(e){e+='&mboxURL='+encodeURIComponent(document.location);var mb=encodeURIComponent(document.referrer);if(e.length+mb.length<2000){e+='&mboxReferrer='+mb;}e+='&mboxVersion='+mboxVersion;return e;});};mboxFactory.prototype.nb=function(){return"";};mboxFactory.prototype.Y=function(){document.write('<style>.'+'mboxDefault'+' { visibility:hidden; }</style>');};mboxFactory.prototype.isDomLoaded=function(){return this.E;};mboxSignaler=function(ob,J){this.J=J;var pb=J.getCookieNames('signal-');for(var j=0;j<pb.length;j++){var qb=pb[j];var rb=J.getCookie(qb).split('&');var X=ob(rb[0],rb);X.load();J.deleteCookie(qb);}};mboxSignaler.prototype.signal=function(sb,_){this.J.setCookie('signal-'+sb,mboxShiftArray(arguments).join('&'),45*60);};mboxList=function(){this.F=new Array();};mboxList.prototype.add=function(X){if(X!=null){this.F[this.F.length]=X;}};mboxList.prototype.get=function(_){var B=new mboxList();for(var j=0;j<this.F.length;j++){var X=this.F[j];if(X.getName()==_){B.add(X);}}return B;};mboxList.prototype.getById=function(tb){return this.F[tb];};mboxList.prototype.length=function(){return this.F.length;};mboxList.prototype.each=function(p){if(typeof p!='function'){throw'Action must be a function, was: '+typeof(p);}for(var j=0;j<this.F.length;j++){p(this.F[j]);}};mboxLocatorDefault=function(g){this.g='mboxMarker-'+g;document.write('<div id="'+this.g+'" style="visibility:hidden;display:none">&nbsp;</div>');};mboxLocatorDefault.prototype.locate=function(){var ub=document.getElementById(this.g);while(ub!=null){if(ub.nodeType==1){if(ub.className=='mboxDefault'){return ub;}}ub=ub.previousSibling;}return null;};mboxLocatorDefault.prototype.force=function(){var vb=document.createElement('div');vb.className='mboxDefault';var wb=document.getElementById(this.g);wb.parentNode.insertBefore(vb,wb);return vb;};mboxLocatorNode=function(xb){this.ub=xb;};mboxLocatorNode.prototype.locate=function(){return typeof this.ub=='string'?document.getElementById(this.ub):this.ub;};mboxLocatorNode.prototype.force=function(){return null;};mboxCreate=function(_){var X=mboxFactoryDefault.create(_,mboxShiftArray(arguments));if(X){X.load();}return X;};mboxDefine=function(fb,_){var X=mboxFactoryDefault.create(_,mboxShiftArray(mboxShiftArray(arguments)),fb);return X;};mboxUpdate=function(_){mboxFactoryDefault.update(_,mboxShiftArray(arguments));};mbox=function(g,yb,w,zb,ib){this.Ab=null;this.Bb=0;this.hb=zb;this.ib=ib;this.Cb=null;this.Db=new mboxOfferContent();this.vb=null;this.w=w;this.message='';this.Eb=new Object();this.Fb=0;this.yb=yb;this.g=g;this.Gb();w.addParameter('mbox',g).addParameter('mboxId',yb);this.Hb=function(){};this.Ib=function(){};this.Jb=null;};mbox.prototype.getId=function(){return this.yb;};mbox.prototype.Gb=function(){if(this.g.length>250){throw"Mbox Name "+this.g+" exceeds max length of "+"250 characters.";}else if(this.g.match(/^\s+|\s+$/g)){throw"Mbox Name "+this.g+" has leading/trailing whitespace(s).";}};mbox.prototype.getName=function(){return this.g;};mbox.prototype.getParameters=function(){var c=this.w.getParameters();var B=new Array();for(var j=0;j<c.length;j++){if(c[j].name.indexOf('mbox')!=0){B[B.length]=c[j].name+'='+c[j].value;}}return B;};mbox.prototype.setOnLoad=function(p){this.Ib=p;return this;};mbox.prototype.setMessage=function(jb){this.message=jb;return this;};mbox.prototype.setOnError=function(Hb){this.Hb=Hb;return this;};mbox.prototype.setFetcher=function(Kb){if(this.Cb){this.Cb.cancel();}this.Cb=Kb;return this;};mbox.prototype.getFetcher=function(){return this.Cb;};mbox.prototype.load=function(c){if(this.Cb==null){return this;}this.setEventTime("load.start");this.cancelTimeout();this.Bb=0;var w=(c&&c.length>0)?this.w.clone().addParameters(c):this.w;this.Cb.fetch(w);var W=this;this.Lb=setTimeout(function(){W.Hb('browser timeout',W.Cb.getType());},15000);this.setEventTime("load.end");return this;};mbox.prototype.loaded=function(){this.cancelTimeout();if(!this.activate()){var W=this;setTimeout(function(){W.loaded();},100);}};mbox.prototype.activate=function(){if(this.Bb){return this.Bb;}this.setEventTime('activate'+(++this.Fb)+'.start');if(this.show()){this.cancelTimeout();this.Bb=1;}this.setEventTime('activate'+this.Fb+'.end');return this.Bb;};mbox.prototype.isActivated=function(){return this.Bb;};mbox.prototype.setOffer=function(Db){if(Db&&Db.show&&Db.setOnLoad){this.Db=Db;}else{throw'Invalid offer';}return this;};mbox.prototype.getOffer=function(){return this.Db;};mbox.prototype.show=function(){this.setEventTime('show.start');var B=this.Db.show(this);this.setEventTime(B==1?"show.end.ok":"show.end");return B;};mbox.prototype.showContent=function(Mb){if(Mb==null){return 0;}if(this.vb==null||!this.vb.parentNode){this.vb=this.getDefaultDiv();if(this.vb==null){return 0;}}if(this.vb!=Mb){this.Nb(this.vb);this.vb.parentNode.replaceChild(Mb,this.vb);this.vb=Mb;}this.Ob(Mb);this.Ib();return 1;};mbox.prototype.hide=function(){this.setEventTime('hide.start');var B=this.showContent(this.getDefaultDiv());this.setEventTime(B==1?'hide.end.ok':'hide.end.fail');return B;};mbox.prototype.finalize=function(){this.setEventTime('finalize.start');this.cancelTimeout();if(this.getDefaultDiv()==null){if(this.hb.force()!=null){this.setMessage('No default content, an empty one has been added');}else{this.setMessage('Unable to locate mbox');}}if(!this.activate()){this.hide();this.setEventTime('finalize.end.hide');}this.setEventTime('finalize.end.ok');};mbox.prototype.cancelTimeout=function(){if(this.Lb){clearTimeout(this.Lb);}if(this.Cb!=null){this.Cb.cancel();}};mbox.prototype.getDiv=function(){return this.vb;};mbox.prototype.getDefaultDiv=function(){if(this.Jb==null){this.Jb=this.hb.locate();}return this.Jb;};mbox.prototype.setEventTime=function(Pb){this.Eb[Pb]=(new Date()).getTime();};mbox.prototype.getEventTimes=function(){return this.Eb;};mbox.prototype.getImportName=function(){return this.ib;};mbox.prototype.getURL=function(){return this.w.buildUrl();};mbox.prototype.getUrlBuilder=function(){return this.w;};mbox.prototype.Qb=function(vb){return vb.style.display!='none';};mbox.prototype.Ob=function(vb){this.Rb(vb,true);};mbox.prototype.Nb=function(vb){this.Rb(vb,false);};mbox.prototype.Rb=function(vb,Sb){vb.style.visibility=Sb?"visible":"hidden";vb.style.display=Sb?"block":"none";};mboxOfferContent=function(){this.Ib=function(){};};mboxOfferContent.prototype.show=function(X){var B=X.showContent(document.getElementById(X.getImportName()));if(B==1){this.Ib();}return B;};mboxOfferContent.prototype.setOnLoad=function(Ib){this.Ib=Ib;};mboxOfferAjax=function(Mb){this.Mb=Mb;this.Ib=function(){};};mboxOfferAjax.prototype.setOnLoad=function(Ib){this.Ib=Ib;};mboxOfferAjax.prototype.show=function(X){var Tb=document.createElement('div');Tb.id=X.getImportName();Tb.innerHTML=this.Mb;var B=X.showContent(Tb);if(B==1){this.Ib();}return B;};mboxOfferDefault=function(){this.Ib=function(){};};mboxOfferDefault.prototype.setOnLoad=function(Ib){this.Ib=Ib;};mboxOfferDefault.prototype.show=function(X){var B=X.hide();if(B==1){this.Ib();}return B;};mboxCookieManager=function mboxCookieManager(g,Ub){this.g=g;this.Ub=Ub==''||Ub.indexOf('.')==-1?'':'; domain='+Ub;this.Vb=new mboxMap();this.loadCookies();};mboxCookieManager.prototype.isEnabled=function(){this.setCookie('check','true',60);this.loadCookies();return this.getCookie('check')=='true';};mboxCookieManager.prototype.setCookie=function(g,h,ab){if(typeof g!='undefined'&&typeof h!='undefined'&&typeof ab!='undefined'){var Wb=new Object();Wb.name=g;Wb.value=escape(h);Wb.expireOn=Math.ceil(ab+new Date().getTime()/1000);this.Vb.put(g,Wb);this.saveCookies();}};mboxCookieManager.prototype.getCookie=function(g){var Wb=this.Vb.get(g);return Wb?unescape(Wb.value):null;};mboxCookieManager.prototype.deleteCookie=function(g){this.Vb.remove(g);this.saveCookies();};mboxCookieManager.prototype.getCookieNames=function(Xb){var Yb=new Array();this.Vb.each(function(g,Wb){if(g.indexOf(Xb)==0){Yb[Yb.length]=g;}});return Yb;};mboxCookieManager.prototype.saveCookies=function(){var Zb=new Array();var _b=0;this.Vb.each(function(g,Wb){Zb[Zb.length]=g+'#'+Wb.value+'#'+Wb.expireOn;if(_b<Wb.expireOn){_b=Wb.expireOn;}});var ac=new Date(_b*1000);document.cookie=this.g+'='+Zb.join('|')+'; expires='+ac.toGMTString()+'; path=/'+this.Ub;};mboxCookieManager.prototype.loadCookies=function(){this.Vb=new mboxMap();var bc=document.cookie.indexOf(this.g+'=');if(bc!=-1){var cc=document.cookie.indexOf(';',bc);if(cc==-1){cc=document.cookie.indexOf(',',bc);if(cc==-1){cc=document.cookie.length;}}var dc=document.cookie.substring(bc+this.g.length+1,cc).split('|');var ec=Math.ceil(new Date().getTime()/1000);for(var j=0;j<dc.length;j++){var Wb=dc[j].split('#');if(ec<=Wb[2]){var fc=new Object();fc.name=Wb[0];fc.value=Wb[1];fc.expireOn=Wb[2];this.Vb.put(fc.name,fc);}}}};mboxSession=function(gc,hc,qb,ic,J){this.hc=hc;this.qb=qb;this.ic=ic;this.J=J;this.jc=false;this.yb=typeof mboxForceSessionId!='undefined'?mboxForceSessionId:mboxGetPageParameter(this.hc);if(this.yb==null||this.yb.length==0){this.yb=J.getCookie(qb);if(this.yb==null||this.yb.length==0){this.yb=gc;this.jc=true;}}J.setCookie(qb,this.yb,ic);};mboxSession.prototype.getId=function(){return this.yb;};mboxSession.prototype.forceId=function(kc){this.yb=kc;this.J.setCookie(this.qb,this.yb,this.ic);};mboxPC=function(qb,ic,J){this.qb=qb;this.ic=ic;this.J=J;this.yb=typeof mboxForcePCId!='undefined'?mboxForcePCId:J.getCookie(qb);if(this.yb!=null){J.setCookie(qb,this.yb,ic);}};mboxPC.prototype.getId=function(){return this.yb;};mboxPC.prototype.forceId=function(kc){if(this.yb!=kc){this.yb=kc;this.J.setCookie(this.qb,this.yb,this.ic);return true;}return false;};mboxGetPageParameter=function(g){var B=null;var lc=new RegExp(g+"=([^\&]*)");var mc=lc.exec(document.location);if(mc!=null&&mc.length>=2){B=mc[1];}return B;};mboxSetCookie=function(g,h,ab){return mboxFactoryDefault.getCookieManager().setCookie(g,h,ab);};mboxGetCookie=function(g){return mboxFactoryDefault.getCookieManager().getCookie(g);};mboxCookiePageDomain=function(){var Ub=(/([^:]*)(:[0-9]{0,5})?/).exec(document.location.host)[1];var nc=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/;if(!nc.exec(Ub)){var oc=(/([^\.]+\.[^\.]{3}|[^\.]+\.[^\.]+\.[^\.]{2})$/).exec(Ub);if(oc){Ub=oc[0];}}return Ub?Ub:"";};mboxShiftArray=function(pc){var B=new Array();for(var j=1;j<pc.length;j++){B[B.length]=pc[j];}return B;};mboxGenerateId=function(){return(new Date()).getTime()+"-"+Math.floor(Math.random()*999999);};mboxScreenHeight=function(){return screen.height;};mboxScreenWidth=function(){return screen.width;};mboxBrowserWidth=function(){return(window.innerWidth)?window.innerWidth:document.documentElement?document.documentElement.clientWidth:document.body.clientWidth;};mboxBrowserHeight=function(){return(window.innerHeight)?window.innerHeight:document.documentElement?document.documentElement.clientHeight:document.body.clientHeight;};mboxBrowserTimeOffset=function(){return-new Date().getTimezoneOffset();};mboxScreenColorDepth=function(){return screen.pixelDepth;};try{if(typeof mboxVersion=='undefined'){var mboxVersion=39;var mboxFactories=new mboxMap();var mboxFactoryDefault=new mboxFactory('mtvnetworks.tt.omtrdc.net','mtvnetworks','default');};if(mboxGetPageParameter("mboxDebug")!=null||mboxFactoryDefault.getCookieManager().getCookie("debug")!=null){setTimeout(function(){if(typeof mboxDebugLoaded=='undefined'){alert('Could not load the remote debug.\nPlease check your connection'+' to Test&amp;Target servers');}},60*60);document.write('<'+'scr'+'ipt language="Javascript1.2" src='+'"http://admin5.testandtarget.omniture.com/admin/mbox/mbox_debug.jsp?mboxServerHost=mtvnetworks.tt.omtrdc.net'+'&clientCode=mtvnetworks"><'+'\/scr'+'ipt>');};}catch(e){};mboxScPluginFetcher=function(b,qc){this.b=b;this.qc=qc;};mboxScPluginFetcher.prototype.rc=function(w){w.setBasePath('/m2/'+this.b+'/sc/standard');this.sc(w);var e=w.buildUrl();e+='&scPluginVersion=1';return e;};mboxScPluginFetcher.prototype.sc=function(w){var tc=["dynamicVariablePrefix","visitorID","vmk","ppu","charSet","visitorNamespace","cookieDomainPeriods","cookieLifetime","pageName","currencyCode","variableProvider","channel","server","pageType","transactionID","purchaseID","campaign","state","zip","events","products","linkName","linkType","resolution","colorDepth","javascriptVersion","javaEnabled","cookiesEnabled","browserWidth","browserHeight","connectionType","homepage","pe","pev1","pev2","pev3","visitorSampling","visitorSamplingGroup","dynamicAccountSelection","dynamicAccountList","dynamicAccountMatch","trackDownloadLinks","trackExternalLinks","trackInlineStats","linkLeaveQueryString","linkDownloadFileTypes","linkExternalFilters","linkInternalFilters","linkTrackVars","linkTrackEvents","linkNames","lnk","eo"];for(var j=0;j<tc.length;j++){this.uc(tc[j],w);}for(var j=1;j<=50;j++){this.uc('prop'+j,w);this.uc('eVar'+j,w);this.uc('hier'+j,w);}};mboxScPluginFetcher.prototype.uc=function(g,w){var h=this.qc[g];if(typeof(h)==='undefined'||h===null||h===''){return;}w.addParameter(g,h);};mboxScPluginFetcher.prototype.cancel=function(){};mboxStandardScPluginFetcher=function(b,qc){mboxScPluginFetcher.call(this,b,qc);};mboxStandardScPluginFetcher.prototype=new mboxScPluginFetcher;mboxStandardScPluginFetcher.prototype.getType=function(){return'standard';};mboxStandardScPluginFetcher.prototype.fetch=function(w){w.setServerType(this.getType());var e=this.rc(w);document.write('<'+'scr'+'ipt src="'+e+'" language="JavaScript"><'+'\/scr'+'ipt>');};mboxAjaxScPluginFetcher=function(b,qc){mboxScPluginFetcher.call(this,b,qc);};mboxAjaxScPluginFetcher.prototype=new mboxScPluginFetcher;mboxAjaxScPluginFetcher.prototype.fetch=function(w){w.setServerType(this.getType());var e=this.rc(w);this.x=document.createElement('script');this.x.src=e;document.body.appendChild(this.x);};mboxAjaxScPluginFetcher.prototype.getType=function(){return'ajax';};function mboxLoadSCPlugin(qc){if(!qc){return null;}qc.m_tt=function(qc){var vc=qc.m_i('tt');vc.H=true;vc.b='mtvnetworks';vc['_t']=function(){if(!this.isEnabled()){return;}var X=this.xc();if(X){var Kb=mboxFactoryDefault.isDomLoaded()?new mboxAjaxScPluginFetcher(this.b,this.s):new mboxStandardScPluginFetcher(this.b,this.s);X.setFetcher(Kb);X.load();}};vc.isEnabled=function(){return this.H&&mboxFactoryDefault.isEnabled();};vc.xc=function(){var _=this.yc();var vb=document.createElement('DIV');return mboxFactoryDefault.create(_,new Array(),vb);};vc.yc=function(){var zc=this.s.events&&this.s.events.indexOf('purchase')!=-1;return'SiteCatalyst: '+(zc?'purchase':'event');};};return qc.loadModule('tt');};mtvn.btg.reporting.omniture.Hcode=s_gi("");if(typeof mtvn.btg.reporting.omniture.Hcode==="object")
{mtvn.btg.reporting.omniture.Hcode.setAccount=function(account){this.un=account;};}
if(typeof mtvn.btg.reporting.omniture.Hcode==="object"){mtvn.btg.reporting.omniture.Hcode.getNewRepeat=new Function(""
+"var s=this,e=new Date(),cval,ct=e.getTime(),y=e.getYear();e.setTime"
+"(ct+30*24*60*60*1000);cval=s.c_r('s_nr');if(cval.length==0){s.c_w("
+"'s_nr',ct,e);return 'New';}if(cval.length!=0&&ct-cval<30*60*1000){s"
+".c_w('s_nr',ct,e);return 'New';}if(cval<1123916400001){e.setTime(cv"
+"al+30*24*60*60*1000);s.c_w('s_nr',ct,e);return 'Repeat';}else retur"
+"n 'Repeat';");}
if(typeof mtvn.btg.reporting.omniture.Hcode==="object"){mtvn.btg.reporting.omniture.Hcode.getTimeParting=new Function("t","z",""
+"var s=this,cy;dc=new Date('1/1/2000');"
+"if(dc.getDay()!=6||dc.getMonth()!=0){return'Data Not Available'}"
+"else{;z=parseFloat(z);var dsts=new Date(s.dstStart);"
+"var dste=new Date(s.dstEnd);fl=dste;cd=new Date();if(cd>dsts&&cd<fl)"
+"{z=z+1}else{z=z};utc=cd.getTime()+(cd.getTimezoneOffset()*60000);"
+"tz=new Date(utc + (3600000*z));thisy=tz.getFullYear();"
+"var days=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday',"
+"'Saturday'];if(thisy!=s.currentYear){return'Data Not Available'}else{;"
+"thish=tz.getHours();thismin=tz.getMinutes();thisd=tz.getDay();"
+"var dow=days[thisd];var ap='AM';var dt='Weekday';var mint='00';"
+"if(thismin>30){mint='30'}if(thish>=12){ap='PM';thish=thish-12};"
+"if (thish==0){thish=12};if(thisd==6||thisd==0){dt='Weekend'};"
+"var timestring=thish+':'+mint+ap;if(t=='h'){return timestring}"
+"if(t=='d'){return dow};if(t=='w'){return dt}}};");mtvn.btg.reporting.omniture.Hcode.dstStart="03/14/2010";mtvn.btg.reporting.omniture.Hcode.dstEnd="11/07/2010";mtvn.btg.reporting.omniture.Hcode.currentYear=(new Date()).getFullYear();}
if(typeof mtvn.btg.reporting.omniture.Hcode==="object"){mtvn.btg.reporting.omniture.Hcode.getValOnce=new Function("v","c","e",""
+"var s=this,k=s.c_r(c),a=new Date;e=e?e:0;if(v){a.setTime(a.getTime("
+")+e*86400000);s.c_w(c,v,e?a:0);}return v==k?'':v");}
if(typeof mtvn.btg.reporting.omniture.Hcode==="object"){mtvn.btg.reporting.omniture.Hcode.getPreviousValue=new Function("v","c","el",""
+"var s=this,t=new Date,i,j,r='';t.setTime(t.getTime()+1800000);if(el"
+"){if(s.events){i=split(el,',');j=split(s.events,',');for(x in i"
+"){for(y in j){if(i[x]==j[y]){if(s.c_r(c)) r=s.c_r(c);v?s.c_w(c,v,t)"
+":s.c_w(c,'no value',t);return r}}}}}else{if(s.c_r(c)) r=s.c_r(c);v?"
+"s.c_w(c,v,t):s.c_w(c,'no value',t);return r}");var split=new Function("l","d",""
+"var i,x=0,a=new Array;while(l){i=l.indexOf(d);i=i>-1?i:l.length;a[x"
+"++]=l.substring(0,i);l=l.substring(i+d.length);}return a");}
if(typeof mtvn.btg.reporting.omniture.Hcode==="object"){mtvn.btg.reporting.omniture.Hcode.getPercentPageViewed=new Function("",""
+"var s=this;if(typeof(s.linkType)=='undefined'||s.linkType=='e'){var"+" v=s.c_r('s_ppv');s.c_w('s_ppv',0);return v;}");mtvn.btg.reporting.omniture.Hcode.getPPVCalc=new Function("",""
+"var s=s_c_il["+mtvn.btg.reporting.omniture.Hcode._in+"],dh=Math.max(Math.max(s.d.body.scrollHeight,"
+"s.d.documentElement.scrollHeight),Math.max(s.d.body.offsetHeight,s."
+"d.documentElement.offsetHeight),Math.max(s.d.body.clientHeight,s.d."
+"documentElement.clientHeight)),vph=s.wd.innerHeight||(s.d.documentE"
+"lement.clientHeight||s.d.body.clientHeight),st=s.wd.pageYOffset||(s"
+".wd.document.documentElement.scrollTop||s.wd.document.body.scrollTo"
+"p),vh=st+vph,pv=Math.round(vh/dh*100),cp=s.c_r('s_ppv');if(pv>100){"+"s.c_w('s_ppv','');}else if(pv>cp){s.c_w('s_ppv',pv);}");mtvn.btg.reporting.omniture.Hcode.getPPVSetup=new Function("",""
+"var s=this;if(s.wd.addEventListener){s.wd.addEventListener('load',s"+".getPPVCalc,false);s.wd.addEventListener('scroll',s.getPPVCalc,fals"+"e);s.wd.addEventListener('resize',s.getPPVCalc,false);}else if(s.wd"
+".attachEvent){s.wd.attachEvent('onload',s.getPPVCalc);s.wd.attachEv"+"ent('onscroll',s.getPPVCalc);s.wd.attachEvent('onresize',s.getPPVCa"+"lc);}");mtvn.btg.reporting.omniture.Hcode.getPPVSetup();}
if(typeof mtvn.btg.reporting.omniture.Hcode==="object"){mtvn.btg.reporting.omniture.Hcode.getQueryParam=new Function("p","d","u",""
+"var s=this,v='',i,t;d=d?d:'';u=u?u:(s.pageURL?s.pageURL:s.wd.locati"
+"on);if(u=='f')u=s.gtfs().location;while(p){i=p.indexOf(',');i=i<0?p"
+".length:i;t=s.p_gpv(p.substring(0,i),u+'');if(t){t=t.indexOf('#')>-"
+"1?t.substring(0,t.indexOf('#')):t;}if(t)v+=v?d+t:t;p=p.substring(i="
+"=p.length?i:i+1)}return v");mtvn.btg.reporting.omniture.Hcode.p_gpv=new Function("k","u",""
+"var s=this,v='',i=u.indexOf('?'),q;if(k&&i>-1){q=u.substring(i+1);v"
+"=s.pt(q,'&','p_gvf',k)}return v");mtvn.btg.reporting.omniture.Hcode.p_gvf=new Function("t","k",""
+"if(t){var s=this,i=t.indexOf('='),p=i<0?t:t.substring(0,i),v=i<0?'T"
+"rue':t.substring(i+1);if(p.toLowerCase()==k.toLowerCase())return s."
+"epa(v)}return ''");}
if(typeof mtvn.btg.reporting.omniture.Hcode==="object"){mtvn.btg.reporting.omniture.Hcode.trackTNT=function(v,p,b){var s=this,n="s_tnt",p=(p)?p:n,v=(v)?v:n,r="",pm=false,b=(b)?b:true;if(s.getQueryParam)
pm=s.getQueryParam(p);if(pm)
r+=(pm+",");if(s.wd[v]!=undefined)
r+=s.wd[v];if(b)
s.wd[v]="";return r;}}
mtvn.btg.ads.AdManager=new function(){var _btgU=mtvn.btg.util;var _btgObj=_btgU.Object;var _btgIsStr=_btgU.String.isDefined;var _btgIsConfig=_btgObj.isConfigDefined;var _btgStrpFileExt=_btgU.String.stripFileExtension;var _btgRnd=_btgU.Math.random;var _btgAds=mtvn.btg.ads;var _btgDc=_btgAds.doubleclick;var _btgGv=mtvn.btg.globalvars;var hasDoubleClickAd=false;var hasFreeWheel=false;var hasInternationalAd=false;var hasQuantCast=false;var allReloadableAds=false;var reloadInterval=30000;var minReloadInterval=10000;var config;var ads=[];this.groupedReloadableAdsTotal=0;this.groupedReloadableAdsCounter=0;var data={};var counter=0;this.reloadableAds={};this.init=function(){config=mtvn.btg.config.AdSettings;if(config.reloadableAds&&config.reloadableAds===true)allReloadableAds=true;if(config.reloadInterval&&!isNaN(parseInt(config.reloadInterval))){config.reloadInterval=parseInt(config.reloadInterval);if(config.reloadInterval>=minReloadInterval){reloadInterval=config.reloadInterval;}}
var qc_obj={};if(_btgIsConfig(config.DoubleClick)){if(config.DoubleClick.type&&config.DoubleClick.type.toLowerCase()=="international"){config.International={};_btgObj.copyProperties(config.DoubleClick,config.International);}
else if(config.DoubleClick.type&&config.DoubleClick.type.toLowerCase()=="domestic"){config.International={};}
hasDoubleClickAd=true;if(_btgIsStr(config.DoubleClick.sections)){config.DoubleClick.sections=_btgStrpFileExt(config.DoubleClick.sections);qc_obj.sections=config.DoubleClick.sections;}
else{this.setDefaultSections();if(_btgIsStr(data.sections))
qc_obj.sections=data.sections;}
qc_obj.dartSite=config.DoubleClick.dartSite;data.tile=0;data.ord=_btgRnd(100000000000000000,999999999999999999);}
if(_btgIsConfig(config.FreeWheel)){hasFreeWheel=true;}
if(_btgIsConfig(config.International)){hasInternationalAd=true;if(_btgIsStr(config.International.sections)){config.International.sections=_btgStrpFileExt(config.International.sections);qc_obj.sections=config.International.sections;}
else{this.setDefaultSections();if(_btgIsStr(data.sections))
qc_obj.sections=data.sections;}
qc_obj.dartSite=config.International.dartSite;data.tile=0;data.ord=_btgRnd(100000000000000000,999999999999999999);}
if(_btgIsConfig(config.QuantCast)){hasQuantCast=true;}
if(hasQuantCast){PlatoAd=new _btgDc.DomesticDc(config.DoubleClick);dmobj={size:'728x90',contentType:"adj"};dmobj.sections=qc_obj.sections;if(_btgIsStr(config.QuantCast.vertical)){PlatoAd.setKeyValues("vertical="+config.QuantCast.vertical);};PlatoAd.init(dmobj);PlatoAd.getUrl();mtvn.btg.reporting.QuantCast.Ads.setLabels(qc_obj,PlatoAd.getSections());}};this.placeAd=function(a_data){if(typeof(_btgGv.IS_CODA_ADS_USED)!='undefined'&&_btgGv.IS_CODA_ADS_USED==false)
_btgGv.IS_CODA_ADS_USED=true;var ad=this.getAd(a_data);if(a_data.isReloadable===true||(allReloadableAds&&a_data.isReloadable!==false)){if(ad.setContentType){ad.setContentType("adi");}
ad.reloadInterval=reloadInterval;if(a_data.reloadInterval&&!isNaN(parseInt(a_data.reloadInterval))){ad.needUniqueOrd=true;a_data.reloadInterval=parseInt(a_data.reloadInterval);if(a_data.reloadInterval>=minReloadInterval){ad.reloadInterval=a_data.reloadInterval;}}
else{this.groupedReloadableAdsTotal++;this.groupedReloadableAdsCounter++;}
var tmpFunc=function(){mtvn.btg.ads.AdManager.reloadAd(ad);};if(ad.reloadTimer){clearInterval(ad.reloadTimer);ad.reloadTimer=null;}
ad.reloadTimer=setInterval(tmpFunc,ad.reloadInterval);}
if(ad!=null){return ad.placeAd(a_data);}
else{document.write("[ERROR: Ad not created, please check your config to enable CODA ads]");return null;}};this.adLoadNotify=function(a_adId){if(typeof _btgU.Events['adLoaded']!='undefined'){_btgU.Events['adLoaded'].fire(a_adId);}};this.setAdReloadOrdByGroup=function(a_adObj){if(a_adObj.needUniqueOrd===true){a_adObj.setOrd(_btgRnd(100000000000000000,999999999999999999));}
else{if((this.groupedReloadableAdsCounter>=this.groupedReloadableAdsTotal)&&(this.groupedReloadableAdsCounter%this.groupedReloadableAdsTotal==0)){data.ord=_btgRnd(100000000000000000,999999999999999999);}
a_adObj.setOrd(data.ord);this.groupedReloadableAdsCounter++;}};this.reloadAd=function(a_adObj){var _btgIsObj=_btgObj.isDefined;if(_btgIsObj(a_adObj)&&_btgIsStr(a_adObj.id)&&_btgIsObj(self.frames[a_adObj.id])){a_adObj.setContentType("adi");this.setAdReloadOrdByGroup(a_adObj);try{self.frames[a_adObj.id].location.replace(a_adObj.getUrl());}catch(e){}}};this.placeIFrameAd=function(adHtml,a_data){if(typeof(_btgGv.IS_CODA_ADS_USED)!='undefined')
_btgGv.IS_CODA_ADS_USED=true;var containerId="container"+a_data.reloadableAdId;this.reloadableAds[a_data.reloadableAdId]={data:a_data};document.write('<iframe allowtransparency="true" name="'+containerId+'" id="'+containerId+'" src="'+adHtml+'?'+a_data.reloadableAdId+'" width='+a_data.size.split('x')[0]+' height='+a_data.size.split('x')[1]+' marginwidth=0 marginheight=0 frameborder=0 scrolling="no"></iframe>');}
this.getData=function(){return data;};this.setDefaultSections=function(a_defaultSections){var sections=(_btgIsStr(a_defaultSections)?a_defaultSections:_btgU.Sections.getAdSections());if(_btgIsStr(sections)){data.sections=_btgStrpFileExt(sections);}};this.getAd=function(a_data){var ad;if(hasInternationalAd){ad=new _btgDc.InternationalDc(config.International);data.tile++;a_data=this.setReloadableAdData(a_data);if(_btgIsStr(a_data.sections)){a_data.sections=_btgStrpFileExt(a_data.sections);}
_btgObj.copyProperties(data,a_data);ad.init(a_data);ads.push(ad);}
else if(hasFreeWheel){ad=new _btgAds.freewheel.FreeWheelAd(config);data.tile++;a_data=this.setReloadableAdData(a_data);if(_btgIsStr(a_data.sections)){a_data.sections=_btgStrpFileExt(a_data.sections);}
_btgObj.copyProperties(data,a_data);ad.init(a_data);ads.push(ad);}
else if(hasDoubleClickAd){ad=new _btgDc.DomesticDc(config.DoubleClick);data.tile++;a_data=this.setReloadableAdData(a_data);if(_btgIsStr(a_data.sections)){a_data.sections=_btgStrpFileExt(a_data.sections);}
_btgObj.copyProperties(data,a_data);ad.init(a_data);ads.push(ad);}else{document.write("<!-- [ERROR: Ads not enabled. Please check your config or placeAd() method call!] -->");return null;}
return ad;};this.getAdUrl=function(a_data){return this.getAd(a_data).getUrl();};this.setReloadableAdData=function(a_data)
{if(_btgIsStr(a_data.reloadableAdId)&&_btgIsStr(this.reloadableAds[a_data.reloadableAdId])){++counter;a_data.ord=data.ord=(_btgIsStr(this.reloadableAds[a_data.reloadableAdId].tile)&&this.hasReloadComplete()?_btgRnd(100000000000000000,999999999999999999):data.ord);a_data.tile=data.tile=this.reloadableAds[a_data.reloadableAdId].tile=(_btgIsStr(this.reloadableAds[a_data.reloadableAdId].tile)?this.reloadableAds[a_data.reloadableAdId].tile:data.tile);}
if(_btgIsStr(a_data.loadOrder))
a_data.tile=a_data.loadOrder;return a_data;}
this.hasReloadComplete=function(){var totAdCount=0;for(var i in this.reloadableAds)
totAdCount++;if(counter>totAdCount){counter=1;return true;}
return false;}};mtvn.btg.ads.doubleclick.DoubleClick=function(config){this.btgAds=mtvn.btg.ads;this.btgU=mtvn.btg.util;this.btgStr=this.btgU.String;this.btgCfg=mtvn.btg.config;this.isStr=this.btgStr.isDefined;this.isObj=this.btgU.Object.isDefined;this.gv=mtvn.btg.globalvars;if(this.isObj(config)){this.config=config;}
this.id;this.server="ad.doubleclick.net";this.ssl=false;this.dartSite;this.contentType="adj";this.mediaType="standard";this.sections;this.keyValues="";this.reloadTimer;this.size;this.realSize;this.zoneOverride=null;this.tile;this.positionThreshold;this.ord;this.additionalKeyValues=[];this.position;this.partner;this.exclusions=[];this.reservedKeyValues={};if(this.isObj(config)){this.autoDcopt=(config.autoDcopt)?true:false;}
if(this.isObj(this.btgAds.AdManager)&&!this.btgAds.AdManager.dcoptOn){this.btgAds.AdManager.dcoptOn=false;}
this.isDevEnv=false;if(this.gv.IS_TOP_ACCESSIBLE&&top.location.hostname.indexOf("mtvi.com")>-1){this.isDevEnv=true;}
if(this.isObj(config)){for(var i in config){if(this.isStr(config[i])&&(typeof(config[i])=='string'||typeof(config[i])=='number')){if(i=="sections"){this.setSections(config[i]);}
else if(i=="keyValues"){this.setKeyValues(config[i]);}
else if(i=="positionThreshold"){this.setPositionThreshold(config[i]);}
else{this[i]=config[i];}}}}};mtvn.btg.ads.doubleclick.DoubleClick.prototype={formatUrl:function(values){var retVal="";var zoneToCheck=values.dartSite+"/"+values.zone+";";if(zoneToCheck.length>64){var cutPoint=values.zone.length-(zoneToCheck.length-64);values.zone=values.zone.substring(0,cutPoint);}
var target=[values.protocol+values.server,values.contentType,values.dartSite,values.zone];var url=target.join("/");var vals=[url,values.sections];if(this.isStr(values.keyValues)){vals.push(values.keyValues);}
if(this.isStr(values.uValues)){vals.push(values.uValues);}
if(values.ord>0){vals.push('ord='+values.ord+"?");}
retVal=vals.join(";");return retVal;},setKeyValues:function(str){str=str.replace(/[^\w=!;|-]/g,"_");this.keyValues=str.replace(/^;+|;+$/g,'');if(this.keyValues.indexOf("mtype=")>-1){this.setMediaType(this.getKeyValue("mtype="));}
if(this.keyValues.indexOf("pos=")>-1){this.setPosition(this.getKeyValue("pos="));}else if(this.keyValues.indexOf("threshold=")>-1){this.setPositionThreshold(this.getKeyValue("threshold="));}},setZoneOverride:function(str){this.zoneOverride=str;},setId:function(str){this.id=str;},setServer:function(str){this.server=str;},setSsl:function(){this.ssl=true;},setDartSite:function(str){this.dartSite=str;},setContentType:function(str){this.contentType=str;},setMediaType:function(str){this.mediaType=str;},setPosition:function(str){this.position=str;},setSections:function(str){str=(str=='/')?str:this.btgStr.charTrim(str,'/');var difn=(this.isObj(this.btgCfg.AdSettings)&&this.isStr(this.btgCfg.AdSettings.defaultIndexFileName))?this.btgCfg.AdSettings.defaultIndexFileName:"index";difn=this.btgStr.stripFileExtension(difn);var hpCases=['/',difn,"home/"+difn];for(var i=0,len=hpCases.length;i<len;i++){if(str.indexOf(hpCases[i])==0&&str.length==hpCases[i].length){str=str.replace(hpCases[i],'_hp');break;}}
str=str.replace(/[^\/\w=!;|-]/g,"_");while(str.match(/\/\d/)){str=str.replace(/\/\d/,RegExp.lastMatch.substring(0,1)+"_"+RegExp.lastMatch.substring(1,2));}
str=str.replace(/^\d/,"_"+str.match(/^\d/,"_"));this.sections=str.replace(/^\/+|\/+$/g,'');if(this.sections.indexOf('.')>-1){this.sections=this.sections.split('.')[0];}},setSize:function(str){this.size=str;},setRealSize:function(str){this.realSize=str;},setTile:function(num){this.tile=num;},setPositionThreshold:function(num){if(isNaN(parseInt(num))){this.positionThreshold=null;}else{this.positionThreshold=parseInt(num);}},setOrd:function(num){this.ord=num;},setPartner:function(str){this.partner=str;},addExclusionCategory:function(str){str=str.replace(/^;+|;+$/g,'');var isExists=false;if(this.exclusions.length>0){for(var i=0,len=this.exclusions.length;i<len;i++)
if(this.exclusions[i].match(new RegExp("category="+str,"ig"))){isExists=true;break;}
if(!isExists)
this.exclusions.push('!category='+str);}
else
this.exclusions.push('!category='+str);},addKeyValues:function(str){if(this.isStr(str)&&str.indexOf('=')>-1){this.additionalKeyValues.push(str);}},appendKeyValue:function(str1,str2){if(!this.isStr(str1))str1="";if(!this.isStr(str2))str2="";str1=str1.replace(/^;+|;+$/g,'');str2=str2.replace(/^;+|;+$/g,'');if(str1.indexOf('=')>-1)str2+=";"+str1;str2=str2.replace(/^;+|;+$/g,'');return str2;},removeKeyValue:function(a_key){if(this.isStr(this.getKeyValue(a_key))){var strToRemove=";"+a_key+this.getKeyValue(a_key);if(this.keyValues.indexOf(strToRemove)==-1){strToRemove=a_key+this.getKeyValue(a_key)+";";if(this.keyValues.indexOf(strToRemove)==-1){strToRemove=a_key+this.getKeyValue(a_key);}}
var re=new RegExp(strToRemove,"g");this.keyValues=this.keyValues.replace(re,"");this.removeKeyValue(a_key);}},getProtocol:function(){return this.ssl?'https://':'http://';},getPosition:function(){var placement="unk";if(this.isStr(this.position)){if(this.position.indexOf("atf")>-1){placement="atf";}else if(this.position.indexOf("btf")>-1){placement="btf";}}else{if(this.isStr(this.positionThreshold)){placement=(this.tile<=this.positionThreshold)?"atf":"btf";}}
return placement;},getKeyValue:function(key){var value;if(this.keyValues.indexOf(key)>-1){var temp=this.keyValues.split(key);if(temp.length>0){if(temp[1].indexOf(";")>-1){value=temp[1].substring(0,temp[1].indexOf(";"));}else{value=temp[1];}}}
return value;},getSections:function(){return this.sections;},getContentTypeAbbreviation:function(){var abbr="";if(this.contentType=="pfadx")abbr="p";if(this.contentType=="adj")abbr="j";if(this.contentType=="adi")abbr="i";if(this.contentType=="adx")abbr="x";if(this.contentType=="ad")abbr="a";return abbr;},getExclusions:function(){return this.exclusions.join(';');},isValidDcopt:function(a_val){var retVal=false;if(this.isStr(a_val)){for(var i=0,len=this.gv.VALID_DCOPT.length;i<len;i++){if(a_val==this.gv.VALID_DCOPT[i]){retVal=true;break;}}}
return retVal;},formatReserved:function(){var keyvals=this.keyValues;var reserved=["dcmt","dcopt","dcove"];for(var i=0,len=reserved.length;i<len;i++){if(keyvals.indexOf(reserved[i]+"=")>-1){var key=this.getKeyValue(reserved[i]+"=");var tempKeys=keyvals.split(reserved[i]+"="+key);for(var x=0,len=tempKeys.length;x<len;x++){tempKeys[x]=tempKeys[x].replace(/^;+|;+$/g,'');}
if(reserved[i]=="dcopt"&&this.isValidDcopt(key)!=true){this.keyValues=tempKeys.join(';');return this.formatReserved();}
this.reservedKeyValues[reserved[i]]=key;keyvals=tempKeys.join(';');}}
if(keyvals.lastIndexOf(";")==keyvals.length-1){keyvals=keyvals.substring(0,keyvals.length-1);}
return keyvals;},getAdditionalKeyValues:function(){return this.additionalKeyValues.join(';');},applyTestbedValues:function(){var atbCookie=mtvn.btg.util.Cookie.read("btg_atb");if(atbCookie!=null&&atbCookie.indexOf("daDart:")>=0){var daDartVal=atbCookie.split(',')[0].split(":")[1];this.dartSite=(daDartVal=="auto")?this.dartSite="atb_"+this.dartSite:daDartVal;}},getValues:function(){this.applyTestbedValues();var zone=this.isStr(this.zoneOverride)?this.zoneOverride:this.formatZone();var keyVals=this.formatKeyValues();var secVals=this.formatSectionValues();var uVals=this.formatUValues(keyVals);if(uVals!=""){uVals="u="+uVals;}
return{id:this.id,protocol:this.getProtocol(),server:this.server,dartSite:this.dartSite,contentType:this.contentType,mediaType:this.mediaType,zone:zone,sections:secVals,keyValues:keyVals,uValues:uVals,ord:this.ord};},getRealWidth:function(){return this.realSize.substr(0,this.realSize.indexOf("x"));},getRealHeight:function(){return this.realSize.substr(this.realSize.indexOf("x")+1,this.realSize.length);},getWidth:function(){return this.size.substr(0,this.size.indexOf("x"));},getHeight:function(){return this.size.substr(this.size.indexOf("x")+1,this.size.length);},getUrl:function(){return this.formatUrl(this.getValues());},getJson:function(){var values=this.getValues();values.url=this.formatUrl(values);return values;},getXml:function(){var xml=[];var values=this.getValues();values.url=this.formatUrl(values);for(var i in values){if(typeof(values[i]=='string')){xml.push('<'+i+'>'+'</'+values[i]+'>');}}
return'<DoubleClick>'+xml.join('')+'</DoubleClick>';},init:function(data){if(typeof(data)==='object'){if(this.isStr(data.zoneOverride))this.setZoneOverride(data.zoneOverride);if(this.isStr(data.id))this.setId(data.id);if(this.isStr(data.server))this.setServer(data.server);if(this.isStr(data.ssl))this.setSsl(data.ssl);if(this.isStr(data.dartSite))this.setDartSite(data.dartSite);if(this.isStr(data.contentType))this.setContentType(data.contentType);if(this.isStr(data.mediaType))this.setMediaType(data.mediaType);if(this.isStr(data.position))this.setPosition(data.position);if(this.isStr(data.sections))this.setSections(data.sections);if(this.isStr(data.keyValues))this.setKeyValues(data.keyValues);if(this.isStr(data.size)){this.setSize(data.size);}
else{this.setSize("[ERROR: Size Not Defined!]");}
if(this.isStr(data.realSize)){this.setRealSize(data.realSize);}
else{this.setRealSize(this.size);}
if(this.isStr(data.tile))this.setTile(data.tile);if(this.isStr(data.positionThreshold))this.setPositionThreshold(data.positionThreshold);if(this.isStr(data.ord))this.setOrd(data.ord);if(this.isStr(data.partner))this.setPartner(data.partner);}}};mtvn.btg.ads.doubleclick.DomesticDc=function(config){this.type="DomesticDc";};mtvn.btg.ads.doubleclick.DomesticDc.prototype={formatSectionValues:function(){try{var parts=this.sections.split('/');}catch(e){parts=["[ERROR: Sections Not Defined!]"];}
var count=0;var sections=[];for(var x=0,len=parts.length;x<len;x++){if(mtvn.btg.util.String.isDefined(parts[x])){sections.push('sec'+count+'='+parts[x]);count++;}}
return sections.join(';');},formatZone:function(){var posTypeTag=this.getPosition()+'_'+this.getContentTypeAbbreviation()+'_'+this.mediaType.substr(0,1);var zoneValues=posTypeTag+"/";var secValues=this.getSections();if(this.isStr(this.keyValues)){if(this.keyValues.indexOf("partner=")>-1){var partner=this.getKeyValue("partner=");if(this.isStr(partner)&&partner!="null"){zoneValues+=partner+"/";this.addExclusionCategory(partner);this.addExclusionCategory("partner");}else{this.keyValues=this.keyValues.replace(/(partner=;)|partner=$/ig,"partner=null;");}}
if(this.keyValues.indexOf("vertical=")>-1){var vertical=this.getKeyValue("vertical=");if(this.isStr(vertical)){secValues=vertical+"/"+secValues;this.setSections(secValues);}}
if(this.keyValues.indexOf("synd=")>-1){var synd=this.getKeyValue("synd=");if(this.isStr(synd))this.addExclusionCategory(synd);}}
zoneValues=zoneValues.replace(/^\d/,"_"+zoneValues.match(/^\d/,"_"));return zoneValues+secValues;},setDemoVal:function(){var demoVal=this.btgU.Cookie.read('qcDemo');var qcModuleExists=typeof this.btgCfg.AdSettings!="undefined"&&typeof this.btgCfg.AdSettings.QuantCast!="undefined";var demoTargetingFlag=qcModuleExists&&typeof this.btgCfg.AdSettings.QuantCast.enableDemoTargeting=="boolean"?this.btgCfg.AdSettings.QuantCast.enableDemoTargeting:true;if(demoTargetingFlag&&this.isStr(demoVal)&&this.keyValues.indexOf("demo=D")==-1){this.keyValues+=";"+unescape(demoVal);}},formatKeyValues:function(){var extraKeyVals=this.getAdditionalKeyValues();if(this.isStr(extraKeyVals)){this.keyValues+=";"+extraKeyVals;}
if(this.keyValues.indexOf("pos=")==-1){this.keyValues+=";pos="+this.getPosition();}
if(this.keyValues.indexOf("tag=")==-1){this.keyValues+=";tag="+this.contentType;}
if(this.keyValues.indexOf("mtype=")==-1){this.keyValues+=";mtype="+this.mediaType;}
if(this.autoDcopt){this.removeKeyValue("dcopt");if(this.tile=="1"){this.keyValues+=";dcopt=ist";}}
this.keyValues=this.formatReserved();if(this.isStr(this.size)&&this.keyValues.indexOf("sz=")==-1){this.keyValues+=";sz="+this.size;}
if(this.tile>=0&&this.keyValues.indexOf("tile=")==-1){this.keyValues+=";tile="+this.tile;}
this.setDemoVal();if(this.isStr(this.reservedKeyValues.dcmt)){this.keyValues+=";dcmt="+this.reservedKeyValues.dcmt;}
if(this.isStr(this.reservedKeyValues.dcopt)){this.removeKeyValue("dcopt");this.keyValues+=";dcopt="+this.reservedKeyValues.dcopt;}
var exclusions=this.getExclusions();if(this.keyValues.indexOf(exclusions)==-1&&this.exclusions.length>0){this.keyValues+=";"+this.getExclusions();}
if(this.isStr(this.reservedKeyValues.dcove)){this.keyValues+=";dcove="+this.reservedKeyValues.dcove;}
if(this.gv.IS_TOP_ACCESSIBLE){var tModeValue=this.btgStr.queryStringToObject(top.location.search.toLowerCase()).testmode;if(this.isStr(tModeValue)){this.keyValues+=';testmode='+tModeValue;}}
this.keyValues=this.keyValues.replace(/^;+|;+$/g,'');return this.keyValues;},formatUValues:function(str){var uvals=str;uvals=uvals.replace(/\;/g,'|');uvals=uvals.replace(/\=/g,'-');return uvals;},placeAd:function(a_data){if(!this.isStr(this.id)){this.setId("ad"+this.tile);}
if(this.contentType=="adi"){var htmlOut='<ifr'+'ame allowtransparency="true" onload="mtvn.btg.ads.AdManager.adLoadNotify(\''+this.id+'\');" id="'+this.id+'" name="'+this.id+'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" width="'+this.getRealWidth()+'" height="'+this.getRealHeight()+'" src="'+this.getUrl()+'"><\/ifr'+'ame>';if(this.gv.IS_TOP_ACCESSIBLE&&this.btgStr.queryStringToObject(top.location.search).mockupMode=='true'){htmlOut=this.btgStr.mockItUp(htmlOut);}
if(this.isStr(a_data)&&this.isStr(a_data.reloadableAdId))
return htmlOut;else if(typeof exposeTestFunctionNames=='undefined')
document.write(htmlOut);}else{var htmlOut='<scr'+'ipt type="text/javascript" id="'+this.id+'" onreadystatechange="if(this.readyState==\'complete\')mtvn.btg.ads.AdManager.adLoadNotify(\''+this.id+'\');" onload="mtvn.btg.ads.AdManager.adLoadNotify(\''+this.id+'\');" src="'+this.getUrl()+'"><\/scr'+'ipt>';if(this.gv.IS_TOP_ACCESSIBLE&&this.btgStr.queryStringToObject(top.location.search).mockupMode=='true'){htmlOut=this.btgStr.mockItUp(htmlOut);}
if(this.isStr(a_data)&&this.isStr(a_data.reloadableAdId))
return htmlOut;else if(typeof exposeTestFunctionNames=='undefined')
document.write(htmlOut);}}}
mtvn.btg.ads.doubleclick.DomesticDc=mtvn.btg.util.Class.inheritFrom(mtvn.btg.ads.doubleclick.DoubleClick,mtvn.btg.ads.doubleclick.DomesticDc);mtvn.btg.ads.doubleclick.InternationalDc=function(config){this.type="InternationalDc";};mtvn.btg.ads.doubleclick.InternationalDc.prototype={formatSectionValues:function(){var parts=this.sections.split('/');var sec0="none";var sec1="none";var secn="none";var temparr=[];if(this.isStr(parts[0])){sec0=parts[0];}else{sec0="/";};if(this.isStr(parts[1])){sec1=parts[1];};if(this.isStr(parts[2])){for(var x=2,len=parts.length;x<len;x++){if(this.isStr(parts[x])){temparr.push(parts[x]);}}
secn=temparr.join("/");};var result="sec0="+sec0+";sec1="+sec1+";secN="+secn;return result;},formatZone:function(){var parts=this.sections.split('/');if(this.isStr(parts[0])){var secValues=parts[0];}else{var secValues="/home";};return secValues;},formatKeyValues:function(){var _btgAdMgr=this.btgAds.AdManager;var extraKeyVals=this.getAdditionalKeyValues();if(this.isStr(extraKeyVals)){this.keyValues+=";"+extraKeyVals;}
this.keyValues=this.formatReserved();if(this.isStr(this.size)&&this.keyValues.indexOf("sz=")==-1){this.keyValues+=";sz="+this.size;}
if(this.tile>=0&&this.keyValues.indexOf("tile=")==-1){this.keyValues+=";tile="+this.tile;}
if(this.isStr(this.reservedKeyValues.dcmt)){this.keyValues+=";dcmt="+this.reservedKeyValues.dcmt;}
if(this.autoDcopt&&this.tile=="1"){this.keyValues+=";dcopt=ist";_btgAdMgr.dcoptOn=true;}
if(this.isStr(this.reservedKeyValues.dcopt)){if(_btgAdMgr.dcoptOn){if(this.tile!="1"&&this.isDevEnv){this.keyValues+=";[ERROR: attempt to set dcopt value more than once per page!]";}}
else{this.keyValues+=";dcopt="+this.reservedKeyValues.dcopt;_btgAdMgr.dcoptOn=true;}}
if(this.exclusions.length>0){this.keyValues+=";"+this.getExclusions();}
if(this.isStr(this.reservedKeyValues.dcove)){this.keyValues+=";dcove="+this.reservedKeyValues.dcove;}
if(self.location.href.indexOf('testmode=on')>-1){this.keyValues+=';testmode=on';}
this.keyValues=this.keyValues.replace(/^;+|;+$/g,'');return this.keyValues;},formatUValues:function(){return"";},addInternationalValues:function(data){if(this.isStr(data.log)){this.addKeyValues("log="+data.log);}else{this.addKeyValues("log=0");};if(this.isStr(data.demo)){this.addKeyValues("demo="+data.demo);}else{this.addKeyValues("demo=none");};if(this.isStr(data.event)){this.addKeyValues("event="+data.event);}else{this.addKeyValues("event=none");};if(this.isStr(data.keyword)){this.addKeyValues("search_kw="+data.keyword);}else{this.addKeyValues("search_kw=none");};if(this.isStr(data.vid)){this.addKeyValues("vid="+data.vid);}else{this.addKeyValues("vid=none");};if(this.isStr(data.vid_type)){this.addKeyValues("vid_type="+data.vid_type);}else{this.addKeyValues("vid_type=none");};if(this.isStr(data.region)){this.addKeyValues("region="+data.region);}else{this.addKeyValues("region=none");};this.addKeyValues("dcove=d");this.addKeyValues("url="+escape(location.pathname));if(this.isStr(data.keyValues)){this.addKeyValues(data.keyValues);};},placeAd:function(a_data){this.addInternationalValues(a_data);if(!this.isStr(this.id)){this.setId("ad"+this.tile);}
if(this.contentType=="adi"){var htmlOut='<ifr'+'ame allowtransparency="true" onload="mtvn.btg.ads.AdManager.adLoadNotify(\''+this.id+'\');" id="'+this.id+'" name="'+this.id+'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" width="'+this.getRealWidth()+'" height="'+this.getRealHeight()+'" src="'+this.getUrl()+'"><\/ifr'+'ame>';if(this.gv.IS_TOP_ACCESSIBLE&&this.btgStr.queryStringToObject(top.location.search).mockupMode=='true'){htmlOut=this.btgStr.mockItUp(htmlOut);}
if(this.isStr(a_data)&&this.isStr(a_data.reloadableAdId))
return htmlOut;else if(typeof exposeTestFunctionNames=='undefined')
document.write(htmlOut);}else{var htmlOut='<scr'+'ipt type="text/javascript" id="'+this.id+'" onreadystatechange="if(this.readyState==\'complete\')mtvn.btg.ads.AdManager.adLoadNotify(\''+this.id+'\');" onload="mtvn.btg.ads.AdManager.adLoadNotify(\''+this.id+'\');" src="'+this.getUrl()+'"><\/scr'+'ipt>';if(this.gv.IS_TOP_ACCESSIBLE&&this.btgStr.queryStringToObject(top.location.search).mockupMode=='true'){htmlOut=this.btgStr.mockItUp(htmlOut);}
if(this.isStr(a_data)&&this.isStr(a_data.reloadableAdId))
return htmlOut;else if(typeof exposeTestFunctionNames=='undefined')
document.write(htmlOut);}}};mtvn.btg.ads.doubleclick.InternationalDc=mtvn.btg.util.Class.inheritFrom(mtvn.btg.ads.doubleclick.DoubleClick,mtvn.btg.ads.doubleclick.InternationalDc);mtvn.btg.ads.freewheel.FreeWheelAd=function(config){this.btgU=mtvn.btg.util;this.btgStr=this.btgU.String;this.isStr=this.btgStr.isDefined;this.btgAds=mtvn.btg.ads;this.btgDc=this.btgAds.doubleclick;this.btgAdMgr=this.btgAds.AdManager;this.config=config;this.type="FreeWheelAd";this.fwType="DART";this.slotId="fwph_";this.reloadTimer;this.dcAd;this.initData;this.realWidth;this.realHeight;this.reloadable=false;this.reloadTime=30000;this.isGroupedByOrd=false;this.needUniqueOrd=false;};mtvn.btg.ads.freewheel.FreeWheelAd.prototype={placeAd:function(data){if(this.fwType=="MRM"||this.fwType=="COV"){this.realWidth=this.realSize.substr(0,this.realSize.indexOf("x"));this.realHeight=this.realSize.substr(this.realSize.indexOf("x")+1,this.realSize.length);var slotParams="slid=";slotParams+=this.slotId;slotParams+="&ptgt=s&envp=g_iframe_js&w=";slotParams+=this.realWidth;slotParams+="&h=";slotParams+=this.realHeight;var fwph='';fwph+='<span id="'+this.slotId+'" class="_fwph">';fwph+='<form id="_fw_form_'+this.slotId+'" style="display:none;">';fwph+='<input type="hidden" name="_fw_input_'+this.slotId+'" id="_fw_input_'+this.slotId+'" value="'+slotParams+'" />';fwph+='</form>';fwph+='<span id="_fw_container_'+this.slotId+'" class="_fwac">';fwph+='<span id="fwCustom_'+this.slotId+'" name="fwCustom_'+this.slotId+'" class="fwCustomAll" style="width:'+this.realWidth+'px;height:'+this.realHeight+'px;display:block;"></span></span>';fwph+='</span>';if(mtvn.btg.globalvars.IS_TOP_ACCESSIBLE&&this.btgStr.queryStringToObject(top.location.search).mockupMode=='true'){fwph=this.btgStr.mockItUp(fwph);}
document.write(fwph);this.btgAds.freewheel.FreeWheelAdInterface.fwAds[this.slotId]=this;this.btgU.DOM.Events.addListener(window,"load",this.timerToPlayAd);}
else if(this.fwType=="DART"){this.dcAd=new this.btgDc.DomesticDc(this.config.DoubleClick);this.dcAd.init(this.initData);this.dcAd.placeAd(data);}
else{new this.btgU.Alert("FreeWheel ad type not recognized.");}},timerToPlayAd:function(){setTimeout(function(){var playerLoaded=false;for(var i in mtvn.btg.reporting.player.MediaPlayer.players){playerLoaded=true;break;}
if(playerLoaded){setTimeout(mtvn.btg.ads.freewheel.FreeWheelAdInterface.forcedPlayAd,mtvn.btg.globalvars.FORCE_AD_WAIT_TIME.PLAYER_LOADED);}
else
setTimeout(mtvn.btg.ads.freewheel.FreeWheelAdInterface.forcedPlayAd,mtvn.btg.globalvars.FORCE_AD_WAIT_TIME.PLAYER_FAILED);},mtvn.btg.globalvars.FORCE_AD_WAIT_TIME.PLAYER_LOAD_WAIT_TIME);},setContentType:function(){},init:function(data){var minReloadInterval=10000;var defaultReloadInterval=30000;this.initData=data;if(this.isStr(data.size)){this.size=data.size;}
else{this.size="[ERROR: Size Not Defined!]";new this.btgU.Alert("FreeWheel ad size not defined.");}
if(this.isStr(data.realSize)){this.realSize=data.realSize;}
else{this.realSize=this.size;}
this.slotId+=data.tile;if(this.isStr(this.config.FreeWheel.type)){this.fwType=this.config.FreeWheel.type.toUpperCase();}
if(this.config.FreeWheel.reloadable||data.isReloadable){this.reloadable=true;this.reloadTime=defaultReloadInterval;if(this.config.FreeWheel.reloadTime&&!isNaN(parseInt(this.config.FreeWheel.reloadTime))&&parseInt(this.config.FreeWheel.reloadTime)>=minReloadInterval){this.reloadTime=parseInt(this.config.FreeWheel.reloadTime);this.isGroupedByOrd=true;}
if(data.reloadInterval&&!isNaN(parseInt(data.reloadInterval))&&parseInt(data.reloadInterval)>=minReloadInterval){this.reloadTime=parseInt(data.reloadInterval);if(this.isGroupedByOrd===true){this.isGroupedByOrd=false;}
this.needUniqueOrd=true;}
if(this.isGroupedByOrd===true){this.btgAdMgr.groupedReloadableAdsTotal++;this.btgAdMgr.groupedReloadableAdsCounter++;}}},reload:function(){var targetFrameId="_fw_frame_"+this.slotId;var targetFrame=document.getElementById(targetFrameId);var targetFrameContainer=document.getElementById("fwCustom_"+this.slotId);if(!this.btgU.Object.isDefined(this.dcAd)){this.dcAd=new this.btgDc.DomesticDc(this.config.DoubleClick);this.dcAd.init(this.initData);}
if(!this.isStr(this.dcAd.id)){this.dcAd.setId("ad"+this.dcAd.tile);}
this.dcAd.needUniqueOrd=this.needUniqueOrd;if(targetFrame!=null){this.btgAdMgr.setAdReloadOrdByGroup(this.dcAd);}
this.dcAd.setContentType("adi");var htmlOut='<ifr'+'ame allowtransparency="true" style="display:inline;width:'+this.realWidth+'px;height:'+this.realHeight+'px;border:0px;z-index:99;border-width:0px;" onload="mtvn.btg.ads.AdManager.adLoadNotify(\''+this.dcAd.id+'\');" id="'+targetFrameId+'" name="'+targetFrameId+'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" width="'+this.realWidth+'" height="'+this.realHeight+'" src="'+this.dcAd.getUrl()+'"><\/ifr'+'ame>';if(targetFrame==null&&targetFrameContainer!=null){targetFrameContainer.style.border='0px';targetFrameContainer.style.backgroundColor='transparent';try{targetFrameContainer.innerHTML=htmlOut;}catch(e){}}
else if(targetFrame!=null){if(targetFrame.parentElement){try{targetFrame.parentElement.innerHTML=htmlOut;}catch(e){}}
else if(targetFrame.parentNode){try{targetFrame.parentNode.innerHTML=htmlOut;}catch(e){}}}},startReloadTimer:function(){if(this.reloadable){var adObj=this;var tmpFunc=function(){adObj.reload();};if(this.reloadTimer){clearInterval(this.reloadTimer);this.reloadTimer=null;}
this.reloadTimer=setInterval(tmpFunc,this.reloadTime);}}};mtvn.btg.ads.freewheel.FreeWheelAdInterface=new function(){var _btgU=mtvn.btg.util;var _btgStr=_btgU.String;this.fwAds=[];this.getFallbackDisplayHTML=function(a_slotId,a_commaSeparatedCompetitiveIndustries){var _isStr=_btgStr.isDefined;var retVal="";var fwAd=this.fwAds[a_slotId];var exCatVals=a_commaSeparatedCompetitiveIndustries.split(",");var dcExCat="";for(var i=0,len=exCatVals.length;i<len;i++){if(_isStr(exCatVals[i])){dcExCat+=";!category="+exCatVals[i];}}
fwAd.dcAd=new mtvn.btg.ads.doubleclick.DomesticDc(fwAd.config.DoubleClick);if(_isStr(fwAd.initData.keyValues)){fwAd.initData.keyValues+=dcExCat;}
else{fwAd.initData.keyValues=dcExCat;}
fwAd.initData.contentType="adj";fwAd.dcAd.init(fwAd.initData);if(fwAd.reloadable){fwAd.startReloadTimer();}
if(!_isStr(fwAd.dcAd.id)){fwAd.dcAd.setId("ad"+fwAd.dcAd.tile);}
retVal+='<scr'+'ipt type="text/javascript" id="'+fwAd.dcAd.id+'" onreadystatechange="if(this.readyState==\'complete\')parent.mtvn.btg.ads.AdManager.adLoadNotify(\''+fwAd.dcAd.id+'\');" onload="parent.mtvn.btg.ads.AdManager.adLoadNotify(\''+fwAd.dcAd.id+'\');" src="';retVal+=fwAd.dcAd.getUrl();retVal+='"><\/scr'+'ipt>';return retVal;};this.forcedPlayAd=function(){var _btgFWAI=mtvn.btg.ads.freewheel.FreeWheelAdInterface;var _btgGv=mtvn.btg.globalvars;var fsEnabled=false;var fsAlertOn=false;var fsOverride;var fsOnLive=_btgGv.IS_LIVE_ENV;if(_btgGv.IS_TOP_ACCESSIBLE){if(_btgStr.queryStringToObject(top.location.search).fwFailSafe=="true"){fsOverride=true;}
else if(_btgStr.queryStringToObject(top.location.search).fwFailSafe=="false"){fsOverride=false;}}
if(fsOverride==true){fsEnabled=true;if(fsOnLive==true){fsAlertOn=true;}}
else if(fsOverride==false){fsEnabled=false;}
else{if(fsOnLive==true){fsEnabled=true;fsAlertOn=true;}}
if(_btgGv.IS_TOP_ACCESSIBLE&&_btgStr.queryStringToObject(top.location.search).mockupMode=='true'){fsEnabled=false;fsAlertOn=false;}
if(fsEnabled==true){for(i in _btgFWAI.fwAds){if(document.getElementById("_fw_frame_"+i)==null){if(_btgFWAI.fwAds[i].reloadable){_btgFWAI.fwAds[i].startReloadTimer();}
_btgFWAI.fwAds[i].reload();}
else{fsAlertOn=false;}}
if(fsAlertOn==true){new _btgU.Alert("Freewheel failsafe method used.",1);}}};};mtvn.btg.ads.FreeWheelAdInterface=mtvn.btg.ads.freewheel.FreeWheelAdInterface;mtvn.btg.ads.games.GameDc=mtvn.btg.util.Class.inheritFrom(mtvn.btg.ads.doubleclick.DomesticDc);mtvn.btg.ads.games.GameDc.prototype.type="GameDc";mtvn.btg.ads.games.GameDc.prototype.formatUrl=function(values){var retVal="";var zoneToCheck=values.dartSite+"/"+values.zone+";";if(zoneToCheck.length>64){var cutPoint=values.zone.length-(zoneToCheck.length-64);values.zone=values.zone.substring(0,cutPoint);}
var target=[values.protocol+values.server,values.contentType,values.dartSite,values.zone];var url=target.join("/");var vals=[url];if(this.isStr(values.keyValues)){vals.push(values.keyValues);}
if(this.isStr(values.uValues)){vals.push(values.uValues);}
if(values.ord>0){vals.push('ord='+values.ord+"?");}
retVal=vals.join(";");return retVal;};mtvn.btg.ads.games.GameDc.prototype.formatKeyValues=function(){var extraKeyVals=this.getAdditionalKeyValues();if(this.isStr(extraKeyVals)){this.keyValues+=";"+extraKeyVals;}
if(this.keyValues.indexOf("mtype=")==-1){this.keyValues+=";mtype="+this.mediaType;}
this.keyValues=this.formatReserved();this.keyValues+=";dcmt=text/xml";if(this.isStr(this.size)&&this.keyValues.indexOf("sz=")==-1){this.keyValues+=";sz="+this.size;}
if(this.tile>=0&&this.keyValues.indexOf("tile=")==-1){this.keyValues+=";tile="+this.tile;}
var demoVal=this.btgU.Cookie.read('qcDemo');var qcModuleExists=typeof this.config.Ad!="undefined"&&typeof this.config.Ad.Quantcast!="undefined";var demoTargetingFlag=qcModuleExists&&typeof this.config.Ad.Quantcast.enabled=="boolean"?this.config.Ad.Quantcast.enabled:true;if(demoTargetingFlag&&this.isStr(demoVal)&&this.keyValues.indexOf("demo=D")==-1){this.keyValues+=";"+unescape(demoVal);}
if(this.exclusions.length>0){this.keyValues+=";"+this.getExclusions();}
if(this.gv.IS_TOP_ACCESSIBLE){var tModeValue=this.btgStr.queryStringToObject(top.location.search.toLowerCase()).testmode;if(this.isStr(tModeValue)){this.keyValues+=';testmode='+tModeValue;}}
this.keyValues=this.keyValues.replace(/^;+|;+$/g,'');return this.keyValues;};mtvn.btg.ads.games.GameDc.prototype.formatZone=function(){var zoneValues="";var secValues=this.getSections();if(this.isObj(this.config.Game)&&this.isObj(this.config.Game.metadata)){if(this.isStr(this.config.Game.metadata.ageGroup)&&this.config.Game.metadata.ageGroup.toLowerCase()=="mature"){this.addExclusionCategory("mature");}
if(this.isStr(this.config.Game.metadata.franchise)){this.addExclusionCategory(this.config.Game.metadata.franchise);}
var viralOn=false;if(this.config.Game.metadata.type&&this.config.Game.metadata.type.toLowerCase()=="viral"){this.setDartSite(this.dartSite+".vr");this.addExclusionCategory("vir");this.addKeyValues("pform=vir");viralOn=true;}
if((this.config.Game.metadata.type&&this.config.Game.metadata.type.toLowerCase()=="syndicated")||viralOn===true){if(viralOn===false){this.setDartSite(this.dartSite+".sy");}
this.addExclusionCategory("synd");this.addKeyValues("pform=synd");if(viralOn===false&&this.isStr(this.getKeyValue("partner="))){zoneValues+=this.getKeyValue("partner=")+"/";}}}
if(this.isObj(this.config.Ad)&&this.isObj(this.config.Ad.DoubleClick)){if(this.isStr(this.config.Ad.DoubleClick.keyValues)){this.addKeyValues(this.config.Ad.DoubleClick.keyValues);}}
this.addExclusionCategory("clip");this.addExclusionCategory("gamevideo");zoneValues+="c/gv/";zoneValues=zoneValues.replace(/^\d/,"_"+zoneValues.match(/^\d/,"_"));return zoneValues+secValues;};mtvn.btg.ads.games.GameAdManager=new function(){var _btgGms=mtvn.btg.ads.games;var _btgIsObj=mtvn.btg.util.Object.isDefined;var _btgIsStr=mtvn.btg.util.String.isDefined;var hasDCEnabled=false;var hasFWEnabled=false;var ad;var config;var gameAdData={};this.setSectionsData=function(){if(_btgIsObj(config.Game)&&_btgIsObj(config.Game.metadata)){gameAdData.sections="";gameAdData.sections+=(config.Game.metadata.revenueSplit&&config.Game.metadata.revenueSplit.toString()=="true")?"/pay":"";if(_btgIsStr(config.Game.metadata.gameGenre)&&config.Game.metadata.gameGenre.toUpperCase()!="NA"){gameAdData.sections+="/"+config.Game.metadata.gameGenre;}
else{gameAdData.sections+=(_btgIsStr(config.Game.metadata.gameType)&&config.Game.metadata.gameType.toUpperCase()!="NA")?"/"+config.Game.metadata.gameType:"/noG";}
gameAdData.sections+=(_btgIsStr(config.Game.metadata.partner)&&config.Game.metadata.partner.toUpperCase()!="NA")?"/"+config.Game.metadata.partner:"/noP";gameAdData.sections+=(_btgIsStr(config.Game.metadata.franchise)&&config.Game.metadata.franchise.toUpperCase()!="NA")?"/"+config.Game.metadata.franchise:"/noF";if(_btgIsStr(config.Game.metadata.gameType)&&config.Game.metadata.gameType.toUpperCase()!="NA"){gameAdData.sections+="/"+config.Game.metadata.gameType;}
else{gameAdData.sections+=(_btgIsStr(config.Game.metadata.gameGenre)&&config.Game.metadata.gameGenre.toUpperCase()!="NA")?"/"+config.Game.metadata.gameGenre:"/noGT";}
if(_btgIsStr(config.Game.metadata.gameName)&&config.Game.metadata.gameName.toUpperCase()!="NA"){gameAdData.sections+="/"+config.Game.metadata.gameName;}
else{gameAdData.sections+=(_btgIsStr(config.Game.metadata.gameTitle)&&config.Game.metadata.gameTitle.toUpperCase()!="NA")?"/"+config.Game.metadata.gameTitle:"/noGN";}
gameAdData.sections+=(_btgIsStr(config.Game.metadata.ageGroup)&&config.Game.metadata.ageGroup.toLowerCase()=="under13")?"/"+config.Game.metadata.ageGroup.toLowerCase():"";}};this.setContentTypeData=function(){gameAdData.contentType="pfadx";};this.setOrdData=function(){gameAdData.ord=mtvn.btg.util.Math.random(100000000000000000,999999999999999999);};this.setTileData=function(){gameAdData.tile=1;};this.setMediaTypeData=function(){gameAdData.mediaType="gamevideo";};this.setDartData=function(){var btgCfg=mtvn.btg.config;gameAdData.dartSite=(_btgIsStr(btgCfg.AdSettings.DoubleClick.dartSite))?btgCfg.AdSettings.DoubleClick.dartSite:"[ERROR: DARTSITE in config not defined!]";};this.setSizeData=function(){if(_btgIsObj(config.Ad)){gameAdData.size=(config.Ad.width)?config.Ad.width:"640";gameAdData.size+="x";gameAdData.size+=(config.Ad.height)?config.Ad.height:"480";}};this.setKeyValuesData=function(){gameAdData.keyValues="";gameAdData.keyValues+=";partner=";gameAdData.keyValues+=(_btgIsStr(config.Game.metadata.partner))?config.Game.metadata.partner:"";gameAdData.keyValues+=";franchise=";gameAdData.keyValues+=(_btgIsStr(config.Game.metadata.franchise))?config.Game.metadata.franchise:"";gameAdData.keyValues+=";mode=clip";gameAdData.keyValues+=";genre=";gameAdData.keyValues+=(_btgIsStr(config.Game.metadata.gameGenre))?config.Game.metadata.gameGenre:"";gameAdData.keyValues+=";game_type=";gameAdData.keyValues+=(_btgIsStr(config.Game.metadata.gameType))?config.Game.metadata.gameType:"";gameAdData.keyValues+=";game_id=";gameAdData.keyValues+=(_btgIsStr(config.Game.metadata.gameId))?config.Game.metadata.gameId:"";gameAdData.keyValues+=";game_name=";gameAdData.keyValues+=(_btgIsStr(config.Game.metadata.gameName))?config.Game.metadata.gameName:"";};this.getAd=function(){ad=new _btgGms.GameDc(config);this.setContentTypeData();this.setDartData();this.setSectionsData();this.setSizeData();this.setMediaTypeData();this.setTileData();this.setKeyValuesData();this.setOrdData();ad.init(gameAdData);return ad;};this.getAdUrl=function(){return this.getAd().getUrl();};this.init=function(){config=com.mtvnet.games.GameSettings;if(config.Ad.DoubleClick.enabled&&config.Ad.DoubleClick.enabled.toString()=="true")
hasDCEnabled=true;if(config.Ad.FreeWheel.enabled&&config.Ad.FreeWheel.enabled.toString()=="true")
hasFWEnabled=true;if(mtvn.btg.globalvars.IS_TOP_ACCESSIBLE&&mtvn.btg.util.String.queryStringToObject(top.location.search).mockupMode=='true'){document.write("<p>"+this.getAdUrl()+"</p>");}
if(hasDCEnabled){config.Ad.DoubleClick.url=this.getAdUrl();}
_btgGms.GameAdLoader.init(config);};this.loadGame=function(status){if(status=="load")
_btgGms.GameAdLoader.swapGame();};}
mtvn.btg.ads.games.GameAdLoader={btgC_read:mtvn.btg.util.Cookie.read,btgC_set:mtvn.btg.util.Cookie.set,config:{},parentDiv:null,init:function(config){this.config=config;this.parentDiv=config.parentDiv;var adPlayCounter=this.btgC_read("adPlayCounter");if(!adPlayCounter)
this.btgC_set("adPlayCounter",0);if(adPlayCounter>=this.config.Ad.gamePerAd&&!(this.config.Ad.disableAds)){adPlayCounter=0;this.embedAdLoader();}else{adPlayCounter++;this.embedGame();}
this.btgC_set("adPlayCounter",adPlayCounter);},noFlashContent:function(divId){this.parentDiv.innerHTML='<div id="'+(divId?divId:"adLoader_div")+'"><p><a href="http://www.adobe.com/go/getflashplayer">Download the free Flash Player now!</a><br/><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> </a></p></div>';},embedAdLoader:function(){this.noFlashContent("adLoader_div");this.config.Game.metadata.gameSWF=this.config.Game.metadata.gameURL;this.embedFlash(this.config.adLoaderURL,"adLoader_div",this.config.Ad.width,this.config.Ad.height,true);},embedGame:function(){var game_url=this.config.Game.metadata.gameURL;var gameFlashVars=game_url.split("?");if(game_url.match(/\.swf(\?|#)/gi)||game_url.match(/(.swf)$/gi)){this.noFlashContent("game_div");if(gameFlashVars[1]&&gameFlashVars[1].match(/(useqsflashvar=true)/gi)){this.embedFlash(game_url,"game_div",this.config.Game.width,this.config.Game.height,"",true);}else{this.embedFlash(gameFlashVars[0],"game_div",this.config.Game.width,this.config.Game.height,"",gameFlashVars[1]?gameFlashVars[1]:false);}}else
this.parentDiv.innerHTML='<div id="game_div"><iframe src="'+this.config.Game.metadata.gameURL+'" height="'+this.config.Game.height+'"width="'+this.config.Game.width+'" scrolling="no" frameborder="0"></iframe></div>';},embedFlash:function(path,id,width,height,adFlashVars,gameFlashVars){var _btgU=mtvn.btg.util;var flashVars={};var params={allowfullscreen:'true',allowscriptaccess:'always',wmode:'transparent'};if(adFlashVars){flashVars.allowscriptaccess="always";flashVars.bgcolor="black";flashVars.sWidth=width;flashVars.sHeight=height;flashVars.timeDisplayEnabled=this.config.Ad.timeDisplayEnabled;flashVars.guiEnabled=(this.config.Ad.guiEnabled?this.config.Ad.guiEnabled:true);flashVars.language=this.config.Ad.language;flashVars.colorTint=this.config.Ad.colorTint;flashVars.doubleClickEnabled=this.config.Ad.DoubleClick.enabled;flashVars.adURL=this.config.Ad.DoubleClick.url;flashVars.freeWheelEnabled=this.config.Ad.FreeWheel.enabled;flashVars.networkId=this.config.Ad.FreeWheel.networkId;flashVars.assetId=this.config.Ad.FreeWheel.assetId;flashVars.siteSection=this.config.Ad.FreeWheel.siteSection;flashVars.isLiveEnvironment=this.config.Ad.FreeWheel.isLiveEnvironment;flashVars.quantcastEnabled=this.config.Ad.Quantcast.enabled;flashVars.quantCastID=this.config.Ad.Quantcast.id;if(typeof flashVars.assetId=="undefined"){new _btgU.Alert("flashVars.assetId missing in mtvn.btg.ads.games.GameAdLoader.embedFlash.");}
if(typeof flashVars.siteSection=="undefined"){new _btgU.Alert("flashVars.siteSection missing in mtvn.btg.ads.games.GameAdLoader.embedFlash.");}
if(this.config.gameCompURL!="")
flashVars.gameCompURL=this.config.gameCompURL;if(this.config.Ad.params){for(var param in this.config.Ad.params)
if(this.config.Ad.params[param]!="")
params[param]=flashVars[param]=this.config.Ad.params[param];}
if(this.config.Game.metadata){for(var key in this.config.Game.metadata)
if(this.config.Game.metadata[key]!="")
flashVars[key]=this.config.Game.metadata[key];}}
else if(gameFlashVars){if(typeof gameFlashVars!='boolean'){var gameFlashVarsArr=gameFlashVars.split("&");for(var i=0,len=gameFlashVarsArr.length;i<len;i++){var key=gameFlashVarsArr[i].split("=")[0];var val=gameFlashVarsArr[i].split("=")[1];if(key)
flashVars[key]=(val?val:"");}}else
flashVars="";for(var gameParam in this.config.Game.param)
if(gameParam)
params[gameParam]=(this.config.Game.param[gameParam]?this.config.Game.param[gameParam]:"");}
if((_btgU.swfobject.getFlashPlayerVersion()).major<10)
_btgU.swfobject.showExpressInstall({data:"http://games.mtvnservices.com/swf/expressinstall/expressInstall.swf",width:width,height:height},{},id,function(){});else if(_btgU.String.isDefined(com.mtvnet.games.GameSettings.Game.gameEmbedTag)&&id!="adLoader_div")
document.getElementById(id).innerHTML=com.mtvnet.games.GameSettings.Game.gameEmbedTag;else
_btgU.swfobject.embedSWF(path,id,width,height,"10.0.0","http://games.mtvnservices.com/swf/expressinstall/expressInstall.swf",flashVars,params,{style:"background:#000000;",name:id},(adFlashVars?null:this.gameEmbeded));},gameEmbeded:function(e){if(e.success)
mtvn.btg.Controller.loadGame("embed");},swapGame:function(){if(document.getElementById('adLoader_div'))document.getElementById('adLoader_div').style.display="none";this.embedGame();},isTimeSpentEnabled:function(){return(typeof this.config.Ad.timePerAd!="boolean"&&!isNaN(this.config.Ad.timePerAd)&&parseInt(this.config.Ad.timePerAd,10)>0);},setTimeSpent:function(clear){if(clear){this.btgC_set("mtvn_btg_GTS",0);return;}
if(!this.isTimeSpentEnabled())
return;var timeSpent=this.btgC_read("mtvn_btg_GTS");if(timeSpent==null||timeSpent==0)
this.btgC_set("mtvn_btg_GTS",5);else
this.btgC_set("mtvn_btg_GTS",parseInt(timeSpent,10)+5);},isTimeForAd:function(){if(!this.isTimeSpentEnabled())
return false;var timeSpent=this.btgC_read("mtvn_btg_GTS");if(timeSpent!=null&&parseInt(timeSpent,10)!=0){timeSpent=parseInt(timeSpent,10);return(timeSpent>parseInt(this.config.Ad.timePerAd,10));}
return false;}}
var com=typeof com==='object'?com:{};com.mtvi=typeof com.mtvi==='object'?com.mtvi:{};com.mtvi.reporting=typeof com.mtvi.reporting==='object'?com.mtvi.reporting:{};com.mtvi.ads=typeof com.mtvi.ads==='object'?com.mtvi.ads:{};com.mtvi.config=typeof com.mtvi.config==='object'?com.mtvi.config:{};com.mtvi.util=typeof com.mtvi.util==='object'?com.mtvi.util:{};com.mtvi.util.IFrameReloader=typeof com.mtvi.util.IFrameReloader==='object'?com.mtvi.util.IFrameReloader:{};com.mtvi.metadata=typeof com.mtvi.metadata==='object'?com.mtvi.metadata:{};com.mtvi.reporting.Controller=new function(){this.initalized=false;this.initialize=function(){mtvn.btg.Controller.init();this.initalized=true;};this.sendCall=function(data){mtvn.btg.Controller.sendPageCall(data);};this.sendLinkEvent=function(data){mtvn.btg.Controller.sendLinkEvent(data);};this.registerLinks=function(){return true;};this.setConfig=function(data){for(var i in data){mtvn.btg.config.ReportSettings.Omniture[i]=data[i];}
return true};this.addRegisterLinks=function(){return true;};this.setDefaultData=function(k,v){if(mtvn.btg.util.String.isDefined(k)){mtvn.btg.config.ReportSettings.Omniture[k]=mtvn.btg.util.String.isDefined(v)?v:'';return true}
else{return false;}}};com.mtvi.reporting.Dispatcher=function(){this.setAccountVars=function(o){try{this.setAttribute("un",o.name);this.setAttribute("dynamicAccountSelection",o.dynamic);this.setAttribute("dynamicAccountList",o.list);this.setAttribute("linkInternalFilters",o.filters);this.setAttribute("charSet",o.chartset);for(var i in o){this.setAttribute(i,o[i]);};}catch(e){}};this.getValOnce=function(v,c,e){return true};this.sendCall=function(data){data=(mtvn.btg.util.Object.isDefined(data)?data:(mtvn.btg.util.Object.isDefined(com.mtvi.config.SectionSetup)?com.mtvi.config.SectionSetup:{}));if(!com.mtvi.reporting.Controller.initalized){mtvn.btg.Controller.init();com.mtvi.reporting.Controller.initalized=true;}
mtvn.btg.Controller.sendPageCall(data);};this.send=function(data){this.sendCall(data);};this.sendLinkEvent=function(data){var objOmniture=(com.mtvi.reporting.Controller.initalized?mtvn.btg.reporting.omniture.Hcode:mtvn.btg.config.ReportSettings.Omniture);for(var i=1;i<=50;i++){objOmniture["eVars"+i]='';objOmniture["prop"+i]='';if(i<6){objOmniture["hier"+i]='';}}
objOmniture["pageName"]='';objOmniture["channel"]='';if(!com.mtvi.reporting.Controller.initalized){mtvn.btg.Controller.init();com.mtvi.reporting.Controller.initalized=true;}
mtvn.btg.Controller.sendLinkEvent(data);};this.registerLinks=function(){return true;}
this.setAttribute=function(k,v){if(mtvn.btg.util.String.isDefined(k)){var objOmniture=(com.mtvi.reporting.Controller.initalized?mtvn.btg.reporting.omniture.Hcode:mtvn.btg.config.ReportSettings.Omniture);objOmniture[k]=mtvn.btg.util.String.isDefined(v)?v:'';return true}
else{return false;}};this.getAttribute=function(k){var objOmniture=(com.mtvi.reporting.Controller.initalized?mtvn.btg.reporting.omniture.Hcode:mtvn.btg.config.ReportSettings.Omniture);return objOmniture[k];};this.setValues=function(data){for(var i in data){this.setAttribute(i,data[i]);}
return true};this.setDefaultData=function(){};this.clearProps=function(){try{for(var p=1;p<=50;p++){this.setAttribute("prop"+p,"");}}catch(e){}};this.clearAllVars=function(){var objOmniture=(com.mtvi.reporting.Controller.initalized?mtvn.btg.reporting.omniture.Hcode:mtvn.btg.config.ReportSettings.Omniture);try{for(var p=1;p<=50;p++){objOmniture["prop"+p]="";}
for(var e=1;e<=50;e++){objOmniture["eVars"+e]="";}
for(var h=1;h<=5;h++){objOmniture["hier"+h]="";}
objOmniture["pageName"]="";objOmniture["channel"]="";}catch(e){}}}
com.mtvi.reporting.MediaPlayer={addPlayer:function(id){var player=mtvn.btg.reporting.player.MediaPlayer.addPlayer(id);return player['id'];}}
mtvn.btg.reporting.MediaPlayer={setEndSlateClick:mtvn.btg.reporting.player.MediaPlayer.setEndSlateClick,getEndSlateClick:mtvn.btg.reporting.player.MediaPlayer.getEndSlateClick}
com.mtvi.ads.AdManager=new function(){var adType="";var reloadInterval=300000;this.setDartSite=function(a_dartSite){try{if(mtvn.btg.config.AdSettings.DoubleClick.enabled&&!mtvn.btg.util.String.isDefined(mtvn.btg.config.AdSettings.DoubleClick.dartSite)){mtvn.btg.config.AdSettings.DoubleClick.dartSite=a_dartSite;}
else if(mtvn.btg.config.AdSettings.International.enabled){mtvn.btg.config.AdSettings.International.dartSite=a_dartSite;}}
catch(e){}};this.setPositionThreshold=function(a_positionThreshold){try{if(mtvn.btg.config.AdSettings.DoubleClick.enabled&&!mtvn.btg.util.String.isDefined(mtvn.btg.config.AdSettings.DoubleClick.positionThreshold)){mtvn.btg.config.AdSettings.DoubleClick.positionThreshold=a_positionThreshold;}
else if(mtvn.btg.config.AdSettings.International.enabled){mtvn.btg.config.AdSettings.International.positionThreshold=a_positionThreshold;}}
catch(e){}};this.setSiteName=function(a_siteName){try{if(mtvn.btg.config.AdSettings.DoubleClick.enabled&&!mtvn.btg.util.String.isDefined(mtvn.btg.config.AdSettings.DoubleClick.siteName)){mtvn.btg.config.AdSettings.DoubleClick.siteName=a_siteName;}
else if(mtvn.btg.config.AdSettings.International.enabled){mtvn.btg.config.AdSettings.International.siteName=a_siteName;}}
catch(e){}};this.setDefaultSections=function(a_defaultSections){if(mtvn.btg.util.String.isDefined(a_defaultSections))
mtvn.btg.config.AdSettings.DoubleClick.sections=a_defaultSections;};this.setKeyValues=function(a_keyValues){try{if(mtvn.btg.config.AdSettings.DoubleClick.enabled&&!mtvn.btg.util.String.isDefined(mtvn.btg.config.AdSettings.DoubleClick.keyValues)){mtvn.btg.config.AdSettings.DoubleClick.keyValues=a_keyValues;}
else if(mtvn.btg.config.AdSettings.International.enabled){mtvn.btg.config.AdSettings.International.keyValues=a_keyValues;}}
catch(e){}};this.getFormattedSections=function(a_sections){var retVal=a_sections;try{retVal=(a_sections=='/')?a_sections:mtvn.btg.util.String.charTrim(a_sections,'/');var sectionsLength=a_sections.length;var difn="index";if(mtvn.btg.util.Object.isDefined(com.mtvi.reporting.Account)&&mtvn.btg.util.String.isDefined(com.mtvi.reporting.Account.defaultIndexFileName)){difn=com.mtvi.reporting.Account.defaultIndexFileName;}
if(mtvn.btg.util.Object.isDefined(mtvn.btg.config.AdSettings)&&mtvn.btg.util.String.isDefined(mtvn.btg.config.AdSettings.defaultIndexFileName)){difn=mtvn.btg.config.AdSettings.defaultIndexFileName;}
difn=mtvn.btg.util.String.stripFileExtension(difn);var hpCases=['/',difn,"home/"+difn];for(var i=0,len=hpCases.length;i<len;i++){if(a_sections.indexOf(hpCases[i])==0&&sectionsLength==hpCases[i].length){retVal=a_sections.replace(hpCases[i],'_hp');break;}}
if(retVal==''){retVal="_hp";}
var sectionArray=mtvn.btg.util.String.stripFileExtension(retVal).split('/');if(sectionArray.length==2){if(sectionArray[1]==difn){retVal=mtvn.btg.util.String.stripFileExtension(retVal).replace(difn,'_mn');}}}
catch(e){}
return retVal;};this.placeAd=function(a_adParametersObj){try{if(typeof(mtvn.btg.globalvars.IS_CODA_ADS_USED)!='undefined')
mtvn.btg.globalvars.IS_CODA_ADS_USED="Bridge methods";if(!com.mtvi.reporting.Controller.initalized){mtvn.btg.Controller.init();com.mtvi.reporting.Controller.initalized=true;}
if(!mtvn.btg.util.String.isDefined(a_adParametersObj.sections)){if(mtvn.btg.util.Object.isDefined(mtvn.btg.config.AdSettings.DoubleClick)&&mtvn.btg.util.String.isDefined(mtvn.btg.config.AdSettings.DoubleClick.sections)){a_adParametersObj.sections=mtvn.btg.config.AdSettings.DoubleClick.sections;}
else{a_adParametersObj.sections=mtvn.btg.util.Sections.getAdSections();}}
if(mtvn.btg.util.Object.isDefined(mtvn.btg.config.AdSettings.International)&&mtvn.btg.config.AdSettings.International.enabled&&mtvn.btg.util.String.isDefined(a_adParametersObj)&&!mtvn.btg.util.String.isDefined(a_adParametersObj.adType))
a_adParametersObj.adType="InternationalAd";a_adParametersObj.sections=this.getFormattedSections(a_adParametersObj.sections);mtvn.btg.ads.AdManager.placeAd(a_adParametersObj);}
catch(e){}};this.setServer=function(a_server){try{if(mtvn.btg.config.AdSettings.DoubleClick.enabled&&!mtvn.btg.util.String.isDefined(mtvn.btg.config.AdSettings.DoubleClick.server)){mtvn.btg.config.AdSettings.DoubleClick.server=a_server;}
else if(mtvn.btg.config.AdSettings.International.enabled){mtvn.btg.config.AdSettings.International.server=a_server;}}
catch(e){}};this.setSsl=function(){try{if(mtvn.btg.config.AdSettings.DoubleClick.enabled&&!mtvn.btg.util.String.isDefined(mtvn.btg.config.AdSettings.DoubleClick.ssl)){mtvn.btg.config.AdSettings.DoubleClick.ssl=true;}
else if(mtvn.btg.config.AdSettings.International.enabled){mtvn.btg.config.AdSettings.International.ssl=true;}}
catch(e){}};this.setDefaultContentType=function(a_defaultContentType){try{if(mtvn.btg.config.AdSettings.DoubleClick.enabled&&!mtvn.btg.util.String.isDefined(mtvn.btg.config.AdSettings.DoubleClick.contentType)){mtvn.btg.config.AdSettings.DoubleClick.contentType=a_defaultContentType;}else if(mtvn.btg.config.AdSettings.International.enabled){mtvn.btg.config.AdSettings.International.contentType=a_defaultContentType;}}
catch(e){}};this.setZoneOverride=function(a_zone){try{if(mtvn.btg.config.AdSettings.DoubleClick.enabled&&!mtvn.btg.util.String.isDefined(mtvn.btg.config.AdSettings.DoubleClick.zoneOverride)){mtvn.btg.config.AdSettings.DoubleClick.zoneOverride=a_zone;}else if(mtvn.btg.config.AdSettings.International.enabled){mtvn.btg.config.AdSettings.International.zoneOverride=a_zone;}}
catch(e){}};this.IFrameAds=[];this.placeIFrameAd=function(a_adParametersObj){try{if(typeof(mtvn.btg.globalvars.IS_CODA_ADS_USED)!='undefined')
mtvn.btg.globalvars.IS_CODA_ADS_USED="Bridge methods";var ad=this.getAd(a_adParametersObj);var adReloader=new com.mtvi.util.IFrameReloader(a_adParametersObj.containerId);adReloader.src=ad.getUrl();adReloader.width=ad.getWidth();adReloader.height=ad.getHeight();adReloader.write();if(a_adParametersObj.reloadAd){this.IFrameAds.push(adReloader);}}catch(e){}};this.setReloadInterval=function(num){try{reloadInterval=parseInt(num);mtvn.btg.util.DOM.Events.addListener(window,"load",function(){try{window.setInterval("com.mtvi.ads.AdManager.reloadIFrameAds()",reloadInterval);}catch(e){}});}catch(e){}};this.setAdClass=function(a_class){if(a_class=="InternationalAd"){adType="InternationalAd";}};this.getAdById=function(a_adId){return null;};this.getDartSite=function(){var retVal=null;try{if(mtvn.btg.util.String.isDefined(mtvn.btg.ads.AdManager.data.dartSite)){retVal=mtvn.btg.ads.AdManager.data.dartSite;}}
catch(e){try{retVal=mtvn.btg.config.AdSettings.DoubleClick.dartSite;}
catch(e){}}
return retVal;};this.getAd=function(a_adParametersObj){var retVal=null;try{retVal=mtvn.btg.ads.AdManager.getAd(a_adParametersObj);}
catch(e){}
return retVal;};this.getReloadInterval=function(){try{return reloadInterval;}catch(e){}};this.reloadIFrameAds=function(){for(var x=0,len=this.IFrameAds.length;x<len;x++){this.reloadIFrameAd(x);}};this.reloadIFrameAd=function(index){var src=this.IFrameAds[index].src;if(index==0)ord=Math.random(100000000000000000,999999999999999999);if(src.indexOf("ord=")>-1){src=src.split("ord=")[0]+"ord="+ord+"?";}
this.IFrameAds[index].src=src;this.IFrameAds[index].reload();};this.setZone=function(zone){};this.getNewAd=function(adObject){};this.populateNamesValuesObj=function(nameValues){};}
com.mtvi.ads.DoubleClickAd=function(params){};com.mtvi.ads.DoubleClickAd.prototype={setZoneOverride:function(str){},setDartSite:function(str){},setOrd:function(num){},placeAd:function(){},getXml:function(){return null;},getJson:function(){return null;},getUrl:function(){return null;},getSections:function(){return null;},setSize:function(str){},setSections:function(str){},setContentType:function(str){},setKeyValues:function(str){},setTile:function(num){},setPositionThreshold:function(num){},setServer:function(str){},setSsl:function(){},setMediaType:function(str){},setPosition:function(str){},setPartner:function(str){},setId:function(str){}};com.mtvi.reporting.FluxWidgeted={setVars:function(){return true;}};com.mtvi.reporting.GoogleAnalytics={makeCall:function(id,uri){return true;}};com.mtvi.reporting.QuantCast=new function(){this.sendQuantCastCall=function(a_labels){return true;};};com.mtvi.reporting.Search={setVars:function(obj){return true;},sendLinkEvent:function(obj){return true;},setConversion:function(){return true;},setSynConversion:function(){return true;}};com.mtvi.util={toObject:function(string,delimiter){var delimiter=delimiter?delimiter:',';var array=string.split(delimiter);var object={};for(var x=0,len=array.length;x<len;x++){var pairs=array[x].split('=');object[pairs[0]]=pairs[1];}
return object;},queryStringToHash:function(string){return mtvn.btg.util.String.queryStringToObject(string);},isDefined:function(value){return mtvn.btg.util.String.isDefined(value);},readCookie:function(name){return mtvn.btg.util.Cookie.read(name);},deleteCookie:function(name){mtvn.btg.util.Cookie.remove(name);},crawlNodes:function(node){return mtvn.btg.util.Window.getNodeLinkName(node);},addOnloadEvent:function(func){return mtvn.btg.util.DOM.Events.addListener(window,"load",func);}}
com.mtvi.reporting.ComScore=new function(){this.sendComScoreCall=function(){}};com.mtvi.metadata={getDefaultPageName:function(){var pageName='';try{pageName=mtvn.btg.config.ReportSettings.defaultPageName;if(pageName.lastIndexOf("/")==(pageName.length-1)){if(mtvn.btg.util.String.isDefined(mtvn.btg.config.ReportSettings.indexFileName)){pageName+=mtvn.btg.config.ReportSettings.indexFileName;}
else{pageName=(pageName!='/')?mtvn.btg.util.String.charRtrim(pageName,'/'):pageName;}}
if(pageName!='/'){pageName=mtvn.btg.util.String.charRtrim(pageName,'/');}
if(pageName!='/'&&pageName.indexOf('/')==0){pageName=pageName.substring(1);}
if(pageName.indexOf('/')==-1&&pageName.indexOf(mtvn.btg.config.ReportSettings.indexFileName)!=-1){pageName='home/'+pageName;}}
catch(e){return null;}
return pageName;},getDefaultHierarchy:function(){try{var hier=this.getDefaultPageName();if(hier=='/')hier='';}
catch(e){return null;}
return hier;},getDefaultChannel:function(){try{var channel=this.getDefaultPageName();if(channel!='/')
channel=channel.split('/')[0];}
catch(e){return null;}
return channel;}};com.mtvi.util.IFrameReloader=function(containerId){try{this.containerId=containerId;this.id="IFrameReloader"+Math.random(0,1000000);this.width;this.height;this.src;this.lastLoaded=0;}catch(e){}};com.mtvi.util.IFrameReloader.prototype={reload:function(){try{var date=new Date();var now=(date.getMinutes()*60000)+(date.getSeconds()*1000);var elapsed=now-this.lastLoaded;if(elapsed>5000){var n=document.getElementById(this.containerId);var i=document.createElement("iframe");i.id=this.id;i.width=this.width;i.height=this.height;i.style.width=this.width;i.style.height=this.height;i.src=this.src;i.frameBorder="0";i.scrolling="no";i.marginheight="0";i.marginwidth="0";i.style.margin="0";i.style.zIndex="99";i.style.border="0";i.style.borderWidth="0px";n.removeChild(document.getElementById(this.id));n.appendChild(i);}
this.lastLoaded=now;}catch(e){}},write:function(){try{var html='<iframe id="'+this.id+'" src="'+this.src+'" width="'+this.width+'" height="'+this.height+'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"><\/iframe>';if(mtvn.btg.globalvars.IS_TOP_ACCESSIBLE&&mtvn.btg.util.String.queryStringToObject(top.location.search).mockupMode=='true'){html=mtvn.btg.util.String.mockItUp(html);}
document.write(html);}catch(e){}}};mtvn.btg.html5.ads.AdGuiControl=function(player)
{this.btgAL=mtvn.btg.html5.ads.AdLoader;this.player=player;this.view=document.createElement("div");this.view.id="adControlsView";this.view.innerHTML='<div id="adPlayPause" class="icon paused"></div>'+'<div id="adProgress">'+'<div id="adTimeDisplay">'+'<span id="adCurrentTimeDisplay">0:00</span> / <span id="adDurationDisplay">0:00</span>'+'</div>'+'<div id="adProgressBar">'+'<div id="adBufferFill"></div>'+'<div id="adProgressFill"></div>'+'</div>'+'<div id="adScrubber" class="icon scrubber"><div id="adScrubberTime" class="scrubberTimeClosed"></div></div>'+'</div>'+'<div id="adFullPageButton" class="icon"></div>';this.player.view.appendChild(this.view);this.availableWidth=0;this.width=0;this.height=0;this.playPause;this.progressBar;this.progressFill;this.currentTimeDisplay;this.durationDisplay;this.bufferFill;this.scrubber;this.cuepointView;this.scrubbing=false;this.scrubberTime;this.startX=0;this.visible=false;}
mtvn.btg.html5.ads.AdGuiControl.prototype.init=function()
{var self=this;window.addEventListener("resize",function(event){self.setSize(window.innerWidth,window.innerHeight);});this.currentTimeDisplay=document.getElementById("adCurrentTimeDisplay");this.durationDisplay=document.getElementById("adDurationDisplay");this.progressBar=document.getElementById("adProgressBar");this.progressBar.controls=this;this.progressFill=document.getElementById("adProgressFill");this.bufferFill=document.getElementById("adBufferFill");this.scrubber=document.getElementById("adScrubber");this.scrubberTime=document.getElementById("adScrubberTime");this.playPause=document.getElementById("adPlayPause");this.playPause.addEventListener('click',function(){self.player.togglePlayPause();});var down=(this.btgAL.isTouchDevice())?"touchstart":"mousedown";var up=(this.btgAL.isTouchDevice())?"touchend":"mouseup";this.playPause.addEventListener(down,function(){self.setPlayingState(self.playing,true);});this.playPause.addEventListener(up,function(){self.setPlayingState(self.playing,false);});this.setSize(window.innerWidth,window.innerHeight);this.updateUI();document.getElementById("adFullPageButton").addEventListener('click',function(){self.toggleFullScreen();});}
mtvn.btg.html5.ads.AdGuiControl.prototype.stopHideCheck=function(){clearTimeout(mtvn.btg.html5.ads.AdLoader.control.hideInterval);}
mtvn.btg.html5.ads.AdGuiControl.prototype.hideCheck=function()
{this.btgAL.control.stopHideCheck();mtvn.btg.html5.ads.AdLoader.control.hideInterval=setTimeout(function()
{mtvn.btg.html5.ads.AdLoader.timeDispDiv.className="occupyFull";mtvn.btg.html5.ads.AdLoader.control.hide();},5000);}
mtvn.btg.html5.ads.AdGuiControl.prototype.setSize=function(width,height)
{this.width=width;this.height=height;this.view.style.width=width+"px";this.updateUI();}
mtvn.btg.html5.ads.AdGuiControl.prototype.setPlayingState=function(playing,over)
{var player=this.btgAL.html5Player;var control=this;control.playing=playing;var overClass=(over)?"Over":"";if(!playing){control.playPause.className="icon playing"+overClass;player.overlays["playIcon"].hide();}
else{control.playPause.className="icon paused"+overClass;player.overlays["playIcon"].show();}}
mtvn.btg.html5.ads.AdGuiControl.prototype.hide=function()
{this.btgAL.control.visible=false;this.btgAL.control.view.className="adControlsClosed";}
mtvn.btg.html5.ads.AdGuiControl.prototype.show=function()
{this.btgAL.control.visible=true;this.btgAL.control.view.className="adControlsOpen";}
mtvn.btg.html5.ads.AdGuiControl.prototype.toggle=function()
{if(!this.btgAL.control.visible){this.btgAL.control.show();}
else{this.btgAL.control.hide();}}
mtvn.btg.html5.ads.AdGuiControl.prototype.updateTime=function()
{var self=this.btgAL.html5Player.video;this.btgAL.control.currentTimeDisplay.innerHTML=this.btgAL.formatDuration((isNaN(self.currentTime)?0:self.currentTime));this.btgAL.control.durationDisplay.innerHTML=this.btgAL.formatDuration((isNaN(self.duration)?0:self.duration));this.btgAL.control.scrubberTime.innerHTML=this.btgAL.formatDuration((isNaN(self.currentTime)?0:self.currentTime));this.btgAL.control.progressFill.style.width=this.btgAL.control.scrubber.style.left=(self.currentTime/self.duration*100)+"%";}
mtvn.btg.html5.ads.AdGuiControl.prototype.updateUI=function()
{this.updateProgress();}
mtvn.btg.html5.ads.AdGuiControl.prototype.updateProgress=function()
{this.availableWidth=(this.width-72-75);this.progressBar.style.width=this.availableWidth+"px";}
mtvn.btg.html5.ads.AdGuiControl.prototype.toggleFullScreen=function()
{this.player.toggleFullScreen();this.player.dispatchEvent(new Event(Player.FULL_SCREEN));parent.postMessage(new Event(Player.FULL_SCREEN,this.player.fullScreen),"*");}
mtvn.btg.html5.ads.AdLoader={btgU:mtvn.btg.util,btgAds:mtvn.btg.html5.ads,_TIME_LAST_AD_STOPPED_COOKIE:"mtvn_btg_timeSinceLastAdCookie",minTimeBtwAds:90,isFWReady:false,isPlayerReady:false,fwAdManager:null,html5Player:null,FW_URL:"http://140cc.v.fwmrm.net/ad/g/1?nw={0}&prof={0}:{1}&flag=+sltp+exvt+slcb+unka+unks;",fwResponse:null,adCompleted:false,adRequested:false,beginAd:false,isAdPlaying:false,failSafeTimer:null,adTimer:0,adTimerObj:null,adDuration:0,timeDispDiv:null,control:null,config:{},init:function(playerObj){var reporter=mtvn.btg.html5.reporting;this.FW_URL="http"+('https:'==document.location.protocol?"s":"")+"://140cc.v.fwmrm.net/ad/g/1?nw={0}&prof={0}:{1}&flag=+sltp+exvt+slcb+unka+unks;";this.html5Player=playerObj;this.minTimeBtwAds=reporter.MetaDataVO.vo.FreeWheel.minTimeBtwAds;this.config.assetId=reporter.MetaDataVO.vo.FreeWheel.assetId;this.config.siteSection=reporter.MetaDataVO.vo.FreeWheel.siteSection;if(!this.btgU.String.isDefined(this.config.siteSection)){new this.btgU.Alert("Freewheel ad error because SID is empty for "+reporter.MetaDataVO.vo.referrer,0);return false;}
this.config.networkId=reporter.MetaDataVO.vo.FreeWheel.networkId;this.config.profileId=reporter.MetaDataVO.vo.FreeWheel.profileId;this.config.displayBase=reporter.MetaDataVO.vo.FreeWheel.displayBase;this.config.duration=this.html5Player.episode.duration;this.adRequested=true;this.timeDispDiv=document.createElement("div");this.controls=document.createElement("div");this.requestAd();},setFWReady:function(e){var self=mtvn.btg.html5.ads.AdLoader.btgAds.AdLoader;self.isFWReady=true;self.fwResponse=e.response;if(self.beginAd){self.playAd();}},hideOverlay:function(){if(this.html5Player.overlays["waitingIcon"])this.html5Player.overlays["waitingIcon"].hide();if(this.html5Player.overlays["playIcon"])this.html5Player.overlays["playIcon"].hide();this.html5Player.overlayContainer.style.display='none';this.html5Player.controls.hide();this.html5Player.shareBar.hide();},showOverlay:function(id){this.html5Player.overlayContainer.style.display='block';if(id)
this.html5Player.overlays[id].show();},isItTimeForAd:function(){var self=this.btgAds.AdLoader;if(!self.isOkToPlayAd())return false;self.failSafeForcePlay();if(self.isFWReady&&!self.adCompleted){self.playAd();return true;}
else if(self.adRequested&&!self.adCompleted){self.beginAd=true;return"wait";}
self.failSafeForcePlay(true);return false;},failSafeForcePlay:function(reset){var self=this.btgAds.AdLoader;if(!reset){if(self.failSafeTimer==null)
self.failSafeTimer=setTimeout("mtvn.btg.html5.ads.AdLoader.postAdHandler('failsafe')",20000);}else{clearTimeout(self.failSafeTimer);self.failSafeTimer=null;}},requestAd:function(){if(!mtvn.btg.html5.reporting.MetaDataVO.vo.FreeWheel.enabled){this.btgAds.AdLoader.adRequested=false;return;}
try{this.fwAdManager=new tv.freewheel.SDK.AdManager();this.fwAdManager.registerVideoDisplayBase(this.config.displayBase);this.fwAdManager.setVideoAsset(this.config.assetId,this.config.duration);this.fwAdManager.setSiteSection(this.config.siteSection);this.fwAdManager.setServerURL(this.FW_URL.replace(/\{0\}/g,this.config.networkId).replace(/\{1\}/g,this.config.profileId));this.fwAdManager.submitRequest(this.setFWReady,5000);}catch(e){new this.btgU.Alert("Error retrieving Freewheel Ad via mtvn.btg.html5.ads.AdLoader.requestAd. "+e.message);}},playAd:function(adType){var self=this.btgAds.AdLoader;if(!self.isFWReady)return;self.preAdHandler();switch(adType){case"preroll":this.fwAdManager.playSlots(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL,self.postAdHandler);break;case"postroll":this.fwAdManager.playSlots(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL,self.postAdHandler);break;case"overlay":this.fwAdManager.playSlots(tv.freewheel.SDK.TIME_POSITION_CLASS_OVERLAY,self.postAdHandler);break;default:this.fwAdManager.playSlots(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL,self.postAdHandler);break;}},preAdHandler:function(){var self=mtvn.btg.html5.ads.AdLoader;var player=self.html5Player.video;self.isAdPlaying=true;self.hideOverlay();self.createOverlay();player.addEventListener("play",mtvn.btg.html5.reporting.Reporter.onPlay);player.addEventListener("play",self.onPlay);player.addEventListener("playing",self.onPlaying);player.addEventListener("timeupdate",self.updateAdTimer);player.addEventListener("pause",self.onPause);player.addEventListener("waiting",self.onWait);},postAdHandler:function(failsafe){var self=mtvn.btg.html5.ads.AdLoader;self.setTimeLastAdStopped();var player=self.html5Player.video;if(typeof failsafe!='undefined')
new this.btgU.Alert("Error retrieving Freewheel Ad via mtvn.btg.html5.ads.AdLoader.postAdHandler. Fail safe method triggered.");player.removeEventListener("play",mtvn.btg.html5.reporting.Reporter.onPlay);player.removeEventListener("play",self.onPlay);player.removeEventListener("playing",self.onPlaying);player.removeEventListener("timeupdate",self.updateAdTimer);player.removeEventListener("pause",self.onPause);player.removeEventListener("waiting",self.onWait);self.isAdPlaying=false;self.adCompleted=true;self.hideOverlay();self.timeDispDiv.style.display='none';self.html5Player.play();self.showOverlay();if(self.control!=null)self.control.hide();},setTimeLastAdStopped:function(){var now=(new Date()).getTime();this.btgU.Cookie.set(this._TIME_LAST_AD_STOPPED_COOKIE,now);},getTimeSinceLastAd:function(){var timeLastAdStopped=this.btgU.Cookie.read(this._TIME_LAST_AD_STOPPED_COOKIE);if(!timeLastAdStopped||isNaN(parseInt(timeLastAdStopped)))return this.minTimeBtwAds+1;var now=(new Date()).getTime();return(now-timeLastAdStopped)/1000;},isOkToPlayAd:function(){return this.getTimeSinceLastAd()>this.minTimeBtwAds;},updateAdTimer:function(e){var self=mtvn.btg.html5.ads.AdLoader;if(self.html5Player.video.duration>0){self.setAdDuration();self.failSafeForcePlay(true);self.adTimer=Math.floor(self.html5Player.video.currentTime);self.updateTimeDisplay();}},stopAdTimer:function(){this.btgAds.AdLoader.hideOverlay();},updateTimeDisplay:function(){var self=this.btgAds.AdLoader;if(self.control==null){self.setControls();self.control.show();self.control.hideCheck();self.control.setPlayingState(false,false);}
self.timeDispDiv.innerHTML='<p class="adTimeLable">Content will resume '+self.formatDuration(self.adDuration-self.adTimer)+'</p>';self.control.updateTime();},createOverlay:function(){var self=this.btgAds.AdLoader;self.timeDispDiv.style.display='block';self.timeDispDiv.id="adTimeDisp";self.timeDispDiv.addEventListener(((self.isTouchDevice())?"touchend":"mouseup"),function(){self.control.hideCheck();if(self.timeDispDiv.className=="occupyFull")
self.control.show();self.timeDispDiv.className="occupyEmpty";});self.html5Player.view.appendChild(self.timeDispDiv);},setAdDuration:function(adType){try{this.adDuration=Math.floor(this.btgAds.AdLoader.html5Player.video.duration);}
catch(e){this.adDuration=0;return this.adDuration;}
return this.adDuration;},formatDuration:function(duration){if(duration>0&&duration<60)
return"00:"+(duration<10?"0":"")+Math.floor(duration);else if(duration>59)
return"0"+Math.floor(x/60)+":"+((duration%60).toString().length<2?"0":"")+(Math.floor(duration)%60);else
return"00:00";},setControls:function(){this.control=new this.btgAds.AdGuiControl(this.html5Player);this.control.init();},isTouchDevice:function()
{try
{document.createEvent("TouchEvent");return true;}
catch(e)
{return false;}},onWait:function(){mtvn.btg.html5.ads.AdLoader.btgAds.AdLoader.showOverlay('waitingIcon');},onPlay:function(){var self=mtvn.btg.html5.ads.AdLoader;self.hideOverlay();if(self.control!=null){self.control.setPlayingState(false,false);self.control.hideCheck();}},onPlaying:function(){var self=mtvn.btg.html5.ads.AdLoader;self.hideOverlay();},onPause:function(){var self=mtvn.btg.html5.ads.AdLoader;setTimeout("mtvn.btg.html5.ads.AdLoader.showOverlay('playIcon')",500);self.control.setPlayingState(true,false);self.control.stopHideCheck();},onError:function(){}}
mtvn.btg.html5.ads.AdManager=new function(){try{mtvn.btg.util.DOM.loadScript("http"+('https:'==document.location.protocol?"s":"")+"://btg.mtvnservices.com/aria/fwadmanager.js");}catch(e){}
this.init=function(playerObj){var _btgAds=mtvn.btg.html5.ads;_btgAds.AdLoader.init(playerObj);_btgAds.EventMediator.playerLoad(playerObj);}}
mtvn.btg.html5.ads.EventMediator={playerObj:null,playerLoad:function(object){this.playerObj=object;if(this.playerObj&&this.playerObj.addEventListener){this.playerObj.addEventListener('ON_ERROR',mtvn.btg.html5.ads.AdLoader.onError);}}}
mtvn.btg.html5.reporting.EventMediator={playerObj:null,playerLoad:function(object){this.playerObj=object;if(this.playerObj&&this.playerObj.addEventListener){mtvn.btg.html5.reporting.Reporter.onLoad();this.playerObj.addEventListener('PLAY',mtvn.btg.html5.reporting.Reporter.onPlay);this.playerObj.addEventListener('PLAYING',mtvn.btg.html5.reporting.Reporter.onPlaying);this.playerObj.addEventListener('PAUSE',mtvn.btg.html5.reporting.Reporter.onPause);this.playerObj.addEventListener('SEEK',mtvn.btg.html5.reporting.Reporter.onSeek);this.playerObj.addEventListener('END',mtvn.btg.html5.reporting.Reporter.onEnd);this.playerObj.addEventListener('RESIZE',mtvn.btg.html5.reporting.Reporter.onResize);this.playerObj.addEventListener('ERROR',mtvn.btg.html5.reporting.Reporter.onError);}}}
mtvn.btg.html5.reporting.MetaDataVO={btgIsStr:mtvn.btg.util.String.isDefined,btgGv:mtvn.btg.globalvars,btgHtml5Rep:mtvn.btg.html5.reporting,vo:{MetaData:{},Omniture:{enabled:"",account:"",metadata:""},ComScore:{primaryId:"",producerId:"",locationId:"",genreId:"",playerUrl:"",videoTitle:"",referrer:""},Nielsen:{clientId:"",videoCensusId:""},QuantCast:{publisherId:""},FreeWheel:{enabled:true,networkId:82125,profileId:"MTVN_Live_HTML5",assetId:"html5_video",siteSection:"",displayBase:"playerView",minTimeBtwAds:90}},configJson:{},mediagen:{},html5Player:null,init:function(playerObj){this.html5Player=playerObj;reportSettings=this.configJson.reportSettings;this.setMetadata();this.vo.referrer=(this.btgIsStr(this.configJson.referrer)?this.configJson.referrer:(this.btgGv.IS_TOP_ACCESSIBLE?top.location.host:false));metadata=this.btgHtml5Rep.MetaDataVO.vo.MetaData;if(metadata.item.length>1){this.vo.FreeWheel.assetId=metadata.item[0].group["playlist_uri"];}else
this.vo.FreeWheel.assetId=metadata.item[this.html5Player.currentIndex].guid;OmnitureVO=reportSettings.videoReporter;comscoreVO=reportSettings.comScore;quantcastVO=reportSettings.quantCast;nilesenVO=reportSettings.nielsenReporter;freewheelVO={};freewheelVO.enabled=(this.btgIsStr(this.configJson.freeWheel)&&typeof this.configJson.freeWheel.enabled=='boolean'?this.configJson.freeWheel.enabled:this.vo.FreeWheel.enabled);freewheelVO.assetId=(this.btgIsStr(this.configJson.freeWheel)&&this.btgIsStr(this.configJson.freeWheel.assetId)?this.configJson.freeWheel.assetId:this.vo.FreeWheel.assetId);freewheelVO.siteSection=(this.btgIsStr(this.configJson.freeWheel)&&this.btgIsStr(this.configJson.freeWheel.siteSection)?this.configJson.freeWheel.siteSection:this.vo.FreeWheel.siteSection);freewheelVO.networkId=(this.btgIsStr(this.configJson.freeWheel)&&this.btgIsStr(this.configJson.freeWheel.networkId)?this.configJson.freeWheel.networkId:this.vo.FreeWheel.networkId);freewheelVO.profileId=(this.btgIsStr(this.configJson.freeWheel)&&this.btgIsStr(this.configJson.freeWheel.profileId)?this.configJson.freeWheel.profileId:this.vo.FreeWheel.profileId);freewheelVO.displayBase=(this.btgIsStr(this.configJson.freeWheel)&&this.btgIsStr(this.configJson.freeWheel.displayBase)?this.configJson.freeWheel.displayBase:this.vo.FreeWheel.displayBase);freewheelVO.minTimeBtwAds=(this.btgIsStr(this.configJson.freeWheel)&&this.btgIsStr(this.configJson.freeWheel.minTimeBtwAds)?this.configJson.freeWheel.minTimeBtwAds:this.vo.FreeWheel.minTimeBtwAds);if(OmnitureVO){this.vo.Omniture.enabled=(OmnitureVO["enabled"].toString()==="true");this.vo.Omniture.account=OmnitureVO.networkAccount;(OmnitureVO.dataCenter&&OmnitureVO.dataCenter.length!="false")?this.vo.Omniture.dataCenter=OmnitureVO.dataCenter:this.vo.Omniture.dataCenter="2o7";this.vo.Omniture.metadata=metadata;}
this.vo.FreeWheel.enabled=freewheelVO.enabled;this.vo.FreeWheel.networkId=freewheelVO.networkId;this.vo.FreeWheel.profileId=freewheelVO.profileId;this.vo.FreeWheel.assetId=freewheelVO.assetId;this.vo.FreeWheel.siteSection=freewheelVO.siteSection;this.vo.FreeWheel.minTimeBtwAds=freewheelVO.minTimeBtwAds;if(comscoreVO){this.vo.ComScore.enabled=false;this.vo.ComScore.primaryId=comscoreVO.primaryId;this.vo.ComScore.producerId=(this.btgIsStr(comscoreVO.producerId)?comscoreVO.producerId:"");this.vo.ComScore.locationId=(this.btgIsStr(comscoreVO.locationId)?comscoreVO.locationId:"");this.vo.ComScore.genreId=(this.btgIsStr(comscoreVO.genreId)?comscoreVO.genreId:"");this.vo.ComScore.playerUrl=(location.protocol+'//'+location.host+location.pathname);this.vo.ComScore.referrer=(this.btgIsStr(this.configJson.referrer)?this.configJson.referrer:(this.btgGv.IS_TOP_ACCESSIBLE?top.location.host:false));}
if(nilesenVO){this.vo.Nielsen.enabled=false;this.vo.Nielsen.clientId=nilesenVO.clientId;this.vo.Nielsen.videoCensusId=nilesenVO.videoCensusId;this.vo.Nielsen.title="";this.vo.Nielsen.streamUrl="";}
if(quantcastVO){this.vo.QuantCast.enabled=false;this.vo.QuantCast.demoTargeting=(quantcastVO.demoTargeting["enabled"].toString()==="true");this.vo.QuantCast.publisherId=quantcastVO.publisherId;this.vo.QuantCast.videoId="";this.vo.QuantCast.title="";this.vo.QuantCast.videoUrl="";this.vo.QuantCast.embedUrl="";this.vo.QuantCast.duration="";}
if(typeof metadata.item.length=='undefined'){this.btgHtml5Rep.MetaDataVO.vo.MetaData.item[0].adUrl=metadata.item.adContent;}else{var i=0;for(var item in metadata.item){this.btgHtml5Rep.MetaDataVO.vo.MetaData.item[i++].adUrl=item.adContent;}}},setMetadata:function(){var metadata={};var episode=this.html5Player.episode;metadata.feed=episode.feed;metadata.title=episode.title;metadata.description=episode.description;metadata.duration=episode.duration;metadata.currentSegment=episode.currentSegment;metadata.item=new Array();for(var i=0,len=this.html5Player.episode.segments.length;i<len;i++)
{var segment=this.html5Player.episode.segments[i];metadata.item[i]={};for(var key in segment){if(key=="metadata"){metadata.item[i].group={};for(var k in segment.metadata)
metadata.item[i].group[k]=segment.metadata[k];for(var j in segment.metadata.category)
if(!metadata.item[i].group[j]||metadata.item[i].group[j]!="")
metadata.item[i].group[j]=segment.metadata.category[j];}
else if(key!="overlays"&&key!="beacons")
metadata.item[i][key]=segment[key];}}
this.btgHtml5Rep.MetaDataVO.vo.MetaData=metadata;}}
mtvn.btg.html5.reporting.Reporter={btgHtml5Rep:mtvn.btg.html5.reporting,hasNielsen:false,hasComScore:false,hasQuantCast:false,hasOmniture:false,config:mtvn.btg.html5.reporting.MetaDataVO.vo,error:"",html5Player:null,init:function(playerObj){this.html5Player=playerObj;var isConfigDefined=mtvn.btg.util.Object.isConfigDefined;if(isConfigDefined(this.config.ComScore))
this.hasComScore=true;if(isConfigDefined(this.config.Nielsen))
this.hasNielsen=true;if(isConfigDefined(this.config.QuantCast))
this.hasQuantCast=true;if(isConfigDefined(this.config.Omniture))
this.hasOmniture=true;},onLoad:function(data){var self=mtvn.btg.html5.reporting;data=self.Reporter.setData();if(self.Reporter.hasNielsen)
self.Nielsen.sendCall('ON_LOAD',data);if(self.Reporter.hasComScore)
self.ComScore.sendCall('ON_LOAD',data);if(self.Reporter.hasQuantCast)
self.QuantCast.sendCall('ON_LOAD',data);if(self.Reporter.hasOmniture)
self.Omniture.sendCall('ON_LOAD',data);self.Labels.sendCall('ON_LOAD',data);},onPlay:function(data){},onPlaying:function(data){var self=mtvn.btg.html5.reporting;data=self.Reporter.setData();if(self.Reporter.hasNielsen)
self.Nielsen.sendCall('ON_PLAY',data);if(self.Reporter.hasComScore)
self.ComScore.sendCall('ON_PLAY',data);if(self.Reporter.hasQuantCast)
self.QuantCast.sendCall('ON_PLAY',data);if(self.Reporter.hasOmniture)
self.Omniture.sendCall('ON_PLAY',data);self.Labels.sendCall('ON_PLAY',data);},onPause:function(data){var self=mtvn.btg.html5.reporting;data=self.Reporter.setData();if(self.Reporter.hasNielsen)
self.Nielsen.sendCall('ON_PAUSE',data);if(self.Reporter.hasComScore)
self.ComScore.sendCall('ON_PAUSE',data);if(self.Reporter.hasQuantCast)
self.QuantCast.sendCall('ON_PAUSE',data);if(self.Reporter.hasOmniture)
self.Omniture.sendCall('ON_PAUSE',data);self.Labels.sendCall('ON_PAUSE',data);},onSeek:function(data){var self=mtvn.btg.html5.reporting;data=self.Reporter.setData();if(self.Reporter.hasNielsen)
self.Nielsen.sendCall('ON_SEEK',data);if(self.Reporter.hasComScore)
self.ComScore.sendCall('ON_SEEK',data);if(self.Reporter.hasQuantCast)
self.QuantCast.sendCall('ON_SEEK',data);if(self.Reporter.hasOmniture)
self.Omniture.sendCall('ON_SEEK',data);self.Labels.sendCall('ON_SEEK',data);},onResize:function(data){var self=mtvn.btg.html5.reporting;data=self.Reporter.setData();if(self.Reporter.hasNielsen)
self.Nielsen.sendCall('ON_RESIZE',data);if(self.Reporter.hasComScore)
self.ComScore.sendCall('ON_RESIZE',data);if(self.Reporter.hasQuantCast)
self.QuantCast.sendCall('ON_RESIZE',data);if(self.Reporter.hasOmniture)
self.Omniture.sendCall('ON_RESIZE',data);},onEnd:function(data){var self=mtvn.btg.html5.reporting;data=self.Reporter.setData();if(self.Reporter.hasNielsen)
self.Nielsen.sendCall('ON_END',data);if(self.Reporter.hasComScore)
self.ComScore.sendCall('ON_END',data);if(self.Reporter.hasQuantCast)
self.QuantCast.sendCall('ON_END',data);if(self.Reporter.hasOmniture)
self.Omniture.sendCall('ON_END',data);self.Labels.sendCall('ON_END',data);},onError:function(data){var self=mtvn.btg.html5.reporting;var error=(data&&data.data?data.data.msg:"");if(error!=""&&(self.error!=error)){self.error=error;new mtvn.btg.util.Alert(error);}
if(self.Reporter.hasNielsen)
self.Nielsen.sendCall('ON_ERROR',data);if(self.Reporter.hasComScore)
self.ComScore.sendCall('ON_ERROR',data);if(self.Reporter.hasQuantCast)
self.QuantCast.sendCall('ON_ERROR',data);if(self.Reporter.hasOmniture)
self.Omniture.sendCall('ON_ERROR',data);self.Labels.sendCall('ON_ERROR',data);},setData:function(){if(typeof this.btgHtml5Rep.Reporter.html5Player!='undefined'&&this.btgHtml5Rep.Reporter.html5Player!=null){var data=this.btgHtml5Rep.Reporter.html5Player.episode.segments[this.btgHtml5Rep.Reporter.html5Player.currentIndex];data.index=this.btgHtml5Rep.Reporter.html5Player.currentIndex;if(mtvn.btg.html5.ads.AdLoader.isAdPlaying)
data.isAd=true;else
data.isAd=false;return data;}else return{};}}
mtvn.btg.html5.reporting.ReportingManager=new function(){var config;this.init=function(playerObj){var _btgRep=mtvn.btg.html5.reporting;_btgRep.MetaDataVO.init(playerObj);_btgRep.Reporter.init(playerObj);_btgRep.EventMediator.playerLoad(playerObj);}}
mtvn.btg.html5.reporting.ComScore={sendCall:function(_event,_data){if(_event!="ON_PLAY")return;var vo=mtvn.btg.html5.reporting.MetaDataVO.vo;var _beacon_url=(document.location.protocol=='https:'?'https://sb':'http://b')+"b.scorecardresearch.com/beacon.js";var _beacon_data={c1:1,c2:vo.ComScore.primaryId,c3:vo.ComScore.producerId,c4:vo.ComScore.locationId,c5:vo.ComScore.genreId,c6:'',c7:vo.playerURL,c8:_data.isAd?"VIDEO_AD":_data.title,c9:vo.ComScore.referrer?vo.ComScore.referrer:"NO_REF"}
var _beacon=new mtvn.btg.util.Beacon(_beacon_url);_beacon.setData(_beacon_data);_beacon.send();}};mtvn.btg.html5.reporting.Labels=new function(){var _btgU=mtvn.btg.util;var _btgIsObj=_btgU.Object.isDefined;var curTimePlayed=0;var prevTimePlayed=0;var timerObj=null;var playStarted;var previousType="none";var currentType="none";var labelsBeaconHost="viamtvnvideo.112.2o7.net";var mediagen;var beaconsArray=[];var doneCounter=0;var labelBeacons=[];var initCalled=false;this.init=function(a_data){var _isStr=_btgU.String.isDefined;currentType=(_btgIsObj(a_data)&&a_data.isAd===true)?"ad":"notAd";mediagen=mtvn.btg.html5.reporting.MetaDataVO.configJson.mediagen;try{if(typeof(mediagen)!="undefined"){beaconsArray=mediagen.video.item[0].beacons.beacon;}}
catch(e){}
for(var i=0,len=beaconsArray.length;i<len;i++){var url=beaconsArray[i].url;if(_isStr(url)&&url.indexOf(labelsBeaconHost)>-1){var timeToFire=parseInt(beaconsArray[i].elapsed);if(!isNaN(timeToFire)){var eaa=beaconsArray[i].elapsedAfterAd;var shouldFire=false;if(!_isStr(eaa)){shouldFire=true;}
else if((currentType=="ad"&&eaa=="true")||(currentType!="ad"&&eaa=="false")){shouldFire=true;}
if(shouldFire===true){var rnd=_btgU.Math.random(1000000,9999999);url=url.replace("{ord}",rnd);labelBeacons[labelBeacons.length]={"url":url,"timeToFire":timeToFire,"enabled":true};}}}}};this.sendCall=function(a_event,a_data){if(a_event=="ON_PLAY"){if(!initCalled){this.init(a_data);initCalled=true;}
if(_btgIsObj(a_data)&&a_data.isAd!=true){this.startTimer();}}
else if(a_event=="ON_PAUSE"||a_event=="ON_SEEK"||a_event=="ON_ERROR"||a_event=="ON_END"){this.stopTimer();}};this.checkTime=function(){var playNow=new Date().getTime();curTimePlayed=parseInt(playNow)-parseInt(playStarted);var totalTimePlayed=parseInt((parseInt(prevTimePlayed)+parseInt(curTimePlayed))/1000);for(var i=0,len=labelBeacons.length;i<len;i++){if((totalTimePlayed>=labelBeacons[i].timeToFire)&&labelBeacons[i].enabled==true){labelBeacons[i].enabled=false;doneCounter++;var beacon=new _btgU.Beacon(labelBeacons[i].url);beacon.send();}}
if(doneCounter>=labelBeacons.length){this.stopTimer();}};this.startTimer=function(){this.stopTimer();playStarted=new Date().getTime();var tmpObj=this;var tmpFunc=function(){tmpObj.checkTime();};timerObj=setInterval(tmpFunc,1000);};this.stopTimer=function(){clearInterval(timerObj);timerObj=null;prevTimePlayed+=parseInt(curTimePlayed);curTimePlayed=0;};};mtvn.btg.html5.reporting.Nielsen={btgIsStr:mtvn.btg.util.String.isDefined,btgIsObj:mtvn.btg.util.Object.isDefined,url:"http://secure-us.imrworldwide.com/cgi-bin/m",callData:{},nielsenVo:mtvn.btg.html5.reporting.MetaDataVO.vo.Nielsen,videoRecord:mtvn.btg.html5.reporting.MetaDataVO.vo.VideoRecord,sendCall:function(a_event,a_data){this.callData=a_data;if(this.btgIsStr(a_event)&&a_event.toUpperCase()=="ON_PLAY"){var beaconData=this.getBeaconData();if(this.btgIsStr(beaconData.ci)){var beacon=new mtvn.btg.util.Beacon(this.url);beacon.setData(beaconData);beacon.send();}}},getBeaconData:function(){var retVal={};retVal.ci=this.getClientId();retVal.c6=this.getVideoCensusId();retVal.cc=1;retVal.ou=this.getStreamUrl();retVal.sd=this.getDuration();retVal.tl=this.getVideoTitle();retVal.rnd=new Date().getTime();return retVal;},getDuration:function(){var retVal="";if(this.btgIsObj(this.videoRecord)&&this.btgIsStr(this.videoRecord.duration)){retVal=this.videoRecord.duration;}
return retVal;},getVideoTitle:function(){var retVal="";if(this.btgIsObj(this.callData)&&this.btgIsStr(this.callData.title)){retVal=this.callData.title;}
else if(this.nielsenVo&&this.btgIsStr(this.nielsenVo.title)){retVal=this.nielsenVo.title;}
if(this.btgIsStr(retVal)){retVal="dav0-"+retVal;}
return retVal;},getStreamUrl:function(){var retVal="";if(this.btgIsObj(this.callData)&&this.btgIsStr(this.callData.streamUrl)){retVal=this.callData.streamUrl;}
else if(this.nielsenVo&&this.btgIsStr(this.nielsenVo.streamUrl)){retVal=this.nielsenVo.streamUrl;}
return retVal;},getClientId:function(){var retVal="";if(this.btgIsObj(this.callData)&&this.btgIsStr(this.callData.clientId)){retVal=this.callData.clientId;}
else if(this.nielsenVo&&this.btgIsStr(this.nielsenVo.clientId)){retVal=this.nielsenVo.clientId;}
return retVal;},getVideoCensusId:function(){var retVal="";if(this.btgIsObj(this.callData)&&this.btgIsStr(this.callData.videoCensusId)){retVal=this.callData.videoCensusId;}
else if(this.nielsenVo&&this.btgIsStr(this.nielsenVo.videoCensusId)){retVal=this.nielsenVo.videoCensusId;}
return retVal;}}
mtvn.btg.html5.reporting.Omniture={SegmentPlayed:-1,sendCall:function(_event,_data){var isStr=mtvn.btg.util.String.isDefined;if(_event!="ON_PLAY")return;itemIndex=0;if(_data.isAd)return;if(typeof _data.index!='undefined'&&_data.index!=null)itemIndex=_data.index;if(itemIndex==this.SegmentPlayed){return;}else{this.SegmentPlayed=itemIndex;}
var btgRep=mtvn.btg.html5.reporting;var vo=btgRep.MetaDataVO.vo;var _guid=vo.Omniture.metadata.item[itemIndex].guid;var _guid_parts=vo.Omniture.metadata.item[itemIndex].guid.split(":");var _videoID=_guid_parts[4];var _account=vo.Omniture.account;var _pagename="video/net/"+vo.Omniture.metadata.item[itemIndex].title+"_"+_videoID;var _videoTitle=vo.Omniture.metadata.item[itemIndex].title+"_"+_videoID;var _videoType=vo.Omniture.metadata.item[itemIndex].group.content_type;var _mtvnOwner=vo.Omniture.metadata.item[itemIndex].group.mtvnOwner;var _videoType_title=_videoType+" : "+_videoTitle;var _franchise=vo.Omniture.metadata.item[itemIndex].group.franchise;var _artist=vo.Omniture.metadata.item[itemIndex].group.artist;var _playlist=(isStr(vo.Omniture.metadata.item[itemIndex].group.playlist_title)?vo.Omniture.metadata.item[itemIndex].group.playlist_title:vo.Omniture.metadata.item[itemIndex].title);var _id_franchise_type=_videoID+" : "+_franchise+" : "+_videoType;var _franchise_content_type=_franchise+" : "+_videoType;var _applicationContext=(isStr(btgRep.MetaDataVO.configJson.referrer)?btgRep.MetaDataVO.configJson.referrer:"CONTEXT_UNSET");var _applicationOrig=(isStr(btgRep.MetaDataVO.configJson.orig)?btgRep.MetaDataVO.configJson.orig:"ORIGIN_UNSET");var _applicationName=btgRep.MetaDataVO.configJson.reportSettings.playerInfo.networkPlayerName;var _agreement=vo.Omniture.metadata.item[itemIndex].agreement;var _agreementId=vo.Omniture.metadata.item[itemIndex].group.agreementId;var _isReportable=!(vo.Omniture.metadata.item[itemIndex].group.reportable.toString().toLowerCase()=="false");if(!_isReportable){return;}
var btgOmn=mtvn.btg.config.ReportSettings.Omniture;var _tempPageViewEvent=btgOmn.pageViewEvent;btgOmn.pageViewEvent="";var _omniture=mtvn.btg.reporting.ReportingManager.getOmniture();_omniture.sendPageCall({un:_account,pageName:_pagename,prop1:_agreement,prop3:_agreementId,eVar26:_franchise,eVar27:_mtvnOwner,eVar28:_videoType,eVar29:_artist,eVar30:_applicationContext,eVar31:_applicationName,eVar32:_applicationOrig,eVar33:_videoTitle,eVar34:_playlist,prop35:_id_franchise_type,prop30:_guid,prop36:_franchise,prop38:_mtvnOwner,prop43:_playlist,prop45:_videoType,prop46:_artist,prop47:_applicationContext,prop48:_applicationName,prop49:_applicationOrig,prop50:_videoTitle,events:'event15'});btgOmn.pageViewEvent=_tempPageViewEvent;}};mtvn.btg.html5.reporting.QuantCast={btgGv:mtvn.btg.globalvars,btgIsStr:mtvn.btg.util.String.isDefined,btgStr:mtvn.btg.util.String,btgIsObj:mtvn.btg.util.Object.isDefined,loadQcScripts:function(){try{var elem=document.createElement('script');elem.src=(document.location.protocol=="https:"?"https://secure":"http://edge")+".quantserve.com/quant.js";elem.async=true;elem.type="text/javascript";var scpt=document.getElementsByTagName('script')[0];scpt.parentNode.insertBefore(elem,scpt);elem=document.createElement('script');elem.src=(document.location.protocol=="https:"?"https://secure":"http://edge")+".quantserve.com/vquant.js";elem.async=true;elem.type="text/javascript";scpt=document.getElementsByTagName('script')[0];scpt.parentNode.insertBefore(elem,scpt);_qevents=(typeof _qevents!='undefined')||[];_qvideos=(typeof _qvideos!='undefined')||[];}catch(e){};}(),callData:"",qc:mtvn.btg.html5.reporting.MetaDataVO.vo.QuantCast,metaData:mtvn.btg.html5.reporting.MetaDataVO.vo.MetaData,sendCall:function(a_event,a_data){if(a_event=="ON_LOAD"){this.callData=a_data;var qcData={pageURL:(this.btgGv.IS_TOP_ACCESSIBLE)?top.location.href:self.location.href,qacct:this.getPublisherId(),videoId:this.getVideoId(),videoElementId:this.getVideoElementId(),videoTitle:this.getVideoTitle(),videoUrl:this.getVideoUrl(),embedUrl:this.getEmbedUrl(),media:this.getMediaValue(),group:this.getMediaValue(),uri:this.getUri(),labels:this.getLabelsHierarchy()};try{_qvideos.push(qcData);}catch(e){};}},getUri:function(){var retVal="";var currentIndex=parseInt(this.callData.currentItem);if(!isNaN(currentIndex)){var item=this.getItem(currentIndex);if(this.btgIsStr(item.guid)){retVal=item.guid;}}
return retVal;},getPublisherId:function(){var retVal="p-94wNw88f65Rhk";if(this.qc.publisherId&&this.btgIsStr(this.qc.publisherId)){retVal=this.qc.publisherId;}
if(this.callData&&this.btgIsStr(this.callData.publisherId)){retVal=this.callData.publisherId;}
return retVal;},getVideoElementId:function(){var retVal="videoView";if(this.qc.videoElementId&&this.btgIsStr(this.qc.videoElementId)){retVal=this.qc.videoElementId;}
if(this.callData&&this.btgIsStr(this.callData.videoElementId)){retVal=this.callData.videoElementId;}
return retVal;},getVideoId:function(){var retVal="";if(this.qc.videoId&&this.btgIsStr(this.qc.videoId)){retVal=this.qc.videoId;}
if(this.callData&&this.btgIsStr(this.callData.videoId)){retVal=this.callData.videoId;}
return retVal;},getVideoUrl:function(){var retVal="";if(this.qc.videoUrl&&this.btgIsStr(this.qc.videoUrl)){retVal=this.qc.videoUrl;}
if(this.callData&&this.btgIsStr(this.callData.videoUrl)){retVal=this.callData.videoUrl;}
return retVal;},getEmbedUrl:function(){var retVal=(this.btgGv.IS_TOP_ACCESSIBLE)?top.location.hostname:self.location.hostname;if(this.qc.embedUrl&&this.btgIsStr(this.qc.embedUrl)){retVal=this.qc.embedUrl;}
if(this.callData&&this.btgIsStr(this.callData.embedUrl)){retVal=this.callData.embedUrl;}
return retVal;},getMediaValue:function(){var retVal="";if(this.getMediaType()=="contentvideo"){retVal="video";}
else if(this.getMediaType()=="musicvideo"){retVal="music";}
return retVal;},getDartSite:function(){var retVal=this.btgStr.getBetween(this.getAdUrl(),"/pfadx/","/");if(this.callData&&this.btgIsStr(this.callData.dartSite)){retVal=this.callData.dartSite;}
if(this.btgIsStr(retVal)){retVal=retVal.replace(/\./,"_");}
else{retVal="NA";}
return retVal;},getAdUrl:function(){var retVal="";var item=this.getItem();if(this.btgIsObj(item)&&this.btgIsStr(item.adUrl)){retVal=item.adUrl;}
if(this.callData&&this.btgIsStr(this.callData.adUrl)){retVal=this.callData.adUrl;}
return retVal;},getItemGroup:function(){var retVal;var item=this.getItem();if(this.btgIsObj(item)&&this.btgIsObj(item.group)){retVal=item.group;}
return retVal;},getItem:function(a_index){var retVal;a_index=parseInt(a_index);if(isNaN(a_index)){a_index=0;}
if(this.metaData.item){if(this.metaData.item.length){if(this.metaData.item.length>=1){retVal=this.metaData.item[a_index];}}
else{retVal=this.metaData.item;}}
return retVal;},getMode:function(){return this.btgStr.getBetween(this.getAdUrl(),"mode=",";");},getMediaType:function(){return this.btgStr.getBetween(this.getAdUrl(),"mtype=",";");},getGenre:function(){return this.btgStr.getBetween(this.getAdUrl(),"genre=",";");},getArtistName:function(){var retVal="NA";var group=this.getItemGroup();if(this.btgIsObj(group)&&this.btgIsStr(group.categoryArtist)){retVal=group.categoryArtist;}
return retVal;},getVideoTitle:function(a_defaultVal){var retVal=this.btgIsStr(a_defaultVal)?a_defaultVal:"";if(this.qc.title&&this.btgIsStr(this.qc.title)){retVal=this.qc.title;}
if(this.callData&&this.btgIsStr(this.callData.title)){retVal=this.callData.title;}
return retVal;},getFranchise:function(){var retVal="NA";var group=this.getItemGroup();if(this.btgIsObj(group)&&this.btgIsStr(group.categoryFranchise)){retVal=group.categoryFranchise;}
return retVal;},getPlaylistTitle:function(){var retVal="PLAYLIST_TITLE_UNSET";var group=this.getItemGroup();if(this.btgIsObj(group)&&this.btgIsStr(group.categoryPlaylistTitle)){retVal=group.categoryPlaylistTitle;}
else if(this.btgIsObj(this.metaData)&&this.btgIsStr(this.metaData.title)){retVal=this.metaData.title;}
return retVal;},getLabelsHierarchy:function(){var retVal="";var labelHierarchy=['Viacom Global Digital Network','MTVN Digital Ad Sales','Content','Video',this.getDartSite()];if(this.getMediaType()=="contentvideo"&&this.getMode()=="episode"){labelHierarchy.push("Full Episodes");labelHierarchy.push(this.getFranchise());labelHierarchy.push(this.getVideoTitle("NA"));}
else if(this.getMediaType()=="musicvideo"){labelHierarchy.push("Music Videos");if(this.btgIsStr(this.getGenre())){labelHierarchy.push("Grouped by Genre");labelHierarchy.push(this.getGenre());labelHierarchy.push(this.getArtistName());labelHierarchy.push(this.getVideoTitle("NA"));}
else{labelHierarchy.push("Grouped by Artist");labelHierarchy.push(this.getArtistName());labelHierarchy.push(this.getVideoTitle("NA"));}}
else if(this.getMediaType()=="contentvideo"){labelHierarchy.push("Clips");labelHierarchy.push(this.getFranchise());if(this.getPlaylistTitle()!="PLAYLIST_TITLE_UNSET"){labelHierarchy.push("Grouped by Playlist");labelHierarchy.push(this.getPlaylistTitle());labelHierarchy.push(this.getVideoTitle("NA"));}
else{labelHierarchy.push("Grouped by Clip");labelHierarchy.push(this.getVideoTitle("NA"));}}
retVal=labelHierarchy.join(".");return retVal;}}
mtvn.btg.config.ReportSettings={
defaultPageName:mtvn.btg.globalvars.PAGE_URL,
Omniture:{
enabled: true,
account: (typeof com_mtvi_mtv2flag!="undefined"&&com_mtvi_mtv2flag==true?'viamtv,viamtv2onmtv':'viamtv'),
cName: '',
charSet: 'ISO-8859-1',
dynamicAccountSelection: 'true',
dynamicAccountList: 'devviamtv=mtv-d,mtv-q,mtv-jd,mtv-jq,mtvx-d,mtvx-jd',
linkInternalFilters: 'javascript:,',
videoViewEventDisable: false,
enableTimeParting: true,
trackInlineStats: true,
defaultHier: 'hier2',
enableVisitorNamespace: 'false',
enableMtvnVisitorGuid: false,
enableMeteorPlugin: false,
enableGuidPlugin: false,
enableGuidAuxiliaryCall: true,
enableFirstPartyCookie: false,
timezone: '-5'
},
Nielsen:{
enabled: false,
cid: 'us-400235',
videoCensusId: 'c02'
},
GoogleAnalytics:{
enabled: false,
account: '',
reportMode: '' // iframe/direct
},
QuantCast:{
enabled: true,
labels: 'MTVN Music and Logo Domestic,MTVN Music,MTVN Global Digital Proper,MTVN Global Digital Network,MTVN Digital Tribes,MTV Site,MTV plus Generation,MTV Digital,MTVN Music and Logo Global Network,MTVN Music and Logo Global Proper,MTVN Music and Logo Tribes',
reportMode: 'ads' //direct/ads
},
ComScore:{
enabled: true,
c2:	'6036034'
},
Meteor:{
enabled:false,
applicationId:"",
multiDomain:false
},
ChoiceStream:{
enabled:true,
apiKey: "04d9f3470c432938",
profileId:"1280552002.1191903563"
}
};
mtvn.btg.config.AdSettings={
DoubleClick:{
enabled: true,
dartSite: 'mtv.mtvi'
},
International:{
enabled: false,
dartSite: ''
},
QuantCast:{ 
enabled: true
},
FreeWheel:{ 
enabled: false,
type: 'MRM'
}

};

MTV.BTG = new function(){
var self = this;
var loc = location.pathname;
this.autoDcopt = true;
/* temp code to support old survey tag */
this.writeSurveyTag = function(dcCallWithPlaceholders){
var keyVals="";
if (MTVN.Ads.sections == ''){
path = loc;
}else{
path = MTVN.Ads.sections;
}
if(location.pathname.substr(-6) == ".jhtml"){
path = path.substr(0,path.length-6);
}
var parts=path.split("/");
parts = parts.splice(1);
for(var i=0; i < parts.length; i++){
keyVals += "sec" + i + "=" + parts[i] +";";
}
keyVals = keyVals.substr(0,keyVals.length-1); //remove trailing semi-colon
var dcCall = dcCallWithPlaceholders.replace(/\{pageValsParam\}/, keyVals );
dcCall = dcCall.replace(/\{ord\}/, Math.random() * 1000000000000000000);
var surveyScript = '<ifr' + 'ame src="' + dcCall + '?" width="1" height="1"><\/ifr'+'ame>';
document.write(surveyScript);
};
this.init = function(){
MTVN.Ads.handleAdditionalValues();
mtvn.btg.config.AdSettings.DoubleClick.keyValues = MTVN.Ads.additionalValues.replace("Gracenote", "gn");
if(MTVN.Ads.dartSite.length > 0){
mtvn.btg.config.AdSettings.DoubleClick.dartSite = MTVN.Ads.dartSite;
}
if(MTVN.Ads.sections.length > 0){
mtvn.btg.config.AdSettings.DoubleClick.sections = MTVN.Ads.sections;
}
mtvn.btg.config.AdSettings.DoubleClick.positionThreshold="2";
mtvn.btg.config.AdSettings.DoubleClick.autoDcopt=self.autoDcopt;
mtvn.btg.config.ReportSettings.indexFileName = "index.jhtml";
mtvn.btg.config.ReportSettings.Omniture.trackExternalLinks = true; 
mtvn.btg.config.ReportSettings.Omniture.videoViewEventDisable = true;
if(typeof com_mtvi_mtv2flag!="undefined" && com_mtvi_mtv2flag==true){
mtvn.btg.config.ReportSettings.Omniture.account = 'viamtv,viamtv2onmtv';
}
if(typeof com_mtvi_attpostedflag!="undefined" && com_mtvi_attpostedflag==true){
mtvn.btg.config.ReportSettings.Omniture.account = 'viamtv,viaposted';
}
if(typeof com_mtvi_unpluggedflag!="undefined" && com_mtvi_unpluggedflag==true){
mtvn.btg.config.ReportSettings.Omniture.account = 'viamtv,viaunplugged';
mtvn.btg.config.ReportSettings.Meteor.enabled = true;
mtvn.btg.config.ReportSettings.Meteor.applicationId = 'daa24ac1-b446-4e94-8d51-c9f0dac0cd89';
mtvn.btg.config.ReportSettings.Meteor.multiDomain = true;
}
if(typeof com_mtvi_omaflag!="undefined" && com_mtvi_omaflag==true){
mtvn.btg.config.ReportSettings.Omniture.account = 'viaoma';
}
if(typeof com_mtvi_vmaflag!="undefined" && com_mtvi_vmaflag==true){
mtvn.btg.config.ReportSettings.Omniture.account = 'viamtv,viamtvvma2005';
}
mtvn.btg.Controller.init();
MTV.BTG.observeDailyFreshClicks();
}
this.observeDailyFreshClicks = function(){
// make sure the DOM is loaded
$j(function(){
// for each feed-wrap - THERE SHOULD ONLY BE ONE
$j('.feed-wrap').each(function(){
var feed_wrap = $j(this);
// add click events to all links within promo modules
feed_wrap.find('.mdl.mdl-rich').each(function(){
var promo = $j(this);
var id = promo.attr('id').replace(/:/g, '/') + '.xml';
promo.find('a').click(function(){
// report click to CODA
// http://confluence.mtvi.com/display/BUSTECH/CODA+Link+Events
mtvn.btg.Controller.sendLinkEvent({
linkName : 'HP:FEED:' + id,
linkType : 'o'
});

return true;
});
});
// add click events to pagination
feed_wrap.find('.feedPagination a').click(function(){
var page_index = parseInt($j(this).text());
// report click to CODA
// http://confluence.mtvi.com/display/BUSTECH/CODA+Link+Events
mtvn.btg.Controller.sendLinkEvent({
linkName : 'HP:FEED:PAGINATION:' + page_index,
linkType : 'o'
});
});
});

})
}
this.setPageUrl = function(pageUrl){
if (pageUrl.charAt(0) != "/") pageUrl = "/" + pageUrl;
var str = "/news/photos/";
if(pageUrl.substr(0,str.length) == str){
pageUrl = pageUrl.replace(/\/news\/photos\/.\//, str);
}
var adPageUrl = pageUrl
.replace(/movieawards/, 'ma')
.replace(/onair|ontv/i, 'shows')
.replace(/home\/index.jhtml/i, '_hp')
.replace(/main\/index.jhtml/i, '_mn');
if (MTVN.Ads.sections == '') MTVN.Ads.sections = adPageUrl;
MTV.Reporting.setPageName(pageUrl);
}
this.pageOverride = function(){
if (arguments.length > 0){
loc = loc.replace(arguments[0], arguments[1]);
}
var overrides = ["/news/articles/", "/movies/news/articles/"]; 
if(loc.substr(0,overrides[0].length) == overrides[0]){
loc = loc.replace(/\/news\/articles\/\d*\/\d*\//, overrides[0]);
}
if(loc.substr(0,overrides[1].length) == overrides[1]){
loc = loc.replace(/\/movies\/news\/articles\/\d*\//, overrides[1]);
}
self.setPageUrl(loc);
}
}
MTV.Reporting = new function(){
var self = this;
var temp;
var isDefined = function(val){
return !(typeof val == 'undefined');
}
this.dispatcherAttributes = "";
this.qs = mtvn.btg.util.String.queryStringToObject(window.location.search);
this.map ={
artist: "prop1",
fullBlogName: "prop10",
vidOrigin: "prop12",
partner: "prop16",
source: "prop17",
story: "prop18",
storyDate: "prop19",
author: "prop20",
vertical: "prop26",
rollUp: "prop28",
bps: "prop24",
fla: "prop25",
betaUsage: "prop34",
gamename: "prop23",
contentType: "prop37",
event: function(val){
if (self.eventNames.join(",").search(val) > 0)
self.data["prop44"] = val;
},
songTitle: function(val){
if(isDefined(val)){
self.temp = val;
}
},
seriesAlias: function(val){
self.data["prop15"] = val;
}
}
this.eventNames = ['ma08','ma09','maYAH','VMA','woodiesYAH','woodies','ma10','att10','fashionweek','grammys','oscars','MovieAwards','lollapalooza2011'];
this.data ={
eVar35:(self.qs.cmp?self.qs.cmp:null)	
};
this.setPageName = function(val){
//replace ontv with onair in ontv urls, Evan Rose 3/18/10 
var newPagenameVal = val
.replace(/ontv/i, 'onair');
self.data.pageName = newPagenameVal;
}
//External Campaign Tracking (SHOULD BE REMOVED WHEN THE NEW USVR IS DEPLOYED!!!)
if(typeof self.qs.sem=="string") mtvn.btg.reporting.campaign = self.qs.sem;
else if(typeof self.qs.extcmp=="string") mtvn.btg.reporting.campaign = self.qs.extcmp;
else mtvn.btg.reporting.campaign = "";
self.data["prop42"] = mtvn.btg.reporting.campaign;
self.data["campaign"] = mtvn.btg.reporting.campaign;
//End External Campaign Tracking

this.report = function(){
self.addAttributes(self.dispatcherAttributes);
self.addAttributes(MTVN.Ads.additionalValues, false);
mtvn.btg.Controller.sendPageCall(self.data);
}
this.addAttributes = function(aString, aPassThru){
if (aString.length < 1)
return false;

var passThru = ((typeof aPassThru != 'undefined')? aPassThru: true);
var attrs = aString.split(";");
for (var i=0; i < attrs.length; i++){
if(attrs[i]!=""){
var pair = attrs[i].split("=");	
if(typeof self.map[pair[0]] != 'undefined'){
if (typeof self.map[pair[0]] == 'string'){
self.data[self.map[pair[0]]] = pair[1];
} else{
self.map[pair[0]](pair[1]);
}
} else{
if(passThru){
self.data[pair[0]] = pair[1];
}
}
}
}
}
this.reportIMX = function(tagUrl, protocol, params){
var imxTag = new Image();
if ((protocol=="flipbook" && !(document.referrer.indexOf("fid="+params) > -1)) || (protocol != 'flipbook')){
imxTag.src = tagUrl;
}
}
}

MTV.Apps = new function(){}

MTV.Apps.Mamabar = new function(){
this.configObj;

this.init = function(){
if(MTV.Apps.Mamabar.configObj != undefined){	
var config = MTV.Apps.Mamabar.configObj;

var attributes = "";	
if(config.search!=undefined) attributes += " search=\"" + config.search + "\"";
if(config.footer!=undefined) attributes += " footer=\"" + config.footer + "\"";
if(config.theme!=undefined) attributes += " theme=\"" + config.theme + "\"";
if(config.head!=undefined) attributes += MTV.Apps.Mamabar.makeLinksObject(config.head, "head");
if(config.footerMidCol!=undefined) attributes += MTV.Apps.Mamabar.makeLinksObject(config.footerMidCol, "foot_midcol");
if(config.footerRightCol!=undefined) attributes += MTV.Apps.Mamabar.makeLinksObject(config.footerRightCol, "foot_rightcol");

var mamabar = "<scr" + "ipt type=\"text/javascript\" src=\"/widgets/scripts/mamma.jhtml\"" + attributes + "><\/scr"+"ipt>";
document.write(mamabar);
}
}

this.makeLinksObject = function(linksObj, name){
var prop = " " + name + "=\"";
prop += "{";
if(linksObj.link instanceof Array){
for (var i=0; i < linksObj.link.length; i++){
prop += MTV.Apps.Mamabar.makeLink(linksObj.link[i]);
if(i < linksObj.link.length-1) prop += ",";
}
}
else {
prop += MTV.Apps.Mamabar.makeLink(linksObj.link);
}
prop += "}\"";
return prop;
}

this.makeLink = function(linkObj){
var link = "";
link += "'" + linkObj.content + "'";
link += ":";
link += "'" + linkObj.args + "'";
return link;
}
}

MTV.Typeahead = new function(){

var default_options = {
minChars: 1,
scrollHeight: 300,
jsonpCallback: 'mtvSearchJSONP',
matchSubset: false,
selectFirst: false,
formatItem: function(item) {
return item;
},
parse: function(data) {
var parsed = [];
$j.each(data, function(i) {
var row = $j.trim(this);
parsed[i] = { data: row, value: row, result: row }
});
return parsed;
}
};

this.init = function(){
MTV.Typeahead.autocomplete('form[name="search"] input[type="text"]');
MTV.Typeahead.autocomplete('form[name="searchF"] input[type="text"]');

}

this.autocomplete = function(selector, options, callback) {

var typehead_options = {};
$j.extend(typehead_options, default_options, options || {});

callback = callback || function(){
var input = $j(this);
/* this blows- too tied to the "search" structure */
input.closest('form').find('button.mtv').click();
};

$j(selector).each(function(){
var input = $j(this);

// we subtract the padding of the autocomplete container class here
// this is defined by .ac_results selector
if (!typehead_options['width']) {
typehead_options['width'] = parseInt(input.outerWidth()) - 8;
}

var url = "";

input.autocomplete(url, typehead_options).result(callback);
});
}
}
MTV.Search = new function(){
var SEARCH_TERM_REGEX = /q=([^&|\s]+)/;

this.init = function(){
var self = this;
var search_forms = 'form[name="search"], form[name="searchF"]';
$j(search_forms).each(function(){
self.addEventListeners(this);
self.setSearchTerm(this);
});
}

this.setSearchTerm = function(selector) {
var query_string = document.location.search;
if (query_string.length < 1) { return; }

var search_term = query_string.match(SEARCH_TERM_REGEX);
if (search_term) {
search_term = search_term[1].replace("+", " ");
search_term = unescape(search_term);
$j(selector).find('input[type="text"]').val(search_term);
}
}

this.addEventListeners = function(selector) {
var self = this;
$j(selector).each(function(){
var form = $j(this);
// deactivate submit
form.submit(function(){
return false;
});

var goButton = form.find('button.mtv');
var webButton = form.find('button.web');
var input = form.find('input[type="text"]');

// clear input on click
input.click(function(){
$j(this).val('');
return false;
});

// watch for user enter
input.keypress(function(event){
if (event.keyCode == 13) {
self.submit(input.val(), 'mtv');
return false;
}
});

// web submit
webButton.click(function(){
self.submit(input.val(), 'web');
});

// mtv submit
goButton.click(function(){
self.submit(input.val(), 'mtv');
});

});
}

this.submit = function(value, type) {
value = value.replace(/^\s*|\s(?=\s)|\s*$/g, "").toLowerCase();
value = value.replace(" ", "+");
value = escape(value);
if (value == "search" || value.length == 0) {
return false;
}

if (type == 'web') {
var msUrl ='http://search.live.com/results.aspx?q=' + value + '&amp;mkt=en-us&amp;FORM=VCM004';
var msWindow = window.open(msUrl);
com.mtvi.reporting.Dispatcher.setAttribute("eVar3","web");
com.mtvi.reporting.Dispatcher.sendLinkEvent({linkName:"MSN_Live_Search",linkType:"e",lnk:this});
}
else {
window.location = this.getBaseUrl() + '/search/?q=' + value;
}
return false;
}

this.getBaseUrl = function() {
if( window.location.hostname.match(/()/) ) return '';
else{
if( window.location.hostname.indexOf("") != -1 ) return '';
else if (window.location.hostname.indexOf("") != -1 ) return '';
else return '';
}
}
}

MTV.Player = new function(){

var navOverride;
var headerLogoLinkOverride;
var navInclude;
var franchiseLinksUrl;
var tuneInPromo;

this.init = function(){

// handle nav
if(navOverride != undefined && navInclude == undefined){

if($j("#header.franchise").length == 0) {

$j("#navlist-wrap").empty();
$j("#searchmtv, #artistlist,").remove();

// remove elements not required from the global nav and add internical styles to header structure
$j('#mtvSitesNav').remove();
$j('div.memberbarlinks').remove();
$j('#nav #mtvLogo').remove();
$j('#topnavLinks').remove();
$j('#container-inner').addClass('franchise');
$j('#header').addClass('franchise');
$j('#nav').removeClass('globalNav').addClass('franchise-navigation').addClass('franchise');
$j('#header').prepend('<a id="logo-link" href="/">mtv</a>');
$j('#nav').removeClass('hidden');

var scriptUrl = "/videos/scripts/nav.jhtml?nav="+navOverride;
$j.ajax({type: "GET", url: scriptUrl, dataType: "script", cache: true});
}

} else if(navInclude != undefined){
$j('#nav').remove();
$j("#searchmtv, #artistlist,").remove();

// remove elements not required from the global nav and add internical styles to header structure
$j('#mtvSitesNav').remove();
$j('div.memberbarlinks').remove();
$j('#nav #mtvLogo').remove();
$j('#topnavLinks').remove();
if (navInclude != "/sitewide/modules/header/geek/nav/index.jhtml")
$j('#container-inner').addClass('franchise');

if (headerLogoLinkOverride == undefined) {
$j('#header').prepend('<a id="logo-link" href="/">mtv</a>');
} else {
var headerLogoLinkOverrideUrl = headerLogoLinkOverride;
$j.get(headerLogoLinkOverrideUrl, function(data) {
$j('#header').prepend(data);
});
}

var navIncludeUrl = navInclude;

$j.get(navIncludeUrl, function(data) {
$j('#header').append(data);
});
}

$j("#searchmtv, #artistlist, #navlist-wrap").css("visibility", "visible");
$j('#nav').removeClass('hidden');

}

this.localFeedHandler = function(){
if(MTVN.Player.feed.document.navOverride!=undefined) navOverride = MTVN.Player.feed.document.navOverride;
if(MTVN.Player.feed.document.navInclude!=undefined) navInclude = MTVN.Player.feed.document.navInclude;
if(MTVN.Player.feed.document.headerLogoLinkOverride!=undefined) headerLogoLinkOverride = MTVN.Player.feed.document.headerLogoLinkOverride;
if(MTVN.Player.feed.document.franchiseLinksUrl!=undefined) franchiseLinksUrl = MTVN.Player.feed.document.franchiseLinksUrl;
if(MTVN.Player.feed.document.tuneInPromo!=undefined) tuneInPromo = MTVN.Player.feed.document.tuneInPromo;
if(MTVN.Player.feed.document.hat!=undefined) MTV.setHat("h-" + MTVN.Player.feed.document.hat);
MTV.setTheme(MTVN.Player.feed.document.theme);

// handle keywords
if(MTVN.Player.feed.document.keywords != undefined){
if(MTVN.Player.feed.document.keywords.toUpperCase().indexOf("MTV2") > -1) {

com_mtvi_mtv2flag = true;
mtvn.btg.config.ReportSettings.Omniture["prop26"] = "MTV2";

}
}

if(MTVN.Player.feed.document.mamabar!=undefined) MTV.Apps.Mamabar.configObj = MTVN.Player.feed.document.mamabar;
}

this.localModulesHandler = function(){
if(franchiseLinksUrl != undefined){
var container = $j("#franchiseLinks");
if(container.is("*")){
// get custom franchise link url
$j.get(franchiseLinksUrl, function(data){
container.append(data);
});
}
}
if(tuneInPromo != undefined){
var container = $j(".group-c");
if(container.is("*")){
// get custom franchise link url
$j.get(tuneInPromo, function(data){
container.prepend(data);
});
}
}
}
}

MTV.UI = new function(){
this.iframes = new Array();

this.initIframes = function(){
var parent_doc = parent.document;

for(var i=0; i < MTV.UI.iframes.length; i++){
// update height
var iframe = $j("#"+MTV.UI.iframes[i], parent_doc);
poll_height = $j(".iframe-mdl").height();
iframe.height(poll_height);
}
}
}

MTV.Content = new function(){}

MTV.Content.RSS = new function(){
this.open = function(obj){
var dataUrl = "/rss/xml/detail.jhtml?rssId=" + obj.id;
MTVN.UI.ModalWindow.open(dataUrl, obj.id);
}
}

MTV.Content.Rhapsody = new function(){

/***** ARTIST PAGE TOP SONGS MODULE *****/
this.getRhapTracksRSS = function (xmlstring) {
var xmlDoc;
var parser;
try //Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.loadXML(xmlstring);
}
catch(e)
{
try //Firefox, Mozilla, Opera, etc.
{
parser=new DOMParser();
xmlDoc=parser.parseFromString(xmlstring,"text/xml");
}
catch(e) {}
}
try 
{ 
var trackValTop = "";
var trackValDesc = "";
var trackVal = "";
var songSlat = "";

for (var i=0; i < xmlDoc.getElementsByTagName("guid").length && i < 5; i++) {
var nameList = xmlDoc.getElementsByTagName("title")[i + 2].childNodes[0].nodeValue;
var regexp = new RegExp(" - ");
var songTitle = nameList.split(regexp);
//if (i == 4) {trackVal += '<li class="last">';}
//else {trackVal += '<li>';}

trackVal += '<li><div class="title1"><a href="#" onClick="RhapsodyPlayer.playTrack(\'tra.' + xmlDoc.getElementsByTagName("guid")[i].childNodes[0].nodeValue + '\'); return false;"><span class="icon icon-play-lg">Song:</span> Listen to Song \'' + songTitle[0] + '\'</a><!-- /strong></p --></div></li>';

}

if(trackVal){
songSlat += '<div class="mdl"><div class="h-wrap group"><h2 class="h-sub group"><span>Top Songs</span></h2></div><ol id="copyDesc" class="lst">' + trackVal +'<li class="last"><div> </div></li></ol></div>' ;

}

document.getElementById("rhapsodySlat").innerHTML = songSlat;

}
catch(e) {}
}
}
MTV.Voting = new function(){

this.init = function(){
if (MTV.Voting.Button.active){
$j("div.vote-btn").each(function(i){
var flashVars = "";
var targetId = this.id;
var embedId = targetId + "Button";

var vars = targetId.split(":"); //get pollId and value
var pollId = vars[0];
var value = vars[1];

flashVars += "cogix=" + MTV.Voting.Button.cogix + "&amp;";
flashVars += "pollid=" + pollId + "&amp;";
flashVars += "answer" + "=" + value + "&amp;";
flashVars += "validator=" + MTV.Voting.Button.validator + "&amp;";
flashVars += "authClass=" + MTV.Voting.Button.authClass;

var so = new SWFObject(MTV.Voting.Button.src, embedId, MTV.Voting.Button.width, MTV.Voting.Button.height, "9", "#000000");
so.addParam("flashVars", flashVars);
so.addParam("AllowScriptAccess", "sameDomain");
so.addParam("wmode", "transparent");
so.useExpressInstall('/sitewide/components/expressInstall/adobeExpressInstall.swf');
so.write(targetId);
});
}
}
}

MTV.Voting.Button = new function(){
this.active = false;
this.src = "/sitewide/components/buttons/vote/voteButton.swf";
this.width = "75";
this.height = "30";
this.cogix = "polling-onair";
this.validator= "timestamp|votes";
this.authClass = "com.mtvnet.auth.dis.HashDigestInputStrategy1";
}

MTV.Events = new function(){
this.addLinkEvents = function(){

$j("a.rssLink").click(function() {
MTV.Content.RSS.open(this);
return false;
});

$j('.user-send-message').each(function() {
if(Flux.Context._isCommunityMember) {
var user_display_name = Flux.Context._currentUserSettings.UserDisplayName;
var community_landing = Flux.Context._communityLandingPage;
var ucid = this.href.match(/\w+$/);
this.href = community_landing + "profile/" + user_display_name + "/Messaging/Mail.aspx?recipient=" + ucid;
}
else {
this.href = Flux.Context._signInUrl + "?returnPath=" + window.location.href;
}
});

}
}
MTV.Community = new function(){
this.host = '';
}

MTV.Community.Widgets = function(){
this.errorLocation = '';
}

MTV.Flux = new function(){}

MTV.Flux.DAAPI = new function(){
this.initArray = new Array();
this.baseUrl = "http://daapi.flux.com/2.0/00001/JSON/D3FCFFFF0002D51D0002FFFFFCD3";

this.init = function(){
if(communityAccess){
jQuery.each(MTV.Flux.DAAPI.initArray, function (i) {
if(jQuery.isFunction(MTV.Flux.DAAPI.initArray[i])) MTV.Flux.DAAPI.initArray[i]();
});

MTV.Flux.DAAPI.Module.init();
}
}

this.sendRequest = function(feed, callback, params) {
var requestUrl = MTV.Flux.DAAPI.baseUrl + feed;
Flux.Core.executeGetRequest(requestUrl, function(response){
callback(Sys.Serialization.JavaScriptSerializer.deserialize(response), params);
});
}
}

MTV.Flux.DAAPI.Module = new function(){
var config; // the current config - a regular js object
var container; // the current container - a jquery object
var responses = new Array();	// stores DAAPI responses for a module until all tabs are loaded
var responseCounter = 0;

this.configs = new Array(); // queue of module configs

this.init = function(){
if(MTV.Flux.DAAPI.Module.configs.length > 0){
config = MTV.Flux.DAAPI.Module.configs.pop();
MTV.Flux.DAAPI.Module.create();
}
}

this.create = function(){
if($j("#"+config.containerId).is("*")){
container = $j("#"+config.containerId);

if(config.moduleWrapper){
var mdl = $j("<div/>").attr("class","mdl");
container.append(mdl);
container = mdl;
if(config.moduleTitle != undefined){
var title = $j("<div/>").attr("class", "h-wrap group");
title.append($j("<h2/>").attr("class", "h-sub2 group").append($j("<span>" + config.moduleTitle + "</span>")));
container.append(title);
}
}

for(var i=0; i < config.tabs.length; i++){
MTV.Flux.DAAPI.sendRequest(config.tabs[i].url, MTV.Flux.DAAPI.Module.loadData, {position:i});
}
}
else{
MTV.Flux.DAAPI.Module.finish();
}
}

this.finish = function(){
responses = new Array();
responseCounter = 0;
MTV.Flux.DAAPI.Module.init(); // start over for more module configs
}

/* ------------------ */

this.loadData = function(response, paramsObj){
responses[paramsObj.position] = response;
responseCounter++;

if(responseCounter == config.tabs.length){
MTV.Flux.DAAPI.Module.build();
}
}

this.build = function(){
if(config.tabs.length > 1) container.append(MTV.Flux.DAAPI.Module.buildTabNav());

for(var i=0; i<responses.length; i++){
var isFirst = (i==0) ? true : false;
container.append(MTV.Flux.DAAPI.Module.buildTab(responses[i], isFirst));
}

MTV.Flux.DAAPI.Module.finish();
}

this.buildTabNav = function(){
var ul = $j("<ul/>").addClass("mdl-nav group");

for(var x=0; x < config.tabs.length; x++){
var li = $j("<li/>");
if(x==0) li.addClass("active");

var a = $j("<a/>").attr("href", "#").append(config.tabs[x].title);
a.click(function(){
MTVN.UI.MdlTab.open(this);
return false;
});

li.append(a);
ul.append(li);
}
return ul;
}

this.buildTab = function(response, isFirst){
var items = response.Items;
var itemCounter = 0;

if(items.length > 0){
var tab = $j("<div/>").addClass("tab-content");
if(!isFirst) tab.addClass("hide");

for(var r=1; r <= config.rows; r++){
if(itemCounter < items.length){	
var olClass = "lst lst-photos";
if(config.columns==2) olClass += " lst-photos-two";
else if(config.columns==3) olClass += " lst-photos-three";
else if(config.columns==4) olClass += " lst-photos-four";
else if(config.columns==6) olClass += " lst-photos-six";

var list = $j("<ol/>").addClass(olClass);

for(var c=1; c <= config.columns; c++){
var isLast = (c==config.columns) ? true : false;
if(itemCounter < items.length){
list.append(MTV.Flux.DAAPI.Module.buildItem(items[itemCounter],isLast));
itemCounter++;
}
}

tab.append(list);
}
}
return tab;
}
}

this.buildItem = function(Entry, isLast){	
var title = $j("<div/>").addClass("title2");
var titleLink = $j("<a/>").attr("href", Entry.DetailUrl);
titleLink.append($j("<img/>").attr("src", Entry.Thumbnails.Medium).addClass("thumb"));

var icon = "";
switch(Entry.Alias){
case "Video":
icon = $j("<span/>").addClass("icon icon-play").append("Video: ");
break;
default: break;
}

if(icon!=="") titleLink.append(icon);
titleLink.append(Entry.Title);
title.append(titleLink);

var li = $j("<li/>");	
if(isLast) li.addClass("last");
li.append(title);
li.append($j("<p/>").addClass("deck").append(Entry.Creator.Title));

var date = MTV.Flux.DAAPI.Utils.formatDate(Entry.DateCreated);
li.append($j("<p/>").append($j("<span/>").addClass("posted").append("Posted " + date)));

return li;
}
}

MTV.Flux.DAAPI.Utils = new function(){
this.formatDate = function(date){
var m = date.getMonth() + 1;
var d = date.getDate();
var y = date.getFullYear().toString().substr(2,2);

var formattedDate = m + "/" + d + "/" + y;

return formattedDate;
}
}
MTV.Utils = new function(){

this.findMaxZ = function() {
var maxZ = Math.max.apply(null,$j.map($j('body > *'), function(e,n){
if($j(e).css('position')=='absolute') {

return parseInt($j(e).css('z-index'))||1 ;
} else {
return 500;
}
}));
return(maxZ);
}

}

MTV.Utils.Cookies = new function(){
this.create = function(name,value,days){
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

this.read = function(name){
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

this.erase = function(name){
MTV.Utils.Cookies.create(name,"",-1);
}
}

function openAndFocus(url,name,features){
var o = window.open(url, name, features);
o.focus();
}

function runMiniAdBanner()
{
var opaWidth = $j("#ad-728x90").outerWidth();

var getData = 

{"module":{"items":{"item":{"images":{"img":{"width":"239","height":"90","src":""}},"link":{"args":""}}},"name":"minipromos"}}
;
if(getData.module!=undefined && getData.module.items!=null)
{
var total = getData.module.items.item.length;
var index = 0;
var imgSrc,imgUrl = "";

if(total==null)
{
if(getData.module.items.item.images!=null)
imgSrc = getData.module.items.item.images.img.src;

if(getData.module.items.item.link!=null)
imgUrl = getData.module.items.item.link.args;
}
else
{
index = Math.floor(Math.random()*total);

if(getData.module.items.item[index].images!=null)
imgSrc = getData.module.items.item[index].images.img.src;

if(getData.module.items.item[index].link!=null)
imgUrl = getData.module.items.item[index].link.args;
}

//alert(imgSrc+" "+opaWidth+" "+$j("#header.franchise").length);

if ((parseInt(opaWidth) <= 728 && $j("#header.franchise").length == 0) && (imgSrc!=null)) 
{
if (parseInt(opaWidth) > 0) {
$j("<div/>").attr("id", "minipromo").prependTo("#adContainer");
$j("<a/>").attr("href", imgUrl).appendTo("#minipromo");
$j("<img/>").attr({"src":imgSrc, "border": 0}).appendTo("#minipromo a");
$j("#minipromo").show(); 
$j("#ad-728x90").css({"padding": "3px 3px 3px 0px","float": "right"});
}
}
}

}

function popFlip(fbKey, obj){

var pWin = false;
if (fbKey.indexOf("fid=")>=0) {
window.location.href = '/photos/?'+fbKey;

}
else {
window.location.href = '/news/photo/';

}
// popCheck(pWin);

}

MTV.Utils.DisplayAdRefreshRate = new function() {

this.bannerRate;
this.billboardRate;

this.setAdRefreshRate = function() {
var getData = {"adRefresh":{"items":{"item":{"ad":{"banner":"180","billboard":"180"}}}}};

this.bannerRate = parseInt(getData.adRefresh.items.item.ad.banner) * 1000;
this.billboardRate = parseInt(getData.adRefresh.items.item.ad.billboard) * 1000;

}

}

$j(function()
{
MTV.Navigation=new MtvNavigation();
});

function MtvNavigation()
{
var self=this;
this.init=function()
{
self.meta = {

}

self.init_triggers();

}

this.init_triggers=function()
{
self.init_coda_link_tracking();
self.init_nav_interaction();
}

this.init_coda_link_tracking=function()
{
// override every link in nav menu
$j('#navlist a').click(function(){

// report click to CODA
// http://confluence.mtvi.com/display/BUSTECH/CODA+Link+Events
mtvn.btg.Controller.sendLinkEvent({
linkName : 'GLOBAL_NAV - ' + $j(this).text(),
linkType : 'o'
});

// continue event
return true;
});
}

this.init_nav_interaction=function()
{
$j('#navlist .gridContainer').css({'z-index': MTV.Utils.findMaxZ() + 10});
/* tooltip on logo*/
$j('div#mtvLogo a, .navLogoToolTip').mouseover(function() {
$j('.navLogoToolTip').show();
}).mouseout(function() {
$j('.navLogoToolTip').hide();
});
/* mtvsites nav */
$j('.globalNav ul#mtvSitesNav li.topLevel').hover( function() {
$j(this).addClass('hover').children('ul').addClass('hover');
}, function() {
$j(this).removeClass('hover').children('ul').removeClass('hover');
});

/* global Nav */
$j('#navlist li.toplvl').hover( function() {
$j(this).addClass('hover').children('ul.gridContainer').addClass('hover');
}, function() {
$j(this).removeClass('hover').children('ul.gridContainer').removeClass('hover');
});

/* global Nav grid columns height matching */
$j('ul#navlist li.toplvl').each( function(a) {
var maxHeight = 0;
var $columns = $j( $j('ul#navlist li.toplvl')[a] ).find('ul.gridContainer div.grid ul.gridMain, ul.gridContainer div.grid ul.centerCol');
$columns.each( function(e) {
if( $j($columns[e]).height() > maxHeight ) maxHeight = $j($columns[e]).height();
});
$columns.height( maxHeight );
});

}

self.init();
}

var Page = {};
Page.onload = function(func) {
if(window.attachEvent){
window.attachEvent('onload',eval(func));
}
else if(document.addEventListener){
// safari
if (/WebKit/i.test(navigator.userAgent)) {
var safari_timer = setInterval(function() {
if (/loaded|complete/.test(document.readyState)) {
clearInterval(safari_timer);
//alert(func);
eval(func+'()');
}
}, 10);
}
else document.addEventListener('DOMContentLoaded',eval(func),null);
}
}

// iPad tweeks to the global nav - should not affect any other browsers...
var isiPad = navigator.userAgent.match(/iPad/i) != null;
var iPadDebug = new function() {
this.touchActivity = [];
this.onclickfunc = 'return iPadDebug.menuclick(this);';
this.init = function() {
document.getElementsByTagName('body')[0].addEventListener('touchend',
function(e){
iPadDebug.touchActivity.push('bodytouch');
},false);
var menuLinks = document.getElementsByClassName('n-link');
for(i = 0; i < menuLinks.length; i++) {
menuLinks[i].setAttribute('linkloc',menuLinks[i].getAttribute('href'));
menuLinks[i].setAttribute('clickevent',menuLinks[i].getAttribute('onclick'));
menuLinks[i].setAttribute('href', '#');
menuLinks[i].setAttribute('onclick', iPadDebug.onclickfunc);
}
};
this.menuclick = function(obj){
iPadDebug.touchActivity.push(obj.id);

if(iPadDebug.touchActivity[iPadDebug.touchActivity.length-1]==iPadDebug.touchActivity[iPadDebug.touchActivity.length-3]){
//var reportObj = { href:obj.getAttribute('linkloc'), name:obj.getAttribute('name')};
//GNav.report(reportObj);
//Page.linkcall(reportObj,'globalnav');
window.location.href = obj.getAttribute('linkloc');
}
return false;
};
};

if(isiPad) {
Page.onload('iPadDebug.init');
}

// default search text

// event handler
function addEventToObject(obj,evt,func) {
var oldhandler = obj[evt];
obj[evt] = (typeof obj[evt] != 'function') ? func : function(){oldhandler();func();};
}

// lyrics box stuff
var Searchbox = {
init : function()
{
var sBox = document.getElementById('search-lyrics');
if (sBox)
{
addEventToObject(sBox,'onclick',Searchbox.click);
addEventToObject(sBox,'onblur',Searchbox.blur);
}	
},
click : function()
{
var sBox = document.getElementById('search-lyrics');
if (sBox.value == 'Enter lyric, artist name or song title')
{
sBox.value = '';
sBox.style.color = 'black';
}
},
blur : function()
{
var sBox = document.getElementById('search-lyrics');
if (sBox.value == '' || sBox.value == ' ') {sBox.value = 'Enter lyric, artist name or song title'; sBox.style.color = '#999999';}
}
};

// search box stuff
var Searchbar = {
init : function()
{
var sBar = document.getElementById('searchmtv-text');
if (sBar)
{
addEventToObject(sBar,'onclick',Searchbar.click);
addEventToObject(sBar,'onblur',Searchbar.blur);
}	
},
click : function()
{
var sBar = document.getElementById('searchmtv-text');
if (sBar.value == 'Search' || sBar.value == 'SEARCH')
{
sBar.value = '';
}
},
blur : function()
{
var sBar = document.getElementById('searchmtv-text');
if (sBar.value == '' || sBar.value == ' ') {sBar.value = 'SEARCH';}
}
};

// add event onload
addEventToObject(window,'onload',Searchbox.init);
addEventToObject(window,'onload',Searchbar.init);

var Utils = {
show : function(element){
if (element!=null && element.className.indexOf('hide') >= 0){
element.className = element.className.substring(0, element.className.indexOf('hide'));
}
},

hide : function(element){
if (element!=null && element.className.indexOf('hide') < 0){
element.className = element.className + " hide";
}
},

// returns the first parent of a node with a given class
findParent : function(obj, parentClass){
var parent = obj.parentNode;
if (parent.className && parent.className.indexOf(parentClass) != -1)
return parent;
else return this.findParent(parent, parentClass);
},

// returns the first child of a node with a given class
findChild : function(obj, childClass){
var match;
for(var i=0; i<obj.childNodes.length; i++){
var child = obj.childNodes[i];
if (child.className && child.className==childClass)
match = child;
else if(child.childNodes && child.childNodes.length>0){
match = this.findChild(child, childClass);
}
if(match) return match;
}
}
}

var Paginate = {
getPrev : function(obj){
this.page(obj, 'prev');
},

getNext : function(obj){
this.page(obj, 'next');
},

page : function(obj, direction){
var mdl = Utils.findParent(obj, 'mdl');

var pagination = Utils.findChild(mdl, 'pagination');
var pageCount = Utils.findChild(pagination, 'sm');

var count = new Array();
count = pageCount.innerHTML.split(' ');

var current = count[0]*1;
var total = count[2]*1;
var requestPage;

if(direction=='prev'){
if(current==1) requestPage = total;
else requestPage = current - 1;
}
else{
if(current==total) requestPage = 1;
else requestPage = current + 1;
}

var listCount = 0;
for(var i=0; i<mdl.childNodes.length; i++){
var child = mdl.childNodes[i];
if (child.nodeName=='OL' || (child.nodeName=='DIV' && child.className.indexOf('paginationGroup')>-1)){
listCount++;
if (listCount!=requestPage) Utils.hide(child);
else Utils.show(child);
}
}

var newPageCounter = requestPage + " of " + total;
pageCount.replaceChild(document.createTextNode(newPageCounter), pageCount.childNodes[0]);
}
}

$j(document).ready(function(){
MTVN.init();
});

MTVN = new function(){
this.pageTitle = document.title;
this.initArray = new Array();
this.version = 'charlie';

this.init = function(){
document.body.onmousedown = mouseDown;

if (typeof MTVN.Flux != 'undefined' && ((typeof(MTV) == "undefined" || typeof(MTV.Flux) == "undefined") || typeof(MTV.Flux.ucid) == "undefined")) MTVN.Flux.Widgets.loadAll();
MTVN.UI.initScrollingModules();

for(var i=0; i<MTVN.initArray.length; i++){
MTVN.initArray[i]();
}

return true;
}

this.resetPageTitle = function(){
document.title = MTVN.pageTitle;
}

mouseDown = function(e){
if (MTVN.UI.ModalWindow.isOpen) MTVN.UI.ModalWindow.mouseDownBody(e);
return true;
}
}

MTVN.Apps = new function(){}

MTVN.Constants = new function(){
this.playerChannelDomain = "mtv";
this.playerMediaHost = "http://media.mtvnservices.com";
this.playerBaseUrl = "";	
}

MTVN.Ads = new function(){
this.additionalValues = "";
this.moreAdditionalValues = "";

this.dartSite = "";
this.sections = ""; // right now this is only ever set to vidzone from the player
this.adPageVals = "";
this.autoDcopt = "";

// this is mostly for the video player, ajaxed in values
this.handleAdditionalValues = function(){

if (MTVN.Ads.additionalValues.indexOf("content_id") == -1 
&& MTVN.Player && MTVN.Player.id != undefined)	{	
MTVN.Ads.additionalValues += "content_id=" + MTVN.Player.id + ";";
}

MTVN.Ads.additionalValues += MTVN.Ads.moreAdditionalValues;
}	

}

MTVN.Reporting = new function(){
this.dispatcherAttributes = "";

this.handleDispatcherAttributes = function(){
var attrs = MTVN.Reporting.dispatcherAttributes.split(";");
for (var i=0; i < attrs.length; i++) {

if(attrs[i]!=""){
var pair = attrs[i].split("=");	
dispatcher.setAttribute(pair[0],pair[1]);
}
}
}

this.reportIMX = function(tagUrl, protocol, params){
var imxTag = new Image();
if ((protocol=="flipbook" && !(document.referrer.indexOf("fid="+params) > -1)) || (protocol != 'flipbook')){
imxTag.src = tagUrl;
}
}

this.reportFluxView = function(tagUrl, protocol, params){
var fluxTag = new Image();
fluxTag.src = tagUrl;
}
}
MTVN.UI = new function(){
this.initScrollingModules = function(){
/* handle no max-height in IE 6 */
if(jQuery.browser.msie && jQuery.browser.version.substr(0,1)=="6"){
$j(".scroll-wrap").each(function(){
var sw = $j(this);
var olHeight = sw.children("ol:first").height();
if(olHeight < 370) sw.height("100%");
});
}
}
}

MTVN.UI.Overlay = new function(){
this.active = false;

this.init = function(){
$j("#container-outer").append('<div id="overlay"></div>');
$j("#modalWindow").remove().appendTo("#container-outer");
MTVN.UI.Overlay.active = true;
}

this.open = function(){
$j("#overlay").addClass("open");
$j("#overlay").height(document.body.offsetHeight + "px");
}

this.close = function(){
$j("#overlay").removeClass("open");
$j("#overlay").height("0px");
}
}

MTVN.UI.ModalWindow = new function(){
var modalWindowId = "modalWindow";
var currentLocationId = "";
this.ignoreMouseDownBody = false;
this.isOpen = false;

this.open = function(requestUrl, locationId){
currentLocationId = locationId;

$j.get(requestUrl, function(data){
MTVN.UI.Overlay.open();
$j("#dialogContainer").empty().append(data);
MTVN.UI.ModalWindow.updateLocation();
});
}

this.updateLocation = function(){
var mwElement = document.getElementById(modalWindowId);
var mwLeft = 0;
var mwTop = 0;
var mwWidth = $j(mwElement).width();
var bodyWidth = document.body.offsetWidth;

$j("#" + modalWindowId).removeClass("hide");

var wrap = document.getElementById("wrap");
var wrapX = $j("#wrap").offset().left;	
var wrapWidth = wrap.offsetWidth;
var wrapThird = Math.round(wrapWidth/3);
var warpHeight = wrap.offsetHeight;	

if(!currentLocationId){
// defaults to centered position
if(MTVN.UI.Overlay.active){
mwLeft = Math.round(bodyWidth/2 - mwWidth/2);
}
else{
mwLeft = Math.round(bodyWidth/2 - mwWidth/2); // centered for 446px-wide modal window
}	
mwTop = Math.round(((document.documentElement.clientHeight - mwElement.offsetHeight)/2) + ($j('html').scrollTop() || $j('body').scrollTop())) - 30; // 30 pixel cheat	
}
else{
//positioning relative to an element

var locElement = document.getElementById(currentLocationId);

var locLeft = $j("#" + currentLocationId).offset().left - wrapX;	//left position relative to wrap instead of the window left
var locTop = $j("#" + currentLocationId).offset().top;

if(locLeft < wrapThird){ mwLeft = wrapX -20; }
else if(locLeft > wrapThird && locLeft < (wrapThird * 2)){ Math.round(bodyWidth/2 - mwWidth/2); }
else{ 
//mwLeft = (wrapX + wrapWidth - mwWidth + 20) ; 
mwLeft = Math.round(bodyWidth/2 - mwWidth/2 - 200) ;
}

if(locTop < 350) {
//mwTop = locTop - (mwElement.offsetHeight + 1);
mwTop = locTop + 20;
}
else {
mwTop = locTop - 350;

}

}

mwElement.style.left = mwLeft + "px";
mwElement.style.top = mwTop + "px";

MTVN.UI.ModalWindow.isOpen = true;
}

this.close = function(){
var mwElement = document.getElementById(modalWindowId);
mwElement.style.left = "-9999px";
MTVN.UI.Overlay.close();
currentLocationId="";
this.isOpen = false;
}

this.mouseDown = function(e){
this.ignoreMouseDownBody = true;
return true;
}

this.mouseDownBody = function(e){
if (!this.ignoreMouseDownBody){
this.close();
}
this.ignoreMouseDownBody = false;
return true;
}
}

MTVN.UI.Tab = new function(){
this.open = function(obj){
var newActiveTabId = obj.parentNode.id;
var newActivePageId = newActiveTabId.substring(0, newActiveTabId.indexOf("Tab"));

var tab = document.getElementById(newActiveTabId);
var tabList = tab.parentNode;
var tabs = tabList.getElementsByTagName("li");

// set new active tab
for(var i=0; i < tabs.length; i++){
var t = tabs[i];

if(t.id == newActiveTabId){
$j(t).addClass("active");
}
else{
$j(t).removeClass("active");
}
}

// set new active page
var page = document.getElementById(newActivePageId);
var pageList = page.parentNode;
var pages = pageList.childNodes;

for(var i=0; i < pages.length; i++){
var p = pages[i];

if(p.nodeName=="DIV" && p.className.indexOf('tab-content') >= 0){
if(p.id == newActivePageId){
$j(p).removeClass("hide");

if(p.className.indexOf('mobileWidget') >= 0){
var tabEvent = $j.Event("showtab");
$j(p).triggerHandler(tabEvent);
}
}
else{
$j(p).addClass("hide");
}
}
}

}

this.openAjax = function(obj, ajaxData, configParams){
var newActiveTabId = obj.parentNode.id;
var newActivePageId = newActiveTabId.substring(0, newActiveTabId.indexOf("Tab"));

var tab = document.getElementById(newActiveTabId);
var tabList = tab.parentNode;
var tabs = tabList.getElementsByTagName("li");
var containerHeight = 10;
var containerHeight2 = 0;

// set new active tab
for(var i=0; i < tabs.length; i++){
var t = tabs[i];
if(t.id == newActiveTabId) $j(t).addClass("active");
else $j(t).removeClass("active");
}

// set new active page
var page = document.getElementById(newActivePageId);
var pageList = page.parentNode;
var pages = pageList.childNodes;

for(var i=0; i < pages.length; i++){
var p = pages[i];
if(p.nodeName=="DIV" && p.className.indexOf('tab-content') >= 0 && p.className.indexOf('hide')== -1) { containerHeight2=$j(p).children("div").height(); containerHeight = $j(p).height();}
}

for(var i=0; i < pages.length; i++){
var p = pages[i];

if(p.nodeName=="DIV" && p.className.indexOf('tab-content') >= 0){
if(p.id == newActivePageId){
var container = $j(p);
if (container.is('.loaded')) {
container.removeClass("hide");
}else
{
container.css({'min-height': containerHeight});
//container.empty();
//container.children(".more-link.group").addClass("hide");

var tempStore = container.children(".more-link.group").remove();
container.prepend('<div class="ajax-loader"><img src="/sitewide/images/charlie/ajax-loader.gif" alt="Loading..."/></div>');
container.removeClass("hide");
$j.get(ajaxData, configParams, function(data){
container.empty();
container.children(".ajax-loader").remove();
container.prepend(data);
container.css({'min-height': '0px'});
//container.children(".more-link.group").removeClass("hide");
container.children(".more-link.group").css({'display': 'block'});
tempStore.appendTo(container);
container.addClass("loaded");
});
}
}
else{
$j(p).addClass("hide");
}
}
}

}
}

MTVN.UI.MdlTab = new function(){
this.open = function(obj){
var currentTabNavItem = $j(obj).parent();
var position = currentTabNavItem.prevAll().length;

currentTabNavItem.addClass("active");
currentTabNavItem.siblings().removeClass("active");

var mdl = currentTabNavItem.parents(".mdl:first");

var pages = (mdl.children("ol.lst").length >0) ? mdl.children("ol.lst") : mdl.children("div.tab-content");
pages.addClass("hide");
pages.eq(position).removeClass("hide");
}
}

MTVN.UI.RefreshPaginate = new function(){
this.submit = function(form){
var str = $j(form).text();
var maxPages = parseInt(str.substring(str.indexOf("of")+3, str.length));
var val = parseInt(form.page.value);
var baseUrl = form.baseUrl.value;

if(val > 0 && val <= maxPages){
var connector = (baseUrl.indexOf("?") >=0) ? "&" : "?";
var url = (val==1) ? baseUrl : baseUrl + connector + "page=" + val;
window.location.href = url;
}

return false;
}
}

MTVN.UI.AjaxPaginate = new function(){
this.page = function(obj, requestUrl, pageNum){
var paginationDiv = $j(obj).parent();
var container = paginationDiv.parent();
var params = {};
if(pageNum > 1) params.page = pageNum;

$j.get(requestUrl, params, function(data){
container.empty();
container.append(data);
});

}
}

MTVN.UI.Accordion = new function(){
var howMany = "";

this.init = function(){
// remove text nodes
$j("#accordion a.accord-link").each(function(){
for(var i=0; i<this.childNodes.length; i++){
if(this.childNodes[i].nodeType==3) this.removeChild(this.childNodes[i]);
}
});

$j("#accordion > div.accord-slat").bind("mouseenter", function(){ MTVN.UI.Accordion.activate(this); });
howMany = $j("#accordion > div.accord-slat").length;
MTVN.UI.Accordion.positionContent($j("#accordion > div.accord-over"));
}

this.activate = function(obj){
var active = $j(obj);
$j("#accordion > div.accord-slat").removeClass("accord-over");
active.addClass("accord-over");
MTVN.UI.Accordion.positionContent(active);
}

this.positionContent = function(active){
var position = active.prevAll().length + 1;
var gap = howMany - position;

var content = active.children(".accord-content"); // the active content box
var offsetLeft = MTVN.UI.Accordion.getOffsetLeft(active.get(0), active.get(0).offsetLeft); // left side of active item
var contentWidth = content.width() + 30;

var newLeft = (offsetLeft+133) - contentWidth/2;
var newRight = newLeft + contentWidth;

if(newRight > 950){
newLeft = 950 - contentWidth - (10*gap); // 10px for every item
}
else if(newLeft < 0){
newLeft = 10*position;
}

content.css("left", newLeft);
}

this.getOffsetLeft = function(element, offsetLeft){
if(element.offsetParent.className=="mdl mdl-main mdl-accordion"){
return offsetLeft;
}
else{
var parent = element.offsetParent;
var val = element.offsetLeft + parent.offsetLeft;
return MTVN.UI.Accordion.getOffsetLeft(parent, val);
}
}
}

MTVN.UI.InView = new function() {

var elements = [];
var positions = [];
var offsets = [];

var jwin = $j(window);

var init = function() {
jwin.bind("scroll resize", function() {
jwin.unbind("scroll resize");
setTimeout(function() {
checkElements();
}, 500);
});	
}

this.register = function(element, callback) {
var offsetLeft = 0;
var offsetTop = 0;
var elementOffset = element.offset();
if (elementOffset != null) {
offsetLeft = elementOffset.left;
offsetTop = elementOffset.top;
}

var coords = offsetLeft + "x" + offsetTop;
var offset = $j.grep(positions, function(n, i){
return (n == coords);
});
offsets.push(offset.length * 100);
positions.push(coords);

if(isInView(element, offset.length * 100)) {
callback();
} else {
elements.push(element);
element.one("inView", callback);
init();
}
}

var checkElements = function () {
var tempElements = [];
$j.each(elements, function(i) {
tempElements.push(this);
if (isInView(this, offsets[i])) {
this.trigger("inView");
tempElements.pop();
}
});
elements = tempElements;
if (elements.length > 0) {
init();
} 
}

var isInView = function(element, offset) {
var viewportHeight = jwin.height();
var docPos = jwin.scrollTop();
var elementOffsetTop = 0;
var elementOffset = element.offset();
if (elementOffset!=null) elementOffsetTop = element.offset().top;

var elPos = parseInt(elementOffsetTop) + offset;
return (elPos < viewportHeight + docPos);
}
}

// Taken from MTV's sitewide paginate.
MTVN.UI.Paginate = new function() {

this.numVisiblePages;
this.firstVisiblePageNum = 1;
this.currentPositionIndex = 1;
this.currentPageNum = 1;
this.totalNumPages;
this.getPrev = function(obj,animate){
this.page(obj, 'prev', animate);
}

this.getNext = function(obj,animate){
this.page(obj, 'next', animate);
}

this.animatePagination = function(obj){
var pagenum = this.firstVisiblePageNum+this.currentPositionIndex-1;
//this.page2(obj, null, this.currentPageNum);

var mdl = $j(obj).parents('.mdl');

var paginationListoffsetParse = mdl.find(".paginationList").css("left");
if (paginationListoffsetParse == "auto") {paginationListoffsetParse = 0;}
var paginationListoffset = parseInt(paginationListoffsetParse);
var numberOffset = parseInt(mdl.find(".paginationList").children("#p" + this.currentPageNum).position().left);
//alert(mdl.find(".paginationList").children("#p" + this.currentPageNum).position().left);
if (-numberOffset > paginationListoffset) {
var moveOffset = paginationListoffset + numberOffset;
$j(mdl).find('.paginationList').animate({"left":'-='+moveOffset},{easing:"swing",duration:"slow"});
}

paginationListoffsetParse = mdl.find(".paginationList").css("left");
if (paginationListoffsetParse == "auto") {paginationListoffsetParse = 0;}
paginationListoffset = parseInt(paginationListoffsetParse);

numberOffset = parseInt(mdl.find(".paginationList").children("#p" + this.currentPageNum).position().left);
var containerWidth = parseInt(mdl.find(".paginationOverflowWidth").css("width"));
var numberWidth = parseInt(mdl.find(".paginationList").children("#p" + this.currentPageNum).width())+6;

if ( ((numberOffset + numberWidth) + paginationListoffset) > containerWidth){
var moveOffset = containerWidth - (numberOffset + numberWidth + paginationListoffset);
$j(mdl).find('.paginationList').animate({"left":'+='+moveOffset},{easing:"swing",duration:"slow"});
}

}

this.leftAction = function(obj){
if (this.currentPageNum>1){ this.currentPositionIndex--; this.currentPageNum--; this.page2(obj,null,this.currentPageNum); }
}

this.rightAction = function(obj){
if(this.currentPageNum < this.totalNumPages) {this.currentPageNum++; this.currentPositionIndex++; this.page2(obj, null,this.currentPageNum);}
}

this.get = function(mdl, requestPage){
var pagination = MTVN.UI.Paginate.Utils.findChild(mdl, 'pagination');
var pageCount = MTVN.UI.Paginate.Utils.findChild(pagination, 'sm');

var count = new Array();
count = pageCount.innerHTML.split(' ');

var total = count[2]*1;

var listCount = 0;
for(var i=0; i<mdl.childNodes.length; i++){
var child = mdl.childNodes[i];
if (child.nodeName=='OL' || (child.nodeName=='DIV' && child.className.indexOf('paginationGroup')>-1)){
listCount++;
if (listCount!=requestPage) MTVN.UI.Paginate.Utils.hide(child);
else MTVN.UI.Paginate.Utils.show(child);
}
}

var newPageCounter = requestPage + " of " + total;
pageCount.replaceChild(document.createTextNode(newPageCounter), pageCount.childNodes[0]);
}

this.page = function(obj, direction, animate){
var paginationDiv = $j(obj).parents('.pagination');
var mdl = $j(obj).parents('.mdl');
var pageCount = paginationDiv.find('.sm');

var count = new Array();
count = pageCount.html().split(' '); 
current = count[0]*1;
var total = count[2]*1;
var requestPage;

if(direction=='prev'){
if(current==1) requestPage = total;
else requestPage = current - 1;
}
else{
if(current==total) requestPage = 1;
else requestPage = current + 1;
}

if (animate) this.animateTransition($j(paginationDiv).parent().parent(),current,requestPage);
else this.staticTransition(mdl,current,requestPage);

var newPageCounter = requestPage + " of " + total;
pageCount.empty().append(newPageCounter);

if(requestPage == total) {
pageCount.parent().parent().removeClass("first").addClass("last");
} else if(requestPage == 1){
pageCount.parent().parent().removeClass("last").addClass("first");
} else {
pageCount.parent().parent().removeClass("last").removeClass("first");
}
}

// pagination in list format ( < 1 2 3 4 5 > )
this.page2 = function(obj, direction, newpage){

this.currentPageNum = newpage;
//this.currentPositionIndex = this.currentPageNum - this.firstVisiblePageNum + 1;

var paginationDiv = $j(obj).parents('.pagination');
var mdl = $j(obj).parents('.mdl');
var current = parseInt(paginationDiv.find('.active').find('a').html());
var total = paginationDiv.find('p').length;

var requestPage;
if(direction=='prev'){
if(current==1) requestPage = total;
else requestPage = current - 1;
}
else if (direction=='next'){
if(current==total) requestPage = 1;
else requestPage = current + 1;

}
else requestPage=newpage;
requestPage=requestPage-1;
current=current-1;

paginationDiv.find('.active').removeClass('active');
$j(paginationDiv.find('p')[requestPage]).addClass('active');

this.animateTransition(mdl,current,requestPage);
if($j(".paginationList").children("p").length > 0) this.animatePagination(obj);
}

this.animateTransition = function(mdl,current,requestPage) {
var pagewidth = $j(mdl).find('.pages').find('ol').width()+10;
var jumpto = (current-requestPage)*pagewidth;
$j(mdl).find('.pages').animate({"left":'+='+jumpto},{easing:"swing",duration:"slow"});

//var pagewidth2 = $j(mdl).find('.paginationList').find('p').width()+6;
//var jumpto2 = (current-requestPage)*pagewidth2;
//alert(jumpto2);
//$j(mdl).find('.paginationList').animate({"left":'+='+jumpto2},{easing:"swing",duration:"slow"});
}

this.staticTransition = function(mdl,current,requestPage) { 
if (mdl.find('.paginationGroup').length>0) {
hideChild = $j(mdl.find('.paginationGroup')[current-1]);
showChild = $j(mdl.find('.paginationGroup')[requestPage-1]);
}
else {
hideChild = $j(mdl.find('ol')[current-1]); 
showChild = $j(mdl.find('ol')[requestPage-1]);
}
hideChild.addClass('hide');
showChild.removeClass('hide'); 
} 

}

MTVN.UI.Paginate.Utils = new function() {
this.show = function(element){
if (element!=null && element.className.indexOf('hide') >= 0){
element.className = element.className.substring(0, element.className.indexOf('hide'));
}
}

this.hide = function(element){
if (element!=null && element.className.indexOf('hide') < 0){
element.className = element.className + " hide";
}
}

// returns the first parent of a node with a given class
this.findParent = function(obj, parentClass){
var parent = obj.parentNode;
if (parent.className && parent.className.indexOf(parentClass) != -1)
return parent;
else return this.findParent(parent, parentClass);
}

// returns the first child of a node with a given class
this.findChild = function(obj, childClass){
var match;
for(var i=0; i<obj.childNodes.length; i++){
var child = obj.childNodes[i];
if (child.className && child.className==childClass)
match = child;
else if(child.childNodes && child.childNodes.length>0){
match = this.findChild(child, childClass);
}
if(match) return match;
}
}
}

MTVN.UI.GetCurrentServerTime = new function() {

this.date = function() {

return new InitCurrentTime().now;

}

this.raw = function() {

return new InitCurrentTime().rawTime;

}

}

$j(function() {
if($j("div.player-placeholder").length > 0) {
MTVN.LitePlayer.init();
MTVN.LitePlayer.applyClick();
}	
});

MTVN.LitePlayer = new function(){
this.imageServer = "";
this.videoUriPrefix = ":";
this.playlistUriPrefix = ":";
this.imageServerUri = "";
this.affilatedHost = "";

this.active = false;
this.playerUrl = "PLAYER_URL_NOT_SET";
this.configUrl = "CONFIG_URL_NOT_SET";
this.width = "240";
this.height = "211";
this.playerArgs = "";

var _this = this;
var initPlayer = function(){
$j("div.player-placeholder").each(function(i){
$this = $j(this);

var playerArgs = _this.playerArgs;
var flashVars;
var configParams = "";

if (this.id) {
configParams = this.id.replace(/\./g, "&").replace(/:/g,"=");
if( $this.attr("flashVars") ) {
configParams += '&' + $this.attr("flashVars");
}
} else {
if ($this.attr("flashVars").length > 0) {
configParams = $this.attr("flashVars");
}
}
if (playerArgs.length > 0) {
playerArgs += "&";
}	

playerArgs += configParams;	
var paramsFromId = {};
var params = configParams.split("&");
var uri;
var imageUri = "";
$j.each(params, function() {
var pair = this.split("=");
paramsFromId[pair[0]] = pair[1];
});

if(typeof paramsFromId.vid != "undefined") {
uri = _this.videoUriPrefix + paramsFromId.vid;
if(_this.imageServerUri != "") {
imageUri = _this.imageServerUri + paramsFromId.vid;
}
} else {
if (typeof paramsFromId.id != "undefined") {
uri = _this.playlistUriPrefix + paramsFromId.id;	
if(_this.imageServerUri != "") {
imageUri = _this.imageServerUri + paramsFromId.id;
}
}
}

if(imageUri == "") { imageUri = uri; }

if(typeof paramsFromId.freewheelId != "undefined") flashVars = "sid=" + paramsFromId.freewheelId + "&configParams=" + escape(playerArgs);
else flashVars = "configParams=" + escape(playerArgs);

var width = (typeof $this.attr("width") == 'undefined') ? _this.width: $this.attr("width");
var height = (typeof $this.attr("height") == 'undefined') ? _this.height: $this.attr("height");

this.innerHTML = _this.generatePreloadHTML("playerPlaceholder", width, height, uri, flashVars, imageUri.replace("videolist", "content"), paramsFromId.freewheelId);

// Fix for IE breaking when leaving a page where a player has been loaded with litePlayer
(function(){var s=function(){__flash__removeCallback=function(i,n){if(i)i[n]=null;};window.setTimeout(s,10);};s();})();
});
this.init = function(){};
}

this.init = initPlayer;

this.generatePreloadHTML = function(className, width, height, playerUri, flashVars, imageServerUri, freewheelId){

var playButtonCenterX = Math.floor(width / 2) - 46;
var playButtonCenterY = Math.floor(height / 2) - 36;

var controlBarTop = height - 31;

var html = '<div style="position: relative; width: ' + width + 'px; height: ' + height + 'px; cursor: pointer;" class="' + className + '" width="' + width + '" height="' + height + '"' + ((freewheelId != null) ? (' fwId="' + freewheelId + '"') : '') + ' id="' + playerUri + '" flashVars="' + flashVars + '">';

html += '<img style="position: absolute; top: ' + playButtonCenterY + 'px; left: ' + playButtonCenterX + 'px;" sr' +'c="'+ MTVN.LitePlayer.affilatedHost +'/global/music/player/images/bttn_play-big.png" />';

html += '<img src="http://' + _this.imageServer + '/uri/' + imageServerUri + '?height=' + controlBarTop + '&width=' + width + '" />';

html += '<img style="position: absolute; left: 0px; bottom:0px;" sr' + 'c="'+ MTVN.LitePlayer.affilatedHost + '/global/music/player/images/bttn_play.gif" />';

html += '<div style="position: absolute; left: 31px; bottom: 0px; width: ' + (width - 31) + 'px; height: 31px; background: url(' + MTVN.LitePlayer.affilatedHost + '/global/music/player/images/control-bar.gif) repeat-x top left"> </div>';

html += '</div>';

return html;
}

this.applyClick = function() {
var h = 0;
var w = 0;
var bgcolor = "#000000";
var hostname = window.location.href;

if (hostname.indexOf(".mtvi.com") > -1)
hostname = "http://media.mtvnservices-q.mtvi.com";
else 
hostname = "http://media.mtvnservices.com";

$j(".playerPlaceholder").one("click", function() {
var $this = $j(this);
var id = this.id;
var flashVars = $this.attr("flashVars");
var fwId = $this.attr("fwId");

if (h == 0){
h = $this.attr("height");
w = $this.attr("width");
}

if (fwId == null || fwId == "") {

if (typeof(freeWheelSSID) != 'undefined')
fwId = freeWheelSSID;
else 
fwId = "MTV_Videos";

}

var embed = "";
embed += '<embed src="' + hostname + '/'+id + '/cp~' + flashVars.replace("configParams=", "") +'"';
embed += 'type="application/x-shockwave-flash"';
embed += 'wmode="opaque"';
embed += 'name="'+id+'"';
embed += 'id="'+id+'"';
embed += 'width="'+w+'"';
embed += 'height="'+h+'"';
embed += 'bgcolor="'+bgcolor+'"';
embed += 'allowFullscreen="true"';
embed += 'flashVars="autoPlay=true' + '&sid=' + fwId + '"';
embed += 'allowScriptAccess="always">';
embed += '</embed>';

$this.html(embed);

});	
}
}

MTVN.LitePlayer.Article = new function(){

this.init = function(){

var pphDivIdVal = $j(".player-placeholder").attr("id");
if (pphDivIdVal.match("^"+"id") == "id")
MTVN.LitePlayer.playerArgs = "instance=fullepisode";

else MTVN.LitePlayer.playerArgs = "instance=news";
var height = 223;
var width = 256;
var styling = {
'background-color': '#000000',
'height': height + 'px',
'width': width + 'px',
'float':'left',
'margin': '0px 10px 10px 0px',
'position' : 'relative',
'cursor' : 'pointer'
}
$j(".player-placeholder").
css(styling).
attr("height",height).
attr("width",width);

MTVN.LitePlayer.init();
}
}

MTVN.Community = new function(){
this.host = ''
}

MTVN.Community.Widgets = function(){
this.errorLocation = '';
}

MTVN.Flux = new function(){}

MTVN.Flux.DAAPI = new function(){
this.initArray = new Array();
this.baseUrl = "http://daapi.flux.com/2.0/00001/JSON/D3FCFFFF0002D51D0002FFFFFCD3";

this.init = function(){
if(communityAccess){
jQuery.each(MTVN.Flux.DAAPI.initArray, function (i) {
if(jQuery.isFunction(MTVN.Flux.DAAPI.initArray[i])) MTVN.Flux.DAAPI.initArray[i]();
});

MTVN.Flux.DAAPI.Module.init();

//if(typeof FN!='undefined' && typeof FN.init=="function") FN.init();
}
}

this.sendRequest = function(feed, callback, params) {
var requestUrl = MTVN.Flux.DAAPI.baseUrl + feed;
Flux.Core.executeGetRequest(requestUrl, function(response){
callback(Sys.Serialization.JavaScriptSerializer.deserialize(response), params);
});
}
}

MTVN.Flux.DAAPI.Module = new function(){
var config; // the current config - a regular js object
var container; // the current container - a jquery object
var responses = new Array();	// stores DAAPI responses for a module until all tabs are loaded
var responseCounter = 0;

this.configs = new Array(); // queue of module configs

this.init = function(){
if(MTVN.Flux.DAAPI.Module.configs.length > 0){
config = MTVN.Flux.DAAPI.Module.configs.pop();
MTVN.Flux.DAAPI.Module.create();
}
}

this.create = function(){
if($j("#"+config.containerId).is("*")){
container = $j("#"+config.containerId);
for(var i=0; i < config.tabs.length; i++){
MTVN.Flux.DAAPI.sendRequest(config.tabs[i].url, MTVN.Flux.DAAPI.Module.loadData, {position:i});
}
}
else{
MTVN.Flux.DAAPI.Module.finish();
}
}

this.finish = function(){
responses = new Array();
responseCounter = 0;
MTVN.Flux.DAAPI.Module.init(); // start over for more module configs
}

/* ------------------ */

this.loadData = function(response, paramsObj){
responses[paramsObj.position] = response;
responseCounter++;

if(responseCounter == config.tabs.length){
MTVN.Flux.DAAPI.Module.build();
}
}

this.build = function(){
if(config.tabs.length > 1) container.append(MTVN.Flux.DAAPI.Module.buildTabNav());

for(var i=0; i<responses.length; i++){
var isFirst = (i==0) ? true : false;
container.append(MTVN.Flux.DAAPI.Module.buildTab(responses[i], isFirst));
}

MTVN.Flux.DAAPI.Module.finish();
}

this.buildTabNav = function(){
var ul = $j("<ul/>").addClass("mdl-nav group");

for(var x=0; x < config.tabs.length; x++){
var li = $j("<li/>");
if(x==0) li.addClass("active");

var a = $j("<a/>").attr("href", "#").append(config.tabs[x].title);
a.click(function(){
MTVN.UI.MdlTab.open(this);
return false;
});

li.append(a);
ul.append(li);
}
return ul;
}

this.buildTab = function(response, isFirst){
var items = response.Items;
var itemCounter = 0;

if(items.length > 0){
var tab = $j("<div/>").addClass("tab-content");
if(!isFirst) tab.addClass("hide");

for(var r=1; r <= config.rows; r++){
if(itemCounter < items.length){	
var olClass = "lst lst-photos";
if(config.columns==2) olClass += " lst-photos-two";
else if(config.columns==3) olClass += " lst-photos-three";
else if(config.columns==4) olClass += " lst-photos-four";
else if(config.columns==6) olClass += " lst-photos-six";

var list = $j("<ol/>").addClass(olClass);

for(var c=1; c <= config.columns; c++){
var isLast = (c==config.columns) ? true : false;
if(itemCounter < items.length){
list.append(MTVN.Flux.DAAPI.Module.buildItem(items[itemCounter],isLast));
itemCounter++;
}
}

tab.append(list);
}
}
return tab;
}
}

this.buildItem = function(Entry, isLast){	
var title = $j("<div/>").addClass("title2");
var titleLink = $j("<a/>").attr("href", Entry.DetailUrl);
titleLink.append($j("<img/>").attr("src", Entry.Thumbnails.Medium).addClass("thumb"));

var icon = "";
switch(Entry.Alias){
case "Video":
icon = $j("<span/>").addClass("icon icon-play").append("Video: ");
break;
default: break;
}

if(icon!=="") titleLink.append(icon);
titleLink.append(Entry.Title);
title.append(titleLink);

var li = $j("<li/>");	
if(isLast) li.addClass("last");
li.append(title);
li.append($j("<p/>").addClass("deck").append(Entry.Creator.Title));

var date = MTVN.Flux.DAAPI.Utils.formatDate(Entry.DateCreated);
li.append($j("<p/>").append($j("<span/>").addClass("posted").append("Posted " + date)));

return li;
}
}

MTVN.Flux.DAAPI.Utils = new function(){
this.formatDate = function(date){
var m = date.getMonth() + 1;
var d = date.getDate();
var y = date.getFullYear().toString().substr(2,2);

var formattedDate = m + "/" + d + "/" + y;

return formattedDate;
}
}

// Flux Widget Proxy
// 

MTVN.Flux.Widgets = new function(){

// you can turn off widgets globally by setting this to false or
// on locally by calling MTVN.Flux.Widgets.enabled = false;
this.enabled = true;

this.create=function(name, options){

if (!(Flux && typeof Flux.createWidget == "function") || !this.enabled) {
return;
}

options = this.getOptionsByName(name, options);
var widgetName = this.getWidgetNameByName(name);
Flux.createWidget(widgetName, options);
}

this.loadAllAttempted = false;
this.loadAll=function() {
if (!MTVN.Flux.Widgets.loadAllAttempted) {
$j(".fluxWidget:not(.delay-load)").each( function() {
MTVN.Flux.Widgets.loadEach(this);
});
MTVN.Flux.Widgets.loadAllAttempted = true;
}
}

// set default options based on the name parameter
// passed to the create method
this.getOptionsByName=function(name, options)
{
switch(name) {
case 'Share2' :
var opts = {};
opts.elements = [
{ id: 'Facebook', placeholder: 'service1Element' },
{ id: 'Twitter', placeholder: 'service2Element' },

];
opts.overlayElements = [
{ id: 'FeedTab', visible: false },
{ id: 'GroupsTab', visible: false},
{ id: 'OtherTab', visible: true, elements: [
{ id: 'Facebook', visible: true },
{ id: 'Twitter', visible: true },
{ id: 'StumbleUpon', visible: true },
{ id: 'Digg', visible: true },
{ id: 'MySpace', visible: true },
{ id: 'Blogger', visible: true },
{ id: 'GoogleBuzz', visible: true },
{ id: 'Yahoo', visible: true },
{ id: 'Orkut', visible: true },	
{ id: 'Hyves', visible: true }
]
}	
];

return $j.extend(opts, options);
break;
case 'Share' :
var opts = {}
opts.size = 'small';
opts.items = [
{ id: 'share', title: 'Share' },
{ id: 'addToFavorites', title: 'Favorite' }
];
return $j.extend(opts, options);
break;
case 'Rate' : 
var opts = {};
opts.size = 'small';

var ratings_title = 'Rate this';

if (options['ratings_title'] != null){
ratings_title = ratings_title + ' ' + options['ratings_title'];
}

opts.items = [
{ id: 'rate', title: ratings_title }
]; 

return $j.extend(opts, options);
break; 

case 'Statistics' :

var opts = {}
opts.size = 'small';

if ( options.hide_titles ) {
opts.items = [
{ id: 'viewCount', title: '' },
{ id: 'commentCount', title: ''},
{ id: 'contentRating', title: { thumbsUpTitle: '', thumbsDownTitle: '' }} 
];
} else {
opts.items = [
{ id: 'viewCount', title: 'Views' },
{ id: 'commentCount', title: 'Comments'},
{ id: 'contentRating', title: { thumbsUpTitle: 'Rating', thumbsDownTitle: 'Rating' }} 
];
}

if (!options.hide_ratings) {
var ratings_title = options.hide_titles ? '' : 'Rate ' + options['ratings_title'];
options['ratings_title'] = null;
options['hide_ratings'] = null;
opts.items.push({ id: 'rate', title: ratings_title });
}

return $j.extend(opts, options);
break;
case 'Usage' :
var opts = {};
opts.layout = 'horizontal';
opts.size = 'small';
opts.items = [
{ id: 'commentCount', title: 'comments' },
{ id: 'contentRating', title: { thumbsUpTitle: 'Rating', thumbsDownTitle: 'Rating' }} 
];
return $j.extend(opts, options);
break;
case 'Rating' :
var opts = {};
opts.layout = 'horizontal';
opts.size = 'small';
opts.items = [
{ id: 'commentCount', title: 'Comments' },
{ id: 'contentRating', title: { thumbsUpTitle: 'Rating', thumbsDownTitle: 'Rating' }},
{ id: 'rate' },
{ id: 'share', title: 'Share' },
{ id: 'addToFavorites', title: 'Favorite' }
];
return $j.extend(opts, options);
break;
case 'QuickMenu' :
var opts = {};
opts.showFBConnectButton = true;
return $j.extend(opts, options);
break;
default :
return options;
break;
}
}

this.getWidgetNameByName=function(name)
{
switch(name) {
case 'Rating' :
case 'Rate' :
case 'Usage' :
case 'Statistics' :
case 'Share' :
return 'ContentAction';
break;
case 'Share2' :
return 'Share';
break;
default :
return name;
break;
}
}
};

MTVN.Flux.widgetDelayLoad = function(arg) {
if ((typeof(MTV) == "undefined" || typeof(MTV.Flux) == "undefined") || typeof(MTV.Flux.ucid) == "undefined" || arg == "load") {
$j('.fluxWidget.delay-load').each(function(){
var widget = $j(this);

MTVN.UI.InView.register(widget, function() {
MTVN.Flux.Widgets.loadEach(widget);
});	
});
}
}

if (typeof(excludefluxWidgetLoadCall) == "undefined") $j(MTVN.Flux.widgetDelayLoad);

MTVN.Utils = {}

MTVN.Utils.Cookies = new function(){
this.create = function(name,value,days){
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

this.read = function(name){
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

this.erase = function(name){
MTVN.Utils.Cookies.create(name,"",-1);
}
}


