var SOUTHPARK=window.SOUTHPARK||{},SP=SOUTHPARK;(function($){$.sp=$.sp||{version:'1.0'};$.sp.tooltip={conf:{effect:'toggle',fadeOutSpeed:"fast",predelay:1000,delay:500,opacity:1,tip:0,position:['left','top'],offset:[0,0],relative:false,cancelDefault:true,events:{def:"mouseenter, mouseleave",input:"focus, blur",widget:"focus mouseenter, blur mouseleave",tooltip:"mouseenter, mouseleave"},layout:'<div />',tipClass:'tooltip'},addEffect:function(name,loadFn,hideFn){effects[name]=[loadFn,hideFn];}};var effects={toggle:[function(done){var conf=this.getConf(),tip=this.getTip(),o=conf.opacity;if(o<1){tip.css({opacity:o});}
tip.show();done.call();},function(done){this.getTip().hide();done.call();}],fade:[function(done){var conf=this.getConf();this.getTip().fadeTo(conf.fadeInSpeed,conf.opacity,done);},function(done){var conf=this.getConf();this.getTip().fadeOut(this.getConf().fadeOutSpeed,done);}]};function getPosition(trigger,tip,conf){var top=conf.relative?trigger.position().top:trigger.offset().top,left=conf.relative?trigger.position().left:trigger.offset().left,pos=conf.position[0];top+=conf.offset[0];left+=trigger.outerWidth()+conf.offset[1];if(/iPad/i.test(navigator.userAgent)){top-=$(window).scrollTop();}
var height=tip.outerHeight()-trigger.outerHeight();if(pos=='center'){top-=height/2;}
if(pos=='bottom'){top-=height;}
pos=conf.position[1];var width=tip.outerWidth()+trigger.outerWidth();if(pos=='center'){left-=width/2;}
if(pos=='left'){left-=width;}
return{top:top,left:left};}
function Tooltip(trigger,conf){var self=this,fire=trigger.add(self),tip,timer=0,pretimer=0,title=trigger.attr("title"),tipAttr=trigger.attr("data-tooltip"),effect=effects[conf.effect],shown,isInput=trigger.is(":input"),isWidget=isInput&&trigger.is(":checkbod, :radio, select, :button, :submit"),type=trigger.attr("type"),evt=conf.events[type]||conf.events[isInput?(isWidget?'widget':'input'):'def'];if(!effect){throw"Nonexistent effect\""+conf.effect+"\"";}
evt=evt.split(/,\s*/);if(evt.length!=2){throw"Tooltip: bad events configuration for "+type;}
trigger.bind(evt[0],function(e){clearTimeout(timer);clearTimeout(pretimer);if(conf.predelay){pretimer=setTimeout(function(){self.show(e);},conf.predelay);}else{self.show(e);}}).bind(evt[1],function(e){clearTimeout(pretimer);clearTimeout(timer);if(conf.delay){timer=setTimeout(function(){self.hide(e);},conf.delay);}else{self.hide(e);}});if(title&&conf.cancelDefault){trigger.removeAttr("title");trigger.data("title",title);}
$.extend(self,{show:function(e){if(!tip){if(tipAttr){tip=$(tipAttr);}else if(conf.tip){tip=$(conf.tip).eq(0);}else{tip=$("."+conf.tipClass);if(!tip.length)
tip=$(conf.layout).addClass(conf.tipClass).appendTo(document.body).hide();if(title)tip.append(title);}
if(!tip.length){throw"Cannot find tooltip for "+trigger;}}
if(self.isShown()){return self;}
tip.stop(true,true);var pos=getPosition(trigger,tip,conf);if(conf.tip){tip.html(trigger.data("title"));}
e=e||$.Event();e.type="onBeforeShow";fire.trigger(e,[pos]);if(e.isDefaultPrevented()){return self;}
pos=getPosition(trigger,tip,conf);tip.css({position:'absolute',top:pos.top,left:pos.left});shown=true;effect[0].call(self,function(){e.type="onShow";shown='full';fire.trigger(e);});var event=conf.events.tooltip.split(/,\s*/);tip.bind(event[0],function(){clearTimeout(timer);clearTimeout(pretimer);});if(event[1]&&!trigger.is("input:not(:checkbox, :radio), textarea")){tip.bind(event[1],function(e){if(e.relatedTarget!=trigger[0]){trigger.trigger(evt[1].split(" ")[0]);}
tip.unbind(event[0]);tip.unbind(event[1]);});}
return self;},hide:function(e){if(!tip||!self.isShown()){return self;}
e=e||$.Event();e.type="onBeforeHide";fire.trigger(e);if(e.isDefaultPrevented()){return;}
shown=false;effects[conf.effect][1].call(self,function(){e.type="onHide";fire.trigger(e);});return self;},isShown:function(fully){return fully?shown=='full':shown;},getConf:function(){return conf;},getTip:function(){return tip;},getTrigger:function(){return trigger;},disable:function(){clearTimeout(timer);clearTimeout(pretimer);self.hide();trigger.unbind(evt[0]).unbind(evt[1]);},enable:function(){trigger.bind(evt[0],function(e){clearTimeout(timer);clearTimeout(pretimer);if(conf.predelay){pretimer=setTimeout(function(){self.show(e);},conf.predelay);}else{self.show(e);}}).bind(evt[1],function(e){clearTimeout(pretimer);clearTimeout(timer);if(conf.delay){timer=setTimeout(function(){self.hide(e);},conf.delay);}else{self.hide(e);}});}});$.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(i,name){if($.isFunction(conf[name])){$(self).bind(name,conf[name]);}
self[name]=function(fn){if(fn){$(self).bind(name,fn);}
return self;};});}
$.fn.tooltip=function(conf){var api=this.data("tooltip");if(api){return api;}
conf=$.extend(true,{},$.sp.tooltip.conf,conf);if(typeof conf.position=='string'){conf.position=conf.position.split(/,?\s/);}
this.each(function(){api=new Tooltip($(this),conf);$(this).data("tooltip",api);});return conf.api?api:this;};})(jQuery);(function($){var t=$.sp.tooltip;t.dynamic={conf:{classNames:"top right bottom left"}};function getCropping(el){var w=$(window);var right=w.width()+w.scrollLeft();var bottom=w.height()+w.scrollTop();return[el.offset().top<=w.scrollTop(),right<=el.offset().left+el.width(),bottom<=el.offset().top+el.height(),w.scrollLeft()>=el.offset().left];}
function isVisible(crop){var i=crop.length;while(i--){if(crop[i]){return false;}}
return true;}
$.fn.dynamic=function(conf){if(typeof conf=='number'){conf={speed:conf};}
conf=$.extend({},t.dynamic.conf,conf);var cls=conf.classNames.split(/\s/),orig;this.each(function(){var api=$(this).tooltip().onBeforeShow(function(e,pos){var tip=this.getTip(),tipConf=this.getConf();if(!orig){orig=[tipConf.position[0],tipConf.position[1],tipConf.offset[0],tipConf.offset[1],$.extend({},tipConf)];}
$.extend(tipConf,orig[4]);tipConf.position=[orig[0],orig[1]];tipConf.offset=[orig[2],orig[3]];tip.css({visibility:'hidden',position:'absolute',top:pos.top,left:pos.left}).show();var crop=getCropping(tip);if(!isVisible(crop)){if(crop[0]){$.extend(tipConf,conf.top);tipConf.position[0]='top';tip.addClass(cls[0]);}
if(crop[3]){$.extend(tipConf,conf.right);tipConf.position[1]='right';tip.addClass(cls[1]);}
if(crop[2]){$.extend(tipConf,conf.bottom);tipConf.position[0]='bottom';tip.addClass(cls[2]);}
if(crop[1]){$.extend(tipConf,conf.left);tipConf.position[1]='left';tip.addClass(cls[3]);}
if(crop[0]||crop[2]){tipConf.offset[0]*=-1;}
if(crop[1]||crop[3]){tipConf.offset[1]*=-1;}}
tip.css({visibility:'visible'}).hide();});api.onBeforeShow(function(){var c=this.getConf(),tip=this.getTip();setTimeout(function(){c.position=[orig[0],orig[1]];c.offset=[orig[2],orig[3]];},0);});api.onHide(function(){var tip=this.getTip();tip.removeClass(conf.classNames);});ret=api;});return conf.api?ret:this;};})(jQuery);(function($){var dropped=false;var theList;var settings={dropClass:'sp-droppableList-box',listClass:'sp-droppableList',contentClass:'sp-droppableList-content',itemClass:'sp-droppableList-item',overClass:'sp-droppableList-over',activeClass:'sp-droppableList-active',dragClass:'sp-droppableList-drag',dropSelector:'li',contentSelector:'.itemWrapper',dropHelperClass:'sp-droppableList-helper',contentDragOptions:{appendTo:'body',helper:'clone',cursorAt:{left:10,top:10},cursor:'move',stack:'sp-droppableList-box',snap:false},contentDropOptions:{accept:'.item'}};var methods={init:function(options){settings=$.extend(settings,options||{});return this.each(function(){var $this=$(this),data=$this.data('droppableList');if(!data){$(this).data('droppableList',{target:$this});}
theList=$this;$this.addClass(settings.listClass);$this.boxes=$this.find(settings.dropSelector);$this.boxes.addClass(settings.dropClass);$this.find(settings.contentSelector).addClass(settings.contentClass);$this.boxes.each(function(){createDroppable.call(this,settings.contentDropOptions);});});},destroy:function(){return this.each(function(){var $this=$(this),data=$this.data('droppableList');$(window).unbind('.droppableList');data.droppableList.remove();$this.removeData('droppableList');});},saveList:function(){return this.each(function(){var $this=$(this),data=$this.data('droppableList');var event=$.Event();event.type='onBeforeSave';$this.trigger(event);var boxes=$this.find('.'+settings.dropClass);boxes.each(function(){var $this2=$(this),data2=$this2.data('droppableList');saveContent.call($this2);});event=event||$.Event();event.type='onSave';$this.trigger(event);});},backupList:function(){return this.each(function(){var $this=$(this),data=$this.data('droppableList');var boxes=$this.find('.'+settings.dropClass);boxes.each(function(){var $this2=$(this),data2=$this2.data('droppableList');backupContent.call($this2);});});},revertList:function(force){return this.each(function(){var $this=$(this),data=$this.data('droppableList');var boxes=$this.find('.'+settings.dropClass);boxes.each(function(){var $this2=$(this),data2=$this2.data('droppableList');revertContent.call($this2,force);});});},removeDuplicates:function(original){return this.each(function(){var $this=$(this),data=$this.data('droppableList');var boxes=$this.find('.'+settings.dropClass);boxes.each(function(){var $this2=$(this),data2=$this2.data('droppableList');var content=getContent.call($this2);if($(content).attr('data-itemid')==$(original).attr('data-itemid')&&!$(content).hasClass('deleteMe'))
emptyContent.call($this2);});});},addContentAt:function(content,position){return this.each(function(){var $this=$(this),data=$this.data('droppableList');var boxes=$this.find('.'+settings.dropClass);var $this2=$(boxes[position-1]),data2=$this2.data('droppableList');setContent.call($this2,$(content));});},deleteContentAt:function(position){return this.each(function(){var $this=$(this),data=$this.data('droppableList');var boxes=$this.find('.'+settings.dropClass);var $this2=$(boxes[position-1]),data2=$this2.data('droppableList');emptyContent.call($this2);methods['saveList'].call($this);});},onDrop:function(dropFunction){return this.each(function(){var $this=$(this),data=$this.data('droppableList');$this.boxes.each(function(){var $this2=$(this),data2=$this2.data('droppableList');$this2.bind('drop',dropFunction);});});},onOver:function(overFunction){return this.each(function(){var $this=$(this),data=$this.data('droppableList');$this.boxes.each(function(){var $this2=$(this),data2=$this2.data('droppableList');$this2.bind('dropover',overFunction);});});},onOut:function(outFunction){return this.each(function(){var $this=$(this),data=$this.data('droppableList');$this.boxes.each(function(){var $this2=$(this),data2=$this2.data('droppableList');$this2.bind('dropout',outFunction);});});},onCreate:function(createFunction){return this.each(function(){var $this=$(this),data=$this.data('droppableList');$this.boxes.each(function(){var $this2=$(this),data2=$this2.data('droppableList');$this2.bind('dropcreate',createFunction);});})}};var onDragStart=function(event,ui){var parent=$(this).parents('.'+settings.dropClass),list=$(this).parents('.'+settings.listClass),data=parent.data('droppableList'),$this=$(this);methods['backupList'].call(theList,true);dropped=false;parent.addClass(settings.dragClass);$(this).addClass('deleteMe');$(this).fadeOut('fast');};var onDrag=function(event,ui){};var onDragStop=function(event,ui){var parent=$(this).parents('.'+settings.dropClass),list=$(this).parents('.'+settings.listClass),data=parent.data('droppableList'),$this=$(this);$('.deleteMe').remove();parent.removeClass(settings.dragClass);if(!dropped){methods['revertList'].call(theList,true);}};var onOver=function(event,ui){var $this=$(this),data=$this.data('droppableList');$this.addClass(settings.overClass);var newContent=$(ui.draggable).clone();newContent.removeClass('deleteMe');newContent.show();methods['removeDuplicates'].call($this.parent(),$(ui.draggable));newContent.css({opacity:0.5});newContent.addClass(settings.dropHelperClass);addContent.call($this,newContent);};var onDrop=function(event,ui){var $this=$(this),data=$this.data('droppableList');theList.find('.'+settings.dropClass).removeClass(settings.dragClass);var newContent=$(ui.draggable).clone();newContent.removeClass('deleteMe');newContent.show();newContent.attr('style','');setContent.call($this,newContent);var draggableData=$(ui.draggable).data('droppableContent');dropped=true;$(ui.draggable).parents('.'+settings.dropClass).removeClass(settings.dragClass);event=event||$.Event();event.type='onDropListDrop';event.content=getContent.call($this);$this.trigger(event);methods['saveList'].call($this.parent());$this.removeClass(settings.overClass);};var onOut=function(event,ui){var $this=$(this),data=$this.data('droppableList');$this.find('.'+settings.dropHelperClass).remove();methods['revertList'].call($this.parent());$this.removeClass(settings.overClass);var contentWrap=$this.find('.'+settings.contentClass);};var createDroppable=function(options){var dropSettings=$.extend(settings.contentDropOptions,options||{});$(this).each(function(){var $this=$(this);var data={target:$this,savedContent:$this.find('.'+settings.contentClass).children(),nextBox:$this.next('.'+settings.dropClass),prevBox:$this.prev('.'+settings.dropClass)};$(this).data('droppableList',data);data=$(this).data('droppableList');$this.droppable(dropSettings);$this.bind('drop',onDrop);$this.bind('dropover',onOver);$this.bind('dropout',onOut);if(data.savedContent)
createDraggable.call(data.savedContent,settings.contentDragOptions);});};var createDraggable=function(options){var dragSettings=$.extend(settings.contentDragOptions,options||{});$(this).unbind('dragstop');$(this).unbind('dragstart');$(this).draggable('destroy');$(this).draggable(dragSettings);$(this).bind('dragstop',onDragStop);$(this).bind('dragstart',onDragStart);};var getContent=function(){var $this=$(this),data=$this.data('droppableList');if($this.hasClass(settings.dragClass))
return'';var content=$this.find('.'+settings.contentClass).find('.'+settings.itemClass).first();if($(content).hasClass('deleteMe'))
return'';content=$('<div>').append(content.clone()).remove().html();return content;};var setContent=function(newContent){var $this=$(this),data=$this.data('droppableList');var contentWrap=$this.find('.'+settings.contentClass);var content=$this.find('.'+settings.contentClass).children();content.each(function(){if(!$(this).hasClass('deleteMe'))
$(this).remove();});if(newContent){contentWrap.prepend(newContent);$(newContent).show();$(newContent).addClass(settings.itemClass);createDraggable.call(newContent);}
if(isEmpty.call($this))
$this.removeClass(settings.activeClass);else
$this.addClass(settings.activeClass);};var saveContent=function(){var $this=$(this),data=$this.data('droppableList');backupContent.call($this);var content=getContent.call($this);$(content).removeClass(settings.dropHelperClass);createDraggable.call($(content),settings.contentDragOptions);if(content!=null&&content!=""){var event=event||$.Event();event.type='onDropListBoxSave';event.content=content;$this.trigger(event);}};var moveNext=function(){var $this=$(this),data=$this.data('droppableList');var next=data.nextBox;if(next==undefined||next==null||next.length<1)
return false;if(isEmpty.call(next)){setContent.call(next,$(getContent.call($this)));return true}else if(moveNext.call(next)){setContent.call(next,$(getContent.call($this)));return true;}
return false;};var movePrev=function(){var $this=$(this),data=$this.data('droppableList');var prev=data.prevBox;if(prev==undefined||prev==null||prev.length<1)
return false;if(isEmpty.call(prev)){setContent.call(prev,$(getContent.call($this)));return true}else if(movePrev.call(prev)){setContent.call(prev,$(getContent.call($this)));return true;}
return false;};var isEmpty=function(){var $this=$(this),data=$this.data('droppableList');var content=getContent.call($this);var empty=(content==''||content==null||content==undefined);return empty;};var backupContent=function(){var $this=$(this),data=$this.data('droppableList');data.savedContent=getContent.call($this);$this.data('droppableList',data);};var revertContent=function(force){var $this=$(this),data=$(this).data('droppableList');if(!$this.hasClass(settings.dragClass)||force){$(data.savedContent).show();setContent.call($this,$(data.savedContent));}else if($this.hasClass(settings.dragClass)){setContent.call($this,null);}};var addContent=function(newContent){var $this=$(this),data=$this.data('droppableList');if(!isEmpty.call($this)){if(!moveNext.call($this))
movePrev.call($this);}
setContent.call($this,$(newContent));};var emptyContent=function(){var $this=$(this),data=$this.data('droppableList');setContent.call($this,null);}
$.fn.droppableList=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}else{$.error('Method '+method+' does not exist on jQuery.droppableList');}}})(jQuery);(function($){$.tools=$.tools||{version:'@VERSION'};var tool;tool=$.tools.expose={conf:{container:'body',maskId:'exposeMask',loadSpeed:'slow',closeSpeed:'fast',closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:0.8,startOpacity:0,color:'#fff',onLoad:null,onClose:null}};function viewport(){if($.browser.msie){var d=$(document).height(),w=$(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,d-w<20?w:d];}
return[$(document).width(),$(document).height()];}
function call(fn){if(fn){return fn.call($.mask);}}
var mask,exposed,loaded,config,overlayIndex;$.mask={load:function(conf,els){if(loaded){return this;}
if(typeof conf=='string'){conf={color:conf};}
conf=conf||config;config=conf=$.extend($.extend({},tool.conf),conf);mask=$("#"+conf.maskId);if(!mask.length){mask=$('<div/>').attr("id",conf.maskId);}
mask.appendTo(config.container);var size=config.container=='body'?viewport():['100%','100%'];mask.css({position:'absolute',top:0,left:0,width:size[0],height:size[1],display:'none',opacity:conf.startOpacity,zIndex:conf.zIndex});if(conf.color){mask.css("backgroundColor",conf.color);}
if(call(conf.onBeforeLoad)===false){return this;}
if(conf.closeOnEsc){$(document).bind("keydown.mask",function(e){if(e.keyCode==27){$.mask.close(e);}});}
if(conf.closeOnClick){mask.bind("click.mask",function(e){$.mask.close(e);});}
var resizer=conf.container=='body'?$(window):$(conf.container);resizer.bind("resize.mask",function(){$.mask.fit();});if(els&&els.length){overlayIndex=els.eq(0).css("zIndex");$.each(els,function(){var el=$(this);if(!/relative|absolute|fixed/i.test(el.css("position"))){el.css("position","relative");}});exposed=els.css({zIndex:Math.max(conf.zIndex+1,overlayIndex=='auto'?0:overlayIndex)});}
mask.css({display:'block'}).fadeTo(conf.loadSpeed,conf.opacity,function(){$.mask.fit();call(conf.onLoad);loaded="full";});loaded=true;return this;},close:function(){if(loaded){if(call(config.onBeforeClose)===false){return this;}
mask.fadeOut(config.closeSpeed,function(){call(config.onClose);if(exposed){exposed.css({zIndex:overlayIndex});}
loaded=false;});$(document).unbind("keydown.mask");mask.unbind("click.mask");var resizer=config.container=='body'?$(window):$(config.container);resizer.unbind("resize.mask");}
return this;},fit:function(){if(loaded){var size=config.container=='body'?viewport():['100%','100%'];mask.css({width:size[0],height:size[1]});}},getMask:function(){return mask;},isLoaded:function(fully){return fully?loaded=='full':loaded;},getConf:function(){return config;},getExposed:function(){return exposed;}};$.fn.mask=function(conf){$.mask.load(conf);return this;};$.fn.expose=function(conf){$.mask.load(conf,this);return this;};})(jQuery);(function($){var settings={container:'body',overlayClass:'sps-overlay',closeButton:'.close',closeOnClick:true,closeOnEsc:true,effect:'default',position:'fixed',left:'center',top:'10%',oneInstance:true,speed:'fast',closeSpeed:'fast',mask:true,maskHtml:'<div class="sp-overlay-mask" />',maskOpacity:0.8,zIndex:9999,showFn:function(){var w=$(window);w.scrollTop($(this).scrollTop()-20);var $this=$(this);$this.css({'z-index':settings.zIndex});$this.fadeIn(settings.speed,function(e){e=e||$.Event();e.type='onShow';$this.trigger(e);if(e.isDefaultPrevented()){return;}});},hideFn:function(){var $this=$(this);$this.fadeOut(settings.closeSpeed,function(e){e=e||$.Event();e.type='onHide';$this.trigger(e);if(e.isDefaultPrevented()){return;}});}};var instances=[];var methods={init:function(options){return this.each(function(){settings=$.extend(settings,options);var $this=$(this),data=$this.data('overlay'),container=$(settings.container);if(!data){$(this).data('overlay',{target:$this,container:container,uid:uid=Math.random().toString().slice(10),settings:settings});data=$(this).data('overlay');}
$this.addClass(settings.overlayClass);if(settings.mask){var mask=container.find('.sp-overlay-mask').length?container.find('.sp-overlay-mask').first():$(settings.maskHtml);mask.appendTo(container);data.mask=mask;mask.hide();}
$this.appendTo(container);$.each("onBeforeShow, onBeforeClose, onHide, onShow".split(","),function(i,name){if($.isFunction(settings[name])){$(this).bind(name,settings[name]);}
this[name]=function(fn){if(fn){$(this).bind(name,fn);}
return this;};});$this.hide();});},show:function(e){return this.each(function(){var $this=$(this),data=$this.data('overlay'),container=$(data.container),settings=data.settings;if($this.is(':visible')){return $this;}
e=e||$.Event();e.type='onBeforeLoad';$(this).trigger(e);if(e.isDefaultPrevented()){return;}
var top=settings.top,left=settings.left,oWidth=$this.outerWidth({margin:true}),oHeight=$this.outerHeight({margin:true});if(typeof top=='string'){top=top=='center'?Math.max((container.height()-oHeight)/2,0):parseInt(top,10)/100*container.height();}
if(left=='center'){left=Math.max((container.width()-oWidth)/2,0);}
var pos={top:top,left:left,position:settings.position};$this.css(pos);if(data.mask){var mask=data.mask;mask.fadeTo(settings.speed,settings.maskOpacity);mask.css({'z-index':settings.zIndex-1});}
if(settings.closeOnClick){$this.bind('onShow',function(){$(document).bind("click."+data.uid,function(e){if(!$(e.target).parents('.'+settings.overlayClass).length){methods['hide'].call($this);}});});}
if(settings.closeOnEsc){$this.bind('onShow',function(){$(document).bind("keydown."+data.uid,function(e){if(e.keyCode==27){methods['hide'].call($this);}});});}
settings.showFn.call(this);});},hide:function(e){return this.each(function(){var $this=$(this),data=$this.data('overlay'),container=$(data.container),settings=data.settings;if(data.mask){var mask=data.mask;mask.fadeOut(settings.closeSpeed,function(){mask.hide();});}
if(!$(this).is(':visible'))
return $(this);e=e||$.Event();e.type='onBeforeClose';$(this).trigger(e);if(e.isDefaultPrevented()){return;}
$(document).unbind("click."+data.uid).unbind("keyboard."+data.uid);settings.hideFn.call(this);});}};$.fn.overlay=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}else{$.error('Method '+method+' does not exist on jQuery.droppableList');}}})(jQuery);var mtvnSetCoad=function(adObject){var url=adObject.url;var width=adObject.width;var height=adObject.height;var clickTag=adObject.clickUrl;var parent=document.getById("flashcontent");var iframe=document.getById("mtvnCoAd");if(parent&&!iframe){if((width==120)&&(height==60)){parent.setInnerHTML('<iframe id="'+((width==120)?"mtvBugAd":"mtvnCoAd")+'" src="'+url+'" frameborder="0" scrolling="no"></iframe>',"append");}}};var MTVi=window.MTVi||{};MTVi.Ads=function(){var that;return{init:function(){that=MTVi.Ads;var ads=$(".ad");ads.filter(function(index){return(/sz_/).test(ads[index].className);});var document_write=document.write;var document_writeln=document.writeln;var promocount=0;var firstad=true;ads.each(function(index,ad){var size=(/sz_([0-9]+)x([0-9]+)/).exec(ad.className);if(size==null)
return;var expandable=false;document.writeln=document.write=function(str){ad.innerHTML+=str;};var flags=[];if(firstad&&size[2]=="90")
flags.push("slot=leaderboard_top");if(ad.className.indexOf("_promo")>0)
flags.push("promo="+(++promocount));if(document.location.toString().indexOf("testmode")>=0)
flags.push("testmode="+that.gup('testmode'));com.mtvi.ads.AdManager.placeAd({size:size[1]+'x'+size[2],keyValues:flags.join(";"),contentType:(expandable?'adj':'adi')});firstad=false;});},gup:function(name)
{name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)return"";else if(results[1]==undefined)return"";else return results[1];}};}();$(document).ready(MTVi.Ads.init);SP.enhanceNav=function(){var that;var nodes;return{init:function()
{that=SP.enhanceNav;var nav=$("#navigation");if(nav.length!=1)
return;that.speed=.1;that.nodes=nav.find('.topLevel');that.nodes.bind('mouseover',that.mouseover);that.nodes.bind('mouseout',that.mouseout);},mouseover:function(event)
{var parent=this.parentNode,node=this;var nodes=that.nodes.filter(function(index){return this!=node;});$(nodes).find('a').stop();$(nodes).each(function(){if(this!=node)
$(this).find('a').fadeTo(that.speed*1000,0.4);});},mouseout:function(event)
{var parent=this.parentNode,node=this;var nodes=that.nodes;$(that.nodes).find('a').stop();$(that.nodes).find('a').fadeTo(that.speed*1000,1);}};}();$(document).ready(SP.enhanceNav.init);SP.searchBar=function(){var that;return{init:function()
{that=SP.searchBar;var searchBar=$("#searchtext");searchBar.bind("focus",that.searchInputFocus);searchBar.bind("blur",that.searchInputBlur);},searchInputFocus:function(event)
{var searchInput=event.target;if(searchInput.value==searchInput.defaultValue)
{searchInput.value="";}},searchInputBlur:function(event)
{var searchInput=event.target;if(searchInput.value==searchInput.defaultValue||searchInput.value=="")
{searchInput.value=searchInput.defaultValue;}}};}();$(document).ready(SP.searchBar.init);SPAccount=function()
{var that;var timer;return{openPopupWithURL:function(url)
{if(timer)
clearTimeout(timer);$("body:first").append('<div style="background: url(/layout/common/img/geoblock/background.png) 0 0 repeat; position: fixed; top: 0px; left:0px; width:100%; height:100%; z-index:10010; " id="account-dialog-container">'+'<div style="position: relative; width: 780px; height: 400px; margin: 200px auto; border: 5px solid #ffcc00; border-radius: 15px; -webkit-border-radius: 15px; -moz-border-radius: 15px;">'+'<iframe src="'+url+'" width="780" height="400" id="account-dialog" />'+'<a href="javascript:SPAccount.close();" id="account-dialog-close" style="display: block; position: absolute; top: -21px; right: -21px; width: 32px; height: 32px; color: #ffcc00; font-size: 20px; line-height: 32px; background-color: black; border: 5px solid #ffcc00; border-radius: 15px; -webkit-border-radius: 15px; -moz-border-radius: 15px;">X</a>'+'</div></div>');timer=setTimeout(SPAccount._check,1000);},openPopup:function(name,parameters)
{that.openPopupWithURL("/iframes/account/"+name);},close:function(url)
{if(timer)
clearTimeout(timer);var iframe=document.getElementById('account-dialog');if(iframe){var currentUrl=that._getURL();if(currentUrl.indexOf("#refresh=close")>0||currentUrl=="")
window.location.reload(true);}
$("#account-dialog-container").remove();},_check:function()
{var iframe=document.getElementById('account-dialog');if(iframe){var currentUrl=that._getURL();if(currentUrl.indexOf("#refresh=now")>0)
window.location.reload(true);}
timer=setTimeout(SPAccount._check,1000);},_getURL:function()
{try{var iframe=document.getElementById('account-dialog');var result=iframe.contentWindow.location.href;if(result!=window.undefined)
return result;}catch(err){}
return"";},init:function()
{that=SPAccount;}};}();SPAccount.init();SP.userStatus=function(){var that;var userStatusBox;return{init:function(){that=SP.userStatus;$("#userstatus #register").bind("click",that.openRegister);$("#userstatus #login").bind("click",that.openLogin);},openRegister:function(e)
{SPAccount.openPopup("register");e.preventDefault();},openLogin:function(e)
{SPAccount.openPopup("login");e.preventDefault();}}}();$(document).ready(SP.userStatus.init);var useBSNns;if(useBSNns)
{if(typeof(bsn)=="undefined")
bsn={}
_bsn=bsn;}
else
{_bsn=this;}
if(typeof(_bsn.Autosuggest)=="undefined")
_bsn.Autosuggest={}
_bsn.AutoSuggest=function(fldID,param)
{if(!document.getElementById)
return false;this.fld=_bsn.DOM.getElement(fldID);if(!this.fld)
return false;this.sInput="";this.nInputChars=0;this.aSuggestions=[];this.iHighlighted=0;this.oP=(param)?param:{};if(!this.oP.minchars)this.oP.minchars=1;if(!this.oP.method)this.oP.meth="get";if(!this.oP.varname)this.oP.varname="input";if(!this.oP.className)this.oP.className="autosuggest";if(!this.oP.timeout)this.oP.timeout=2500;if(!this.oP.delay)this.oP.delay=500;if(!this.oP.offsety)this.oP.offsety=-5;if(!this.oP.shownoresults)this.oP.shownoresults=true;if(!this.oP.noresults)this.oP.noresults="No results!";if(!this.oP.maxheight&&this.oP.maxheight!==0)this.oP.maxheight=250;if(!this.oP.cache&&this.oP.cache!=false)this.oP.cache=true;var pointer=this;this.fld.onkeypress=function(ev){return pointer.onKeyPress(ev);}
this.fld.onkeyup=function(ev){return pointer.onKeyUp(ev);}
this.fld.setAttribute("autocomplete","off");}
_bsn.AutoSuggest.prototype.onKeyPress=function(ev)
{var key=(window.event)?window.event.keyCode:ev.keyCode;var RETURN=13;var TAB=9;var ESC=27;var bubble=true;switch(key)
{case RETURN:this.setHighlightedValue();bubble=false;break;case ESC:this.clearSuggestions();break;}
return bubble;}
_bsn.AutoSuggest.prototype.onKeyUp=function(ev)
{var key=(window.event)?window.event.keyCode:ev.keyCode;var ARRUP=38;var ARRDN=40;var bubble=true;switch(key)
{case ARRUP:this.changeHighlight(key);bubble=false;break;case ARRDN:this.changeHighlight(key);bubble=false;break;default:this.getSuggestions(this.fld.value);}
return bubble;}
_bsn.AutoSuggest.prototype.getSuggestions=function(val)
{if(val==this.sInput)
return false;if(val.length<this.oP.minchars)
{this.sInput="";return false;}
if(val.length>this.nInputChars&&this.aSuggestions.length&&this.oP.cache)
{var arr=[];for(var i=0;i<this.aSuggestions.length;i++)
{if(this.aSuggestions[i].value.substr(0,val.length).toLowerCase()==val.toLowerCase())
arr.push(this.aSuggestions[i]);}
this.sInput=val;this.nInputChars=val.length;this.aSuggestions=arr;this.createList(this.aSuggestions);return false;}
else
{this.sInput=val;this.nInputChars=val.length;var pointer=this;clearTimeout(this.ajID);this.ajID=setTimeout(function(){pointer.doAjaxRequest()},this.oP.delay);}
return false;}
_bsn.AutoSuggest.prototype.doAjaxRequest=function()
{var pointer=this;var url=this.oP.script+this.oP.varname+"="+escape(this.fld.value);var meth=this.oP.meth;var onSuccessFunc=function(req){pointer.setSuggestions(req)};var onErrorFunc=function(status){alert("AJAX error: "+status);};var myAjax=new _bsn.Ajax();myAjax.makeRequest(url,meth,onSuccessFunc,onErrorFunc);}
_bsn.AutoSuggest.prototype.setSuggestions=function(req)
{this.aSuggestions=[];if(this.oP.json)
{var jsondata=eval('('+req.responseText+')');for(var i=0;i<jsondata.results.length;i++)
{this.aSuggestions.push({'id':jsondata.results[i].id,'value':jsondata.results[i].value,'info':jsondata.results[i].info});}}
else
{var xml=req.responseXML;var results=xml.getElementsByTagName('results')[0].childNodes;for(var i=0;i<results.length;i++)
{if(results[i].hasChildNodes())
this.aSuggestions.push({'id':results[i].getAttribute('id'),'value':results[i].childNodes[0].nodeValue,'info':results[i].getAttribute('info')});}}
this.idAs="as_"+this.fld.id;this.createList(this.aSuggestions);}
_bsn.AutoSuggest.prototype.createList=function(arr)
{var pointer=this;_bsn.DOM.removeElement(this.idAs);this.killTimeout();var div=_bsn.DOM.createElement("div",{id:this.idAs,className:this.oP.className});var hcorner=_bsn.DOM.createElement("div",{className:"as_corner"});var hbar=_bsn.DOM.createElement("div",{className:"as_bar"});var header=_bsn.DOM.createElement("div",{className:"as_header"});header.appendChild(hcorner);header.appendChild(hbar);div.appendChild(header);var ul=_bsn.DOM.createElement("ul",{id:"as_ul"});for(var i=0;i<arr.length;i++)
{var val=arr[i].value;var st=val.toLowerCase().indexOf(this.sInput.toLowerCase());var output=val.substring(0,st)+"<em>"+val.substring(st,st+this.sInput.length)+"</em>"+val.substring(st+this.sInput.length);var span=_bsn.DOM.createElement("span",{},output,true);if(arr[i].info!="")
{var br=_bsn.DOM.createElement("br",{});span.appendChild(br);var small=_bsn.DOM.createElement("small",{},arr[i].info);span.appendChild(small);}
var a=_bsn.DOM.createElement("a",{href:"#"});var tl=_bsn.DOM.createElement("span",{className:"tl"}," ");var tr=_bsn.DOM.createElement("span",{className:"tr"}," ");a.appendChild(tl);a.appendChild(tr);a.appendChild(span);a.name=i+1;a.onclick=function(){pointer.setHighlightedValue();return false;}
a.onmouseover=function(){pointer.setHighlight(this.name);}
var li=_bsn.DOM.createElement("li",{},a);ul.appendChild(li);}
if(arr.length==0)
{var li=_bsn.DOM.createElement("li",{className:"as_warning"},this.oP.noresults);ul.appendChild(li);}
div.appendChild(ul);var fcorner=_bsn.DOM.createElement("div",{className:"as_corner"});var fbar=_bsn.DOM.createElement("div",{className:"as_bar"});var footer=_bsn.DOM.createElement("div",{className:"as_footer"});footer.appendChild(fcorner);footer.appendChild(fbar);div.appendChild(footer);var pos=_bsn.DOM.getPos(this.fld);div.style.left=pos.x+"px";div.style.top=(pos.y+this.fld.offsetHeight+this.oP.offsety)+"px";div.style.width=this.fld.offsetWidth+"px";div.onmouseover=function(){pointer.killTimeout()}
div.onmouseout=function(){pointer.resetTimeout()}
document.getElementById("wrap").appendChild(div);this.iHighlighted=0;var pointer=this;this.toID=setTimeout(function(){pointer.clearSuggestions()},this.oP.timeout);}
_bsn.AutoSuggest.prototype.changeHighlight=function(key)
{var list=_bsn.DOM.getElement("as_ul");if(!list)
return false;var n;if(key==40)
n=this.iHighlighted+1;else if(key==38)
n=this.iHighlighted-1;if(n>list.childNodes.length)
n=list.childNodes.length;if(n<1)
n=1;this.setHighlight(n);}
_bsn.AutoSuggest.prototype.setHighlight=function(n)
{var list=_bsn.DOM.getElement("as_ul");if(!list)
return false;if(this.iHighlighted>0)
this.clearHighlight();this.iHighlighted=Number(n);list.childNodes[this.iHighlighted-1].className="as_highlight";this.killTimeout();}
_bsn.AutoSuggest.prototype.clearHighlight=function()
{var list=_bsn.DOM.getElement("as_ul");if(!list)
return false;if(this.iHighlighted>0)
{list.childNodes[this.iHighlighted-1].className="";this.iHighlighted=0;}}
_bsn.AutoSuggest.prototype.setHighlightedValue=function()
{if(this.iHighlighted)
{this.sInput=this.fld.value=this.aSuggestions[this.iHighlighted-1].value;this.fld.focus();if(this.fld.selectionStart)
this.fld.setSelectionRange(this.sInput.length,this.sInput.length);this.clearSuggestions();if(typeof(this.oP.callback)=="function")
this.oP.callback(this.aSuggestions[this.iHighlighted-1]);}}
_bsn.AutoSuggest.prototype.killTimeout=function()
{clearTimeout(this.toID);}
_bsn.AutoSuggest.prototype.resetTimeout=function()
{clearTimeout(this.toID);var pointer=this;this.toID=setTimeout(function(){pointer.clearSuggestions()},1000);}
_bsn.AutoSuggest.prototype.clearSuggestions=function()
{this.killTimeout();var ele=_bsn.DOM.getElement(this.idAs);var pointer=this;if(ele)
{var fade=new _bsn.Fader(ele,1,0,250,function(){_bsn.DOM.removeElement(pointer.idAs)});}}
if(typeof(_bsn.Ajax)=="undefined")
_bsn.Ajax={}
_bsn.Ajax=function()
{this.req={};this.isIE=false;}
_bsn.Ajax.prototype.makeRequest=function(url,meth,onComp,onErr)
{if(meth!="POST")
meth="GET";this.onComplete=onComp;this.onError=onErr;var pointer=this;if(window.XMLHttpRequest)
{this.req=new XMLHttpRequest();this.req.onreadystatechange=function(){pointer.processReqChange()};this.req.open("GET",url,true);this.req.send(null);}
else if(window.ActiveXObject)
{this.req=new ActiveXObject("Microsoft.XMLHTTP");if(this.req)
{this.req.onreadystatechange=function(){pointer.processReqChange()};this.req.open(meth,url,true);this.req.send();}}}
_bsn.Ajax.prototype.processReqChange=function()
{if(this.req.readyState==4){if(this.req.status==200)
{this.onComplete(this.req);}else{this.onError(this.req.status);}}}
if(typeof(_bsn.DOM)=="undefined")
_bsn.DOM={}
_bsn.DOM.createElement=function(type,attr,cont,html)
{var ne=document.createElement(type);if(!ne)
return false;for(var a in attr)
ne[a]=attr[a];if(typeof(cont)=="string"&&!html)
ne.appendChild(document.createTextNode(cont));else if(typeof(cont)=="string"&&html)
ne.innerHTML=cont;else if(typeof(cont)=="object")
ne.appendChild(cont);return ne;}
_bsn.DOM.clearElement=function(id)
{var ele=this.getElement(id);if(!ele)
return false;while(ele.childNodes.length)
ele.removeChild(ele.childNodes[0]);return true;}
_bsn.DOM.removeElement=function(ele)
{var e=this.getElement(ele);if(!e)
return false;else if(e.parentNode.removeChild(e))
return true;else
return false;}
_bsn.DOM.replaceContent=function(id,cont,html)
{var ele=this.getElement(id);if(!ele)
return false;this.clearElement(ele);if(typeof(cont)=="string"&&!html)
ele.appendChild(document.createTextNode(cont));else if(typeof(cont)=="string"&&html)
ele.innerHTML=cont;else if(typeof(cont)=="object")
ele.appendChild(cont);}
_bsn.DOM.getElement=function(ele)
{if(typeof(ele)=="undefined")
{return false;}
else if(typeof(ele)=="string")
{var re=document.getElementById(ele);if(!re)
return false;else if(typeof(re.appendChild)!="undefined"){return re;}else{return false;}}
else if(typeof(ele.appendChild)!="undefined")
return ele;else
return false;}
_bsn.DOM.appendChildren=function(id,arr)
{var ele=this.getElement(id);if(!ele)
return false;if(typeof(arr)!="object")
return false;for(var i=0;i<arr.length;i++)
{var cont=arr[i];if(typeof(cont)=="string")
ele.appendChild(document.createTextNode(cont));else if(typeof(cont)=="object")
ele.appendChild(cont);}}
_bsn.DOM.getPos=function(ele)
{var ele=this.getElement(ele);var obj=ele;var curleft=0;if(obj.offsetParent)
{while(obj.offsetParent)
{curleft+=obj.offsetLeft
obj=obj.offsetParent;}}
else if(obj.x)
curleft+=obj.x;var obj=ele;var curtop=0;if(obj.offsetParent)
{while(obj.offsetParent)
{curtop+=obj.offsetTop
obj=obj.offsetParent;}}
else if(obj.y)
curtop+=obj.y;return{x:curleft,y:curtop}}
if(typeof(_bsn.Fader)=="undefined")
_bsn.Fader={}
_bsn.Fader=function(ele,from,to,fadetime,callback)
{if(!ele)
return false;this.ele=ele;this.from=from;this.to=to;this.callback=callback;this.nDur=fadetime;this.nInt=50;this.nTime=0;var p=this;this.nID=setInterval(function(){p._fade()},this.nInt);}
_bsn.Fader.prototype._fade=function()
{this.nTime+=this.nInt;var ieop=Math.round(this._tween(this.nTime,this.from,this.to,this.nDur)*100);var op=ieop/100;if(this.ele.filters)
{try
{this.ele.filters.item("DXImageTransform.Microsoft.Alpha").opacity=ieop;}catch(e){this.ele.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+ieop+')';}}
else
{this.ele.style.opacity=op;}
if(this.nTime==this.nDur)
{clearInterval(this.nID);if(this.callback!=undefined)
this.callback();}}
_bsn.Fader.prototype._tween=function(t,b,c,d)
{return b+((c-b)*(t/d));};var options={script:"/feeds/typeahead/json/?",varname:"q",json:true,callback:function(obj){document.location=obj.id;}};var as_json=new AutoSuggest('searchtext',options);
/* 2012-02-21 01:00:02 - cached for 41686 seconds */
