/*!
* jQuery JavaScript Library v1.5.2
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Thu Mar 31 15:28:23 2011 -0400
*/
(function(a,b){function ci(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cf(a){if(!b_[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";b_[a]=c}return b_[a]}function ce(a,b){var c={};d.each(cd.concat.apply([],cd.slice(0,b)),function(){c[this]=a});return c}function b$(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bZ(){try{return new a.XMLHttpRequest}catch(b){}}function bY(){d(a).unload(function(){for(var a in bW)bW[a](0,1)})}function bS(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h==="string"&&(f[h.toLowerCase()]=a.converters[h]);l=k,k=e[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=f[m]||f["* "+k];if(!n){p=b;for(o in f){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=f[j[1]+" "+k];if(p){o=f[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&d.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bR(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bQ(a,b,c,e){if(d.isArray(b)&&b.length)d.each(b,function(b,f){c||bs.test(a)?e(a,f):bQ(a+"["+(typeof f==="object"||d.isArray(f)?b:"")+"]",f,c,e)});else if(c||b==null||typeof b!=="object")e(a,b);else if(d.isArray(b)||d.isEmptyObject(b))e(a,"");else for(var f in b)bQ(a+"["+f+"]",b[f],c,e)}function bP(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bJ,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l==="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bP(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bP(a,c,d,e,"*",g));return l}function bO(a){return function(b,c){typeof b!=="string"&&(c=b,b="*");if(d.isFunction(c)){var e=b.toLowerCase().split(bD),f=0,g=e.length,h,i,j;for(;f<g;f++)h=e[f],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bq(a,b,c){var e=b==="width"?bk:bl,f=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return f;d.each(e,function(){c||(f-=parseFloat(d.css(a,"padding"+this))||0),c==="margin"?f+=parseFloat(d.css(a,"margin"+this))||0:f-=parseFloat(d.css(a,"border"+this+"Width"))||0});return f}function bc(a,b){b.src?d.ajax({url:b.src,async:!1,dataType:"script"}):d.globalEval(b.text||b.textContent||b.innerHTML||""),b.parentNode&&b.parentNode.removeChild(b)}function bb(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function ba(a,b){if(b.nodeType===1){var c=b.nodeName.toLowerCase();b.clearAttributes(),b.mergeAttributes(a);if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(d.expando)}}function _(a,b){if(b.nodeType===1&&d.hasData(a)){var c=d.expando,e=d.data(a),f=d.data(b,e);if(e=e[c]){var g=e.events;f=f[c]=d.extend({},e);if(g){delete f.handle,f.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)d.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function $(a,b){return d.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Q(a,b,c){if(d.isFunction(b))return d.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return d.grep(a,function(a,d){return a===b===c});if(typeof b==="string"){var e=d.grep(a,function(a){return a.nodeType===1});if(L.test(b))return d.filter(b,e,!c);b=d.filter(b,e)}return d.grep(a,function(a,e){return d.inArray(a,b)>=0===c})}function P(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function H(a,b){return(a&&a!=="*"?a+".":"")+b.replace(t,"`").replace(u,"&")}function G(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,p=[],q=[],s=d._data(this,"events");if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;i<t.length;i++)g=t[i],g.origType.replace(r,"")===a.type?q.push(g.selector):t.splice(i--,1);f=d(a.target).closest(q,a.currentTarget);for(j=0,k=f.length;j<k;j++){m=f[j];for(i=0;i<t.length;i++){g=t[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,e=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,e=d(a.relatedTarget).closest(g.selector)[0];(!e||e!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){f=p[j];if(c&&f.level>c)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function E(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function y(){return!0}function x(){return!1}function i(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function h(a,c,e){if(e===b&&a.nodeType===1){e=a.getAttribute("data-"+c);if(typeof e==="string"){try{e=e==="true"?!0:e==="false"?!1:e==="null"?null:d.isNaN(e)?g.test(e)?d.parseJSON(e):e:parseFloat(e)}catch(f){}d.data(a,c,e)}else e=b}return e}var c=a.document,d=function(){function G(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(G,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x,y,z=Object.prototype.toString,A=Object.prototype.hasOwnProperty,B=Array.prototype.push,C=Array.prototype.slice,D=String.prototype.trim,E=Array.prototype.indexOf,F={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.2",length:0,size:function(){return this.length},toArray:function(){return C.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?B.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),x.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(C.apply(this,arguments),"slice",C.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:B,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){e=i[c],f=a[c];if(i===f)continue;l&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,h=e&&d.isArray(e)?e:[]):h=e&&d.isPlainObject(e)?e:{},i[c]=d.extend(l,h,f)):f!==b&&(i[c]=f)}return i},d.extend({noConflict:function(b){a.$=f,b&&(a.jQuery=e);return d},isReady:!1,readyWait:1,ready:function(a){a===!0&&d.readyWait--;if(!d.readyWait||a!==!0&&!d.isReady){if(!c.body)return setTimeout(d.ready,1);d.isReady=!0;if(a!==!0&&--d.readyWait>0)return;x.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=d._Deferred();if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",y,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",y),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&G()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):F[z.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!A.call(a,"constructor")&&!A.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||A.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g<h;)if(c.apply(a[g++],e)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(var j=a[0];g<h&&c.call(j,g,j)!==!1;j=a[++g]){}return a},trim:D?function(a){return a==null?"":D.call(a)}:function(a){return a==null?"":(a+"").replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var e=d.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||d.isWindow(a)?B.call(c,a):d.merge(c,a)}return c},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length==="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,b,c){var d=[],e;for(var f=0,g=a.length;f<g;f++)e=b(a[f],f,c),e!=null&&(d[d.length]=e);return d.concat.apply([],d)},guid:1,proxy:function(a,c,e){arguments.length===2&&(typeof c==="string"?(e=a,a=e[c],c=b):c&&!d.isFunction(c)&&(e=c,c=b)),!c&&a&&(c=function(){return a.apply(e||this,arguments)}),a&&(c.guid=a.guid=a.guid||c.guid||d.guid++);return c},access:function(a,c,e,f,g,h){var i=a.length;if(typeof c==="object"){for(var j in c)d.access(a,j,c[j],f,g,e);return a}if(e!==b){f=!h&&f&&d.isFunction(e);for(var k=0;k<i;k++)g(a[k],c,f?e.call(a[k],k,g(a[k],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function b(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){F["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),E&&(d.inArray=function(a,b){return E.call(b,a)}),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?y=function(){c.removeEventListener("DOMContentLoaded",y,!1),d.ready()}:c.attachEvent&&(y=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",y),d.ready())});return d}(),e="then done fail isResolved isRejected promise".split(" "),f=[].slice;d.extend({_Deferred:function(){var a=[],b,c,e,f={done:function(){if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this},resolveWith:function(d,f){if(!e&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(d,f)}finally{b=[d,f],c=0}}return this},resolve:function(){f.resolveWith(this,arguments);return this},isResolved:function(){return c||b},cancel:function(){e=1,a=[];return this}};return f},Deferred:function(a){var b=d._Deferred(),c=d._Deferred(),f;d.extend(b,{then:function(a,c){b.done(a).fail(c);return this},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,promise:function(a){if(a==null){if(f)return f;f=a={}}var c=e.length;while(c--)a[e[c]]=b[e[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?f.call(arguments,0):c,--g||h.resolveWith(h,f.call(b,0))}}var b=arguments,c=0,e=b.length,g=e,h=e<=1&&a&&d.isFunction(a.promise)?a:d.Deferred();if(e>1){for(;c<e;c++)b[c]&&d.isFunction(b[c].promise)?b[c].promise().then(i(c),h.reject):--g;g||h.resolveWith(h,b)}else h!==a&&h.resolveWith(h,e?[a]:[]);return h.promise()}}),function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0,reliableMarginRight:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e)}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(a.style.width="1px",a.style.marginRight="0",d.support.reliableMarginRight=(parseInt(c.defaultView.getComputedStyle(a,null).marginRight,10)||0)===0),b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function");return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}}();var g=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!i(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c==="object"||typeof c==="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,g=b.nodeType,h=g?d.cache:b,j=g?b[d.expando]:d.expando;if(!h[j])return;if(c){var k=e?h[j][f]:h[j];if(k){delete k[c];if(!i(k))return}}if(e){delete h[j][f];if(!i(h[j]))return}var l=h[j][f];d.support.deleteExpando||h!=a?delete h[j]:h[j]=null,l?(h[j]={},g||(h[j].toJSON=d.noop),h[j][f]=l):g&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var f=this[0].attributes,g;for(var i=0,j=f.length;i<j;i++)g=f[i].name,g.indexOf("data-")===0&&(g=g.substr(5),h(this[0],g,e[g]))}}return e}if(typeof a==="object")return this.each(function(){d.data(this,a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(c===b){e=this.triggerHandler("getData"+k[1]+"!",[k[0]]),e===b&&this.length&&(e=d.data(this[0],a),e=h(this[0],a,e));return e===b&&k[1]?this.data(k[0]):e}return this.each(function(){var b=d(this),e=[k[0],c];b.triggerHandler("setData"+k[1]+"!",e),d.data(this,a,c),b.triggerHandler("changeData"+k[1]+"!",e)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})}}),d.extend({queue:function(a,b,c){if(a){b=(b||"fx")+"queue";var e=d._data(a,b);if(!c)return e||[];!e||d.isArray(c)?e=d._data(a,b,d.makeArray(c)):e.push(c);return e}},dequeue:function(a,b){b=b||"fx";var c=d.queue(a,b),e=c.shift();e==="inprogress"&&(e=c.shift()),e&&(b==="fx"&&c.unshift("inprogress"),e.call(a,function(){d.dequeue(a,b)})),c.length||d.removeData(a,b+"queue",!0)}}),d.fn.extend({queue:function(a,c){typeof a!=="string"&&(c=a,a="fx");if(c===b)return d.queue(this[0],a);return this.each(function(b){var e=d.queue(this,a,c);a==="fx"&&e[0]!=="inprogress"&&d.dequeue(this,a)})},dequeue:function(a){return this.each(function(){d.dequeue(this,a)})},delay:function(a,b){a=d.fx?d.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){d.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var j=/[\n\t\r]/g,k=/\s+/,l=/\r/g,m=/^(?:href|src|style)$/,n=/^(?:button|input)$/i,o=/^(?:button|input|object|select|textarea)$/i,p=/^a(?:rea)?$/i,q=/^(?:radio|checkbox)$/i;d.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"},d.fn.extend({attr:function(a,b){return d.access(this,a,b,!0,d.attr)},removeAttr:function(a,b){return this.each(function(){d.attr(this,a,""),this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.addClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"){var b=(a||"").split(k);for(var c=0,e=this.length;c<e;c++){var f=this[c];if(f.nodeType===1)if(f.className){var g=" "+f.className+" ",h=f.className;for(var i=0,j=b.length;i<j;i++)g.indexOf(" "+b[i]+" ")<0&&(h+=" "+b[i]);f.className=d.trim(h)}else f.className=a}}return this},removeClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"||a===b){var c=(a||"").split(k);for(var e=0,f=this.length;e<f;e++){var g=this[e];if(g.nodeType===1&&g.className)if(a){var h=(" "+g.className+" ").replace(j," ");for(var i=0,l=c.length;i<l;i++)h=h.replace(" "+c[i]+" "," ");g.className=d.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,e=typeof b==="boolean";if(d.isFunction(a))return this.each(function(c){var e=d(this);e.toggleClass(a.call(this,c,e.attr("class"),b),b)});return this.each(function(){if(c==="string"){var f,g=0,h=d(this),i=b,j=a.split(k);while(f=j[g++])i=e?i:!h.hasClass(f),h[i?"addClass":"removeClass"](f)}else if(c==="undefined"||c==="boolean")this.className&&d._data(this,"__className__",this.className),this.className=this.className||a===!1?"":d._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(j," ").indexOf(b)>-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var j=i?f:0,k=i?f+1:h.length;j<k;j++){var m=h[j];if(m.selected&&(d.support.optDisabled?!m.disabled:m.getAttribute("disabled")===null)&&(!m.parentNode.disabled||!d.nodeName(m.parentNode,"optgroup"))){a=d(m).val();if(i)return a;g.push(a)}}if(i&&!g.length&&h.length)return d(h[f]).val();return g}if(q.test(c.type)&&!d.support.checkOn)return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(l,"")}return b}var n=d.isFunction(a);return this.each(function(b){var c=d(this),e=a;if(this.nodeType===1){n&&(e=a.call(this,b,c.val())),e==null?e="":typeof e==="number"?e+="":d.isArray(e)&&(e=d.map(e,function(a){return a==null?"":a+""}));if(d.isArray(e)&&q.test(this.type))this.checked=d.inArray(c.val(),e)>=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=m.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&n.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var k=a.getAttributeNode("tabIndex");return k&&k.specified?k.value:o.test(a.nodeName)||p.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var l=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return l===null?b:l}h&&(a[c]=e);return a[c]}});var r=/\.(.*)$/,s=/^(?:textarea|input|select)$/i,t=/\./g,u=/ /g,v=/[^\w\s.|`]/g,w=function(a){return a.replace(v,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a)}catch(h){}if(f===!1)f=x;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(a){return typeof d!=="undefined"&&d.event.triggered!==a.type?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=x);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),w).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))d.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=d.event.special[h]||{};for(j=f||0;j<p.length;j++){q=p[j];if(e.guid===q.guid){if(l||n.test(q.namespace))f==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(f!=null)break}}if(p.length===0||f!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&d.removeEvent(a,h,s.handle),g=null,delete t[h]}if(d.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,d.isEmptyObject(s)&&d.removeData(a,b,!0)}}},trigger:function(a,c,e){var f=a.type||a,g=arguments[3];if(!g){a=typeof a==="object"?a[d.expando]?a:d.extend(d.Event(f),a):d.Event(f),f.indexOf("!")>=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(r,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=a.type,l[m]())}catch(p){}k&&(l["on"+m]=k),d.event.triggered=b}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l<m;l++){var n=f[l];if(e||h.test(n.namespace)){c.handler=n.handler,c.data=n.data,c.handleObj=n;var o=n.handler.apply(this,k);o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[d.expando])return a;var e=a;a=d.Event(e);for(var f=this.props.length,g;f;)g=this.props[--f],a[g]=e[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=c.documentElement,i=c.body;a.pageX=a.clientX+(h&&h.scrollLeft||i&&i.scrollLeft||0)-(h&&h.clientLeft||i&&i.clientLeft||0),a.pageY=a.clientY+(h&&h.scrollTop||i&&i.scrollTop||0)-(h&&h.clientTop||i&&i.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:d.proxy,special:{ready:{setup:d.bindReady,teardown:d.noop},live:{add:function(a){d.event.add(this,H(a.origType,a.selector),d.extend({},a,{handler:G,guid:a.handler.guid}))},remove:function(a){d.event.remove(this,H(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){d.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},d.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},d.Event=function(a){if(!this.preventDefault)return new d.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?y:x):this.type=a,this.timeStamp=d.now(),this[d.expando]=!0},d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=y;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=y;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=y,this.stopPropagation()},isDefaultPrevented:x,isPropagationStopped:x,isImmediatePropagationStopped:x};var z=function(a){var b=a.relatedTarget;try{if(b&&b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&(a.type=a.data,d.event.handle.apply(this,arguments))}catch(e){}},A=function(a){a.type=a.data,d.event.handle.apply(this,arguments)};d.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){d.event.special[a]={setup:function(c){d.event.add(this,b,c&&c.selector?A:z,a)},teardown:function(a){d.event.remove(this,b,a&&a.selector?A:z)}}}),d.support.submitBubbles||(d.event.special.submit={setup:function(a,b){if(this.nodeName&&this.nodeName.toLowerCase()!=="form")d.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&d(b).closest("form").length&&E("submit",this,arguments)}),d.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&d(b).closest("form").length&&a.keyCode===13&&E("submit",this,arguments)});else return!1},teardown:function(a){d.event.remove(this,".specialSubmit")}});if(!d.support.changeBubbles){var B,C=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},D=function D(a){var c=a.target,e,f;if(s.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=C(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:D,beforedeactivate:D,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&D.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&D.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",C(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in B)d.event.add(this,c+".specialChange",B[c]);return s.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return s.test(this.nodeName)}},B=d.event.special.change.filters,B.focus=B.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function f(a){var c=d.event.fix(a);c.type=b,c.originalEvent={},d.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var e=0;d.event.special[b]={setup:function(){e++===0&&c.addEventListener(a,f,!0)},teardown:function(){--e===0&&c.removeEventListener(a,f,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i<j;i++)d.event.add(this[i],a,h,e);return this}}),d.fn.extend({unbind:function(a,b){if(typeof a!=="object"||a.preventDefault)for(var e=0,f=this.length;e<f;e++)d.event.remove(this[e],a,b);else for(var c in a)this.unbind(c,a[c]);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){d.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var c=d.Event(a);c.preventDefault(),c.stopPropagation(),d.event.trigger(c,b,this[0]);return c.result}},toggle:function(a){var b=arguments,c=1;while(c<b.length)d.proxy(a,b[c++]);return this.click(d.proxy(a,function(e){var f=(d._data(this,"lastToggle"+a.guid)||0)%c;d._data(this,"lastToggle"+a.guid,f+1),e.preventDefault();return b[f].apply(this,arguments)||!1}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var F={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};d.each(["live","die"],function(a,c){d.fn[c]=function(a,e,f,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:d(this.context);if(typeof a==="object"&&!a.preventDefault){for(var o in a)n[c](o,e,a[o],m);return this}d.isFunction(e)&&(f=e,e=b),a=(a||"").split(" ");while((h=a[i++])!=null){j=r.exec(h),k="",j&&(k=j[0],h=h.replace(r,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,h==="focus"||h==="blur"?(a.push(F[h]+k),h=h+k):h=(F[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)d.event.add(n[p],"live."+H(h,m),{data:e,selector:m,handler:f,origType:h,origHandler:f,preType:l});else n.unbind("live."+H(h,m),f)}return this}}),d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){d.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!=="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(u)if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else e.push.apply(e,n);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!=="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(f){if(f===!0)continue}else g=o=!0}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.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|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!=="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"text"===c&&(b===c||b===null)},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(a===b){g=!0;return 0}if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};d.find=k,d.expr=k.selectors,d.expr[":"]=d.expr.filters,d.unique=k.uniqueSort,d.text=k.getText,d.isXMLDoc=k.isXML,d.contains=k.contains}();var I=/Until$/,J=/^(?:parents|prevUntil|prevAll)/,K=/,/,L=/^.[^:#\[\.,]*$/,M=Array.prototype.slice,N=d.expr.match.POS,O={children:!0,contents:!0,next:!0,prev:!0};d.fn.extend({find:function(a){var b=this.pushStack("","find",a),c=0;for(var e=0,f=this.length;e<f;e++){c=b.length,d.find(a,this[e],b);if(e>0)for(var g=c;g<b.length;g++)for(var h=0;h<c;h++)if(b[h]===b[g]){b.splice(g--,1);break}}return b},has:function(a){var b=d(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(d.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(Q(this,a,!1),"not",a)},filter:function(a){return this.pushStack(Q(this,a,!0),"filter",a)},is:function(a){return!!a&&d.filter(a,this).length>0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e<f;e++)i=a[e],j[i]||(j[i]=d.expr.match.POS.test(i)?d(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=N.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e<f;e++){g=this[e];while(g){if(l?l.index(g)>-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(P(c[0])||P(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=M.call(arguments);I.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!O[a]?d.unique(f):f,(this.length>1||K.test(e))&&J.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var R=/ jQuery\d+="(?:\d+|null)"/g,S=/^\s+/,T=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,U=/<([\w:]+)/,V=/<tbody/i,W=/<|&#?\w+;/,X=/<(?:script|object|embed|option|style)/i,Y=/checked\s*(?:[^=]|=\s*.checked.)/i,Z={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};Z.optgroup=Z.option,Z.tbody=Z.tfoot=Z.colgroup=Z.caption=Z.thead,Z.th=Z.td,d.support.htmlSerialize||(Z._default=[1,"div<div>","</div>"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(R,""):null;if(typeof a!=="string"||X.test(a)||!d.support.leadingWhitespace&&S.test(a)||Z[(U.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(T,"<$1></$2>");try{for(var c=0,e=this.length;c<e;c++)this[c].nodeType===1&&(d.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(f){this.empty().append(a)}}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(d.isFunction(a))return this.each(function(b){var c=d(this),e=c.html();c.replaceWith(a.call(this,b,e))});typeof a!=="string"&&(a=d(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;d(this).remove(),b?d(b).before(a):d(c).append(a)})}return this.length?this.pushStack(d(d.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,e){var f,g,h,i,j=a[0],k=[];if(!d.support.checkClone&&arguments.length===3&&typeof j==="string"&&Y.test(j))return this.each(function(){d(this).domManip(a,c,e,!0)});if(d.isFunction(j))return this.each(function(f){var g=d(this);a[0]=j.call(this,f,c?g.html():b),g.domManip(a,c,e)});if(this[0]){i=j&&j.parentNode,d.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?f={fragment:i}:f=d.buildFragment(a,this,k),h=f.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&d.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)e.call(c?$(this[l],g):this[l],f.cacheable||m>1&&l<n?d.clone(h,!0,!0):h)}k.length&&d.each(k,bc)}return this}}),d.buildFragment=function(a,b,e){var f,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]==="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!X.test(a[0])&&(d.support.checkClone||!Y.test(a[0]))&&(g=!0,h=d.fragments[a[0]],h&&(h!==1&&(f=h))),f||(f=i.createDocumentFragment(),d.clean(a,i,f,e)),g&&(d.fragments[a[0]]=h?f:1);return{fragment:f,cacheable:g}},d.fragments={},d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(c){var e=[],f=d(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&f.length===1){f[b](this[0]);return this}for(var h=0,i=f.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){ba(a,e),f=bb(a),g=bb(e);for(h=0;f[h];++h)ba(f[h],g[h])}if(b){_(a,e);if(c){f=bb(a),g=bb(e);for(h=0;f[h];++h)_(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||W.test(i)){if(typeof i==="string"){i=i.replace(T,"<$1></$2>");var j=(U.exec(i)||["",""])[1].toLowerCase(),k=Z[j]||Z._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=V.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]==="<table>"&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&S.test(i)&&m.insertBefore(b.createTextNode(S.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bd=/alpha\([^)]*\)/i,be=/opacity=([^)]*)/,bf=/-([a-z])/ig,bg=/([A-Z]|^ms)/g,bh=/^-?\d+(?:px)?$/i,bi=/^-?\d/,bj={position:"absolute",visibility:"hidden",display:"block"},bk=["Left","Right"],bl=["Top","Bottom"],bm,bn,bo,bp=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bm(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bm)return bm(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bf,bp)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bq(a,b,e):d.swap(a,bj,function(){f=bq(a,b,e)});if(f<=0){f=bm(a,b,b),f==="0px"&&bo&&(f=bo(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!bh.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return be.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bd.test(f)?f.replace(bd,e):c.filter+" "+e}}),d(function(){d.support.reliableMarginRight||(d.cssHooks.marginRight={get:function(a,b){var c;d.swap(a,{display:"inline-block"},function(){b?c=bm(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bn=function(a,c,e){var f,g,h;e=e.replace(bg,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bo=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bh.test(d)&&bi.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bm=bn||bo,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var br=/%20/g,bs=/\[\]$/,bt=/\r?\n/g,bu=/#.*$/,bv=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bw=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bx=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,by=/^(?:GET|HEAD)$/,bz=/^\/\//,bA=/\?/,bB=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bC=/^(?:select|textarea)/i,bD=/\s+/,bE=/([?&])_=[^&]*/,bF=/(^|\-)([a-z])/g,bG=function(a,b,c){return b+c.toUpperCase()},bH=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bI=d.fn.load,bJ={},bK={},bL,bM;try{bL=c.location.href}catch(bN){bL=c.createElement("a"),bL.href="",bL=bL.href}bM=bH.exec(bL.toLowerCase())||[],d.fn.extend({load:function(a,c,e){if(typeof a!=="string"&&bI)return bI.apply(this,arguments);if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var g=a.slice(f,a.length);a=a.slice(0,f)}var h="GET";c&&(d.isFunction(c)?(e=c,c=b):typeof c==="object"&&(c=d.param(c,d.ajaxSettings.traditional),h="POST"));var i=this;d.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?d("<div>").append(c.replace(bB,"")).find(g):c)),e&&i.each(e,[c,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bC.test(this.nodeName)||bw.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(bt,"\r\n")}}):{name:b.name,value:c.replace(bt,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,c){d[c]=function(a,e,f,g){d.isFunction(e)&&(g=g||f,f=e,e=b);return d.ajax({type:c,url:a,data:e,success:f,dataType:g})}}),d.extend({getScript:function(a,c){return d.get(a,b,c,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a,b){b?d.extend(!0,a,d.ajaxSettings,b):(b=a,a=d.extend(!0,d.ajaxSettings,b));for(var c in {context:1,url:1})c in b?a[c]=b[c]:c in d.ajaxSettings&&(a[c]=d.ajaxSettings[c]);return a},ajaxSettings:{url:bL,isLocal:bx.test(bM[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bO(bJ),ajaxTransport:bO(bK),ajax:function(a,c){function v(a,c,l,n){if(r!==2){r=2,p&&clearTimeout(p),o=b,m=n||"",u.readyState=a?4:0;var q,t,v,w=l?bR(e,u,l):b,x,y;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=u.getResponseHeader("Last-Modified"))d.lastModified[k]=x;if(y=u.getResponseHeader("Etag"))d.etag[k]=y}if(a===304)c="notmodified",q=!0;else try{t=bS(e,w),c="success",q=!0}catch(z){c="parsererror",v=z}}else{v=c;if(!c||a)c="error",a<0&&(a=0)}u.status=a,u.statusText=c,q?h.resolveWith(f,[t,c,u]):h.rejectWith(f,[u,c,v]),u.statusCode(j),j=b,s&&g.trigger("ajax"+(q?"Success":"Error"),[u,e,q?t:v]),i.resolveWith(f,[u,c]),s&&(g.trigger("ajaxComplete",[u,e]),--d.active||d.event.trigger("ajaxStop"))}}typeof a==="object"&&(c=a,a=b),c=c||{};var e=d.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof d)?d(f):d.event,h=d.Deferred(),i=d._Deferred(),j=e.statusCode||{},k,l={},m,n,o,p,q,r=0,s,t,u={readyState:0,setRequestHeader:function(a,b){r||(l[a.toLowerCase().replace(bF,bG)]=b);return this},getAllResponseHeaders:function(){return r===2?m:null},getResponseHeader:function(a){var c;if(r===2){if(!n){n={};while(c=bv.exec(m))n[c[1].toLowerCase()]=c[2]}c=n[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){r||(e.mimeType=a);return this},abort:function(a){a=a||"abort",o&&o.abort(a),v(0,a);return this}};h.promise(u),u.success=u.done,u.error=u.fail,u.complete=i.done,u.statusCode=function(a){if(a){var b;if(r<2)for(b in a)j[b]=[j[b],a[b]];else b=a[u.status],u.then(b,b)}return this},e.url=((a||e.url)+"").replace(bu,"").replace(bz,bM[1]+"//"),e.dataTypes=d.trim(e.dataType||"*").toLowerCase().split(bD),e.crossDomain==null&&(q=bH.exec(e.url.toLowerCase()),e.crossDomain=q&&(q[1]!=bM[1]||q[2]!=bM[2]||(q[3]||(q[1]==="http:"?80:443))!=(bM[3]||(bM[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!=="string"&&(e.data=d.param(e.data,e.traditional)),bP(bJ,e,c,u);if(r===2)return!1;s=e.global,e.type=e.type.toUpperCase(),e.hasContent=!by.test(e.type),s&&d.active++===0&&d.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(bA.test(e.url)?"&":"?")+e.data),k=e.url;if(e.cache===!1){var w=d.now(),x=e.url.replace(bE,"$1_="+w);e.url=x+(x===e.url?(bA.test(e.url)?"&":"?")+"_="+w:"")}}if(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)l["Content-Type"]=e.contentType;e.ifModified&&(k=k||e.url,d.lastModified[k]&&(l["If-Modified-Since"]=d.lastModified[k]),d.etag[k]&&(l["If-None-Match"]=d.etag[k])),l.Accept=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"];for(t in e.headers)u.setRequestHeader(t,e.headers[t]);if(e.beforeSend&&(e.beforeSend.call(f,u,e)===!1||r===2)){u.abort();return!1}for(t in {success:1,error:1,complete:1})u[t](e[t]);o=bP(bK,e,c,u);if(o){u.readyState=1,s&&g.trigger("ajaxSend",[u,e]),e.async&&e.timeout>0&&(p=setTimeout(function(){u.abort("timeout")},e.timeout));try{r=1,o.send(l,v)}catch(y){status<2?v(-1,y):d.error(y)}}else v(-1,"No Transport");return u},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery&&!d.isPlainObject(a))d.each(a,function(){f(this.name,this.value)});else for(var g in a)bQ(g,a[g],c,f);return e.join("&").replace(br,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bT=d.now(),bU=/(\=)\?(&|$)|\?\?/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bT++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){var f=typeof b.data==="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bU.test(b.url)||f&&bU.test(b.data))){var g,h=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2",m=function(){a[h]=i,g&&d.isFunction(i)&&a[h](g[0])};b.jsonp!==!1&&(j=j.replace(bU,l),b.url===j&&(f&&(k=k.replace(bU,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},e.then(m,m),b.converters["script json"]=function(){g||d.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bV=d.now(),bW,bX;d.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&bZ()||b$()}:bZ,bX=d.ajaxSettings.xhr(),d.support.ajax=!!bX,d.support.cors=bX&&"withCredentials"in bX,bX=b,d.support.ajax&&d.ajaxTransport(function(a){if(!a.crossDomain||d.support.cors){var c;return{send:function(e,f){var g=a.xhr(),h,i;a.username?g.open(a.type,a.url,a.async,a.username,a.password):g.open(a.type,a.url,a.async);if(a.xhrFields)for(i in a.xhrFields)g[i]=a.xhrFields[i];a.mimeType&&g.overrideMimeType&&g.overrideMimeType(a.mimeType),!a.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(a.hasContent&&a.data||null),c=function(e,i){var j,k,l,m,n;try{if(c&&(i||g.readyState===4)){c=b,h&&(g.onreadystatechange=d.noop,delete bW[h]);if(i)g.readyState!==4&&g.abort();else{j=g.status,l=g.getAllResponseHeaders(),m={},n=g.responseXML,n&&n.documentElement&&(m.xml=n),m.text=g.responseText;try{k=g.statusText}catch(o){k=""}j||!a.isLocal||a.crossDomain?j===1223&&(j=204):j=m.text?200:404}}}catch(p){i||f(-1,p)}m&&f(j,k,m,l)},a.async&&g.readyState!==4?(bW||(bW={},bY()),h=bV++,g.onreadystatechange=bW[h]=c):c()},abort:function(){c&&c(0,1)}}}});var b_={},ca=/^(?:toggle|show|hide)$/,cb=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cc,cd=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(ce("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)e=this[g],f=e.style.display,!d._data(e,"olddisplay")&&f==="none"&&(f=e.style.display=""),f===""&&d.css(e,"display")==="none"&&d._data(e,"olddisplay",cf(e.nodeName));for(g=0;g<h;g++){e=this[g],f=e.style.display;if(f===""||f==="none")e.style.display=d._data(e,"olddisplay")||""}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ce("hide",3),a,b,c);for(var e=0,f=this.length;e<f;e++){var g=d.css(this[e],"display");g!=="none"&&!d._data(this[e],"olddisplay")&&d._data(this[e],"olddisplay",g)}for(e=0;e<f;e++)this[e].style.display="none";return this},_toggle:d.fn.toggle,toggle:function(a,b,c){var e=typeof a==="boolean";d.isFunction(a)&&d.isFunction(b)?this._toggle.apply(this,arguments):a==null||e?this.each(function(){var b=e?a:d(this).is(":hidden");d(this)[b?"show":"hide"]()}):this.animate(ce("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){var f=d.speed(b,c,e);if(d.isEmptyObject(a))return this.each(f.complete);return this[f.queue===!1?"each":"queue"](function(){var b=d.extend({},f),c,e=this.nodeType===1,g=e&&d(this).is(":hidden"),h=this;for(c in a){var i=d.camelCase(c);c!==i&&(a[i]=a[c],delete a[c],c=i);if(a[c]==="hide"&&g||a[c]==="show"&&!g)return b.complete.call(this);if(e&&(c==="height"||c==="width")){b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(d.css(this,"display")==="inline"&&d.css(this,"float")==="none")if(d.support.inlineBlockNeedsLayout){var j=cf(this.nodeName);j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)}else this.style.display="inline-block"}d.isArray(a[c])&&((b.specialEasing=b.specialEasing||{})[c]=a[c][1],a[c]=a[c][0])}b.overflow!=null&&(this.style.overflow="hidden"),b.curAnim=d.extend({},a),d.each(a,function(c,e){var f=new d.fx(h,b,c);if(ca.test(e))f[e==="toggle"?g?"show":"hide":e](a);else{var i=cb.exec(e),j=f.cur();if(i){var k=parseFloat(i[2]),l=i[3]||(d.cssNumber[c]?"":"px");l!=="px"&&(d.style(h,c,(k||1)+l),j=(k||1)/f.cur()*j,d.style(h,c,j+l)),i[1]&&(k=(i[1]==="-="?-1:1)*k+j),f.custom(j,k,l)}else f.custom(j,e,"")}});return!0})},stop:function(a,b){var c=d.timers;a&&this.queue([]),this.each(function(){for(var a=c.length-1;a>=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:ce("show",1),slideUp:ce("hide",1),slideToggle:ce("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a==="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=d.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||(d.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!cc&&(cc=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||d.fx.stop()},interval:13,stop:function(){clearInterval(cc),cc=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){d.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),d.expr&&d.expr.filters&&(d.expr.filters.animated=function(a){return d.grep(d.timers,function(b){return a===b.elem}).length});var cg=/^t(?:able|d|h)$/i,ch=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?d.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement;if(!c||!d.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=f.body,i=ci(f),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||d.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||d.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:d.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);d.offset.initialize();var c,e=b.offsetParent,f=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(d.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===e&&(l+=b.offsetTop,m+=b.offsetLeft,d.offset.doesNotAddBorder&&(!d.offset.doesAddBorderForTableAndCells||!cg.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),f=e,e=b.offsetParent),d.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;d.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},d.offset={initialize:function(){var a=c.body,b=c.createElement("div"),e,f,g,h,i=parseFloat(d.css(a,"marginTop"))||0,j="<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>";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=(e==="absolute"||e==="fixed")&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=ch.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&(!ch.test(a.nodeName)&&d.css(a,"position")==="static"))a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=ci(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=ci(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a==="string"?a:a+"px")}}),a.jQuery=a.$=d})(window);

/* 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;
var newHat = " defaultMiscBucket";
//bodyTag.className = classList + newHat + "";
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>");
}
}

//Including Coda 3 config from CODA/sites/mtv.com/staging/config.js

if(typeof btg=="undefined")var btg = {};

btg.config={
version:'3',
defferedAdLoading: false,
Omniture:{
enabled: true,
account: (typeof com_mtvi_mtv2flag!="undefined"&&com_mtvi_mtv2flag==true?'viamtv,viamtv2onmtv':'viamtv'),
charSet: 'ISO-8859-1',
dynamicAccountSelection: 'true',
dynamicAccountList: 'devviamtv=mtv-d,mtv-q,mtv-jd,mtv-jq,mtvx-d,mtvx-jd,posting.mtv,stage.mtv,origin.www.mtv,origin.mtv',
linkInternalFilters: 'javascript:,mtv.com,mtvx.com,mtvn.com',
videoViewEventDisable: false,
enableTimeParting: true,
trackInlineStats: true,
defaultHier: 'hier2',
enableVisitorNamespace: 'false',
enableMtvnVisitorGuid: false,
enableMeteorPlugin: false,
enableGuidPlugin: true,
enableGuidAuxiliaryCall: true,
enableFirstPartyCookie: false,
tabletAccount: '',
timezone: '-5',
trackExternalLinks: 'true',
fluxCommunityId:'D3FCFFFF0002D51D0002FFFFFCD3'
},
Nielsen:{
enabled: false,
cid: 'us-400235',
videoCensusId: 'c02'
},
GoogleAnalytics:{
enabled: false,
account: '',
reportMode: '' // iframe/direct
},
QuantCast:{
enabled: true,
adsEnabled: 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"
},
DoubleClick:{
enabled: true,
dartSite: 'mtv.mtvi'
},
FreeWheel:{ 
enabled: false,
type: 'MRM'
},
International:{
enabled: false,
dartSite: ''
},
ABTest:{
enabled: false
},
FluxHosted:{
enabled: false
},
Photos:{
enabled: true
},
TestAndTarget:{
enabled: false
},
Demdex:{
enabled:true
}
};

//Including Coda 3 build.
//Coda v.3.1 - Build 60 - Sprint 63 - 01/26/2012

var btg=typeof btg==="object"?btg:{};btg.config=typeof btg.config==="object"?btg.config:{};btg.isCoreLoaded=false;
btg.globalvars={VISITOR_NAMESPACE:"mtvn",IS_CODA_ADS_USED:false,USER_AGENT:new function(){if(/MSIE/.test(navigator.userAgent))this.BROWSER="MSIE";else this.BROWSER="Other"},MODULES_URL:"http://btg.mtvnservices.com/aria/mods.html",IS_TOP_ACCESSIBLE:function(){try{return typeof top.location.search!="undefined"&&typeof top.location.search!="unknown"}catch(b){return false}}(),PAGE_URL:function(){try{var b="",b=self.location.pathname;if(b=="")b="/";return b}catch(c){}}(),IS_UNIT_TEST:function(){try{return location.href.toLowerCase().indexOf("/api/jsunittest/tests/")!=
-1}catch(b){return false}}(),FORCE_AD_WAIT_TIME:{PLAYER_LOADED:1E4,PLAYER_FAILED:1E4,PLAYER_LOAD_WAIT_TIME:1E4},VALID_DCOPT:["ist"],ON_DOCUMENT_READY:function(){window.DOMLOADED=false;window.onload=function(){if(window.DOMLOADED==false&&btg.config.defferedAdLoading)btg.AdManager.placeAllAds()};document.onreadystatechange=function(){if(document.readyState=="complete"&&btg.config.defferedAdLoading){window.DOMLOADED=true;btg.AdManager.placeAllAds()}}}()};
btg.loadLocalConfig=function(){if(typeof btg.config!="undefined"&&typeof btg.config!="undefined")btg.Object.copyProperties(btg.config,this.config,true);if(typeof MTVN!="undefined"&&typeof MTVN.config!="undefined"&&typeof MTVN.config.btg!="undefined")btg.Object.copyProperties(MTVN.config.btg,this.config,true);if(typeof mtvn!="undefined"&&typeof mtvn.btg!="undefined"&&typeof mtvn.btg.config!="undefined"){if(typeof mtvn.btg.config.ReportSettings!="undefined")for(r in mtvn.btg.config.ReportSettings){if(!mtvn.btg.config.ReportSettings.hasOwnProperty(r))continue;
if(typeof mtvn.btg.config.ReportSettings[r]==="object")btg.Object.copyProperties(mtvn.btg.config.ReportSettings[r],this.config[r],true);else this.config[r]=mtvn.btg.config.ReportSettings[r]}if(typeof mtvn.btg.config.AdSettings!="undefined")for(a in mtvn.btg.config.AdSettings){if(!mtvn.btg.config.AdSettings.hasOwnProperty(a))continue;if(typeof mtvn.btg.config.AdSettings[a]==="object")btg.Object.copyProperties(mtvn.btg.config.AdSettings[a],this.config[a],true);else this.config[a]=mtvn.btg.config.AdSettings[a]}}if(typeof com!=
"undefined"&&typeof com.mtvi!="undefined"&&typeof com.mtvi.reporting!="undefined"&&typeof com.mtvi.reporting.Account!="undefined"){if(typeof this.config.Omniture=="undefined")this.config.Omniture={enabled:true};this.config.Omniture.account=com.mtvi.reporting.Account.name;this.config.Omniture.dynamicAccountSelection=com.mtvi.reporting.Account.dynamic;this.config.Omniture.dynamicAccountList=com.mtvi.reporting.Account.list;this.config.Omniture.indexFileName=com.mtvi.reporting.Account.defaultIndexFileName;
this.config.Omniture.linkInternalFilters=com.mtvi.reporting.Account.filters;if(typeof com.mtvi.reporting.Account.dartSite!="undefined"){this.config.DoubleClick.enabled=true;this.config.DoubleClick.dartSite=com.mtvi.reporting.Account.dartSite}}if(typeof com!="undefined"&&typeof com.mtvi!="undefined"&&typeof com.mtvi.config!="undefined"&&typeof com.mtvi.config.SectionSetup!="undefined")btg.Object.copyProperties(com.mtvi.config.SectionSetup,this.config.Omniture,true)};
btg.loadModules=function(){var b=[],c=this.config;if(typeof c.TestAndTarget!="undefined"&&typeof c.TestAndTarget.enabled!="undefined"&&c.TestAndTarget.enabled)b.push("TestAndTarget");if(typeof c.Photos!="undefined"&&typeof c.Photos.enabled!="undefined"&&c.Photos.enabled)b.push("Photos");if(typeof c.ABTest!="undefined"&&typeof c.ABTest.enabled!="undefined"&&c.ABTest.enabled)b.push("ABTest");if(typeof c.FluxHosted!="undefined"&&typeof c.FluxHosted.enabled!="undefined"&&c.FluxHosted.enabled)b.push("FluxHosted");
if(typeof c.Meteor!="undefined"&&typeof c.Meteor.enabled!="undefined"&&c.Meteor.enabled)b.push("Meteor");b=btg.globalvars.MODULES_URL+"?m="+b.join(",")+"&v="+btg.Controller.getVersion();btg.DOM.loadScript(b)};
btg.Controller=new function(){var b=btg.globalvars,c=true,d=true,e=false,f="";this.init=function(){btg.loadLocalConfig();btg.loadModules();b.IS_LIVE_ENV=function(){var c=true;try{if(btg.String.isDefined(btg.config.Omniture.dynamicAccountList)){var d=btg.config.Omniture.dynamicAccountList,f=d.indexOf("=");if(f>-1){var d=d.substring(f+1),d=d.split(","),e=self.location.hostname;if(b.IS_TOP_ACCESSIBLE)e=top.location.hostname;for(var f=0,l=d.length;f<l;f++)if(e.indexOf(d[f])>-1){c=false;break}}}}catch(o){}return c}();
f=typeof b.PAGE_URL=="string"&&b.PAGE_URL!=""?b.PAGE_URL:location.pathname;if(f.charAt(f.length-1)=="/")f+=typeof btg.config.indexFileName=="string"?btg.config.indexFileName:"index";btg.config._defaultPageName=f;btg.ReportingManager.init();btg.AdManager.init();if(typeof btg.TestAndTarget!="undefined")btg.TestAndTarget.init();this.init=function(){btg.loadLocalConfig();return this};return this};this.gameInit=function(){if(!c&&btg.config){btg.ReportingManager.init();c=true}if(!d&&btg.config){btg.AdManager.init();
d=true}if(!e&&com.mtvnet.games.GameSettings){btg.GameReportingManager.init();btg.GameAdManager.init();e=true}return true};this.loadGame=function(b){if(e){btg.GameAdManager.loadGame(b);btg.GameReportingManager.gameLoad(b)}};this.sendPageCall=function(b){this.init();if(c){if(typeof b=="undefined"||!b)b={};btg.ReportingManager.sendPageCall(b);btg.ReportingManager.getData()}};this.sendLinkEvent=function(b){this.init();if(c){if(typeof b=="undefined"||!b)b={};btg.ReportingManager.sendLinkEvent(b)}};this.placeAd=
function(b){this.init();if(d)if(btg.config.defferedAdLoading)return btg.AdManager.placeAdTag(b,true);else{b=btg.AdManager.placeAd(b);btg.AdManager.getData();return b}};this.reloadAds=function(){btg.AdManager.reloadAll();return this};this.placeIFrameAd=function(b,c){this.init();btg.AdManager.placeIFrameAd(b,c)};this.getAdUrl=function(b){this.init();if(d)return btg.AdManager.getAdUrl(b)};this.getVersion=function(){return btg.config.version};this.createMboxes=function(b){if(typeof mboxDefine=="function"&&
typeof btg.config.Omniture.enableTestAndTarget=="boolean"&&btg.config.Omniture.enableTestAndTarget&&typeof btg.TestAndTarget!="undefined")btg.TestAndTarget.createMboxes(b)};this.setChoiceStreamRequest=function(b,d){if(c)btg.ReportingManager.setChoiceStreamRequest(b,d)}};btg.Beacon=function(b){this.url=b;this.data=null};
btg.Beacon.prototype={setData:function(b){this.data=btg.Object.toString(b,"&")},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 b=new Image(1,1);b.src=this.formatSrc();b.onload=function(){};b.onabort=function(){};b.onerror=function(){}}};
btg.Alert=function(b,c){if(!b)return;switch(c){case 1:var d="Warning";break;case 2:d="Alert";break;default:d="Error"}this.dependencies=new btg.DependencyManager;this.dependencies.add("ga_script_load",function(){return typeof _gat=="object"},100);this.dependencies.checkDependency("ga_script_load");if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,function(){new btg.Alert(b,c)});return}var e=_gat._createTracker("UA-18578264-1","coda_alerts_tracker");e._setDomainName("");e._trackEvent(location.hostname,
location.pathname,d+": "+b)};
btg.Cookie={read:function(b){for(var b=b+"=",c=document.cookie.split(";"),d=0,e=c.length;d<e;d++){for(var f=c[d];f.charAt(0)==" ";)f=f.substring(1,f.length);if(f.indexOf(b)==0)return unescape(f.substring(b.length,f.length))}return null},set:function(b,c,d,e,f){b=b+"="+escape(c)+"; path=/";if(d)b+=";expires="+d;if(!f){f=document.domain.split(".");f=f.length>2?f[f.length-2]+"."+f[f.length-1]:document.domain}if(f!="localhost")b+=";domain="+f;b+=";path="+(e?e:"/");document.cookie=b},remove:function(b,
c,d){b=b+"=";if(!d){d=document.domain.split(".");d=d.length>2?d[d.length-2]+"."+d[d.length-1]:document.domain}if(d!="localhost")b+=";domain="+d;b+=";path="+(c?c:"/");b+=";expires=Thu, 01-Jan-1970 00:00:01 GMT";document.cookie=b}};
btg.DOM={Events:{addListener:function(b,c,d){if(c=="DOMContentLoaded"&&!b.addEventListener)document.onreadystatechange=function(){if(document.readyState=="complete")d()};else if(b.attachEvent)b.attachEvent("on"+c,d);else if(b.addEventListener)b.addEventListener(c,d,false);else b["on"+c]=d},removeListener:function(b,c,d){if(b.detachEvent)b.detachEvent("on"+c,d);else if(b.removeEventListener)b.removeEventListener(c,d,false);else b["on"+c]=null}},createIframe:function(b){for(var c=document.createElement("iframe"),
d=["id","name","width","height","scrolling","frameBorder","marginHeight","marginWidth","noResize"],e=d.length,f=0;f<e;f++){var g=d[f],h=b[g];if(h){c[g]=h;c.setAttribute(g,h)}}return c},appendIframe:function(b){if(!b.src)return null;if(!b.parent||b.parent.nodeType!==1)b.parent=document.body;if(typeof b.style!=="object")b.style={height:"1px",width:"1px",visibility:"hidden",position:"absolute",bottom:"0",left:"-1000px"};var c=this.createIframe(b);if(typeof b.onload==="function")c.onload=b.onload;this.applyStyle(c,
b.style);b.parent.appendChild(c);c.src=b.src;return c},applyStyle:function(b,c){if(!btg.Object.isDefined(c)||!btg.Object.isDefined(b))return;var d=btg.Object.toString(c,";",":");if(btg.globalvars.USER_AGENT.BROWSER=="MSIE"){if(!btg.String.isDefined(b.id))b.id="coda_iframe_"+(new Date).getTime();document.createStyleSheet().addRule("#"+b.id,d)}else b.setAttribute("style",d)},loadScript:function(b,c,d){if(btg.String.isDefined(b))try{var e=document.createElement("script");e.setAttribute("type","text/javascript");
e.setAttribute("src",b);if(typeof d=="function")e.onload=e.onreadystatechange=d;if(c)document.body.appendChild(e);else document.getElementsByTagName("head")[0].appendChild(e)}catch(f){}},loadScriptOnHead:function(b){if(btg.String.isDefined(b))try{var c=document.createElement("script");c.setAttribute("type","text/javascript");c.setAttribute("src",b);document.getElementsByTagName("head")[0].appendChild(c)}catch(d){}},getStyle:function(b,c){var d=null;try{if(btg.Object.isDefined(b)&&btg.String.isDefined(c))if(btg.Object.isDefined(document.defaultView)&&
typeof document.defaultView.getComputedStyle=="function")d=document.defaultView.getComputedStyle(b,null)[c];else if(typeof window.getComputedStyle=="function")d=window.getComputedStyle(b,null)[c];else if(btg.Object.isDefined(b.currentStyle))d=b.currentStyle[c];else d=b.style[c]}catch(e){return d}return d}};
btg.Events=new function(){var b=function(){this.callbacks=[];this.subscribe=function(b){if(typeof b=="function")this.callbacks[this.callbacks.length]=b};this.remove=function(b){for(var d=0,e=this.callbacks.length;d<e;d++)if(this.callbacks[d]==b)delete this.callbacks[d]};this.fire=function(){for(var b=0,d=this.callbacks.length;b<d;b++)try{if(typeof this.callbacks[b]=="function")this.callbacks[b].apply(this,arguments)}catch(e){new btg.Alert('An event callback has failed. "'+e.number+": "+e.message+
'".')}}};this.add=function(c){this[c]=new b;return this};this.CORE_LOADED=new b;this.flipBookView=new b;this.adLoaded=new b;this.Player_Freewheel_failsafe=new b;this.ABTest_Group_Assigned=new b;this.ON_GAME_CONFIG_LOADED=new b;this.ON_GAME_LOAD=new b;this.ON_GAME_PLAY=new b;this.ON_GAME_LEVELSTART=new b};
if(!this.btg.JSON)btg.JSON=function(){function b(b){return b<10?"0"+b:b}function c(b,f){var g,h,k,j;g=/["\\\x00-\x1f\x7f-\x9f]/g;var l;switch(typeof b){case "string":return g.test(b)?'"'+b.replace(g,function(b){var c=d[b];if(c)return c;c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"':'"'+b+'"';case "number":return isFinite(b)?String(b):"null";case "boolean":case "null":return String(b);case "object":if(!b)return"null";if(typeof b.toJSON==="function")return c(b.toJSON());
g=[];if(typeof b.length==="number"&&!b.propertyIsEnumerable("length")){j=b.length;for(h=0;h<j;h+=1)g.push(c(b[h],f)||"null");return"["+g.join(",")+"]"}if(f){j=f.length;for(h=0;h<j;h+=1){k=f[h];if(typeof k==="string")if(l=c(b[k],f))g.push(c(k)+":"+l)}}else for(k in b)if(typeof k==="string")if(l=c(b[k],f))g.push(c(k)+":"+l);return"{"+g.join(",")+"}"}}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+
":"+b(this.getUTCSeconds())+"Z"};var d={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return{stringify:c,parse:function(b,c){function d(b,e){var h,o;if(e&&typeof e==="object")for(h in e)if(Object.prototype.hasOwnProperty.apply(e,[h])){o=d(h,e[h]);if(o!==undefined)e[h]=o}return c(b,e)}var h;if(/^[\],:{}\s]*$/.test(b.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){h=eval("("+
b+")");return typeof c==="function"?d("",h):h}throw new SyntaxError("parseJSON");}}}();btg.Math={random:function(){var b,c;if(arguments.length>1){b=arguments[0];c=arguments[1]}else{b=0;c=arguments[0]}return Math.floor(Math.random()*(c-b+1)+b)}};
btg.Object={isDefined:function(b){if(typeof b=="object"&&b!==null)return true;else return false},toString:function(b,c,d){if(!c)c=",";if(!d)d="=";var e=[],f;for(f in b)if(b.hasOwnProperty(f))e.push(f+d+b[f]);return e.join(c)},copyProperties:function(b,c,d){if(btg.Object.isDefined(b)&&btg.Object.isDefined(c))for(var e in b)if(btg.Object.isDefined(c[e])||btg.String.isDefined(c[e])){if(d)c[e]=b[e]}else c[e]=b[e]},isConfigDefined:function(b){if(typeof b=="object"&&b!==null&&b.enabled==true)return true;
else return false}};btg.Sections={getAdSections:function(){var b=btg.config,c=self.location.pathname;if(c=="")c="/";if(c.lastIndexOf("/")==c.length-1)c+=btg.Object.isDefined(b)&&btg.String.isDefined(b.defaultIndexFileName)?b.defaultIndexFileName:"index";if(c!="/"&&c.indexOf("/")==0)c=c.substring(1);return c},getReportingSections:function(){return self.location.pathname}};
btg.Session={Variables:{config:[],add:function(b){if(typeof b=="undefined")return false;for(var c=0,d=this.config.length;c<d;c++){if(typeof this.config[c].varName!="string")continue;for(var e=0,d=b.length;e<d;e++){if(typeof b[e].varName!="string")continue;if(b[e].varName==this.config[c].varName)this.config.splice(c,1)}}this.config=this.config.concat(b);return true},setData:function(b){var c=btg.String.isDefined;if(!c(b))return null;for(var d=0,e=this.config.length;d<e;d++){var f=this.config[d];if(typeof b[f.varName]!=
"undefined")b[f.varName]=this.saveToCookie(f,b[f.varName]);else{var g=c(f.cookieName)?f.cookieName:"mtvn_btg_"+f.varName,g=btg.Cookie.read(g);if(c(g)){g=g.replace(/\+/gim,";");b[f.varName]=g}}}return b},saveToCookie:function(b,c){var d=btg.String.isDefined;if(typeof c=="string"&&typeof b.varName=="string"){var c=c.replace(/\;/gim,"+"),e=b.varName,e=typeof b.cookieName=="string"?b.cookieName:"mtvn_btg_"+e,f=typeof b.neverDie=="boolean"?b.neverDie:0;if(typeof b.appendOnly=="boolean"||typeof b.appendOnly==
"number"?b.appendOnly:0){var g=btg.Cookie.read(e);if(d(g)){values=c.split(",");for(var h=0,k=values.length;h<k;h++){var j=values[h];if(!d(j))continue;if(g.indexOf(j)>-1)continue;if(g.length>0)g+=",";g+=j}c=g}}g=(new Date).getYear();btg.Cookie.set(e,c,f?"Thu, 01-Jan-"+(g+10)+" 23:59:59 GMT":null)}return d(c)?c.replace(/\+/gim,";"):null}}};
btg.String={isDefined:function(b){if(typeof b==="undefined"||b===null||b=="")return false;else return true},random:function(b){for(var c="",b=b?b:8,d=0;d<b;d++){var e=Math.floor(Math.random()*"ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".length);c+="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".substring(e,e+1)}return c},toObject:function(b,c){for(var d=b.split(c?c:","),e={},f=0,g=d.length;f<g;f++){var h=d[f].split("=");e[h[0]]=h[1]}return e},queryStringToObject:function(b){b=b.indexOf("?")>
-1?b.split("?")[1]:b;return btg.String.toObject(b,"&")},stripFileExtension:function(b){var c=b.lastIndexOf(".");if(c>0)return b.substring(0,c);else return b},charLtrim:function(b,c){if(b.indexOf(c)==0)b=b.substring(1);return b},charRtrim:function(b,c){var d=b.lastIndexOf(c),e=b.length;if(d==e-1)b=b.substring(0,e-1);return b},charTrim:function(b,c){b=btg.String.charLtrim(b,c);return b=btg.String.charRtrim(b,c)},isMockupMode:function(){var b=false,c=this.queryStringToObject((btg.globalvars.IS_TOP_ACCESSIBLE?
top:self).location.search);if(c.mockupMode&&c.mockupMode=="true")b=true;return b},mockItUp:function(b){b=b.replace(/[<]/g,"&lt;");return b=b.replace(/[>]/g,"&gt;")},getFileName:function(b){b=btg.String.isDefined(b)?b:"";return b=b.substring(b.lastIndexOf("/")+1)},getBetween:function(b,c,d){var e="";if(btg.String.isDefined(b)){if(btg.String.isDefined(c)){var f=b.indexOf(c);if(f>=0)e=b.substring(f+c.length)}if(btg.String.isDefined(d)){b=e.indexOf(d);if(b>=0)e=e.substring(0,b)}}return e},encode:function(b,
c){if(b)b=c?escape(b):encodeURIComponent(b);return b},decode:function(b,c){if(b)b=c?unescape(b):decodeURIComponent(b);return b}};btg.Error={log:function(b){try{if(typeof console==="object"&&console.log&&btg.String.isDefined(b))console.log(b)}catch(c){}}};
btg.Window={getNodeLinkName:function(b){for(var c=null,d=0,e=b.childNodes.length;d<e;d++){var f=b.childNodes[d];switch(f.nodeType){case 3:c=f.nodeValue;break;case 1:if(b.attributes.title&&b.attributes.title.nodeValue!="")c=b.attributes.title.nodeValue;else if(b.attributes.alt&&b.attributes.alt.nodeValue!="")c=b.attributes.alt.nodeValue}}return c},debug:function(b){var c=document.getElementById("debug");if(!c){c=document.createElement("div");c.setAttribute("id","debug");document.getElementsByTagName("body")[0].appendChild(c)}c.innerHTML=
c.innerHTML+b+"<br>"}};btg.Environment={getPlatform:function(){var b="desktop",c=window.navigator.userAgent.toLowerCase();if(c.indexOf("ipad")!=-1)b="iPad";else if(c.indexOf("iphone")!=-1)b="iPhone";return b},getCnamedDomain:function(){var b=location.hostname,c="",d=new RegExp(/([A-z0-9]*\.\bco\...\b|[A-z0-9]*\.uol\.\bcom\...\b|[A-z0-9]*\.\bcom\...\b|[A-z0-9]*\.\bcom\b|[A-z0-9]*\...\b)/);if(b.match(d)){m=d.exec(b);c="sc."+b.substr(m.index)}return c}};
btg.Class={inheritFrom:function(b,c){function d(){if(arguments.length>0&&typeof b==="function")b.apply(this,arguments)}if(typeof b==="function"||typeof b==="object")if(typeof c==="function"||typeof c==="object"){var e=c.prototype;c.prototype=typeof b==="function"?new b:b;for(var f in e)c.prototype[f]=e[f];c.prototype.constructor=c;d.prototype=typeof c==="function"?new c:c;d.prototype.constructor=d}else{d.prototype=typeof b==="function"?new b:b;d.prototype.constructor=d}else btg.Error.log("Coda ERROR: btg.Class.inheritFrom(a_superClass,a_subClass) requires at least a_superClass argument!");
return d}};btg.Timer=function(b,c){this.id=b;this.isRunning=false;this.currentCount=0;this.milliseconds=c?c:100;this.intervalId=null;this.listeners=[]};
btg.Timer.prototype={on:function(b,c){if(typeof c=="function")this.listeners[b]=c},execListener:function(b){if(typeof this.listeners[b]=="function")this.listeners[b]()},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()}};
btg.TimeTracker=function(b){var c=btg.String.isDefined,d=btg.Cookie,e="",f=null,g=c(b)?b:"";this.init=function(){f=(new Date).getTime();btg.DOM.Events.addListener(window,"unload",this.saveTimeSpent);return true};this.setData=function(b){if(c(b))e=b};this.getTimeSpentOnPage=function(){var b="",b=(new Date).getTime(),b=Math.round((b-f)/100);if(b<1)b="";f=(new Date).getTime();return b};this.saveTimeSpent=function(){if(c(g)){var b=(new Date).getTime(),b=Math.round((b-f)/100);if(b<1)b=1;b=b;b+=c(e)?","+
e:"";d.set(g,b)}};this.getTimespent=function(){if(c(g)){var b=d.read(g);d.remove(g);f=(new Date).getTime();return c(b)?b:""}}};
btg.Ajax=function(b){var c=btg.Object.isDefined(b)?b:{};c.method=btg.String.isDefined(c.method)?c.method:"GET";var d;if(window.XMLHttpRequest)d=new XMLHttpRequest;else d=new ActiveXObject("Microsoft.XMLHTTP");this.sendRequest=function(){if(!btg.String.isDefined(c.url)){btg.Error.log("Coda ERROR: Ajax request URL not specified!");return"[ERROR: Ajax request URL not specified!]"}d.onreadystatechange=function(){if(d.readyState==4){c.responseText=d.responseText;c.responseXML=d.responseXML;if(d.status==
404){if(typeof c.on404=="function")c.on404(c)}else if(typeof c.onSuccess=="function"){c.success=true;c.onSuccess(c)}}};try{d.open(c.method,c.url,true);d.send();return true}catch(b){if(typeof c.onFail=="function"){c.error=b;c.fail=true;c.onFail(c)}return false}};if(c.autoSend===true)this.sendRequest()};
(function(b){var c=["demdexcall","demdexfwsegment","uuid","usersegment"],d=function(b){var d=b.data,g,h;if(!JSON)return;if(d){try{d=JSON.parse(d)}catch(k){return}g=d.type;h=d.value}if(g&&c.join().indexOf(g)!=-1)switch(g){case c[0]:b={};d=0;for(g=h.length;d<g;d++){var j=h[d].split("=");b[j[0]]=j[1]}btg.Demdex.sendPageCall(b);break;case c[1]:h={type:c[1],value:btg.Demdex.getFWSegment()};if(h.value)b.source.postMessage(JSON.stringify(h),"*");break;case c[2]:h={type:c[2],value:btg.Cookie.read("vmn_uuid")};
if(h.value)b.source.postMessage(JSON.stringify(h),"*");break;case c[3]:h={type:c[3],value:btg.Cookie.read("mtvn_btg_userSegments")};if(h.value)b.source.postMessage(JSON.stringify(h),"*")}};if(typeof b.addEventListener!=="undefined")b.addEventListener("message",d,false);else if(typeof b.attachEvent!=="undefined")b.attachEvent("onmessage",d)})(window);
btg.DependencyManager=function(b){var c=btg.config,d=b?b:8E3,e=false,f=[],g=[];this.add=function(b,c,f,l){if(typeof b=="undefined"||typeof c=="undefined")return false;for(var o=0,p=g.length;o<p;o++)if(g[o].flagname==b)return false;g[g.length]={flagname:b,callback:c,interval:f?f:100};if(!e){e=true;window.setTimeout(this.sendCalls,d)}if(l)this.checkDependency(b);return true};this.remove=function(b){if(typeof b=="string"&&b!="")for(var c=0,d=g.length;c<d;c++)if(g[c].flagname==b){g.splice(c,1);break}if(!this.hasDependency())this.sendCalls()};
this.checkDependency=function(b){for(var c=null,d=0,f=g.length;d<f;d++)if(g[d].flagname==b)c=g[d];if(!c)return false;if(c.callback.apply())this.remove(b);else{var e=this;window.setTimeout(function(){e.checkDependency(b)},c.interval)}};this.hasDependency=function(b){if(btg.String.isDefined(b)){for(var c=g.length,d=0;d<c;d++)if(g[d].flagname==b)return true;return false}return g.length>=1};this.addToCallQueue=function(b,d){if(!d)return false;for(var e=new Array,g=2,o=arguments.length;g<o;g++)e.push(arguments[g]);
f[f.length]={context:b?b:this,callback:d,args:e,config:c};return true};this.sendCalls=function(){g=[];for(var b=c,d=0,e=f.length;d<e;d++){c=f[d].config;f[d].callback.apply(f[d].context,f[d].args)}c=b;f=[]}};
btg.PluginManager=function(b){for(var c=new Array,d=1,e=arguments.length;d<e;d++)c.push(arguments[d]);d=0;for(e=b.length;d<e;d++)if(typeof b[d].init=="function")b[d].init.apply(this,c);this.run=function(c){for(var d=0,e=b.length;d<e;d++)if(btg.Object.isDefined(b[d])&&typeof b[d].run=="function")c=b[d].run(c);return c}};
btg.QueueManager=function(b){this.id=b.id;this.timeToWait=!isNaN(b.timeToWait)?b.timeToWait:1;this.handler=typeof b.handler=="function"?b.handler:function(){};this.notificationHandler=typeof b.notificationHandler=="function"?b.notificationHandler:function(){};this.intervalId=null;this.isProcessing=false;this.queue=[];this.processedQueue=[];this.maxNumItems=b.maxNumItems;this.maxElapsed=b.maxElapsed;this.itemsAdded=this.totalItems=this.elapsed=0};
btg.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 b=this.queue.shift();this.elapsed=this.elapsed+this.timeToWait;this.totalItems++;if(!this.hasLimit()){this.handler(b);this.processedQueue.push(b)}else{this.notificationHandler(this);
this.clearQueue();this.stop()}}else this.stop()},stop:function(){clearInterval(this.intervalId);this.isProcessing=false;this.itemsAdded=this.totalItems=this.elapsed=0},hasLimit:function(){return this.elapsed==this.maxElapsed||this.totalItems>this.maxNumItems},clearQueue:function(){this.queue=[];this.processedQueue=[]}};
btg.Demdex=new function(){var b=btg.Cookie,c=new btg.Beacon,d=false,e=btg.String;this.canSendRequest=true;this.dependencies=new btg.DependencyManager;this.data=null;this.sendIdSyncCall=function(){var d=b.read("vmn_uuid");if(!b.read("mtvn_dmp_init")&&d){var e=new Date;c.url="//dpm.demdex.net/ibs:dpid=332&dpuuid="+d;c.send();e.setHours(23);e.setMinutes(59);b.set("mtvn_dmp_init",1,e)}};this.init=function(){this.dependencies.add("demdex_response",function(){return(btg.Demdex?btg.Demdex:{}).canSendRequest},
500,false)};this.sendPageCall=function(c,d){if(b.read("vmn_3pc")=="0")return;this.dependencies.checkDependency("demdex_response");if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,this.sendPageCall,c,d);return}this.canSendRequest=false;var h="//mtvn.demdex.net"+"/event?",k={d_rtbd:"json",d_dst:1,d_cts:1,d_cb:"btg.Demdex.response"};if(d&&typeof d==="object")for(var j in d)if(d.hasOwnProperty(j))k["d_"+j]=e.encode(e.decode(d[j]));if(b.read("vmn_host")==null){c.host=location.hostname;
b.set("vmn_host",1)}if(c&&typeof c==="object")for(j in c)if(c.hasOwnProperty(j)&&c[j]){var l=j;if(j.match(/^(prop\d{1,2})$/ig))l=j.replace("prop","c");else if(j.match(/^(evar\d{1,2})$/ig))l=j.replace("eVar","v");else if(j.match(/^(hier\d{1,2})$/ig))l=j.replace("hier","h");else if(j.match(/^(channel)$/ig))l=j.replace("channel","ch");k["c_"+l]=e.encode(e.decode(c[j]))}btg.DOM.loadScript(h+btg.Object.toString(k,"&"))};this.sendSocialCall=function(c){if(b.read("vmn_3pc")=="0")return;this.dependencies.checkDependency("demdex_response");
if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,this.sendSocialCall,c);return}this.canSendRequest=false;var d="//mtvn.demdex.net"+"/event?",h={d_rtbd:"json",d_dst:1,d_cts:1,d_cb:"btg.Demdex.response",c_uuid:b.read("vmn_uuid")};if(c&&typeof c==="object")for(var k in c)if(c.hasOwnProperty(k)&&c[k])h["c_"+k]=e.encode(e.decode(c[k]));btg.DOM.loadScript(d+btg.Object.toString(h,"&"))};this.getFWSegment=function(){var b=this.data,c=btg.String,d=btg.Object,e;if(d.isDefined(b)&&
d.isDefined(b.stuff))for(var b=b.stuff,j=0,l=b.length;j<l;j++)if(d.isDefined(b[j])&&c.isDefined(b[j].cn)&&b[j].cn=="fw"&&c.isDefined(b[j].cv)){e=b[j].cv;break}return e};this.response=function(b){this.data=b;btg.Demdex.canSendRequest=true;if(!d){btg.DOM.appendIframe({src:location.protocol+"//fast.mtvn.demdex.net/DSD-gz/mtvn-dest.html?targus=1&targusvalidttl=14400&bizo=1&bizovalidttl=14400&nexac=1&nexacvalidttl=14400"});d=true}btg.MediaPlayer.setDemdexFWSegment(b);a:{if(!btg.Demdex.data)break a;if(!btg.Demdex.data.dests)break a;
for(var b=btg.Demdex.data.dests,c=0;c<b.length;c++){var e=document.createElement("img");e.src=b[c].c;document.body.appendChild(e)}}}};
btg.GUID=new function(){var b=null,c=null,d=function(){var b=btg.Cookie.read("vmn_uuid");if(typeof b=="string")c=b;return typeof c=="string"},e=function(){return typeof b.enableGuidPlugin=="boolean"&&b.enableGuidPlugin};this.isGUIDReported=false;this.hasGUIDCookie=function(){return d()};this.get3pcCookie=function(){var b=btg.Cookie.read("vmn_3pc");return!btg.String.isDefined(b)?null:b};this.init=function(c){b=c;if(!e())return false;if(typeof b.guidIdVarMap=="undefined")b.guidIdVarMap=["eVar57"];if(typeof b.guidIdVarMap==
"string")b.guidIdVarMap=b.guidIdVarMap.split(",");return true};this.run=function(f){if(!e())return f;if(!d()){new btg.Alert("Failed to find the UUID value.");return f}for(var g=0,j=b.guidIdVarMap.length;g<j;g++)f[b.guidIdVarMap[g]]=c;this.isGUIDReported=true;return f};this.guidScript=function(){var b=btg.GUID;btg.Controller.init();if(b.hasGUIDCookie()&&!b.isGUIDReported){b.sendLinkEventCall();return b.isGUIDReported=true}return false};this.sendLinkEventCall=function(){var b={linkName:"GUID reporting",
linkType:"o"},b=btg.GUID.run(b);if(e)btg.Controller.sendLinkEvent(b)};try{var f="http"+("https:"==document.location.protocol?"s":"")+"://btg.mtvnservices.com/aria/uuid.html";if(!this.get3pcCookie())btg.DOM.loadScript(f)}catch(g){}};
try{btg.DOM.Events.addListener(window,"load",function(){var b=btg.config,c=btg.Object.isConfigDefined;if(c(b.Omniture))if(b.Omniture.enableGuidPlugin&&b.Omniture.enableGuidAuxiliaryCall&&!btg.GUID.isGUIDReported){b=new btg.DependencyManager;b.add("vmn_uuid",btg.GUID.guidScript);b.checkDependency("vmn_uuid")}})}catch(e$$13){}
btg.ComScore=function(b){this.btgIsStr=btg.String.isDefined;this.config=b;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:escape(document.location.href);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()};
btg.ComScore.prototype={sendPageCall:function(b){var c=btg.ReportingManager;if(typeof b==="object"){if(this.btgIsStr(b.comScore1))this.c1=b.comScore1;if(this.btgIsStr(b.comScore2))this.c2=b.comScore2;if(this.btgIsStr(b.comScore3))this.c3=b.comScore3;if(this.btgIsStr(b.comScore4))this.c4=b.comScore4;if(this.btgIsStr(b.comScore5))this.c5=b.comScore5;if(this.btgIsStr(b.comScore6))this.c6=b.comScore6;if(this.btgIsStr(b.comScore15))this.c15=b.comScore15}b=["c1=",this.c1,"&c2=",this.c2,"&c3=",this.c3,"&c4=",
this.c4,"&c5=",this.c5,"&c6=",this.c6,"&c15=",this.c15].join("");try{if(!btg.globalvars.IS_UNIT_TEST&&!c.isScriptIncluded.comscore){btg.DOM.loadScript((document.location.protocol=="https:"?"https://sb":"http://b")+".scorecardresearch.com/beacon.js?"+b);c.isScriptIncluded.comscore=true}}catch(d){}}};
btg.GoogleAnalytics=function(b){this.btgIsStr=btg.String.isDefined;this.config=b;if(b.iframeAccount&&!btg.globalvars.IS_UNIT_TEST)document.write(unescape("%3Cdiv id='btg_ga_div'%3E%3C/div%3E"));this.account=b.account;this.dependencies=new btg.DependencyManager;this.dependencies.add("ga_script_load",function(){return typeof _gat=="object"},100);this.dependencies.checkDependency("ga_script_load")};
btg.GoogleAnalytics.prototype={sendPageCall:function(b){if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,this.sendPageCall,b);return}if(this.btgIsStr(this.config.iframeAccount)){var c=[];if(this.config.iframeAccount.indexOf(",")>-1)c=this.config.iframeAccount.split(",");else c[0]=this.config.iframeAccount;for(var d=0,e=c.length;d<e;d++){var f=document.getElementById("btg_ga_div"),g=window.location,h=b.pageName,h=h.substring(0,1)!="/"?"/"+h:h,k=document.referrer,j="//btg.mtvnservices.com/aria/ga.html?ga="+
c[d]+"&uri=",k="&ref="+escape(k);if(f){var l=document.createElement("iframe");l.src=g.protocol+j+g.hostname+h+k;l.style.width=1+"px";l.style.height=1+"px";l.style.visibility="hidden";l.style.left=-50+"px";l.style.top=-50+"px";l.style.position="absolute";f.appendChild(l)}}}if(this.btgIsStr(this.config.account))try{if(!btg.globalvars.IS_UNIT_TEST)if(typeof _gat=="object")_gat._getTracker(this.config.account)._trackPageview()}catch(o){}},sendLinkEvent:function(b){if(!b||!this.btgIsStr(b.category)||!this.btgIsStr(b.action)||
!this.btgIsStr(b.label))return;if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,this.sendLinkEvent,b);return}b.value=typeof b.value!="undefined"&&typeof parseInt(b.value)=="number"?parseInt(b.value):null;var c=_gat._createTracker(this.config.account,"event_tracker");c._setDomainName("");c._trackEvent(b.category,b.action,b.label,b.value)}};
try{if(!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$$16){}
btg.Nielsen=function(b){this.config=b;this.dependencies=new btg.DependencyManager;this.dependencies.add("nielsen_uuid_present",function(){return btg.Cookie.read("vmn_uuid")!=""?true:false},100);this.dependencies.checkDependency("nielsen_uuid_present");this.sendIdSyncCall()};
btg.Nielsen.prototype={sendPageCall:function(){var b=null;if(!b&&btg.String.isDefined(this.config.cid))b=this.config.cid;if(!b)return false;var c=new Image(1,1);c.onerror=c.onload=function(){c.onerror=c.onload=null};c.src=["//secure-us.imrworldwide.com/cgi-bin/m?ci="+b+"&cg=0&cc=1&si=",escape(window.location.href),"&rp=",escape(document.referrer),"&ts=compact&rnd=",(new Date).getTime()].join("")},sendIdSyncCall:function(b){if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,
this.sendIdSyncCall,b);return}b=btg.Cookie.read("vmn_uuid");if(b==null)return;if(btg.Cookie.read("vmn_nielsen_idsynch")==null){var c=new Image(1,1);c.onerror=c.onload=function(){c.onerror=c.onload=null};var d=escape(window.location.href);c.src=["//secure-us.imrworldwide.com/cgi-bin/m?ci=us-mtvn&cg="+b+"&cc=1&si=",d,"&rp=",escape(document.referrer),"&ts=compact&rnd=",(new Date).getTime()].join("");btg.Cookie.set("vmn_nielsen_idsynch","true")}}};
btg.Omniture=function(b){this.pageViewEventSet=false;this.btgIsStr=btg.String.isDefined;this.btgSv=btg.Session.Variables;this.name="Omniture";this.values=[];this.newRepeatProp=this.btgIsStr(b.newRepeatProp)?b.newRepeatProp:"prop41";this.config=b;this.hcode=btg.Hcode;this.userPlatform=btg.Environment.getPlatform();this.hcode.setAccount(this.config.account);if(this.userPlatform=="desktop"){if(this.config.enableFirstPartyCookie)this.hcode.trackingServer=btg.Environment.getCnamedDomain()}else{this.hcode.trackingServer=
btg.Environment.getCnamedDomain();if(this.btgIsStr(this.config.tabletAccount))this.hcode.setAccount(this.config.tabletAccount)}for(var c in this.config)this.hcode[c]=this.config[c];this.url="http"+(this.hcode.ssl?"s":"")+"://"+this.hcode.un+".112.2o7.net/b/ss/"+this.hcode.un+"/1/";this.dependencies=new btg.DependencyManager;this.plugins=new btg.PluginManager([btg.GUID],this.config,this.dependencies);if(typeof btg.config.Omniture.enableVisitorNamespace=="boolean"&&btg.config.Omniture.enableVisitorNamespace)this.setAttribute("visitorNamespace",
btg.globalvars.VISITOR_NAMESPACE);if(typeof this.config.userSegmentVarMap=="undefined"){this.config.userSegmentVarMap={traffic:"prop31",commerce:"products"};btg.config.Omniture.userSegmentVarMap=this.config.userSegmentVarMap}if(typeof btg.UserSegment!="undefined")btg.UserSegment.init(this);if(typeof btg.FluxState!="undefined")btg.FluxState.init(this.config.fluxCommunityId);if(typeof this.config.fluxVarMap=="undefined"){this.config.fluxVarMap={memberState:"prop5",loginState:"prop6"};btg.config.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 this.config.pageViewEvent!="string")this.config.pageViewEvent="event16";if(typeof btg.MediaPlayer!=
"undefined")btg.MediaPlayer.init(this)};
btg.Omniture.prototype={setAttribute:function(b,c){if(this.btgIsStr(b)){this.hcode[b]=this.btgIsStr(c)?c:"";return true}else return false},getAttribute:function(b){return this.hcode[b]},setValues:function(b){for(var c in b){this.setAttribute(c,b[c]);this.values.push(c)}return true},clearValues:function(){for(var b=0,c=this.values.length;b<c;b++)if(this.values[b]!="pageName")this.setAttribute(this.values[b],"");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(b,c,d){return this.hcode.getValOnce(b,c,d)},getNewRepeat:function(){return this.hcode.getNewRepeat()},getPageName:function(){return this.getAttribute("pageName")},preprocessData:function(b){b=this.plugins.run(b);if(this.btgIsStr(b.account))this.hcode.setAccount(b.account);else this.hcode.setAccount(this.config.account);if(typeof mboxDefine=="function"&&typeof this.config.enableTestAndTarget==
"boolean"&&this.config.enableTestAndTarget){b.tnt=this.hcode.trackTNT();if(b.tnt=="")b.tnt=btg.TestAndTarget.getCampaignId()}if(typeof btg.UserSegment!="undefined")b=btg.UserSegment.setData(this,b);if(typeof btg.Session!="undefined")b=this.btgSv.setData(b);var c=btg.Cookie.read;if(c("vmn_3pc")&&c("vmn_3pc")=="0")b.eVar58="3PB";return b},sendPageCall:function(b){if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,this.sendPageCall,b);return}b=typeof b!="object"?{}:b;if(typeof b.pageName!=
"string"||b.pageName=="")b.pageName=typeof this.hcode.pageName==="string"&&this.hcode.pageName!=""?this.hcode.pageName:btg.config._defaultPageName;if(typeof this.config.noPagenameSlash!="undefined"&&this.config.noPagenameSlash&&b.pageName.charAt(0)=="/")b.pageName=b.pageName.substring(1);if(typeof this.config.defaultHier=="string"&&this.config.defaultHier!="")if(typeof b[this.config.defaultHier]!=="string"||b[this.config.defaultHier]==""){if(typeof this.hcode[this.config.defaultHier]==="string"&&
this.hcode[this.config.defaultHier]!="")var c=this.hcode[this.config.defaultHier];else if(typeof b.docHierarchy==="string"&&b.docHierarchy!="")c=b.docHierarchy;else c=b.pageName;if(c.charAt(c.length-1)=="/")if(typeof btg.config.indexFileName==="string")b[this.config.defaultHier]=c+btg.config.indexFileName;else b[this.config.defaultHier]=c+"index";else b[this.config.defaultHier]=c;b[this.config.defaultHier]=btg.String.charLtrim(b[this.config.defaultHier],"/")}if(typeof b.channel!="string"||b.channel==
"")if(typeof this.hcode.channel=="string")b.channel=this.hcode.channel;else if(b.pageName=="/")b.channel=b.pageName;else for(var c=b.pageName.split("/"),d=0,e=c.length;d<e;d++)if(c[d]!=""){b.channel=c[d];break}if(typeof b.channel=="string")b.eVar49=b.channel;if(typeof btg.SEO!="undefined")b=btg.SEO.setData(this,b);if(typeof btg.BrowserToolbar!="undefined")b=btg.BrowserToolbar.setData(this,b);if((typeof this.config.isFluxHosted=="undefined"||typeof this.config.isFluxHosted!="undefined"&&this.config.isFluxHosted!=
true)&&typeof btg.FluxState!="undefined")b=btg.FluxState.setData(this,b);if(typeof btg.Search!="undefined")b=btg.Search.setData(b);if(typeof btg.Search!="undefined")b=btg.Search.chkConversions(b);if(typeof btg.Photos!="undefined")b=btg.Photos.setData(b);if(typeof this.config.enableTimeParting!="undefined"&&this.config.enableTimeParting==true&&typeof this.config.timePartingVarMap!="undefined"){c=typeof btg.config.Omniture.timezone!="undefined"?btg.config.Omniture.timezone:"-5";b[this.config.timePartingVarMap.commerceHour]=
b[this.config.timePartingVarMap.trafficHour]=this.hcode.getTimeParting("h",c);b[this.config.timePartingVarMap.commerceDay]=b[this.config.timePartingVarMap.trafficDay]=this.hcode.getTimeParting("d",c)}if(typeof this.config.percentPageViewedVarMap!="undefined"){if(typeof this.config.percentPageViewedVarMap.previousPage!="undefined")b[this.config.percentPageViewedVarMap.previousPage]=this.hcode.getPreviousValue(b.pageName,"s_pn");if(typeof this.config.percentPageViewedVarMap.percentage!="undefined")if(this.config.percentPageViewedVarMap.percentage.indexOf("event")>=
0){if(typeof b.events=="string"&&b.events!="")b.events+=",";else b.events="";b.events+=this.config.percentPageViewedVarMap.percentage;if(typeof b.products=="string"&&b.products!="")b.products+=",";else b.products="";b.products+=";;;;"+this.config.percentPageViewedVarMap.percentage+"="+this.hcode.getPercentPageViewed()}else b[this.config.percentPageViewedVarMap.percentage]=this.hcode.getPercentPageViewed()}if(!this.pageViewEventSet){c=typeof b.events==="string"?b.events:"";if(typeof this.config.pageViewEvent===
"string"&&c.indexOf(this.config.pageViewEvent)<0){if(c!="")c+=",";c+=this.config.pageViewEvent;b.events=c;this.pageViewEventSet=true}}if(typeof btg.GameReporter!="undefined"){btg.GameReporter.gtsEvent="event74";b=btg.GameReporter.setData(b)}b=this.preprocessData(b);this.setValues(b);this.setNewRepeat();this.attachLoggedEvent();if(btg.Object.isConfigDefined(btg.config.Demdex)&&btg.Demdex){b[this.newRepeatProp]=this.getAttribute(this.newRepeatProp);btg.Demdex.sendPageCall(b)}this.hcode.t();this.clearValues();
return true},sendLinkEvent:function(b){this.hcode.trackExternalLinks=false;if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,this.sendPageCall,b);return}var b=typeof b!="object"?{}:b,c=this.getPageName();b.lnk=b.lnk?this.hcode.co(b.lnk):true;b.linkType=b.linkType?b.linkType:"o";b.referrer=location.href;b=this.preprocessData(b);this.setValues(b);this.setAttribute("pageName","");this.attachLoggedEvent();this.hcode.t();this.clearValues();this.setAttribute("pageName",c);if(btg.config.Omniture.trackExternalLinks===
true){var d=this;setTimeout(function(){d.hcode.trackExternalLinks=true},1)}return true},setAccountVars:function(b){this.setAttribute("un",b.name);this.setAttribute("dynamicAccountSelection",b.dynamic);this.setAttribute("dynamicAccountList",b.list);this.setAttribute("linkInternalFilters",b.filters);this.setAttribute("charSet",b.chartset);for(var c in b)if(this.btgIsStr(c))this.setAttribute(c,this.btgIsStr(b[c])?b[c]:"")},logEvent:function(b){var c=btg.Cookie.set;if(this.btgIsStr(b)){if(this.btgIsStr(b.UIEvent))c("UIEvent",
b.UIEvent);if(this.btgIsStr(b.UIEventName))c("UIEventName",b.UIEventName);if(this.btgIsStr(b.UITrackingCode))c("UITrackingCode",b.UITrackingCode)}},attachLoggedEvent:function(){var b=btg.Cookie.read,c=btg.Cookie.remove;if(this.btgIsStr(b("UIEvent"))){this.setAttribute("events",b("UIEvent"));c("UIEvent")}if(this.btgIsStr(b("UIEventName"))){this.setAttribute("eVar40",b("UIEventName"));c("UIEventName")}if(this.btgIsStr(b("UITrackingCode"))){this.setAttribute("campaign",b("UITrackingCode"));c("UITrackingCode")}return true},
clearAllVars:function(){for(var b=1;b<=50;b++){this.setAttribute("eVar"+b,"");this.setAttribute("prop"+b,"");if(b<6)this.setAttribute("hier"+b,"")}this.setAttribute("pageName","");this.setAttribute("channel","");return true}};
btg.ReportingManager=new function(){var b=false,c=false,d=false,e=false,f,g,h,k,j;this.isScriptIncluded={comscore:false,quantcast:false,googleAnalytics:false};this.init=function(){g=btg.config;var f=btg.Object.isConfigDefined;if(f(g.Omniture)&&btg.Omniture){h=new btg.Omniture(g.Omniture);b=true}new btg.Nielsen(g.Nielsen);if(f(g.GoogleAnalytics)&&btg.GoogleAnalytics){j=new btg.GoogleAnalytics(g.GoogleAnalytics);d=true}if(f(g.QuantCast)&&btg.QuantCast){k=new btg.QuantCast(g.QuantCast);c=true}if(f(g.ComScore)&&
btg.ComScore)new btg.ComScore(g.ComScore);if(g.ChoiceStream&&g.ChoiceStream.enabled&&btg.ChoiceStream){choicestream=new btg.ChoiceStream(g.ChoiceStream);e=true}if(f(g.ChoiceStream)&&btg.ChoiceStream){choicestream=new btg.ChoiceStream(g.ChoiceStream);e=true}if(f(g.Demdex)&&btg.Demdex){btg.Demdex.init();btg.Demdex.sendIdSyncCall();hasDemdex=true}};this.sendPageCall=function(e){if(b){h.sendPageCall(typeof e.omniture=="object"&&e.omniture!=null?e.omniture:e);f=h.getPageName()}if(c)k.sendPageCall(typeof e.quantCast==
"object"&&e.quantCast!=null?e.quantCast:e);if(d)j.sendPageCall(typeof e.googleAnalytics=="object"&&e.googleAnalytics!=null?e.googleAnalytics:e)};this.sendLinkEvent=function(c){if(b)h.sendLinkEvent(typeof c.omniture=="object"&&c.omniture!=null?c.omniture:c);if(d&&btg.Object.isDefined(c.googleAnalytics))j.sendLinkEvent(c.googleAnalytics)};this.getData=function(){btg.Controller.init();return{pageName:f}};this.getOmniture=function(){return b?h:null};this.setChoiceStreamRequest=function(b,c){if(e)choicestream.setChoiceStreamRequest(b,
c)}};
btg.FluxState=new function(){var b=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};this.init=function(b){if(b)btg.DOM.loadScript((document.location.protocol=="https:"?"https://":"http://")+"widgets3.flux.com/context/short/"+b)};this.setData=function(c,d){var e=c.config.fluxVarMap.memberState;var f=
null;switch(b()){case 3:f=Flux.context.user.communityMember;break;case 2:f=Flux.Context.isCommunityMember()}d[e]=f?"member":"non-member";e=c.config.fluxVarMap.loginState;var f=btg.UserSegment,g=null;switch(b()){case 3:if(Flux.context.user.memberType){g=Flux.context.user.memberType;f.add(c,g+" User")}else if(Flux.context.user.facebookOnly){g="FB Only";f.add(c,"FB Connect Only User")}else if(Flux.context.user.facebookConnected){g="Flux + FB";f.add(c,"Flux & FB Connect User")}else if(typeof Flux.context.user.ucid==
"string"&&Flux.context.user.ucid.length>0){g="Flux Only";f.add(c,"Flux Only User")}else g="not logged-in";break;case 2:g=Flux.Context.isUserAuthenticated()?"logged-in":"not logged-in";break;default:g="not logged-in"}if(g&&g!="not logged-in")f.add(c,"LoggedIn");d[e]=g;return d}};
btg.SEO=new function(){this.setData=function(b,c){for(var d=[["google.com","GoogleUser"],["msn.com","MSNUser"],["yahoo.com","YahooUser"]],e=0,f=d.length;e<f;e++)if(document.referrer.indexOf(d[e][0])>-1)if(typeof btg.UserSegment!="undefined")btg.UserSegment.set(d[e][1]);return c}};
btg.Search=new function(){var b=btg.Cookie,c=b.set,d="",e=function(b){if(d.indexOf(b)<0){if(d!="")d+=",";d+=b}return d};this.init=function(){};this.setData=function(b){if(typeof com_mtvi_SSDC!="object")return b;var c="events,prop31";e("event36");b.eVar3=typeof com_mtvi_SSDC.srchtype=="string"?com_mtvi_SSDC.srchtype:"GENERAL";if(typeof com_mtvi_SSDC.srchsyn!="undefined"){e("event33");if(typeof com_mtvi_SSDC.srchsyn=="object"){for(var h=0,k=com_mtvi_SSDC.srchsyn.length;h<k;h++)com_mtvi_SSDC.srchsyn[h]=
com_mtvi_SSDC.srchsyn[h].replace(/\,/,"");com_mtvi_SSDC.srchsyn=com_mtvi_SSDC.srchsyn.join(",")}b.eVar36=com_mtvi_SSDC.srchsyn;c+=",eVar36"}if(typeof com_mtvi_SSDC.srchterm=="string"){e("event38");b.eVar2=com_mtvi_SSDC.srchterm;c+=",eVar2"}else if(typeof com_mtvi_SSDC.srchfail=="string"){e("event37");b.eVar4=typeof com_mtvi_SSDC.appfailure=="boolean"&&com_mtvi_SSDC.appfailure?"APP_FAILURE":com_mtvi_SSDC.srchfail;c+=",eVar4"}btg.UserSegment.set("SiteSearcher");b.linkTrackVars=c;b.linkTrackEvents=d;
return b};this.sendLinkEvent=function(){if(!com_mtvi_SSDC)return false;var b={linkName:"SITE_SEARCH_RESULTS",linkType:"o"},b=this.setData(b);btg.Controller.sendLinkEvent(b);return true};this.chkConversions=function(c){var g=b.read,h=b.remove;if(typeof c.events=="string")d=c.events;if(g("mtvn_btg_SSDC_conv")){e("event35");h("mtvn_btg_SSDC_conv")}if(g("mtvn_btg_SSDC_syn_conv")){e("event34");h("mtvn_btg_SSDC_syn_conv")}if(g("mtvn_btg_SSDC_typeahead_conv")){e("event39");h("mtvn_btg_SSDC_typeahead_conv")}c.events=
d;return c};this.setConversion=function(){c("mtvn_btg_SSDC_conv",1)};this.setSynConversion=function(){c("mtvn_btg_SSDC_syn_conv",1)};this.setTypeAheadConversion=function(){c("mtvn_btg_SSDC_typeahead_conv",1)}};
btg.UserSegment=new function(){var b=btg.Cookie;this.init=function(c){var d=b.read("mtvn_btg_userSegments");c.userSegments=d?d.split(","):[];return true};this.set=function(c,d){if(!d)d=btg.ReportingManager.getOmniture();for(var e=0,f=d.userSegments.length;e<f;e++)if(d.userSegments[e]==c)return false;d.userSegments[d.userSegments.length]=c;b.set("mtvn_btg_userSegments",d.userSegments.join(","));return true};this.add=function(b,d){this.set(d,b);return true};this.getSegments=function(b){return b.userSegments};
this.getStr=function(b,d,e){if(!d)d="";if(!e)e="";return typeof b.userSegments=="object"&&b.userSegments.length>0?d+b.userSegments.join(e+","+d)+e:""};this.setData=function(b,d){d[b.config.userSegmentVarMap.traffic]=d[b.config.userSegmentVarMap.traffic]?d[b.config.userSegmentVarMap.traffic]+(this.getStr(b)!=""?",":"")+this.getStr(b):this.getStr(b);d[b.config.userSegmentVarMap.commerce]=d[b.config.userSegmentVarMap.commerce]?d[b.config.userSegmentVarMap.commerce]+(this.getStr(b,"User Segment;")!=""?
",":"")+this.getStr(b,"User Segment;"):this.getStr(b,"User Segment;");return d}};btg.QuantCast=function(b){this.labels="";this.config=b;this.labels=this.config.labels};btg.QuantCast.prototype={sendPageCall:function(b){if(this.config.reportMode=="direct"){var c=btg.QuantCast.Ads;if(c.dependencies.hasDependency()){c.dependencies.addToCallQueue(this,this.sendPageCall,b);return}try{_qoptions={labels:this.labels};_qacct="p-94wNw88f65Rhk";quantserve()}catch(d){}}}};
btg.QuantCast.Ads=new function(){this.dependencies=new btg.DependencyManager;this.dependencies.add("qc_script_load",function(){return typeof quantserve=="function"},100,true);this.setLabels=function(b,c){try{if(this.dependencies.hasDependency()){this.dependencies.addToCallQueue(this,this.setLabels,b,c);return}var d="",e="",f="",e=b.dartSite.replace(/\./g,"_"),f=c.replace(/^\//m,""),f=f.replace(/\//g,"."),d=btg.config.QuantCast.labels+",Viacom Global Digital Network.MTVN Digital Ad Sales.Content.Pages."+
e+"."+f;_qoptions={labels:d};_qacct="p-94wNw88f65Rhk";quantserve()}catch(g){}};this.setCookieDemoTargetVal=function(b){for(var c=[],d=0,e=b.segments.length;d<e;d++)c[d]="demo="+b.segments[d].id;btg.Cookie.set("qcDemo",escape(c.join(";")))}};try{var _qCfg=btg.config.QuantCast;if(_qCfg.enabled)btg.DOM.loadScript(("https:"==document.location.protocol?"//secure":"//edge")+".quantserve.com/quant.js");if(_qCfg.adsEnabled&&!btg.String.isDefined(btg.Cookie.read("qcDemo")))btg.DOM.loadScript("//pixel.quantserve.com/api/segments.json?a=p-94wNw88f65Rhk&callback=btg.QuantCast.Ads.setCookieDemoTargetVal")}catch(e$$21){}
btg.ABTest=function(b,c,d){var e=btg.Cookie;if(typeof b!=="string"||btg.String.charTrim(b," ")==""){btg.Error.log("Coda ERROR: btg.ABTest: The first argument to the constructor must be a unique ID of the type {String}.");return null}if(typeof c!="object"||c.length<2){btg.Error.log('Coda ERROR: btg.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 f=0,g=Math.floor(Math.random()*(100-1+1)+1),h="MTVN_ABTest_"+
b,k=e.read(h),j=null;this.getId=function(){return b};this.getGroup=function(){return j};if(k&&k!="")j=k;else{c.sort(function(b,c){return c.weight-b.weight});for(var k=0,l=c.length;k<l;k++){var o=f+c[k].weight;if(g>f&&g<=o)j=c[k].name;f+=c[k].weight}if(!j){btg.Error.log("Coda ERROR: btg.ABTest: Couldn't assign user to an A/B Test group.");return null}if(f!=100){btg.Error.log("Coda ERROR: btg.ABTest: The sum of the weights of your A/B Test groups must equal 100 exactly.");return null}e.set(h,j,"Thu, 31-Dec-2038 11:59:59 GMT")}btg.UserSegment.set(b+
": "+j);btg.Events.ABTest_Group_Assigned.fire(b,j);if(typeof d=="function")d.call(this)};var s_code="",s_objectID;
function s_gi(b,c,d){try{var e='s.version=\'H.23.4\';s.an=s_an;s.logDebug=function(m){var s=this,tcf=new Function(\'var e;try{console.log("\'+s.rep(s.rep(m,"\\n","\\\\n"),"'+'\\"","\\\\\\"")+\'");}catch(e){}\');tcf()};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){retur'+"n x?(''+x).substring(0,l):x};s.co=function(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').indexOf(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.toU"+
"pperCase():'';if(x){x=''+x;if(s.em==3)x=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)}x=y}else x=escape(''+x);x=s.rep(x,'+','%2B');if(c&&c!='AUTO'&&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=s.rep(''+x,'+',' ');return s.em==3?decodeURIComponent(x):unescape(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.substri"+"ng(0,y);r=s[f](t,a);if(r)return r;z+=y+d.length;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);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.fsf=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!=unde"+"fined){if(typeof(v)!='number')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?pa"+
"rseInt(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.a"+"pe(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!='NONE'){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.gtfs"+"oe=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=thi"+"s,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,r.t,r.u)}};s.flushBufferedRequests=fun"+"ction(){};s.mr=function(sess,q,rs,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 Obje"+"ct,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')+'/'+s.version+'/'+sess+'?AQB=1&ndh=1'+(q?q:'')+'&AQE=1';if(s.isie&&!s.ismac)rs=s.fl(rs,2047)}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++;if(s.debugTrackin"+"g){var d='AppMeasurement Debug: '+rs,dl=s.sp(rs,'&'),dln;for(dln=0;dln<dl.length;dln++)d+=\"\\n\\t\"+s.epa(dl[dln]);s.logDebug(d)}im.src=rs;if((!ta||ta=='_self'||ta=='_top'||(s.wd.name&&ta==s.wd.na"+"me))&&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){va"+
"r 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,p,l=0,q,a,b='',c='',t;if(x&&x.length>255){y=''+x;i=y.indexOf('?');if(i>0){q=y.substring(i+1);y=y.substring(0,i);h=y.toLowerCase();j=0;if(h.su"+"bstring(0,7)=='http://')j+=7;else if(h.substring(0,8)=='https://')j+=8;i=h.indexOf(\"/\",j);if(i>0){h=h.substring(j,i);p=y.substring(i);y=y.substring(0,i);if(h.indexOf('google')>=0)l=',q,ie,start,s"+
"earch_key,word,kw,cd,';else if(h.indexOf('yahoo.co')>=0)l=',p,ei,';if(l&&q){a=s.sp(q,'&');if(a&&a.length>1){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)q=b+'&'+c;else c=''}i=253-(q.length-c.length)-y.length;x=y+(i>0?p.substring(0,i):'')+'?'+q}}}}return x};s.s2q=function(k,v,vf,vfp,f){var s=this,qs"+"='',sk,sv,sp,ss,nke,nk,nf,nfl=0,nfn,nfm;if(k==\"contextData\")k=\"c\";if(v){for(sk in v) {if((!f||sk.substring(0,f.length)==f)&&v[sk]&&(!vf||vf.indexOf(','+(vfp?vfp+'.':'')+sk+',')>=0)){nfm=0;if(nf"+
"l)for(nfn=0;nfn<nfl.length;nfn++)if(sk.substring(0,nfl[nfn].length)==nfl[nfn])nfm=1;if(!nfm){if(qs=='')qs+='&'+k+'.';sv=v[sk];if(f)sk=sk.substring(f.length);if(sk.length>0){nke=sk.indexOf('.');if(n"+"ke>0){nk=sk.substring(0,nke);nf=(f?f:'')+nk+'.';if(!nfl)nfl=new Array;nfl[nfl.length]=nf;qs+=s.s2q(nk,v,vf,vfp,nf)}else{if(typeof(sv)=='boolean'){if(sv)sv='true';else sv='false'}if(sv){if(vfp=='ret"+"rieveLightData'&&f.indexOf('.contextData.')<0){sp=sk.substring(0,4);ss=sk.substring(4);if(sk=='transactionID')sk='xact';else if(sk=='channel')sk='ch';else if(sk=='campaign')sk='v0';else if(s.num(ss"+
")){if(sp=='prop')sk='c'+ss;else if(sp=='eVar')sk='v'+ss;else if(sp=='list')sk='l'+ss;else if(sp=='hier'){sk='h'+ss;sv=sv.substring(0,255)}}}qs+='&'+s.ape(sk)+'='+s.ape(sv)}}}}}}if(qs!='')qs+='&.'+k"+"}return qs};s.hav=function(){var s=this,qs='',l,fv='',fe='',mn,i,e;if(s.lightProfileID){l=s.va_m;fv=s.lightTrackVars;if(fv)fv=','+fv+','+s.vl_mr+','}else{l=s.va_t;if(s.pe||s.linkType){fv=s.linkTrac"+"kVars;fe=s.linkTrackEvents;if(s.pe){mn=s.pe.substring(0,1).toUpperCase()+s.pe.substring(1);if(s[mn]){fv=s[mn].trackVars;fe=s[mn].trackEvents}}}if(fv)fv=','+fv+','+s.vl_l+','+s.vl_l2;if(fe){fe=','+f"+
"e+',';if(fv)fv+=',events,'}if (s.events2)e=(e?',':'')+s.events2}for(i=0;i<l.length;i++){var k=l[i],v=s[k],b=k.substring(0,4),x=k.substring(4),n=parseInt(x),q=k;if(!v)if(k=='events'&&e){v=e;e=''}if("+"v&&(!fv||fv.indexOf(k)>=0)&&k!='linkName'&&k!='linkType'){if(k=='timestamp')q='ts';else if(k=='dynamicVariablePrefix')q='D';else if(k=='visitorID')q='vid';else if(k=='pageURL'){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.visitorMigrationServerSecure)v=''}else i"+
"f(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 i"+"f(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(k=='events'){if(e)v+=(v?',':'')+e;if(fe)v=s.fs(v,fe)}else if(k=='events2')v='';else if(k=='contextData'){qs+=s.s2q('c',s[k],fv,k,0);v=''}else if(k=='lightProfileID')q='mtp';else if(k=='ligh"+"tStoreForSeconds'){q='mtss';if(!s.lightProfileID)v=''}else if(k=='lightIncrementBy'){q='mti';if(!s.lightProfileID)v=''}else if(k=='retrieveLightProfiles')q='mtsr';else if(k=='deleteLightProfiles')q"+
"='mtsd';else if(k=='retrieveLightData'){if(s.retrieveLightProfiles)qs+=s.s2q('mts',s[k],fv,k,0);v=''}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+='&'+s.ape(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.linkExternalFilters,lif=s.linkInternalFilters;lif=lif?lif:s.wd.location.hostname;h=h.toLowerCase();if(s.trackDownloadLinks&&l"+"ft&&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 Func"+"tion('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 Function("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.indexOf(':');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;if(o.tagUrn||(o.scopeName&&o.scopeName.toUpperCase()!='HTML'))return '';t=t&&t.toUpperCase?t.toUpperCase():'';if(t=='SHAPE')t='';if(t){if((t=='INPUT'||t=='BUTTON')&&o.ty"+"pe&&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[un]=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||!Object.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.wd"+
'l=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=function(x){var s=this,v=s.visitorSampling,g=s.vis"+
"itorSamplingGroup,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.substring(0,i),x=t.substring(i+1);if(s.pt(x,',','dy"+"asmf',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.toLowerCase();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 Array('_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.length;i++)if(m[l[i]])r[l[i]]=m[l[i]];r._il[r._i"+"n]=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).indexOf('function')>=0){if(d&&e)u=m[t+1](d,e);else i"+"f(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.loadModule(o.n,o.u,o.d,o.l,o.e,1);g[i]=0}};s.loadMod"+
"ule=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.f"+
"2,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/javascript\";'+(n?'o.id=i;o.defer=true;o.onload=o.o"+"nreadystatechange=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.voa=function(vo,r){var s=this,l=s.va_g,i,k,v,x;for(i=0;i<l.length;i++){"+
'k=l[i];v=vo[k];if(v||vo[\'!\'+k]){if(!r&&(k=="contextData"||k=="retrieveLightData")&&s[k])for(x in s[k])if(!v[x])v[x]=s[k][x];s[k]=v}}};s.vob=function(vo){var s=this,l=s.va_g,i,k;for(i=0;i<l.leng'+"th;i++){k=l[i];vo[k]=s[k];if(!vo[k])vo['!'+k]=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.dll[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.dl=function(vo){var s=this,d=new Date;if("+
"!vo)vo=new Object;s.vob(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.track=s.t=function(vo){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.ge"+"tHours()+':'+tm.getMinutes()+':'+tm.getSeconds()+' '+tm.getDay()+' '+tm.getTimezoneOffset(),tcf,tfs=s.gtfs(),ta=-1,q='',qs='',code='',vb=new Object;s.gl(s.vl_g);s.uns();s.m_ll();if(!s.td){var tl=tf"+
"s.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.innerH"+
"eight}}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.offsetWidth;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.fl(s.pl[pn].name,100)+';';if(p.indexOf(ps)<0)p+=ps;p"+
"n++}s.resolution=x;s.colorDepth=c;s.javascriptVersion=j;s.javaEnabled=v;s.cookiesEnabled=k;s.browserWidth=bw;s.browserHeight=bh;s.connectionType=ct;s.homepage=hp;s.plugins=p;s.td=1}if(vo){s.vob(vb)"+";s.voa(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.paren"+
"tElement?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)r"+"eturn ''}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,ta);qs='';s.m_m('t');if(s.p_r)s.p_r();s.referrer=s.lightProfileID=s.retrieveLightProfiles=s.deleteLightProfiles=''}s.sq(qs"+");}else{s.dl(vo);}if(vo)s.voa(vb,1);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_linkName=s.wd.s_linkType='';return code};"+
"s.trackLink=s.tl=function(o,t,n,vo){var s=this;s.lnk=s.co(o);s.linkType=t;s.linkName=n;s.t(vo)};s.trackLight=function(p,ss,i,vo){var s=this;s.lightProfileID=p;s.lightStoreForSeconds=ss;s.lightIncre"+"mentBy=i;s.t(vo)};s.jsLoaded=function(){var s=this,x;if(s.lmq)for(i=0;i<s.lmq.length;i++){x=s.lmq[i];s.loadModule(x.n,x.u,x.d)}if(s.onLoad)s.onLoad(s);if(s.tq)for(i=0;i<s.tq.length;i++)s.t(s.tq[i])"+"};s.wd=window;s.ssl=(s.wd.location.protocol.toLowerCase().indexOf('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=navi"+
"gator;s.u=s.n.userAgent;s.ns6=s.u.indexOf('Netscape6/');var apn=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.isopera=(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.substrin"+"g(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(St"+
"ring.fromCharCode(256)).toUpperCase();s.em=(i=='%C4%80'?2:(i=='%U0100'?1:0))}if(s.oun)s.sa(s.oun);s.sa(un);s.vl_l='dynamicVariablePrefix,visitorID,vmk,visitorMigrationKey,visitorMigrationServer,vis"+"itorMigrationServerSecure,ppu,charSet,visitorNamespace,cookieDomainPeriods,cookieLifetime,pageName,pageURL,referrer,currencyCode';s.va_l=s.sp(s.vl_l,',');s.vl_mr=s.vl_m='charSet,visitorNamespace,co"+"okieDomainPeriods,cookieLifetime,contextData,lightProfileID,lightStoreForSeconds,lightIncrementBy';s.vl_t=s.vl_l+',variableProvider,channel,server,pageType,transactionID,purchaseID,campaign,state,z"+
"ip,events,events2,products,linkName,linkType,contextData,lightProfileID,lightStoreForSeconds,lightIncrementBy,retrieveLightProfiles,deleteLightProfiles,retrieveLightData';var n;for(n=1;n<=75;n++){s"+".vl_t+=',prop'+n+',eVar'+n;s.vl_m+=',prop'+n+',eVar'+n}for(n=1;n<=5;n++)s.vl_t+=',hier'+n;for(n=1;n<=3;n++)s.vl_t+=',list'+n;s.va_m=s.sp(s.vl_m,',');s.vl_l2=',tnt,pe,pev1,pev2,pev3,resolution,color"+"Depth,javascriptVersion,javaEnabled,cookiesEnabled,browserWidth,browserHeight,connectionType,homepage,plugins';s.vl_t+=s.vl_l2;s.va_t=s.sp(s.vl_t,',');s.vl_g=s.vl_t+',trackingServer,trackingServerS"+
"ecure,trackingServerBase,fpCookieDomainPeriods,disableBufferedRequests,mobile,visitorSampling,visitorSamplingGroup,dynamicAccountSelection,dynamicAccountList,dynamicAccountMatch,trackDownloadLinks,"+"trackExternalLinks,trackInlineStats,linkLeaveQueryString,linkDownloadFileTypes,linkExternalFilters,linkInternalFilters,linkTrackVars,linkTrackEvents,linkNames,lnk,eo,lightTrackVars,_1_referrer,un';"+"s.va_g=s.sp(s.vl_g,',');s.pg=pg;s.gl(s.vl_g);s.contextData=new Object;s.retrieveLightData=new Object;if(!ss)s.wds();if(pg){s.wd.s_co=function(o){s_gi(\"_\",1,1).co(o)};s.wd.s_gs=function(un){s_gi(u"+
"n,1,1).t()};s.wd.s_dc=function(un){s_gi(un,1).t()}}",f=window,g=f.s_c_il,h=navigator,k=h.userAgent,j=h.appVersion,l=j.indexOf("MSIE "),o=k.indexOf("Netscape6/"),p,v,n,q;if(b){b=b.toLowerCase();if(g)for(v=0;v<g.length;v++){q=g[v];n=q._c;if((!n||n=="s_c"||n=="s_l")&&(q.oun==b||q.fs&&q.sa&&q.fs(q.oun,b))){if(q.sa)q.sa(b);if(n=="s_c")return q}else q=0}}f.s_an="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";f.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");f.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");f.s_rep=new Function("x","o","n","return s_jn(s_sp(x,o),n)");f.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");f.s_fe=new Function("c","return s_rep(s_rep(s_rep(c,'\\\\','\\\\\\\\'),'\"','\\\\\"'),\"\\n\",\"\\\\n\")");f.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");f.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;");e=s_d(e);if(l>0){p=parseInt(v=j.substring(l+5));if(p>3)p=parseFloat(v)}else if(o>0)p=parseFloat(k.substring(o+10));else p=parseFloat(j);if(p<5||j.indexOf("Opera")>=0||k.indexOf("Opera")>=0)e=s_ft(e);if(!q){q=new Object;if(!f.s_c_in){f.s_c_il=new Array;
f.s_c_in=0}q._il=f.s_c_il;q._in=f.s_c_in;q._il[q._in]=q;f.s_c_in++}q._c="s_c";(new Function("s","un","pg","ss",e))(q,b,c,d);return q}catch(w){}}var mboxCopyright="Copyright 1996-2009. Adobe Systems Incorporated. All rights reserved";mboxUrlBuilder=function(b,c){this.a=b;this.b=c;this.c=new Array;this.d=function(b){return b};this.f=null};
mboxUrlBuilder.prototype.addParameter=function(b,c){if((new RegExp("('|\")")).exec(b))throw"Parameter '"+b+"' contains invalid characters";for(var d=0;d<this.c.length;d++){var e=this.c[d];if(e.name==b){e.value=c;return this}}d=new Object;d.name=b;d.value=c;this.c[this.c.length]=d;return this};mboxUrlBuilder.prototype.addParameters=function(b){if(!b)return this;for(var c=0;c<b.length;c++){var d=b[c].indexOf("=");if(d==-1||d==0)continue;this.addParameter(b[c].substring(0,d),b[c].substring(d+1,b[c].length))}return this};
mboxUrlBuilder.prototype.setServerType=function(b){this.o=b};mboxUrlBuilder.prototype.setBasePath=function(b){this.f=b};mboxUrlBuilder.prototype.setUrlProcessAction=function(b){this.d=b};
mboxUrlBuilder.prototype.buildUrl=function(){for(var b=(document.location.protocol=="file:"?"http:":document.location.protocol)+"//"+this.a+(this.f?this.f:"/m2/"+this.b+"/mbox/"+this.o),c=b.indexOf("?")!=-1?"&":"?",d=0;d<this.c.length;d++){var e=this.c[d];b+=c+encodeURIComponent(e.name)+"="+encodeURIComponent(e.value);c="&"}return this.t(this.d(b))};mboxUrlBuilder.prototype.getParameters=function(){return this.c};mboxUrlBuilder.prototype.setParameters=function(b){this.c=b};
mboxUrlBuilder.prototype.clone=function(){var b=new mboxUrlBuilder(this.a,this.b);b.setServerType(this.o);b.setBasePath(this.f);b.setUrlProcessAction(this.d);for(var c=0;c<this.c.length;c++)b.addParameter(this.c[c].name,this.c[c].value);return b};mboxUrlBuilder.prototype.t=function(b){return b.replace(/\"/g,"&quot;").replace(/>/g,"&gt;")};mboxStandardFetcher=function(){};mboxStandardFetcher.prototype.getType=function(){return"standard"};
mboxStandardFetcher.prototype.fetch=function(b){b.setServerType(this.getType());document.write("<"+"scr"+'ipt src="'+b.buildUrl()+'" language="JavaScript"><'+"/scr"+"ipt>")};mboxStandardFetcher.prototype.cancel=function(){};mboxAjaxFetcher=function(){};mboxAjaxFetcher.prototype.getType=function(){return"ajax"};mboxAjaxFetcher.prototype.fetch=function(b){b.setServerType(this.getType());b=b.buildUrl();this.x=document.createElement("script");this.x.src=b;document.body.appendChild(this.x)};
mboxAjaxFetcher.prototype.cancel=function(){};mboxMap=function(){this.y=new Object;this.z=new Array};mboxMap.prototype.put=function(b,c){if(!this.y[b])this.z[this.z.length]=b;this.y[b]=c};mboxMap.prototype.get=function(b){return this.y[b]};mboxMap.prototype.remove=function(b){this.y[b]=undefined};mboxMap.prototype.each=function(b){for(var c=0;c<this.z.length;c++){var d=this.z[c],e=this.y[d];if(e)if(b(d,e)===false)break}};
mboxFactory=function(b,c,d){this.E=false;this.C=b;this.D=d;this.F=new mboxList;mboxFactories.put(d,this);this.H=(this.G=typeof document.createElement("div").replaceChild!="undefined"&&true&&typeof document.getElementById!="undefined"&&typeof(window.attachEvent||document.addEventListener||window.addEventListener)!="undefined"&&typeof encodeURIComponent!="undefined")&&mboxGetPageParameter("mboxDisable")==null;var e=d=="default";this.J=new mboxCookieManager("mbox"+(e?"":"-"+d),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(b,c);this.T(this.w,e);this.V=this.U=(new Date).getTime();var f=this;this.addOnLoad(function(){f.V=
(new Date).getTime()});if(this.G){this.addOnLoad(function(){f.E=true;f.getMboxes().each(function(b){b.setFetcher(new mboxAjaxFetcher);b.finalize()})});this.limitTraffic(100,10368E3);if(this.H){this.Y();this.Z=new mboxSignaler(function(b,c){return f.create(b,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(b,c){if(typeof b=="undefined")b=60*60;if(typeof c=="undefined")c="unspecified";if(!this.isAdmin()){this.H=false;this.J.setCookie("disable",c,b)}};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(){};
mboxFactory.prototype.addOnLoad=function(b){if(window.addEventListener)window.addEventListener("load",b,false);else if(document.addEventListener)document.addEventListener("load",b,false);else if(document.attachEvent)window.attachEvent("onload",b)};mboxFactory.prototype.getEllapsedTime=function(){return this.V-this.U};mboxFactory.prototype.getEllapsedTimeUntil=function(b){return b-this.U};mboxFactory.prototype.getMboxes=function(){return this.F};
mboxFactory.prototype.get=function(b,c){return this.F.get(b).getById(c||0)};mboxFactory.prototype.update=function(b,c){if(!this.isEnabled())return;if(this.F.get(b).length()==0)throw"Mbox "+b+" is not defined";this.F.get(b).each(function(b){b.getUrlBuilder().addParameter("mboxPage",mboxGenerateId());b.load(c)})};
mboxFactory.prototype.create=function(b,c,d){if(!this.isSupported())return null;var e=this.w.clone();e.addParameter("mboxCount",this.F.length()+1);e.addParameters(c);var c=this.F.get(b).length(),f=this.D+"-"+b+"-"+c;if(d)d=new mboxLocatorNode(d);else{if(this.E)throw"The page has already been loaded, can't write marker";d=new mboxLocatorDefault(f)}try{var g=this,h=new mbox(b,c,e,d,"mboxImported-"+f);if(this.H)h.setFetcher(this.E?new mboxAjaxFetcher:new mboxStandardFetcher);h.setOnError(function(b){h.setMessage(b);
h.activate();if(!h.isActivated()){g.disable(60*60,b);window.location.reload(false)}});this.F.add(h)}catch(k){this.disable();throw'Failed creating mbox "'+b+'", the error was: '+k;}b=new Date;e.addParameter("mboxTime",b.getTime()-b.getTimezoneOffset()*6E4);return h};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(b,c){b.addParameter("mboxHost",document.location.hostname).addParameter("mboxSession",this.R.getId());if(!c)b.addParameter("mboxFactoryId",this.D);if(this.S.getId()!=null)b.addParameter("mboxPC",this.S.getId());b.addParameter("mboxPage",this.K);b.addParameter("screenHeight",this.L);b.addParameter("screenWidth",this.M);b.addParameter("browserWidth",this.N);b.addParameter("browserHeight",this.O);b.addParameter("browserTimeOffset",this.Q);b.addParameter("colorDepth",
this.P);b.setUrlProcessAction(function(b){b+="&mboxURL="+encodeURIComponent(document.location);var c=encodeURIComponent(document.referrer);if(b.length+c.length<2E3)b+="&mboxReferrer="+c;b+="&mboxVersion="+mboxVersion;return b})};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(b,c){this.J=c;for(var d=c.getCookieNames("signal-"),e=0;e<d.length;e++){var f=d[e],g=c.getCookie(f).split("&");b(g[0],g).load();c.deleteCookie(f)}};mboxSignaler.prototype.signal=function(b){this.J.setCookie("signal-"+b,mboxShiftArray(arguments).join("&"),45*60)};mboxList=function(){this.F=new Array};mboxList.prototype.add=function(b){if(b!=null)this.F[this.F.length]=b};
mboxList.prototype.get=function(b){for(var c=new mboxList,d=0;d<this.F.length;d++){var e=this.F[d];if(e.getName()==b)c.add(e)}return c};mboxList.prototype.getById=function(b){return this.F[b]};mboxList.prototype.length=function(){return this.F.length};mboxList.prototype.each=function(b){if(typeof b!="function")throw"Action must be a function, was: "+typeof b;for(var c=0;c<this.F.length;c++)b(this.F[c])};mboxLocatorDefault=function(b){this.g="mboxMarker-"+b;document.write('<div id="'+this.g+'" style="visibility:hidden;display:none">&nbsp;</div>')};
mboxLocatorDefault.prototype.locate=function(){for(var b=document.getElementById(this.g);b!=null;){if(b.nodeType==1)if(b.className=="mboxDefault")return b;b=b.previousSibling}return null};mboxLocatorDefault.prototype.force=function(){var b=document.createElement("div");b.className="mboxDefault";var c=document.getElementById(this.g);c.parentNode.insertBefore(b,c);return b};mboxLocatorNode=function(b){this.ub=b};
mboxLocatorNode.prototype.locate=function(){return typeof this.ub=="string"?document.getElementById(this.ub):this.ub};mboxLocatorNode.prototype.force=function(){return null};mboxCreate=function(b){var c=mboxFactoryDefault.create(b,mboxShiftArray(arguments));if(c)c.load();return c};mboxDefine=function(b,c){return mboxFactoryDefault.create(c,mboxShiftArray(mboxShiftArray(arguments)),b)};mboxUpdate=function(b){mboxFactoryDefault.update(b,mboxShiftArray(arguments))};
mbox=function(b,c,d,e,f){this.Ab=null;this.Bb=0;this.hb=e;this.ib=f;this.Cb=null;this.Db=new mboxOfferContent;this.vb=null;this.w=d;this.message="";this.Eb=new Object;this.Fb=0;this.yb=c;this.g=b;this.Gb();d.addParameter("mbox",b).addParameter("mboxId",c);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(){for(var b=this.w.getParameters(),c=new Array,d=0;d<b.length;d++)if(b[d].name.indexOf("mbox")!=0)c[c.length]=b[d].name+"="+b[d].value;return c};mbox.prototype.setOnLoad=function(b){this.Ib=b;return this};
mbox.prototype.setMessage=function(b){this.message=b;return this};mbox.prototype.setOnError=function(b){this.Hb=b;return this};mbox.prototype.setFetcher=function(b){if(this.Cb)this.Cb.cancel();this.Cb=b;return this};mbox.prototype.getFetcher=function(){return this.Cb};
mbox.prototype.load=function(b){if(this.Cb==null)return this;this.setEventTime("load.start");this.cancelTimeout();this.Bb=0;this.Cb.fetch(b&&b.length>0?this.w.clone().addParameters(b):this.w);var c=this;this.Lb=setTimeout(function(){c.Hb("browser timeout",c.Cb.getType())},15E3);this.setEventTime("load.end");return this};mbox.prototype.loaded=function(){this.cancelTimeout();if(!this.activate()){var b=this;setTimeout(function(){b.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(b){if(b&&b.show&&b.setOnLoad)this.Db=b;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(b){if(b==null)return 0;if(this.vb==null||!this.vb.parentNode){this.vb=this.getDefaultDiv();if(this.vb==null)return 0}if(this.vb!=b){this.Nb(this.vb);this.vb.parentNode.replaceChild(b,this.vb);this.vb=b}this.Ob(b);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(b){this.Eb[b]=(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(b){return b.style.display!="none"};mbox.prototype.Ob=function(b){this.Rb(b,true)};mbox.prototype.Nb=function(b){this.Rb(b,false)};mbox.prototype.Rb=function(b,c){b.style.visibility=c?"visible":"hidden";b.style.display=c?"block":"none"};mboxOfferContent=function(){this.Ib=function(){}};mboxOfferContent.prototype.show=function(b){b=b.showContent(document.getElementById(b.getImportName()));if(b==1)this.Ib();return b};
mboxOfferContent.prototype.setOnLoad=function(b){this.Ib=b};mboxOfferAjax=function(b){this.Mb=b;this.Ib=function(){}};mboxOfferAjax.prototype.setOnLoad=function(b){this.Ib=b};mboxOfferAjax.prototype.show=function(b){var c=document.createElement("div");c.id=b.getImportName();c.innerHTML=this.Mb;b=b.showContent(c);if(b==1)this.Ib();return b};mboxOfferDefault=function(){this.Ib=function(){}};mboxOfferDefault.prototype.setOnLoad=function(b){this.Ib=b};
mboxOfferDefault.prototype.show=function(b){b=b.hide();if(b==1)this.Ib();return b};mboxCookieManager=function(b,c){this.g=b;this.Ub=c==""||c.indexOf(".")==-1?"":"; domain="+c;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(b,c,d){if(typeof b!="undefined"&&typeof c!="undefined"&&typeof d!="undefined"){var e=new Object;e.name=b;e.value=escape(c);e.expireOn=Math.ceil(d+(new Date).getTime()/1E3);this.Vb.put(b,e);this.saveCookies()}};mboxCookieManager.prototype.getCookie=function(b){return(b=this.Vb.get(b))?unescape(b.value):null};mboxCookieManager.prototype.deleteCookie=function(b){this.Vb.remove(b);this.saveCookies()};
mboxCookieManager.prototype.getCookieNames=function(b){var c=new Array;this.Vb.each(function(d){if(d.indexOf(b)==0)c[c.length]=d});return c};mboxCookieManager.prototype.saveCookies=function(){var b=new Array,c=0;this.Vb.each(function(d,f){b[b.length]=d+"#"+f.value+"#"+f.expireOn;if(c<f.expireOn)c=f.expireOn});var d=new Date(c*1E3);document.cookie=this.g+"="+b.join("|")+"; expires="+d.toGMTString()+"; path=/"+this.Ub};
mboxCookieManager.prototype.loadCookies=function(){this.Vb=new mboxMap;var b=document.cookie.indexOf(this.g+"=");if(b!=-1){var c=document.cookie.indexOf(";",b);if(c==-1){c=document.cookie.indexOf(",",b);if(c==-1)c=document.cookie.length}for(var b=document.cookie.substring(b+this.g.length+1,c).split("|"),c=Math.ceil((new Date).getTime()/1E3),d=0;d<b.length;d++){var e=b[d].split("#");if(c<=e[2]){var f=new Object;f.name=e[0];f.value=e[1];f.expireOn=e[2];this.Vb.put(f.name,f)}}}};
mboxSession=function(b,c,d,e,f){this.hc=c;this.qb=d;this.ic=e;this.J=f;this.jc=false;this.yb=typeof mboxForceSessionId!="undefined"?mboxForceSessionId:mboxGetPageParameter(this.hc);if(this.yb==null||this.yb.length==0){this.yb=f.getCookie(d);if(this.yb==null||this.yb.length==0){this.yb=b;this.jc=true}}f.setCookie(d,this.yb,e)};mboxSession.prototype.getId=function(){return this.yb};mboxSession.prototype.forceId=function(b){this.yb=b;this.J.setCookie(this.qb,this.yb,this.ic)};
mboxPC=function(b,c,d){this.qb=b;this.ic=c;this.J=d;this.yb=typeof mboxForcePCId!="undefined"?mboxForcePCId:d.getCookie(b);if(this.yb!=null)d.setCookie(b,this.yb,c)};mboxPC.prototype.getId=function(){return this.yb};mboxPC.prototype.forceId=function(b){if(this.yb!=b){this.yb=b;this.J.setCookie(this.qb,this.yb,this.ic);return true}return false};mboxGetPageParameter=function(b){var c=null,b=(new RegExp(b+"=([^&]*)")).exec(document.location);if(b!=null&&b.length>=2)c=b[1];return c};
mboxSetCookie=function(b,c,d){return mboxFactoryDefault.getCookieManager().setCookie(b,c,d)};mboxGetCookie=function(b){return mboxFactoryDefault.getCookieManager().getCookie(b)};mboxCookiePageDomain=function(){var b=/([^:]*)(:[0-9]{0,5})?/.exec(document.location.host)[1];if(!/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/.exec(b)){var c=/([^\.]+\.[^\.]{3}|[^\.]+\.[^\.]+\.[^\.]{2})$/.exec(b);if(c)b=c[0]}return b?b:""};
mboxShiftArray=function(b){for(var c=new Array,d=1;d<b.length;d++)c[c.length]=b[d];return c};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,mboxFactories=new mboxMap,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$$30){}mboxScPluginFetcher=function(b,c){this.b=b;this.qc=c};mboxScPluginFetcher.prototype.rc=function(b){b.setBasePath("/m2/"+this.b+"/sc/standard");this.sc(b);b=b.buildUrl();b+="&scPluginVersion=1";return b};
mboxScPluginFetcher.prototype.sc=function(b){for(var c=["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"],d=0;d<c.length;d++)this.uc(c[d],b);for(d=1;d<=50;d++){this.uc("prop"+d,b);this.uc("eVar"+d,b);this.uc("hier"+d,b)}};
mboxScPluginFetcher.prototype.uc=function(b,c){var d=this.qc[b];if(typeof d==="undefined"||d===null||d==="")return;c.addParameter(b,d)};mboxScPluginFetcher.prototype.cancel=function(){};mboxStandardScPluginFetcher=function(b,c){mboxScPluginFetcher.call(this,b,c)};mboxStandardScPluginFetcher.prototype=new mboxScPluginFetcher;mboxStandardScPluginFetcher.prototype.getType=function(){return"standard"};
mboxStandardScPluginFetcher.prototype.fetch=function(b){b.setServerType(this.getType());b=this.rc(b);document.write("<"+"scr"+'ipt src="'+b+'" language="JavaScript"><'+"/scr"+"ipt>")};mboxAjaxScPluginFetcher=function(b,c){mboxScPluginFetcher.call(this,b,c)};mboxAjaxScPluginFetcher.prototype=new mboxScPluginFetcher;mboxAjaxScPluginFetcher.prototype.fetch=function(b){b.setServerType(this.getType());b=this.rc(b);this.x=document.createElement("script");this.x.src=b;document.body.appendChild(this.x)};
mboxAjaxScPluginFetcher.prototype.getType=function(){return"ajax"};
function mboxLoadSCPlugin(b){if(!b)return null;b.m_tt=function(b){b=b.m_i("tt");b.H=true;b.b="mtvnetworks";b._t=function(){if(!this.isEnabled())return;var b=this.xc();if(b){var c=mboxFactoryDefault.isDomLoaded()?new mboxAjaxScPluginFetcher(this.b,this.s):new mboxStandardScPluginFetcher(this.b,this.s);b.setFetcher(c);b.load()}};b.isEnabled=function(){return this.H&&mboxFactoryDefault.isEnabled()};b.xc=function(){var b=this.yc(),c=document.createElement("DIV");return mboxFactoryDefault.create(b,new Array,
c)};b.yc=function(){return"SiteCatalyst: "+(this.s.events&&this.s.events.indexOf("purchase")!=-1?"purchase":"event")}};return b.loadModule("tt")}btg.Hcode=s_gi("");if(typeof btg.Hcode==="object")btg.Hcode.setAccount=function(b){this.un=b};
if(typeof btg.Hcode==="object")btg.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 btg.Hcode==="object"){btg.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}}};");btg.Hcode.dstStart="03/13/2011";btg.Hcode.dstEnd="11/06/2011";
btg.Hcode.currentYear=(new Date).getFullYear()}if(typeof btg.Hcode==="object")btg.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 btg.Hcode==="object"){btg.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 btg.Hcode==="object"){btg.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;}");btg.Hcode.getPPVCalc=new Function("",""+"var s=s_c_il["+btg.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);}");btg.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);}");btg.Hcode.getPPVSetup()}
if(typeof btg.Hcode==="object"){btg.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");btg.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");btg.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 btg.Hcode==="object")btg.Hcode.trackTNT=function(b,c,d){var b=b?b:"s_tnt",e="",f=false,d=d?d:true;if(this.getQueryParam)f=this.getQueryParam(c?c:"s_tnt");if(f)e+=f+",";if(this.wd[b]!=undefined)e+=this.wd[b];if(d)this.wd[b]="";return e};
btg.MediaPlayer={context:null,playerCommandQueue:null,isHtml5:false,html5MetaData:{},init:function(b){this.context=b;this.playerCommandQueue=new btg.QueueManager({id:"btg.MediaPlayer.playerCommandQueue",timeToWait:100,maxNumItems:10,maxElapsed:1E3,handler:this.execute})},playStarted:false,players:[],addPlayer:function(b,c){var d=this.isHtml5?b.id:b;this.players[d]=new this.Player(b,c);return this.players[d]},setEndSlateClick:function(b){var c=btg.Cookie.set,d=btg.config.Omniture;c("mtvn_btg_tnt",
(b&&typeof d.enableTestAndTarget=="boolean"&&d.enableTestAndTarget?btg.TestAndTarget.getCampaignId():"")+"_"+(typeof feedEndslate!="undefined"&&feedEndslate));c("mtvn_btg_esclicked",b)},getEndSlateClick:function(){return btg.Cookie.read("mtvn_btg_esclicked")},PlayerController:function(b,c){return this.addPlayer(b,c)},pause:function(){var b=btg.MediaPlayer,c;for(c in b.players)if(b.players.hasOwnProperty(c))b.players[c].player.pause()},unpause:function(){var b=btg.MediaPlayer,c;for(c in b.players)if(b.players.hasOwnProperty(c))if(b.players[c].player.unpause)b.players[c].player.unpause();
else if(b.players[c].player.play)b.players[c].player.play()},execute:function(b){var c=btg.MediaPlayer;if(c.playStarted)switch(b){case "unpause":c.unpause();break;case "pause":c.pause()}else c.playerCommandQueue.queue.push(b)},reportingInit:function(){try{btg.config.Omniture.videoViewEventDisable=true;btg.Demdex.sendIdSyncCall()}catch(b){}},getFirstPartyServer:function(){var b=null;if(btg.config.Omniture.enableFirstPartyCookie)b=btg.Environment.getCnamedDomain();return b},getVmnUUID:function(){return btg.Cookie.read("vmn_uuid")},
setDemdexFWSegment:function(){var b=btg.Demdex.getFWSegment(),c=btg.MediaPlayer;if(b)for(var d in c.players)if(c.players.hasOwnProperty(d)&&c.players[d].player&&c.players[d].player.setDemdexFWSegment)c.players[d].player.setDemdexFWSegment(b)},Player:function(b,c){var d=btg.Controller,e=btg.Cookie,f=btg.TestAndTarget,g=btg.MediaPlayer,h=btg.config;this.playerId=this.isHtml5?b.id:b;this.player=this.lastGuid=null;this.playerLoaded=false;this.onLoadFunctionName=c;this.onLoaded=function(){this.player=
g.getPlayerObject(b);g.addListeners(this.player);this.playerLoaded=true;var c=eval(this.onLoadFunctionName);if(typeof c=="function")c(this)};this.onDump=function(){};this.dump=function(){var b="";if(this.playerLoaded)b=this.player.getLogDump();else b="player not loaded";this.onDump(b)};this.onPlayHeadUpdate=function(b){b=g.isHtml5?b.data:b;if((b=b==-1||b==null||typeof b=="undefined"?1.5:b)&&b>1)if(!g.playStarted){g.playStarted=true;g.playerCommandQueue.init()}};this.onMetaData=function(b){if(btg.MediaPlayer.isHtml5)try{html5MetaData=
b={guid:b.data.rss.guid,contentType:b.data.rss.group.categories.contentType}}catch(c){}if(location.search.match(/showMetaData\=true/)){str="";for(m in b)str+=m+": "+b[m]+"\n";alert(this.lastGuid+"\n\n\n"+str)}var l="",o=document.location.search,p=o.toLowerCase().indexOf("xrs=mpes_")!=-1?true:false,v=b.contentType==="c3_adpod";if(p)for(var o=o.replace(/^\?/g,"").split("&"),p=0,n=o.length;p<n;p++)if(o[p].split("=")[0]=="xrs")l=btg.String.isDefined(o[p].split("=")[1])?o[p].split("=")[1]:"";if(b.guid&&
this.lastGuid!==b.guid){l={linkName:"Video View",linkType:"o",eVar28:b.contentType,events:"event15"+(g.getEndSlateClick()=="true"?",event45":""),campaign:l};if(typeof h.Omniture.enableTestAndTargetTrial!="undefined"&&h.Omniture.enableTestAndTargetTrial){o=(p=e.read("mtvn_btg_tnt"))?p.split("_")[0]:"";p=p?p.split("_")[1]:"false";if(g.getEndSlateClick()=="true"&&o!="")if(p.toString()=="true")f.convertMbox(location.href&&location.href.match(/[\?#&]id=[^&]/gi)?"editorialplaylist":"dynamicplaylist");else f.convertMbox("endslatevideoloaded");
f.convertMbox("endSlateGating")}e.set("mtvn_btg_tnt","");if(typeof btg.UserSegment!="undefined"){btg.UserSegment.add(g.context,"VideoViewer");if(v)btg.UserSegment.add(btg.MediaPlayer.context,"C3VideoViewer")}if(typeof h.Omniture.videoViewEventDisable!="undefined"&&h.Omniture.videoViewEventDisable){l.events=l.events.replace(/event15(,)?/gi,"");l.eVar28=""}else{g.setEndSlateClick("false");d.sendLinkEvent(l)}}this.lastGuid=b.guid};this.onEndslateLoad=function(){if(typeof this.onEndslateFired!="undefined")return;
else this.onEndslateFired=true;if(typeof btg.UserSegment!="undefined")btg.UserSegment.add(g.context,"EndslateViewer");d.sendLinkEvent({linkName:"Endslate View",linkType:"o",events:"event44"});if(typeof h.Omniture.enableTestAndTargetTrial!="undefined"&&h.Omniture.enableTestAndTargetTrial)f.convertMbox("endslateload")}},getPlayerObject:function(b){if(btg.MediaPlayer.isHtml5)b=b;else{if(navigator.appName.indexOf("Microsoft"))b=window[b]?window[b]:document[b]?document[b]:null;else b=document[b]?document[b]:
window[b]?window[b]:null;if(b&&typeof b.length!="undefined")for(var c in b)if(typeof b[c].pause!="undefined"){b=b[c];break}}return b},addListeners:function(b){if(btg.MediaPlayer.isHtml5){b.addEventListener("onMetadata",btg.MediaPlayer.players[b.id].onMetaData);b.addEventListener("onPlayheadUpdate",btg.MediaPlayer.players[b.id].onPlayHeadUpdate)}else{b.addEventListener("METADATA",'btg.MediaPlayer.players["'+b.id+'"].onMetaData');b.addEventListener("ENDSLATE_CLICK",'btg.MediaPlayer.players["'+b.id+
'"].onEndslateLoad');b.addEventListener("PLAYHEAD_UPDATE",'btg.MediaPlayer.players["'+b.id+'"].onPlayHeadUpdate');if(b.addReportingEventListener){b.addReportingEventListener("DEMDEXVIDEOSTARTCALL","btg.Demdex.sendPageCall");b.addReportingEventListener("DEMDEXVIDEOENDCALL","btg.Demdex.sendPageCall");b.addReportingEventListener("DEMDEXEMBED","btg.Demdex.sendSocialCall");b.addReportingEventListener("DEMDEXLINK","btg.Demdex.sendSocialCall");b.addReportingEventListener("DEMDEXSHARE","btg.Demdex.sendSocialCall");
b.addReportingEventListener("REPORTINGINIT","btg.MediaPlayer.reportingInit");b.addReportingEventListener("FIRSTPARTYSERVER","btg.MediaPlayer.getFirstPartyServer");b.addReportingEventListener("VMNUUID","btg.MediaPlayer.getVmnUUID");b.addReportingEventListener("ENDSLATECLICK","btg.MediaPlayer.setEndSlateClick")}}},onWindowLoaded:function(){var b=btg.MediaPlayer,c=window.mtvnPlayerLoaded;window.mtvnPlayerLoaded=function(d){var e;if(btg.Object.isDefined(d)){b.isHtml5=true;e=d.id;if(d.isFlash){b.isHtml5=
false;d=d.id}}else e=d;if(typeof c!="undefined")c(e);if(!b.isHtml5&&typeof document.getElementById(e)=="undefined")return;if(typeof b.players[e]=="undefined")b.addPlayer(d);b.players[e].onLoaded()}}};try{btg.MediaPlayer.onWindowLoaded();var MTVNPlayer=MTVNPlayer||{};MTVNPlayer.addCallback=function(b){this.onAPIReady=function(c){return c?function(){c();b()}:b}(this.onAPIReady)};MTVNPlayer.addCallback(function(b){return function(){MTVNPlayer.onPlayer(b)}}(mtvnPlayerLoaded))}catch(e$$38){}
btg.AdManager=new function(){var b=btg.Object,c=b.copyProperties,d=btg.String.isDefined,e=b.isConfigDefined,f=btg.String.stripFileExtension,g=btg.Math.random,h=btg.globalvars,k=false,j=false,l=false,o=false,p=false,v=3E4,n,q=[],w=new btg.DependencyManager(7E3);w.add("demdex_data",function(){return!btg.config.Demdex||!btg.config.Demdex.enabled||btg.Object.isDefined(btg.Demdex.data)},100,true);w.add("uuid",function(){return btg.Cookie.read("vmn_uuid")!=null},100,true);this.groupedReloadableAdsCounter=
this.groupedReloadableAdsTotal=0;var t={};t.tile=0;t.ord=g(1E17,1E18);var u=[{name:"DoubleClick",url:"http://ad.doubleclick.net/",reportEvent:"event79"},{name:"FreeWheel",url:"http://140cc.v.fwmrm.net/",reportEvent:"event80"}];this.reloadableAds={};this.init=function(){n=btg.config;if(n.reloadableAds&&n.reloadableAds===true)p=true;if(n.reloadInterval&&!isNaN(parseInt(n.reloadInterval))){n.reloadInterval=parseInt(n.reloadInterval);if(n.reloadInterval>=1E4)v=n.reloadInterval}var b={};if(e(n.DoubleClick)){n.DoubleClick.dartSite=
btg.DartSite.getValue(n.DoubleClick.dartSite);if(n.DoubleClick.type&&n.DoubleClick.type.toLowerCase()=="international"){n.International={};c(n.DoubleClick,n.International)}else if(n.DoubleClick.type&&n.DoubleClick.type.toLowerCase()=="domestic")n.International={};k=true;if(d(n.DoubleClick.sections)){n.DoubleClick.sections=f(n.DoubleClick.sections);b.sections=n.DoubleClick.sections}else{this.setDefaultSections();if(d(t.sections))b.sections=t.sections}b.dartSite=n.DoubleClick.dartSite}if(e(n.FreeWheel))j=
true;if(e(n.International)){l=true;if(d(n.International.sections)){n.International.sections=f(n.International.sections);b.sections=n.International.sections}else{this.setDefaultSections();if(d(t.sections))b.sections=t.sections}b.dartSite=n.International.dartSite}if(e(n.QuantCast))o=true;if(o){PlatoAd=new btg.DomesticDc(n.DoubleClick);dmobj={size:"728x90",contentType:"adj"};dmobj.sections=b.sections;if(d(n.QuantCast.vertical))PlatoAd.setKeyValues("vertical="+n.QuantCast.vertical);PlatoAd.init(dmobj);
PlatoAd.getUrl();if(btg.QuantCast)btg.QuantCast.Ads.setLabels(b,PlatoAd.getSections())}this.check4BlockedAds();b=this.getAdsBHCookie("mtvn_btg_adshidden");if(b<2){btg.Cookie.set("mtvn_btg_adshidden",++b);btg.Events.adLoaded.subscribe(this.checkStyle)}};this.getAdsBHCookie=function(b){var c="",b=btg.Cookie.read(b);if(b!=null)c=parseInt(b);else c=0;return c};this.sendAdBlockedRepCall=function(){btg.Cookie.set("mtvn_btg_adsblocked",this.getAdsBHCookie("mtvn_btg_adsblocked")+1);for(var b=[],c=[],d=0,
e=u.length;d<e;d++)if(u[d].isBlocked===true){b.push(u[d].name);c.push(u[d].reportEvent)}if(b.length>0){b=b.join(" and ");btg.Controller.sendLinkEvent({linkName:b+" Blocked",linkType:"o",eVar55:b+" Blocked",events:c.join()});btg.Cookie.set("mtvn_btg_adsblocked",2)}};this.blockCallback=function(b){for(var c=0,d=0,e=u.length;d<e;d++){if(b.url==u[d].url)if(typeof b.fail!="undefined"&&b.fail===true)u[d].isBlocked=true;else u[d].isBlocked=false;if(typeof u[d].isBlocked!="undefined")c++}if(c==u.length)btg.AdManager.sendAdBlockedRepCall()};
this.check4BlockedAds=function(){if(navigator.userAgent.indexOf("MSIE")!=-1)return;var b=this.getAdsBHCookie("mtvn_btg_adsblocked");if(b>=2);else if(b<2)for(var b=0,c=u.length;b<c;b++)new btg.Ajax({method:"POST",onSuccess:this.blockCallback,onFail:this.blockCallback,autoSend:true,url:u[b].url})};this.sendAdHiddenRepCall=function(){if(this.getAdsBHCookie("mtvn_btg_adshidden")>=2)return;btg.Controller.sendLinkEvent({linkName:"DoubleClick Hidden",linkType:"o",eVar55:"DoubleClick Hidden",events:u[0].reportEvent});
btg.Cookie.set("mtvn_btg_adshidden",2)};this.checkStyle=function(b){try{var c=document.getElementById(b),d=c.tagName.toLowerCase()=="iframe"?c:c.parentNode;if(btg.DOM.getStyle(d,"display")=="none"||btg.DOM.getStyle(d,"visibility")=="hidden")btg.AdManager.sendAdHiddenRepCall()}catch(e){}};this.addUuid=function(b){var c=btg.Cookie.read("vmn_uuid"),d=btg.config.DoubleClick.keyValues;if(c!=null){c="u="+c;if(btg.String.isDefined(b.keyValues))b.keyValues+=b.keyValues.lastIndexOf(";")==b.keyValues.length-
1?c+";":";"+c+";";else if(btg.String.isDefined(d))b.keyValues=d.lastIndexOf(";")==d.length-1?d+c+";":d+";"+c+";";else b.keyValues=c+";"}return b};this.addDemdexVals=function(b){if(btg.Object.isDefined(btg.Demdex.data&&btg.Demdex.data.stuff))for(var c=btg.Demdex.data.stuff,d=btg.config.DoubleClick.keyValues,e=0,f=c.length;e<f;e++)if(btg.Object.isDefined(c[e])&&btg.String.isDefined(c[e].cn)&&c[e].cn=="dfp"&&btg.String.isDefined(c[e].cv)){c=c[e].cv.split(",").join(";");if(btg.String.isDefined(b.keyValues))b.keyValues+=
b.keyValues.lastIndexOf(";")==b.keyValues.length-1?c+";":";"+c+";";else if(btg.String.isDefined(d))b.keyValues=d.lastIndexOf(";")==d.length-1?d+c+";":d+";"+c+";";else b.keyValues=c+";";break}return b};this.placeAd=function(b,c){btg.Controller.init();if(btg.config.defferedAdLoading&&!c)this.placeAdTag(b);else{if(typeof h.IS_CODA_ADS_USED!="undefined"&&h.IS_CODA_ADS_USED==false)h.IS_CODA_ADS_USED=true;if(b.size=="6x6")if(btg.Cookie.read("vmn_poe")==null)btg.Cookie.set("vmn_poe","6x6");else return;var d=
this.getAd(b);if(b.isReloadable===true||p&&b.isReloadable!==false){if(d.setContentType)d.setContentType("adi");d.reloadInterval=v;if(b.reloadInterval&&!isNaN(parseInt(b.reloadInterval))){d.needUniqueOrd=true;b.reloadInterval=parseInt(b.reloadInterval);if(b.reloadInterval>=1E4)d.reloadInterval=b.reloadInterval}else{this.groupedReloadableAdsTotal++;this.groupedReloadableAdsCounter++}if(d.reloadTimer){clearInterval(d.reloadTimer);d.reloadTimer=null}d.reloadTimer=setInterval(function(){btg.AdManager.reloadAd(d)},
d.reloadInterval)}if(d!=null){d.placeAd(b);return d}else{btg.Error.log("Coda ERROR: Ad not created, please check your config to enable CODA ads!");return null}}};this.placeAdTag=function(b){var c=btg.config;c.adSetup=c.adSetup||[];b.adId="btgAd_"+c.adSetup.length;c.adSetup[c.adSetup.length]=b;document.write("<div id='"+b.adId+"'></div>")};this.placeAllAds=function(){if(btg.Cookie.read("vmn_3pc")!="0"&&w.hasDependency()){w.addToCallQueue(this,btg.AdManager.placeAllAds);return}var b=btg.config.adSetup;
if(b)for(var c=0,d=b.length;c<d;c++){b[c].contentType="adi";if(b[c].adId.match(/btgad_/ig))this.placeAd(b[c],true);else if(console&&console.log)console.log("Please provide adId in std format. Ex. 'btgAd_1'.")}};this.adLoadNotify=function(b){if(typeof btg.Events.adLoaded!="undefined")btg.Events.adLoaded.fire(b)};this.setAdReloadOrdByGroup=function(b){if(b.needUniqueOrd===true)b.setOrd(g(1E17,1E18));else{if(this.groupedReloadableAdsCounter>=this.groupedReloadableAdsTotal&&this.groupedReloadableAdsCounter%
this.groupedReloadableAdsTotal==0)t.ord=g(1E17,1E18);b.setOrd(t.ord);this.groupedReloadableAdsCounter++}};this.reloadAd=function(c){var e=b.isDefined;if(e(c)&&d(c.id)&&e(self.frames[c.id])){c.setContentType("adi");this.setAdReloadOrdByGroup(c);try{self.frames[c.id].location.replace(c.getUrl())}catch(f){}}};this.reloadAll=function(){var b=q.length,c=btg.FreeWheelAdInterface.fwAds,d=c.length;t.ord=g(1E17,1E18);for(var e=0;e<b;e++){var f=q[e];f.setOrd(t.ord);this.reloadAd(f);if(f.reloadTimer){clearInterval(f.reloadTimer);
f.reloadTimer=null;f.reloadTimer=setInterval(function(){btg.AdManager.reloadAd(f)},f.reloadInterval)}}for(e=0;e<d;e++){f=c[e];f.dcAd.setOrd(t.ord);f.reload();f.startReloadTimer()}return this};this.getData=function(){return t};this.setDefaultSections=function(b){b=d(b)?b:btg.Sections.getAdSections();if(d(b))t.sections=f(b)};this.getAd=function(b){this.init();var e;if(l)e=new btg.InternationalDc(n.International);else if(j)e=new btg.FreeWheelAd(n);else if(k)e=new btg.DomesticDc(n.DoubleClick);else{btg.Error.log("Coda ERROR: Ads not enabled. Please check your config or placeAd() method call!");
return null}if(btg.Object.isConfigDefined(btg.config.Demdex))b=this.addDemdexVals(b);b=this.addUuid(b);if(!b.isSurrogate)t.tile++;if(d(b.sections))b.sections=f(b.sections);c(t,b);e.init(b);if(!b.isSurrogate)q.push(e);return e};this.getAds=function(){return q};this.getAdUrl=function(b){return this.getAd(b).getUrl()};this.setTile=function(b){t.tile=b}};
btg.FreeWheelAd=function(b){this.isStr=btg.String.isDefined;this.config=b;this.type="FreeWheelAd";this.fwType="DART";this.slotId="fwph_";this.reloadable=false;this.reloadTime=3E4;this.needUniqueOrd=this.isGroupedByOrd=false};
btg.FreeWheelAd.prototype={placeAd:function(b){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 c="slid=";c+=this.slotId;c+="&ptgt=s&envp=g_iframe_js&w=";c+=this.realWidth;c+="&h=";c+=this.realHeight;var d="";d+='<span id="'+this.slotId+'" class="_fwph">';d+='<form id="_fw_form_'+this.slotId+'" style="display:none;">';d+='<input type="hidden" name="_fw_input_'+
this.slotId+'" id="_fw_input_'+this.slotId+'" value="'+c+'" />';d+="</form>";d+='<span id="_fw_container_'+this.slotId+'" class="_fwac">';d+='<span id="fwCustom_'+this.slotId+'" name="fwCustom_'+this.slotId+'" class="fwCustomAll" style="width:'+this.realWidth+"px;height:"+this.realHeight+'px;display:block;"></span></span>';d+="</span>";if(btg.globalvars.IS_TOP_ACCESSIBLE&&btg.String.queryStringToObject(top.location.search).mockupMode=="true")d=btg.String.mockItUp(d);if(btg.config.defferedAdLoading)if(b=
document.getElementById(b.adId))b.innerHTML=d;else document.write(d);else document.write(d);btg.FreeWheelAdInterface.fwAds[this.slotId]=this;btg.DOM.Events.addListener(window,"load",this.timerToPlayAd)}else if(this.fwType=="DART"){this.dcAd=new btg.DomesticDc(this.config.DoubleClick);this.dcAd.init(this.initData);this.dcAd.placeAd(b)}else{new btg.Alert("FreeWheel ad type not recognized.");btg.Error.log("Coda ERROR: FreeWheel ad type not recognized. Please check your config!")}},timerToPlayAd:function(){setTimeout(function(){var b=
false,c;for(c in btg.MediaPlayer.players){b=true;break}if(b)setTimeout(btg.FreeWheelAdInterface.forcedPlayAd,btg.globalvars.FORCE_AD_WAIT_TIME.PLAYER_LOADED);else setTimeout(btg.FreeWheelAdInterface.forcedPlayAd,btg.globalvars.FORCE_AD_WAIT_TIME.PLAYER_FAILED)},btg.globalvars.FORCE_AD_WAIT_TIME.PLAYER_LOAD_WAIT_TIME)},setContentType:function(){},init:function(b){this.initData=b;if(this.isStr(b.size))this.size=b.size;else{this.size="[ERROR: Size Not Defined!]";new btg.Alert("FreeWheel ad size not defined.");
btg.Error.log("Coda ERROR: FreeWheel ad size not defined.")}if(this.isStr(b.realSize))this.realSize=b.realSize;else this.realSize=this.size;this.slotId+=b.tile;if(this.isStr(this.config.FreeWheel.type))this.fwType=this.config.FreeWheel.type.toUpperCase();if(this.config.FreeWheel.reloadable||b.isReloadable){this.reloadable=true;this.reloadTime=3E4;if(this.config.FreeWheel.reloadTime&&!isNaN(parseInt(this.config.FreeWheel.reloadTime))&&parseInt(this.config.FreeWheel.reloadTime)>=1E4){this.reloadTime=
parseInt(this.config.FreeWheel.reloadTime);this.isGroupedByOrd=true}if(b.reloadInterval&&!isNaN(parseInt(b.reloadInterval))&&parseInt(b.reloadInterval)>=1E4){this.reloadTime=parseInt(b.reloadInterval);if(this.isGroupedByOrd===true)this.isGroupedByOrd=false;this.needUniqueOrd=true}if(this.isGroupedByOrd===true){btg.AdManager.groupedReloadableAdsTotal++;btg.AdManager.groupedReloadableAdsCounter++}}},reload:function(){var b="_fw_frame_"+this.slotId,c=document.getElementById(b),d=document.getElementById("fwCustom_"+
this.slotId);if(!btg.Object.isDefined(this.dcAd)){this.dcAd=new btg.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(c!=null)btg.AdManager.setAdReloadOrdByGroup(this.dcAd);this.dcAd.setContentType("adi");b="<ifr"+'ame allowtransparency="true" style="display:inline;width:'+this.realWidth+"px;height:"+this.realHeight+'px;border:0px;z-index:99;border-width:0px;" onload="btg.AdManager.adLoadNotify(\''+
this.dcAd.id+'\');" id="'+b+'" name="'+b+'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" width="'+this.realWidth+'" height="'+this.realHeight+'" src="'+this.dcAd.getUrl()+'"></ifr'+"ame>";if(c==null&&d!=null){d.style.border="0px";d.style.backgroundColor="transparent";try{d.innerHTML=b}catch(e){}}else if(c!=null)if(c.parentElement)try{c.parentElement.innerHTML=b}catch(f){}else if(c.parentNode)try{c.parentNode.innerHTML=b}catch(g){}},startReloadTimer:function(){if(this.reloadable){var b=
this;if(this.reloadTimer){clearInterval(this.reloadTimer);this.reloadTimer=null}this.reloadTimer=setInterval(function(){b.reload()},this.reloadTime)}}};
btg.FreeWheelAdInterface=new function(){var b=btg.String;this.fwAds=[];this.getFallbackDisplayHTML=function(c,d){for(var e=b.isDefined,f="",g=this.fwAds[c],h=d.split(","),k="",j=0,l=h.length;j<l;j++)if(e(h[j]))k+=";!category="+h[j];g.dcAd=new btg.DomesticDc(g.config.DoubleClick);if(e(g.initData.keyValues))g.initData.keyValues+=k;else g.initData.keyValues=k;g.initData.contentType="adj";g.dcAd.init(g.initData);if(g.reloadable)g.startReloadTimer();if(!e(g.dcAd.id))g.dcAd.setId("ad"+g.dcAd.tile);f+="<scr"+
'ipt type="text/javascript" id="'+g.dcAd.id+"\" onreadystatechange=\"if(this.readyState=='complete')parent.btg.AdManager.adLoadNotify('"+g.dcAd.id+"');\" onload=\"parent.btg.AdManager.adLoadNotify('"+g.dcAd.id+'\');" src="';f+=g.dcAd.getUrl();f+='"></scr'+"ipt>";return f};this.forcedPlayAd=function(){var c=btg.FreeWheelAdInterface,d=btg.globalvars,e=b.queryStringToObject,f=false,g=false,h,k=d.IS_LIVE_ENV;if(d.IS_TOP_ACCESSIBLE)if(e(top.location.search).fwFailSafe=="true")h=true;else if(e(top.location.search).fwFailSafe==
"false")h=false;if(h==true){f=true;if(k==true)g=true}else if(h==false)f=false;else if(k==true)g=f=true;if(d.IS_TOP_ACCESSIBLE&&e(top.location.search).mockupMode=="true")g=f=false;if(f==true){for(i in c.fwAds)if(document.getElementById("_fw_frame_"+i)==null){if(c.fwAds[i].reloadable)c.fwAds[i].startReloadTimer();c.fwAds[i].reload()}else g=false;if(g==true)new btg.Alert("Freewheel failsafe method used.",1)}}};var mtvn=typeof mtvn==="object"?mtvn:{};mtvn.btg=typeof mtvn.btg==="object"?mtvn.btg:{};
mtvn.btg.ads=typeof mtvn.btg.ads==="object"?mtvn.btg.ads:{};mtvn.btg.ads.FreeWheelAdInterface=btg.FreeWheelAdInterface;(function(b){b.DartSite=function(){var c=b.Environment.getPlatform();return{getValue:function(b){if(c==="iPad"&&b.indexOf(".tab")===-1)b+=".tab";return b}}}()})(btg);
btg.DoubleClick=function(b){this.isStr=btg.String.isDefined;this.isObj=btg.Object.isDefined;this.gv=btg.globalvars;this.qsToObj=btg.String.queryStringToObject;this.mockItUp=btg.String.mockItUp;if(this.isObj(b))this.config=b;this.server="ad.doubleclick.net";this.ssl=false;this.contentType="adj";this.mediaType="standard";this.keyValues="";this.zoneOverride=null;this.additionalKeyValues=[];this.exclusions=[];this.reservedKeyValues={};if(this.isObj(b))this.autoDcopt=b.autoDcopt?true:false;if(this.isObj(btg.AdManager)&&
!btg.AdManager.dcoptOn)btg.AdManager.dcoptOn=false;this.isDevEnv=false;if(btg.globalvars.IS_TOP_ACCESSIBLE&&top.location.hostname.indexOf("mtvi.com")>-1)this.isDevEnv=true;if(this.isObj(b))for(var c in b)if(this.isStr(b[c])&&(typeof b[c]=="string"||typeof b[c]=="number"))if(c=="sections")this.setSections(b[c]);else if(c=="keyValues")this.setKeyValues(b[c]);else if(c=="positionThreshold")this.setPositionThreshold(b[c]);else this[c]=b[c]};
btg.DoubleClick.prototype={formatUrl:function(b){var c="",c=b.dartSite+"/"+b.zone+";";if(c.length>64)b.zone=b.zone.substring(0,b.zone.length-(c.length-64));c=[[b.protocol+b.server,b.contentType,b.dartSite,b.zone].join("/"),b.sections];if(this.isStr(b.keyValues))c.push(b.keyValues);if(b.ord>0)c.push("ord="+b.ord+"?");return c=c.join(";")},setKeyValues:function(b){b=b.replace(/[^\w=!;|-]/g,"_");this.keyValues=b.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(b){this.zoneOverride=b},setId:function(b){this.id=b},setServer:function(b){this.server=b},setSsl:function(){this.ssl=true},setDartSite:function(b){this.dartSite=btg.DartSite.getValue(b)},setContentType:function(b){this.contentType=b},setMediaType:function(b){this.mediaType=b},setPosition:function(b){this.position=
b},setSections:function(b){for(var b=b=="/"?b:btg.String.charTrim(b,"/"),c=this.isObj(btg.config)&&this.isStr(btg.config.defaultIndexFileName)?btg.config.defaultIndexFileName:"index",c=btg.String.stripFileExtension(c),c=["/",c,"home/"+c],d=0,e=c.length;d<e;d++)if(b.indexOf(c[d])==0&&b.length==c[d].length){b=b.replace(c[d],"_hp");break}for(b=b.replace(/[^\/\w=!;|-]/g,"_");b.match(/\/\d/);)b=b.replace(/\/\d/,RegExp.lastMatch.substring(0,1)+"_"+RegExp.lastMatch.substring(1,2));b=b.replace(/^\d/,"_"+
b.match(/^\d/,"_"));this.sections=b.replace(/^\/+|\/+$/g,"");if(this.sections.indexOf(".")>-1)this.sections=this.sections.split(".")[0]},setSize:function(b){this.size=b},setRealSize:function(b){this.realSize=b},setTile:function(b){this.tile=b},setPositionThreshold:function(b){if(isNaN(parseInt(b)))this.positionThreshold=null;else this.positionThreshold=parseInt(b)},setOrd:function(b){this.ord=b},setPartner:function(b){this.partner=b},addExclusionCategory:function(b){var b=b.replace(/^;+|;+$/g,""),
c=false;if(this.exclusions.length>0){for(var d=0,e=this.exclusions.length;d<e;d++)if(this.exclusions[d].match(new RegExp("category="+b,"ig"))){c=true;break}if(!c)this.exclusions.push("!category="+b)}else this.exclusions.push("!category="+b)},addKeyValues:function(b){if(this.isStr(b)&&b.indexOf("=")>-1)this.additionalKeyValues.push(b)},appendKeyValue:function(b,c){if(!this.isStr(b))b="";if(!this.isStr(c))c="";b=b.replace(/^;+|;+$/g,"");c=c.replace(/^;+|;+$/g,"");if(b.indexOf("=")>-1)c+=";"+b;return c=
c.replace(/^;+|;+$/g,"")},removeKeyValue:function(b){if(this.isStr(this.getKeyValue(b))){var c=";"+b+this.getKeyValue(b);if(this.keyValues.indexOf(c)==-1){c=b+this.getKeyValue(b)+";";if(this.keyValues.indexOf(c)==-1)c=b+this.getKeyValue(b)}this.keyValues=this.keyValues.replace(new RegExp(c,"g"),"");this.removeKeyValue(b)}},getProtocol:function(){return this.ssl?"https://":"http://"},getPosition:function(){var b="unk";if(this.isStr(this.position))if(this.position.indexOf("atf")>-1)b="atf";else{if(this.position.indexOf("btf")>
-1)b="btf"}else if(btg.String.isDefined(this.containerAdId)){var c=document.getElementById(this.containerAdId),c=parseInt(c.offsetTop),d=parseInt(document.documentElement.clientHeight);if(!isNaN(c)&!isNaN(d))if(c<d)b="atf";else b="btf"}else if(this.isStr(this.positionThreshold))b=this.tile<=this.positionThreshold?"atf":"btf";return b},getKeyValue:function(b){var c;if(this.keyValues.indexOf(b)>-1){b=this.keyValues.split(b);if(b.length>0)if(b[1].indexOf(";")>-1)c=b[1].substring(0,b[1].indexOf(";"));
else c=b[1]}return c},getSections:function(){return this.sections},getContentTypeAbbreviation:function(){var b="";if(this.contentType=="pfadx")b="p";if(this.contentType=="adj")b="j";if(this.contentType=="adi")b="i";if(this.contentType=="adx")b="x";if(this.contentType=="ad")b="a";return b},getExclusions:function(){return this.exclusions.join(";")},isValidDcopt:function(b){var c=false;if(this.isStr(b))for(var d=0,e=btg.globalvars.VALID_DCOPT.length;d<e;d++)if(b==btg.globalvars.VALID_DCOPT[d]){c=true;
break}return c},formatReserved:function(){for(var b=this.keyValues,c=["dcmt","dcopt","dcove"],d=0,e=c.length;d<e;d++)if(b.indexOf(c[d]+"=")>-1){for(var f=this.getKeyValue(c[d]+"="),b=b.split(c[d]+"="+f),g=0,e=b.length;g<e;g++)b[g]=b[g].replace(/^;+|;+$/g,"");if(c[d]=="dcopt"&&this.isValidDcopt(f)!=true){this.keyValues=b.join(";");return this.formatReserved()}this.reservedKeyValues[c[d]]=f;b=b.join(";")}if(b.lastIndexOf(";")==b.length-1)b=b.substring(0,b.length-1);return b},getAdditionalKeyValues:function(){return this.additionalKeyValues.join(";")},
applyTestbedValues:function(){var b=btg.Cookie.read("mtvn_btg_atb");if(b!=null&&b.indexOf("daDart:")>=0){b=b.split(",")[0].split(":")[1];this.dartSite=b=="auto"?this.dartSite="atb_"+this.dartSite:b}},getValues:function(){this.applyTestbedValues();var b=this.isStr(this.zoneOverride)?this.zoneOverride:this.formatZone(),c=this.formatKeyValues(),d=this.formatSectionValues();return{id:this.id,protocol:this.getProtocol(),server:this.server,dartSite:this.dartSite,contentType:this.contentType,mediaType:this.mediaType,
zone:b,sections:d,keyValues:c,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 b=this.getValues();b.url=this.formatUrl(b);
return b},getXml:function(){var b=[],c=this.getValues();c.url=this.formatUrl(c);for(var d in c)if(typeof(c[d]=="string"))b.push("<"+d+">"+"</"+c[d]+">");return"<DoubleClick>"+b.join("")+"</DoubleClick>"},init:function(b){if(typeof b==="object"){if(this.isStr(b.zoneOverride))this.setZoneOverride(b.zoneOverride);if(this.isStr(b.id))this.setId(b.id);if(this.isStr(b.server))this.setServer(b.server);if(this.isStr(b.ssl))this.setSsl(b.ssl);if(this.isStr(b.dartSite))this.setDartSite(b.dartSite);if(this.isStr(b.contentType))this.setContentType(b.contentType);
if(this.isStr(b.mediaType))this.setMediaType(b.mediaType);if(this.isStr(b.position))this.setPosition(b.position);if(this.isStr(b.sections))this.setSections(b.sections);if(this.isStr(b.keyValues))this.setKeyValues(b.keyValues);if(this.isStr(b.size))this.setSize(b.size);else{this.setSize("[ERROR: Size Not Defined!]");btg.Error.log("Coda ERROR: btg.DoubleClick: Size Not Defined!")}if(this.isStr(b.realSize))this.setRealSize(b.realSize);else this.setRealSize(this.size);if(this.isStr(b.tile))this.setTile(b.tile);
if(this.isStr(b.positionThreshold))this.setPositionThreshold(b.positionThreshold);if(this.isStr(b.ord))this.setOrd(b.ord);if(this.isStr(b.partner))this.setPartner(b.partner)}},createIframe:function(b){var c=document.getElementById(b.adId),d=null;if(c){b.frameBorder="0";b.marginHeight="0";b.marginWidth="0";b.scrolling="no";b.onload=function(){btg.AdManager.adLoadNotify(this.id)};b.parent=c;b.style={height:b.height+"px",width:b.width+"px","border-width":"0",overflow:"hidden"};if(this.gv.IS_TOP_ACCESSIBLE&&
this.qsToObj(top.location.search).mockupMode=="true"){b.parent=document.createElement("div");d=btg.DOM.appendIframe(b);c.innerHTML=this.mockItUp(d.parentNode.innerHTML)}else d=btg.DOM.appendIframe(b);d.setAttribute("allowtransparency",true)}}};btg.DomesticDc=function(){this.type="DomesticDc"};
btg.DomesticDc.prototype={formatSectionValues:function(){try{var b=this.sections.split("/")}catch(c){b=["[ERROR: Sections Not Defined!]"];btg.Error.log("Coda ERROR: btg.DomesticDc: Sections Not Defined!")}for(var d=0,e=[],f=0,g=b.length;f<g;f++)if(btg.String.isDefined(b[f])){e.push("sec"+d+"="+b[f]);d++}return e.join(";")},formatZone:function(){var b=this.getPosition()+"_"+this.getContentTypeAbbreviation()+"_"+this.mediaType.substr(0,1)+"/",c=this.getSections();if(this.isStr(this.keyValues)){if(this.keyValues.indexOf("partner=")>
-1){var d=this.getKeyValue("partner=");if(this.isStr(d)&&d!="null"){b+=d+"/";this.addExclusionCategory(d);this.addExclusionCategory("partner")}else this.keyValues=this.keyValues.replace(/(partner=;)|partner=$/ig,"partner=null;")}if(this.keyValues.indexOf("vertical=")>-1){d=this.getKeyValue("vertical=");if(this.isStr(d)){c=d+"/"+c;this.setSections(c)}}if(this.keyValues.indexOf("synd=")>-1){d=this.getKeyValue("synd=");if(this.isStr(d))this.addExclusionCategory(d)}}b=b.replace(/^\d/,"_"+b.match(/^\d/,
"_"));return b+c},setDemoVal:function(){var b=btg.Cookie.read("qcDemo");if((typeof btg.config!="undefined"&&typeof btg.config.QuantCast!="undefined"&&typeof btg.config.QuantCast.adsEnabled=="boolean"&&btg.config.QuantCast.adsEnabled?true:false)&&this.isStr(b)&&this.keyValues.indexOf("demo=D")==-1)this.keyValues+=";"+unescape(b)},formatKeyValues:function(){var b=this.getAdditionalKeyValues();if(this.isStr(b))this.keyValues+=";"+b;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}if(this.keyValues.indexOf(this.getExclusions())==-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){b=this.qsToObj(top.location.search.toLowerCase()).testmode;if(this.isStr(b)&&this.keyValues.toLowerCase().indexOf("testmode")<
0)this.keyValues+=";testmode="+b}return this.keyValues=this.keyValues.replace(/^;+|;+$/g,"")},placeAd:function(b){if(!this.isStr(this.id))this.setId("ad"+this.tile);if(btg.config.defferedAdLoading){this.containerAdId=b.adId;this.createIframe({allowtransparency:"true",id:this.id,name:this.id,width:this.getRealWidth(),height:this.getRealHeight(),src:this.getUrl(),adType:this.contentType,adId:b.adId})}else if(this.contentType=="adi"){var c="<ifr"+'ame allowtransparency="true" onload="btg.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.qsToObj(top.location.search).mockupMode=="true")c=this.mockItUp(c);if(this.isStr(b)&&this.isStr(b.reloadableAdId))return c;else if(typeof exposeTestFunctionNames=="undefined")document.write(c)}else{c="<scr"+'ipt type="text/javascript" id="'+this.id+
"\" onreadystatechange=\"if(this.readyState=='complete')btg.AdManager.adLoadNotify('"+this.id+"');\" onload=\"btg.AdManager.adLoadNotify('"+this.id+'\');" src="'+this.getUrl()+'"></scr'+"ipt>";if(this.gv.IS_TOP_ACCESSIBLE&&this.qsToObj(top.location.search).mockupMode=="true")c=this.mockItUp(c);if(this.isStr(b)&&this.isStr(b.reloadableAdId))return c;else if(typeof exposeTestFunctionNames=="undefined")document.write(c)}}};btg.DomesticDc=btg.Class.inheritFrom(btg.DoubleClick,btg.DomesticDc);
btg.InternationalDc=function(){this.type="InternationalDc"};
btg.InternationalDc.prototype={formatSectionValues:function(){var b=this.sections.split("/"),c="none",d="none",e="none",f=[];if(this.isStr(b[0]))c=b[0];else c="/";if(this.isStr(b[1]))d=b[1];if(this.isStr(b[2])){for(var e=2,g=b.length;e<g;e++)if(this.isStr(b[e]))f.push(b[e]);e=f.join("/")}return"sec0="+c+";sec1="+d+";secN="+e},formatZone:function(){var b=this.sections.split("/");if(this.isStr(b[0]))b=b[0];else b="/home";return b},formatKeyValues:function(){var b=btg.AdManager,c=this.getAdditionalKeyValues();
if(this.isStr(c))this.keyValues+=";"+c;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";b.dcoptOn=true}if(this.isStr(this.reservedKeyValues.dcopt))if(b.dcoptOn){if(this.tile!=
"1"){btg.Error.log("Coda ERROR: btg.InternationalDc: Attempt to set dcopt value more than once per page!");if(this.isDevEnv)this.keyValues+=";[ERROR: Attempt to set dcopt value more than once per page!]"}}else{this.keyValues+=";dcopt="+this.reservedKeyValues.dcopt;b.dcoptOn=true}if(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){b=this.qsToObj(top.location.search.toLowerCase()).testmode;
if(this.isStr(b)&&this.keyValues.toLowerCase().indexOf("testmode")<0)this.keyValues+=";testmode="+b}return this.keyValues=this.keyValues.replace(/^;+|;+$/g,"")},addInternationalValues:function(b){if(this.isStr(b.log))this.addKeyValues("log="+b.log);else this.addKeyValues("log=0");if(this.isStr(b.demo))this.addKeyValues("demo="+b.demo);else this.addKeyValues("demo=none");if(this.isStr(b.event))this.addKeyValues("event="+b.event);else this.addKeyValues("event=none");if(this.isStr(b.keyword))this.addKeyValues("search_kw="+
b.keyword);else this.addKeyValues("search_kw=none");if(this.isStr(b.vid))this.addKeyValues("vid="+b.vid);else this.addKeyValues("vid=none");if(this.isStr(b.vid_type))this.addKeyValues("vid_type="+b.vid_type);else this.addKeyValues("vid_type=none");if(this.isStr(b.region))this.addKeyValues("region="+b.region);else this.addKeyValues("region=none");this.addKeyValues("dcove=d");this.addKeyValues("url="+escape(location.pathname));if(this.isStr(b.keyValues))this.addKeyValues(b.keyValues)},placeAd:function(b){this.addInternationalValues(b);
if(!this.isStr(this.id))this.setId("ad"+this.tile);if(btg.config.defferedAdLoading)this.createIframe({allowtransparency:"true",id:this.id,name:this.id,width:this.getRealWidth(),height:this.getRealHeight(),src:this.getUrl(),adType:this.contentType,adId:b.adId});else if(this.contentType=="adi"){var c="<ifr"+'ame allowtransparency="true" onload="btg.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.qsToObj(top.location.search).mockupMode=="true")c=this.mockItUp(c);if(this.isStr(b)&&this.isStr(b.reloadableAdId))return c;else if(typeof exposeTestFunctionNames=="undefined")document.write(c)}else{c="<scr"+'ipt type="text/javascript" id="'+this.id+"\" onreadystatechange=\"if(this.readyState=='complete')btg.AdManager.adLoadNotify('"+this.id+"');\" onload=\"btg.AdManager.adLoadNotify('"+this.id+
'\');" src="'+this.getUrl()+'"></scr'+"ipt>";if(this.gv.IS_TOP_ACCESSIBLE&&this.qsToObj(top.location.search).mockupMode=="true")c=this.mockItUp(c);if(this.isStr(b)&&this.isStr(b.reloadableAdId))return c;else if(typeof exposeTestFunctionNames=="undefined")document.write(c)}}};btg.InternationalDc=btg.Class.inheritFrom(btg.DoubleClick,btg.InternationalDc);
btg.SurrogateAd=new function(){var b={poe:{tile:"0",size:"6x6",cookieName:"vmn_poe",contentType:"adj",position:"btf"}};this.load=function(c){if(btg.String.isDefined(c)&&btg.Object.isDefined(b[c])&&btg.Object.isConfigDefined(btg.config.DoubleClick)){var d=function(b){document.write("<scr"+'ipt src="'+b+'">'+"</sc"+"ript>")},c=b[c];c.isSurrogate=true;if(btg.String.isDefined(c.cookieName)){if(btg.Cookie.read(c.cookieName)==null){var e=btg.AdManager.getAdUrl(c);d(e);btg.Cookie.set(c.cookieName,c.size)}}else{e=
btg.AdManager.getAdUrl(c);d(e)}}}};if(typeof mtvn=="undefined")mtvn={};
mtvn.btg={Controller:btg.Controller,managers:{DependencyManager:btg.DependencyManager,PluginManager:btg.PluginManager,QueueManager:btg.QueueManager},ads:{AdManager:btg.AdManager,games:{GameAdLoader:btg.GameAdLoader,GameAdManager:btg.GameAdManager,GameDc:btg.GameDc},freewheel:{FreeWheelAd:btg.FreeWheelAd,FreeWheelAdInterface:btg.FreeWheelAdInterface}},reporting:{ABTest:btg.ABTest,ChoiceStream:btg.ChoiceStream,ComScore:btg.ComScore,ESIVars:btg.ESIVars,FluxHosted:btg.FluxHosted,FluxState:btg.FluxState,
GoogleAnalytics:btg.GoogleAnalytics,Nielsen:btg.Nielsen,Omniture:btg.Omniture,Photos:btg.Photos,QuantCast:btg.QuantCast,RecsABTesting:btg.RecsABTesting,ReportingManager:btg.ReportingManager,Search:btg.Search,SEO:btg.SEO,TestAndTarget:btg.TestAndTarget,UserSegment:btg.UserSegment,Demdex:btg.Demdex,omniture:{Hcode:btg.Hcode},player:{Loadtime:btg.Loadtime,MediaPlayer:btg.MediaPlayer,Preload:btg.Preload},games:{GameEventMediator:btg.GameEventMediator,GameEventVO:btg.GameEventVO,GameReporter:btg.GameReporter,
GameReportingManager:btg.GameReportingManager}},util:{Alert:btg.Alert,Beacon:btg.Beacon,Class:btg.Class,Cookie:btg.Cookie,DOM:btg.DOM,Events:btg.Events,JSON:btg.JSON,Math:btg.Math,Object:btg.Object,String:btg.String,Timer:btg.Timer,TimeTracker:btg.TimeTracker,Window:btg.Window,Sections:btg.Sections},plugins:{GUID:btg.GUID,Meteor:btg.Meteor}};if(typeof mtvn.btg.config=="undefined")mtvn.btg.config={};
if(typeof mtvn.btg.config.ReportSettings=="undefined")mtvn.btg.config.ReportSettings={defaultPageName:btg.globalvars.PAGE_URL,Omniture:{},Nielsen:{},GoogleAnalytics:{},QuantCast:{},ComScore:{},Meteor:{},ChoiceStream:{},Demdex:{}};if(typeof mtvn.btg.config.AdSettings=="undefined")mtvn.btg.config.AdSettings={DoubleClick:{},International:{},QuantCast:{}};if(typeof com=="undefined")com={};if(typeof com.mtvi=="undefined")com.mtvi={};if(typeof com.mtvi.reporting=="undefined")com.mtvi.reporting={};
if(typeof com.mtvi.ads=="undefined")com.mtvi.ads={};if(typeof com.mtvi.config=="undefined")com.mtvi.config={};if(typeof com.mtvi.util=="undefined")com.mtvi.util={};if(typeof com.mtvi.util.IFrameReloader=="undefined")com.mtvi.util.IFrameReloader={};if(typeof com.mtvi.metadata=="undefined")com.mtvi.metadata={};
com.mtvi.util={toObject:btg.String.toObject,queryStringToHash:btg.String.queryStringToObject,isDefined:btg.String.isDefined,readCookie:btg.Cookie.read,deleteCookie:btg.Cookie.remove,crawlNodes:btg.Window.getNodeLinkName,addOnloadEvent:function(b){return btg.DOM.Events.addListener(window,"load",b)}};
com.mtvi.metadata={getDefaultPageName:function(){var b="",c=btg.globalvars;try{b=c&&typeof c.PAGE_URL=="string"&&c.PAGE_URL!=""?c.PAGE_URL:location.pathname;if(b.lastIndexOf("/")==b.length-1)if(mtvn.btg.util.String.isDefined(mtvn.btg.config.ReportSettings.indexFileName))b+=mtvn.btg.config.ReportSettings.indexFileName;else b=b!="/"?mtvn.btg.util.String.charRtrim(b,"/"):b;if(b!="/")b=mtvn.btg.util.String.charRtrim(b,"/");if(b!="/"&&b.indexOf("/")==0)b=b.substring(1);if(b.indexOf("/")==-1&&b.indexOf(mtvn.btg.config.ReportSettings.indexFileName)!=
-1)b="home/"+b}catch(d){}return b},getDefaultHierarchy:function(){var b=this.getDefaultPageName();return b=="/"?"":b},getDefaultChannel:function(){var b=this.getDefaultPageName();return b!="/"?b.split("/")[0]:b}};
com.mtvi.reporting.Controller=new function(){this.initalized=false;this.initialize=function(){btg.Controller.init()};this.sendCall=function(b){btg.Controller.sendPageCall(b)};this.sendLinkEvent=function(b){btg.Controller.sendLinkEvent(b)};this.registerLinks=function(){return true};this.setConfig=function(b){for(var c in b)btg.config.Omniture[c]=b[c];return true};this.addRegisterLinks=function(){return true};this.setDefaultData=function(b,c){if(btg.String.isDefined(b)){btg.config.Omniture[b]=btg.String.isDefined(c)?
c:"";return true}return false}};
com.mtvi.ads.AdManager=new function(){var b=btg.config.DoubleClick,c=btg.config.International,d=btg.String.isDefined,e=btg.Object.isDefined;this.setDartSite=function(d){(b.enabled?b:c).dartSite=d};this.setPositionThreshold=function(d){(b.enabled?b:c).positionThreshold=d};this.setSiteName=function(d){(b.enabled?b:c).siteName=d};this.setDefaultSections=function(c){if(d(c))b.sections=c};this.setKeyValues=function(d){(b.enabled?b:c).keyValues=d};this.getFormattedSections=function(b){var c=b;try{var c=
b=="/"?b:btg.String.charTrim(b,"/"),h=b.length,k="index";if(e(com.mtvi.reporting.Account)&&d(com.mtvi.reporting.Account.defaultIndexFileName))k=com.mtvi.reporting.Account.defaultIndexFileName;if(e(mtvn.btg.config.AdSettings)&&d(mtvn.btg.config.AdSettings.defaultIndexFileName))k=mtvn.btg.config.AdSettings.defaultIndexFileName;if(e(btg.config)&&d(btg.config.defaultIndexFileName))k=btg.config.defaultIndexFileName;for(var k=btg.String.stripFileExtension(k),j=["/",k,"home/"+k],l=0,o=j.length;l<o;l++)if(b.indexOf(j[l])==
0&&h==j[l].length){c=b.replace(j[l],"_hp");break}if(c=="")c="_hp";var p=btg.String.stripFileExtension(c).split("/");if(p.length==2)if(p[1]==k)c=btg.String.stripFileExtension(c).replace(k,"_mn")}catch(v){}return c};this.placeAd=function(b){btg.Controller.placeAd(b)};this.setServer=function(d){(b.enabled?b:c).server=d};this.setSsl=function(){(b.enabled?b:c).ssl=true};this.setDefaultContentType=function(d){(b.enabled?b:c).contentType=d};this.setZoneOverride=function(d){(b.enabled?b:c).zoneOverride=d};
this.IFrameAds=[];this.placeIFrameAd=function(b){b.isReloadable=true;btg.Controller.placeAd(b)};this.setReloadInterval=function(b){btg.config.reloadInterval=b};this.setAdClass=function(){};this.getAdById=function(){return null};this.getDartSite=function(){return(b.enabled?b:c).dartSite};this.getAd=function(b){return btg.AdManager.getAd(b)};this.getReloadInterval=function(){return btg.config.reloadInterval};this.reloadIFrameAds=function(){btg.Controller.reloadAds()};this.reloadIFrameAd=function(){};
this.setZone=function(){};this.getNewAd=function(){};this.populateNamesValuesObj=function(){}};com.mtvi.ads.DoubleClickAd=function(){};
com.mtvi.ads.DoubleClickAd.prototype={setZoneOverride:function(){},setDartSite:function(){},setOrd:function(){},placeAd:function(){},getXml:function(){return null},getJson:function(){return null},getUrl:function(){return null},getSections:function(){return null},setSize:function(){},setSections:function(){},setContentType:function(){},setKeyValues:function(){},setTile:function(){},setPositionThreshold:function(){},setServer:function(){},setSsl:function(){},setMediaType:function(){},setPosition:function(){},
setPartner:function(){},setId:function(){}};com.mtvi.reporting.ComScore=new function(){this.sendComScoreCall=function(){}};
com.mtvi.reporting.Dispatcher=function(){this.getValOnce=function(){return true};this.sendCall=function(b){btg.Controller.sendPageCall(b)};this.sendLinkEvent=function(b){mtvn.btg.Controller.sendLinkEvent(b)};this.registerLinks=function(){return true};this.setAttribute=function(b,c){if(btg.String.isDefined(b)){btg.Hcode[b]=btg.String.isDefined(c)?c:"";return true}return false};this.getAttribute=function(b){return btg.config.Omniture[b]};this.setValues=function(b){for(var c in b)if(btg.String.isDefined(b[c]))this.setAttribute(c,
b[c])};this.send=function(b){btg.Controller.sendPageCall(b)};this.setDefaultData=function(){};this.clearProps=function(){};this.clearAllVars=function(){}};com.mtvi.reporting.FluxWidgeted={setVars:function(){return true}};com.mtvi.reporting.GoogleAnalytics={makeCall:function(){(new btg.GoogleAnalytics(btg.GoogleAnalytics)).sendPageCall();return true}};com.mtvi.reporting.MediaPlayer={addPlayer:btg.MediaPlayer.addPlayer};
mtvn.btg.reporting.MediaPlayer={setEndSlateClick:mtvn.btg.reporting.player.MediaPlayer.setEndSlateClick,getEndSlateClick:mtvn.btg.reporting.player.MediaPlayer.getEndSlateClick};com.mtvi.reporting.QuantCast=new function(){this.sendQuantCastCall=function(){(new btg.QuantCast(btg.config.QuantCast)).sendPageCall();return true}};com.mtvi.reporting.Search=btg.Search;com.mtvi.reporting.Search.setVars=btg.Search.setData;
btg.isCoreLoaded=function(){btg.Events.CORE_LOADED.fire();btg.DOM.Events.addListener(document,"DOMContentLoaded",function(){this.dependencies=new btg.DependencyManager(4E3);this.dependencies.add("poe_loading",function(){return typeof vmn_btg_ESIVars!="undefined"},500,true);if(this.dependencies.hasDependency())this.dependencies.addToCallQueue(this,function(){btg.SurrogateAd.load("poe")})});btg.SurrogateAd.load("poe");return true}();

document.write('<scr' + 'ipt type="text/javascript" src="/global/scripts/special/projx.jhtml?channelname=MTV"></script>');

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

if(promo.hasClass('v2')){	
promo.find('.title2 a').click(function(){
mtvn.btg.Controller.sendLinkEvent({
linkName : 'HP:FEED:' + id,
linkType : 'o'
});	
return true;
});
promo.find('.simple-list a').click(function(){
mtvn.btg.Controller.sendLinkEvent({
linkName : 'HP:FEED:SOURCE',
linkType : 'o'
});	
return true;
});
} else {
id = 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 = "http://search.mtvnservices.com/typeahead/suggest/?siteName=mtv&format=json";
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(/(www.mtvx?-j?[dq].mtvi.com)/) ) return '';
else{
if( window.location.hostname.indexOf("mtv-d.mtvi.com") != -1 ) return 'http://www.mtv-d.mtvi.com';
else if (window.location.hostname.indexOf("mtv-q.mtvi.com") != -1 ) return 'http://www.mtv-q.mtvi.com';
else return 'http://www.mtv.com';
}
}
}
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);
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>Hear 25 full tracks per month free on mtv.com. <a href="#" onClick="MTVN.UI.ModalWindow.open(&quot;/music/html/rhap25/help.jhtml&quot;,null); return false;">Learn more.</a></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 = 'http://community.mtv.com';
}
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":"http://www.mtv.com/shared/promoimages/bands/g/gotye/push/hp/mini//239x90.jpg"}},"title":"PUSH: Gotye","link":{"args":"http://buzzworthy.mtv.com/category/push/"}}},"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(window).load(function(){
$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":"60","billboard":"60"}}}}};

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);
if(page==null){
// Go to page given in anchor tag if page is null
window.location.href=obj.href;
}
else{
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",queue:true});
}

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",queue:true});
}

}

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 animation = function(){
var pagewidth = $j(mdl).find('.pages').find('ol').width()+10; 

var jumpto = (current-requestPage)*pagewidth; 

var thisJumpto = parseInt($j(mdl).find('.pages').css('left')) + jumpto;

$j(mdl).find('.pages').animate({"left": thisJumpto},{easing:"swing",duration:'slow'});

$j(this).dequeue();

}

$j(mdl).find('.pages').queue(animation);	

//$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() {
$j("a.dynLink").click(function (e) {
e.preventDefault();
});
});

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

MTVN.LitePlayer = new function(){
this.imageServer = "mtv.mtvnimages.com";
this.videoUriPrefix = "mgid:uma:video:mtv.com:";
this.playlistUriPrefix = "mgid:uma:videolist:mtv.com:";
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 = 'http://community.mtv.com';
}

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

// included in ../mtvn.jhtml
// depends on community_flux.jhtml

// Flux Widget Proxy for MTVN
// 

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

this.loadEach = function(el) {
try{
var jsonText = "";
var code = $j(el).find("code");
if (code.get(0).firstChild && code.get(0).firstChild.nodeType == 8) {
jsonText = code.get(0).firstChild.nodeValue;
}

if (jsonText.length > 0 && ($j(el).parent().attr("id").indexOf("scriptPopupWidget_") == -1 || $j("#playerContainer").is("*") || el.toString().indexOf("#ModuleVideoList_") > -1)) {
var obj = eval("(" + jsonText + ")");
$j(el).empty().removeClass("hide");
if (typeof(MTV) != "undefined" && typeof(MTV.Flux) != "undefined" && typeof(MTV.Flux.ucid) != "undefined") {
if (!(MTV.Flux.ucid == "0ABEFFFF01F364840002FFFFBE0A" && obj.args.containerId == "wQuickMenu"))
if (!(MTV.Flux.ucid == "D3FCFFFF0002D51D0002FFFFFCD3" && obj.args.containerId == "wQuickMenu2"))
MTVN.Flux.Widgets.create(obj.widget, obj.args);
}
else
MTVN.Flux.Widgets.create(obj.widget, obj.args);
}
}catch(e){}
}

// 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'},
{ id: 'StumbleUpon', placeholder: 'service3Element'},
{ id: 'More', placeholder: 'moreElement'}
];
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);
}
}

MTVN.Utils.addSponsoredOverlay = function(imgPath, imgId, width, height, divSelector, trackingCode) {
var imgSrc = imgPath;
$j("#page-header h1").attr("style", "height: 30px;").empty();
$j("<img/>").attr({"id":imgId, "src":imgSrc, "border": 0, "width":width, "height":height}).prependTo(divSelector);
if (trackingCode != null)
$j("<img/>").attr({"src":trackingCode, "border": 0, "width": 1, "height": 1}).appendTo("#page-header");
}

function ThemeScheduler(){ 
this.scheduledTheme = null;
this.makeSchedule = function(){
var xmlString = "<themes> <theme> <start>11 24 2010 00 00</start> <end>11 29 2010 00 00</end> <pageurl>/</pageurl> <url>/sitewide/css/charlie/themes/hp-takeover/thanksgiving/0/theme.jhtml</url> <oparamName>thanksgiving</oparamName> </theme> <theme> <start>01 13 2011 14 57</start> <end>01 13 2011 15 11</end> <pageurl>1654756</pageurl> <url>/sitewide/css/charlie/themes/hp-takeover/thanksgiving/0/theme.jhtml</url> <oparamName>C3Event</oparamName> </theme> <theme> <start>01 14 2011 22 00</start> <end>01 14 2011 22 10</end> <pageurl>/music/unplugglaye/</pageurl> <url>/sitewide/css/charlie/themes/hp-takeover/thanksgiving/0/theme.jhtml</url> <oparamName>unplugged</oparamName> </theme> <!-- SITE BUCKETS --> <!-- MOVIES THEME ONE OFF --> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/shows/after_hours_josh_horowitz/*</pageurl> <url>/sitewide/css/charlie/themes/movies/theme.jhtml</url> <oparamName>default</oparamName> </theme> <!-- MOVIES THEME ONE OFF END --> <!--HUBS--> <theme> <start>12 23 2011 00 00</start> <end>01 01 2012 00 00</end> <pageurl>/</pageurl> <url>/sitewide/css/charlie/themes/buckets/hubs/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/</pageurl> <url>/sitewide/css/charlie/themes/buckets/hubs/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/ontv/</pageurl> <url>/sitewide/css/charlie/themes/buckets/hubs/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/sites/</pageurl> <url>/sitewide/css/charlie/themes/buckets/hubs/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <!--HUBS END--> <!--UTILITY--> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/sitewide/legal/*</pageurl> <url>/sitewide/css/charlie/themes/buckets/utility/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <!--UTILITY END--> <!--NEWS--> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/news/photo/index.jhtml</pageurl> <url>/sitewide/css/charlie/themes/buckets/news/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/news/correspondents/kash/*</pageurl> <url>/sitewide/css/charlie/themes/buckets/news/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/news/correspondents/sway/*</pageurl> <url>/sitewide/css/charlie/themes/buckets/news/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <!--NEWS END--> <!--MUSIC--> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/artists/browse.jhtml*</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/artist/*</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/playlibs/*</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/live_performances/*</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/artists/</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/artists/most_popular.jhtml*</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/photos/</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/videos/</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/videos/premieres/</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/playlists/index.jhtml?contentId=1654462</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/most-popular/music-videos/?category=pop*</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/rock/</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/hiphop/</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/indie/</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/radio/*</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/music/lyrics/*</pageurl> <url>/sitewide/css/charlie/themes/buckets/music/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <!--MUSIC END--> <!--SHOWS--> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/videos/home.jhtml</pageurl> <url>/sitewide/css/charlie/themes/buckets/shows/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/ontv/schedule/</pageurl> <url>/sitewide/css/charlie/themes/buckets/shows/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/ontv/all/</pageurl> <url>/sitewide/css/charlie/themes/buckets/shows/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/most-popular/tv-show-videos/?category=full*</pageurl> <url>/sitewide/css/charlie/themes/buckets/shows/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/shows/celebrity_deathmatch/series.jhtml</pageurl> <url>/sitewide/css/charlie/themes/buckets/shows/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/ontv/castingcall/</pageurl> <url>/sitewide/css/charlie/themes/buckets/shows/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <!--SHOWS END--> <!--MISC--> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/games/arcade/</pageurl> <url>/sitewide/css/charlie/themes/buckets/misc/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/mobile/</pageurl> <url>/sitewide/css/charlie/themes/buckets/misc/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/most-popular/photos/*</pageurl> <url>/sitewide/css/charlie/themes/buckets/misc/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/partners/mtv_tribe/index.jhtml</pageurl> <url>/sitewide/css/charlie/themes/buckets/misc/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/sweepstakes/</pageurl> <url>/sitewide/css/charlie/themes/buckets/misc/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/rss/</pageurl> <url>/sitewide/css/charlie/themes/buckets/misc/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/partners/newsletters/index.jhtml</pageurl> <url>/sitewide/css/charlie/themes/buckets/misc/default/theme.jhtml</url> <oparamName>default</oparamName> </theme> <!--MISC END--> <theme> <start>01 01 2010 00 00</start> <end>01 01 2020 00 00</end> <pageurl>/shows/after_hours_josh_horowitz/series.jhtml</pageurl> <url>/sitewide/css/charlie/themes/movies/theme.jhtml</url> <oparamName>default</oparamName> </theme> <!-- SITE BUCKETS END--> </themes>";
var loc = window.location.pathname+window.location.search; 
var sn = new Object();
window.location.search.replace( new RegExp( "([^?=&]+)(=([^&]*))?", "g" ), function( $0, $1, $2, $3 ){ sn[ $1 ] = $3; } );
var tm = sn['_testTheme'];
var xmlDoc;
try{ //Internet Explorer
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.loadXML(xmlString);
}
catch(e){
try{ //Firefox, Mozilla, Opera, etc.
var parser=new DOMParser();
xmlDoc=parser.parseFromString(xmlString,"text/xml");
}
catch(e){}
}
var now = new InitCurrentTime().now;
var n = new Date(now);
var cd = new Date();//client date
for(var i=0; i < xmlDoc.getElementsByTagName("theme").length; i++){
var pageurl = xmlDoc.getElementsByTagName("pageurl")[i].childNodes[0].nodeValue;
var localLoc = loc+'';
if(pageurl.indexOf("*") > -1) localLoc = localLoc.substring(0,pageurl.indexOf("*"))+'*'; 
if(localLoc == pageurl){
var cn ={};
var node = xmlDoc.getElementsByTagName("theme")[i];
for(j = 0; j < node.childNodes.length ;j++){
var child = node.childNodes[j];
if(child.nodeType==1){
if(child.childNodes.length)
cn[child.nodeName] = child.childNodes[0].nodeValue;
}
}
if(cn['start'].indexOf(":") < 0){ // mtv format
var sa = cn['start'].split(" "); var ea = cn['end'].split(" ");
cn['start'] = sa[2]+'/'+sa[0]+'/'+sa[1]+' '+ sa[3]+':'+sa[4];
cn['end'] = ea[2]+'/'+ea[0]+'/'+ea[1]+' '+ ea[3]+':'+ea[4];
}
var s = new Date(cn['start']);
var e = new Date(cn['end']);
if(tm==cn['oparamName']||parseInt(tm)==i){ // display datetime for this theme
var h = '<span id="testinfo" style="position:absolute; left:3px; top:3px;padding:3px; background:#ff6600; font-family:helvetica; font-size:11px; z-index:9999999">';
h += cn['start']+'<br>';
h += cn['end']+'<br>';
h += cn['url'];
h += '</span>'
document.write(h);
}
if((n < e && n >= s)||tm==cn['oparamName']||parseInt(tm)==i){
this.scheduledTheme = cn['url'];
if(cn['track']!=null && cn['track']!='' && cn['track']!='undefined'){
var ts = cd.getTime();
var tfp = cn['track'].replace(/\[timestamp\]/, ts);
document.write('<div id="track" style="position:absolute; left:-10; width:1px; height:1px; overflow:hidden;"><img s'+'rc="'+tfp+'" width="1" height="1" border="0"/></div>');
}

break;
}
}
}
}
}
MTVN.DartThemeOverride = function(path){
if (path != 'no_dart_skin')
MTV.setTheme(path);
}
MTVN.writeDartScriptTag = function(testmodeArg){
var testmode1 = "";
var testmode2 = "";
var testmode3 = testmodeArg;
var pageLoc = window.location.pathname;
var doubleclickPath = "";
var category = "";
var tile = "";
if (pageLoc == "/movies/"){
doubleclickPath = 'http://ad.doubleclick.net/adj/mtv.mtvi/atf_j_s/movies/_mn;sec0=movies;sec1=_mn;!category=float;!category=pop;!category=video;!category=expand;!category=pointroll;';
tile = "6";
}
else if (pageLoc == "/music/"){
doubleclickPath = 'http://ad.doubleclick.net/adj/mtv.mtvi/atf_j_s/music/_mn;sec0=music;sec1=_mn;!category=float;!category=pop;!category=video;!category=expand;!category=pointroll;';
tile = "6";
}
else if (pageLoc == "/ontv/"){
doubleclickPath = 'http://ad.doubleclick.net/adj/mtv.mtvi/atf_j_s/shows/_mn;sec0=shows;sec1=_mn;!category=float;!category=pop;!category=video;!category=expand;!category=pointroll;';
tile = "6";
}
else if (pageLoc == "/news/"){
doubleclickPath = 'http://ad.doubleclick.net/adj/mtv.mtvi/atf_j_s/news/_mn;sec0=news;sec1=_mn;!category=float;!category=pop;!category=video;!category=expand;!category=pointroll;';
tile = "6";
}
else{
doubleclickPath = 'http://ad.doubleclick.net/adj/mtv.mtvi/atf_j_s/_hp;sec0=_hp;!category=_hp;!category=float;!category=pop;!category=video;!category=expand;!category=pointroll;';
category = '!category-_hp%7C';
tile = "4";
}
if (testmode3 != null){
testmode1 = "testmode=" + testmode3 + ";";
testmode2 = "%7Ctestmode-" + testmode3 + "%7C";
}
document.write('<script type="' + 'text/javascript');
document.write('"');
document.write(' src="');
document.write(doubleclickPath + testmode1 + 'pos=atf;tag=adj;mtype=standard;sz=3x3;tile=' + tile + ';demo=D;demo=T;demo=1189;demo=852;demo=845;demo=791;demo=776;dcopt=ist;ord=' + mtvn.btg.util.Math.random(100000000000000000,999999999999999999) + '?');
document.write('">');
document.write('</script>');
}

MTV.loadMemberbarHTML = function(){
MTVN.conf.flux4["ucid"] = "0ABEFFFF01F364840002FFFFBE0A";

// Remove duplicate #wUserBar div on Geek Comics' pages
if($j("#memberbar #wUserBar").size() > 1) {
$j("#memberbar #wUserBar.flux4Widget").remove();
}

$j("#wUserBar").attr("class", "geekFlux4Widget");
$j("#wUserBar").attr("data-widget", "userBar");
$j("#wUserProfile").attr("class", "geekFlux4Widget");
$j("#wUserProfile").attr("data-widget", "userProfile");

//Add selected class
$j('#navlist .toplvl').children('a').each(function(){
var link = this.href;
var loc = window.location.href;
if(link.charAt(link.length-1)=='/'){
link += 'index.jhtml';
}
if(loc.indexOf(link) != -1){
$j(this).parent().addClass('selected');
}
});

$j(".geekFlux4Widget").flux4();
}

MTV.loadFluxLibs = function(){

document.getElementsByTagName('script')[document.getElementsByTagName('script').length - 1].setAttribute('id', MTV.Flux.ucid);
$j.ajax({
url: "/sitewide/scripts/FluxLoader.jhtml",
dataType: "script",
async: false
});
$j.ajax({
url: "http://widgets3.flux.com/context/short/" + MTV.Flux.ucid,
dataType: "script",
async: false,
complete: function(){
if (!$j("#playerContainer").is("*")){
MTVN.Flux.Widgets.loadAll();
MTVN.Flux.widgetDelayLoad("load");
}
}
});

$j(function() {
$j(".flux4Widget").flux4();
}); 

}

function postedDateTime(postedDateTime) {
var utc = new Date(postedDateTime);
var offset = -utc.getTimezoneOffset()*60;
var unixtime = Math.round(utc.getTime()/1000.0)-offset;
var posted = new Date(unixtime*1000);

var postedHour = posted.getHours();

if (postedHour == 12) var postedTime = "12:" + posted.getMinutes() + "pm";
else if (postedHour > 12) var postedTime = (postedHour - 12) + ":" + posted.getMinutes() + "pm";
else if (postedHour == 0) var postedTime = "12:" + posted.getMinutes() + "am";
else var postedTime = postedHour + ":" + posted.getMinutes() + "am";

document.write("Posted " + (posted.getMonth()+1) + "/" + posted.getDate() + "/" + posted.getFullYear() + " " + postedTime + "EST");
}

//This function takes a UTC time without offset and returns the Posted date/time in EST
//usage: postedDateTime("2011-07-19T15:58:17Z") - returns: Posted 7/19/2011 3:58pm EST

/* FLUX4 Core */

var MTVN = MTVN || {};
MTVN.conf = MTVN.conf || {};
MTVN.conf.flux4 = MTVN.conf.flux4 || {};

MTVN.conf.flux4["ucid"] = "D3FCFFFF0002D51D0002FFFFFCD3";

MTVN.conf.flux4["widgets"] = {
"userBar": {
"name": "UserBar",
"opts": {
displayMode: 'EmbeddedTop',
elements: [
{
id: 'MyStuff',
showThumbnail: true,
fbPublishing:true
}
/*	,	
{
id: 'ActivityFeed',
settings: { 
updateRequestInterval: 30,
injectSeconds: 10,
maxResults: 8 
}
}*/

]
},
"onLoad": function(widget) {
setTimeout(function() {
$j("<div/>").attr("id", "activityFeedLink").attr("style", "height:30px;background:#efefef;text-align:right;").appendTo('#memberbar .flux4Widget .userBar .dropdownAnimation .moduleContent');
$j('#activityFeedLink').append('<a style="color:#39BFA8;line-height:30px;padding-right:10px;font-weight:bold;" href="/social/activity.jhtml">view all updates</a>');	
},1000);
}
},

"userProfile": {
"name": "UserProfile",
"opts": {
ownerHeader: { showChangePhotoButton: true },
guestHeader: { },
tabs: [
{ id: 'Activity', title: 'My Activity', visibility: 'all' },
{ id: 'Following', title: 'My MTV', visibility: 'all' },
{ id: 'Followers', title: 'Followers', visibility: 'owner' },
{ id: 'Account', title: 'Account', visibility: 'owner' }
]
}
},

"followBar": {
"name": "Follow",
"opts": {
title: '',
contentUri: MTVN.conf.flux4.ucid,
layout: 'horizontal',
elements: [{ id: 'facebook', layout:'button_count'}, { id: 'twitter', width:'130px'}, { id: 'flux', title: 'My MTV', showCounter: false}]
},
"onLoad": function(widget) {
$j("<div/>").attr("id", "wFollow").attr("class", "mL10p").prependTo('.group-a');
$j('#wFollowContent .serviceList').append('<div class="followService copy">add show updates to your feed</div>');
$j('#wFollowContent').appendTo('#wFollow');

}
},

"followVideoContent": {
"name": "Follow",
"opts": {
title: '',
followParent: true,
contentUri: MTVN.conf.flux4.ucid,
layout: 'horizontal',
elements: [{ id: 'facebook', layout:'button_count'}, { id: 'twitter', width:'130px'}, { id: 'flux', title: 'My MTV', showCounter: false}]
},
"onLoad": function(widget) {
if($j('#seriesLinks div').length > 0) {
$j('#wFollow .serviceList').append('<div class="followService copy">add updates from this show to your feed</div>')

if(!($j('#seriesLinks .simple-list li').size() > 1)) {
$j('#wFollow').appendTo('#seriesLinks .simple-list li');
} else {$j('#wFollow').remove();}

} else {
$j('#wFollow').remove();
}
}
},

"followContent": {
"name": "Follow",
"opts": {
elements: [{ id: 'facebook', layout:'button_count'} , { id: 'twitter', width: '130px' }, { id: 'flux', title: 'My MTV'}]
}
},

"followShowOverlay": {
"name": "Follow",
"opts": {
title:"", layout: 'horizontal', elements: [{ id: 'flux', title: 'My MTV' }] 
}
},

"activity": {
"name": "ActivityFeed",
"opts": {
title: "",
updateRequestInterval: 30,
injectItems: 2,
injectSeconds: 10,
maxResults: 15,
showPager: true,
paginationType: 'pages',
filterVisible: false,
sortingVisible:false,
defaultFilter: 'Comments',
enableComments: true,
topOrder: true,
showPostToFacebook: false, 
commentMessage: 'Join the conversation ...'
}
},

"activityFeed": {
"name": "ActivityFeed",
"opts": {
title: "",
updateRequestInterval: 30,
injectItems: 2,
injectSeconds: 10,
maxResults: 15,
showPager: true,
paginationType: 'pages',
topOrder: true,
showParentAddedChild: true, 
contentTitleLength: 140,
showPostToFacebook: false,
commentMessage: 'Join the conversation ...'
}
},

"eventShare": {
"name": "Share",
"opts": {
title: " ",
layout: 'horizontal',
elements: [
{ id: 'Facebook', layout:'button_count', type: 'fblike', colorScheme: 'light', send: true },
{ id: 'Twitter', originalButton: true, urlSettings: { related: 'mtvnews',via: "MTV" } },
]
}
},

"photoShare": {
"name": "Share",
"opts": {
title: " ",
layout: 'horizontal',
elements: [
{ id: 'Facebook', layout:'button_count', type: 'fblike', colorScheme: 'light', send: false },
{ id: 'Twitter', originalButton: true, urlSettings: { related: 'mtvnews',via: "MTV" } },
{ id: 'GooglePlusOne', count:false},	
{ id: 'MyEmail' },
{ id: 'More', title: 'More&raquo;' }
]
}
},

"videoShare": {
"name": "Share",
"opts": {
title: " ",
layout: 'horizontal',
elements: [
{ id: 'Facebook', type: 'fblike', colorScheme: 'light', send: false },
{ id: 'Twitter', originalButton: true, urlSettings: { related: 'mtvnews', via: "MTV" } },
{ id: 'GooglePlusOne', count:false},	
{ id: 'Embed' },
{ id: 'More', title: 'More&raquo;' }
]
}
},

"articleShare": {
"name": "Share",
"opts": {
title: " ",
layout: 'horizontal',
elements: [
{ id: 'Facebook', layout:'button_count', type: 'fblike', action: 'recommend', colorScheme: 'light', send: false },
{ id: 'Twitter', originalButton: true, urlSettings: { related: 'mtvnews', via: "MTV" } },
{ id: 'GooglePlusOne', count:false},	
{ id: 'MyEmail' },
{ id: 'More', title: 'More&raquo;' }
]
}
},

"articleFooterShare": {
"name": "Share",
"opts": {
title: " ",
layout: 'horizontal',
containerId: 'articleShareFooter',
elements: [
{ id: 'Facebook', layout:'button_count', type: 'fblike', action: 'recommend', colorScheme: 'light', send: false },
{ id: 'Twitter', originalButton: true, urlSettings: { related: 'mtvnews', via: "MTV" } },
{ id: 'GooglePlusOne', count:false},	
{ id: 'MyEmail' },
{ id: 'More', title: 'More&raquo;' }
]
}
},

"facebookTimeline": {
"name": "FacebookTimeline",
"opts": {
containerId: 'facebookTimeline-widget'
},
"onLoad": function(widget) {
widget.postReadToTimeline('news.reads','article', 'onTime', 5);
}
},

"facebookFlipbookTimeline": {
"name": "FacebookTimeline",
"opts": {
containerId: 'facebookTimeline-widget'
},
"onLoad": function(widget) {
widget.postReadToTimeline('flipbook.views','flipbook', 'onTime', 5);
}
},

"badges": {
"name": "ActivityFeed",
"opts": {
title: 'Recent Badges',
mode: 'mini',
updateRequestInterval: 30,
injectItems: 1,
injectSeconds: 20,
maxResults: 3,
showPager: false,
filterVisible: false,
defaultFilter: 'Badges', 
enableComments: false
}
}
};

;(function($, w) {

var configured, conf, stub, loading, extant = {}, _guid = 0; waiting = $();
var version = "0.1";

var createConf = function() {

if (w.MTVN && w.MTVN.conf && w.MTVN.conf.flux4) {
$.extend(conf, w.MTVN.conf.flux4);
configured = true;
}

}

var loadScript = function(url, callback) {

var script = document.createElement("script"),
body = document.body;
script.type = "text/javascript";

if ( script.readyState ) { //IE <= 8
script.onreadystatechange = function() {
if ( script.readyState == "loaded" || script.readyState == "complete" ) {
script.onreadystatechange = null;

w.setTimeout(function() {
callback();
}, 500);	
}
};
}
else { //Others
script.onload = function() {
callback();
};
}

body.insertBefore(script, body.firstChild);
script.src = url;

}

var loadCore = function() {

var core = (MTVN.conf.flux4.staging) ? 
"http://widgets4.flux-staging.com/Core?includeJquery=false&enableWidgetsDebug=true":
"http://widgets4.flux.com/Core?includeJquery=false";

loading = true;

// flux needs an id on a script tag to figure out the UCID, so we add an empty one to the document
stub = document.createElement("script");
stub.setAttribute('id', conf.ucid);
stub.setAttribute('widgets4Debug', "true");
document.body.appendChild(stub)

loadScript(core, function () {
loading = false;
if (w.Flux4) {

waiting.trigger("Flux4.coreLoad", [true]);
} else {
waiting.trigger("Flux4.coreLoad", [false]);
}
});

}

var loadElement = function(element) {

var el = $(element);

if (!el.data("_guid")) {
el.data("_guid", _guid++)
}

var wGuid = el.data("_guid");
var wName = el.data("widget")
var wContentUri = el.data("contenturi");

if (conf.widgets[wName]) {

var opts = $.extend({"container": element}, conf.widgets[wName].opts)

if (wContentUri) {
opts.contentUri = wContentUri;
opts.contentId = wContentUri;
}

if (extant[wGuid] != wName + "|" + wContentUri) {
extant[wGuid] = wName + "|" + wContentUri;

el.empty();

if (window.console) {
console.log("jQuery plugin loading widget: ")
console.log(conf.widgets[wName]["name"])
console.log(opts)
}

w.Flux4.createWidget(conf.widgets[wName]["name"], opts, function(widget) {

if (conf.widgets[wName]["onLoad"]) {
conf.widgets[wName]["onLoad"](widget);	
}
el.trigger("Flux4.widget.load", [widget, true, conf.widgets[wName]["name"], opts]);

});
} else {	
el.trigger("Flux4.widget.load", [undefined, false, conf.widgets[wName]["name"], opts]);
}
} 
}

var init = function() {

configured = false;
loading = false;
extant = {};
waiting = $();

conf = {}	

if (stub) {
stub.parentNode.removeChild(stub);
stub = undefined;
}
}

init();

$.fn.flux4 = function(cmd) {
var filtered;	

if (cmd == "init") {

init();
return this;

} else if (cmd == "debug") {

return {
configured: configured,
extant: extant,
waiting: waiting
}

} else {

if (configured !== true) {
createConf();
}

if (!conf.ucid) {
return this
}

filtered = this.filter(function() {
if (conf.widgets[$(this).data("widget")]) {
return true;
} else {
return false;
}
});

waiting = waiting.add(filtered);

if (filtered.length) {

if (!window.Flux4) {

if (!loading) {
loadCore(filtered);
}

filtered.bind("Flux4.coreLoad", function(){

loadElement(this);
});

} else {

filtered.each(function() {
loadElement(this);
});

}
} 
}

return filtered;

};

})(jQuery, window);

function loadimgcarousel(obj){
var carouselDiv= $j(obj).parents('.h-wrap').parent();
$j(carouselDiv).find('img').filter(':[longdesc]').each(function(i){
var tmpLongDesc = $j(this).attr("longdesc");
$j(this).attr("src",tmpLongDesc)[0].removeAttribute("longdesc",0);
});
}
function loadnewsimgcarousel(obj){
var newActiveTabId = obj.parentNode.id;
var newActivePageId = newActiveTabId.substring(0, newActiveTabId.indexOf("Tab"));
$j("#"+newActivePageId+" img").filter(':[longdesc]').each(function(i){
var tmpLongDesc = $j(this).attr("longdesc");
$j(this).attr("src",tmpLongDesc)[0].removeAttribute("longdesc",0);
});
}	
var feo_switch=true;
FEO = new function(){
this.channelId='1';
}
var deferMarqueeImageLoad = true;
$j(window).load(function(){
if(typeof(deferMarqueeImageLoad) != 'undefined' && deferMarqueeImageLoad){
$j(".marquee_img_vertical img").filter(':[longdesc]').each(function(i){
var tmpLongDesc = $j(this).attr("longdesc");
$j(this).attr("src",tmpLongDesc)[0].removeAttribute("longdesc",0);
});
$j(".marquee_img_horizontal img").filter(':[longdesc]').each(function(i){
var tmpLongDesc = $j(this).attr("longdesc");
$j(this).attr("src",tmpLongDesc)[0].removeAttribute("longdesc",0);
});
}
});


