/* base.js */
var signupClicked=false;jQuery(document).ready(function(){init()})
function init(){jQuery("#navContainer").load(navigationAjaxURL+"?when="+navigationWhenToDo+"#navContainer",function(){openExternalLinksInNewWindow();jQuery('#subNavContainer').fadeIn();if(jQuery("#greyOutNav").length<=0)ddsmoothmenu.init({mainmenuid:"topNav",orientation:'h',classname:'ddsmoothmenu',contentsource:"markup"})});initMiniTabs();initImageLoad();videoHomeTabs();showSkyscraper();initCommunityActivity();jQuery('input#email').click(function(){if(!signupClicked){jQuery(this).val('');signupClicked=true}});jQuery("body").append('<div class="modal" id="prompt"></div>')
function show_error(){modal.load('/dialogs/error_ajaxtimeout/',function(){var buttons=jQuery('button.closebtn','#prompt').click(function(e){e.preventDefault();modal.overlay().close()});modal.overlay({expose:{color:'#333',loadSpeed:200,opacity:0.9},closeOnClick:false,api:true,close:'.close'}).load()})};var ajaxing=false,modal=jQuery('#prompt');jQuery('.profilebutton:not(.btn-pending, .btn-edit, .btn-msg)').live('click',function(e){e.preventDefault();if(jQuery(e.target).hasClass('disabled'))return false;if(MPORA.globalVars.uid<=0)return false;jQuery(e.target).addClass('disabled');var url=jQuery(this).attr('href')+'1/';jQuery.ajax({url:url,dataType:'html',success:function(returnData){if(returnData.substr(0,2)=='<a'){var buttonContainer=jQuery(e.target).parent();if(buttonContainer.hasClass('profilebtnContainer')){buttonContainer.fadeOut('fast',function(){jQuery(this).find('a').remove();buttonContainer.html(returnData);buttonContainer.fadeIn('fast')})}else{location.reload(true);return false}}else show_error()},timeout:6000,error:function(msg,a,b){show_error()},complete:function(){jQuery(e.target).removeClass('disabled')}})});if(jQuery('.photoAlbum').length)initAlbumThumbs();if(jQuery('#productHomePage').length>0)jQuery('#productHomePage .homeProductItem').each(function(){var itemId=jQuery(this).attr('id');jQuery(this).tooltip({tip:'#'+itemId+'_tooltip',effect:'fade',position:'center left',offset:[-228,487]})});initFooterNav()}
function initImageLoad(){jQuery("img").not('.noLazyLoad').lazyload({placeholder:MPORA.globalVars.static_base_url+"loadres/images/blank.gif",effect:"fadeIn",failurelimit:30})}
function openExternalLinksInNewWindow(){jQuery('a').each(function(){if(jQuery(this).attr('href')!==undefined)if(jQuery(this).attr('href').indexOf('mpora.')==-1&&jQuery(this).attr('href').indexOf('http')!==-1)jQuery(this).attr('target','_blank')})}
function initMiniTabs(){jQuery('.top10ContentLinks > ul > li > a').click(function(indexClick){jQuery(this).parent().parent().children().each(function(){jQuery('#'+jQuery(this).children().attr('rel')).css('display','none');jQuery(this).removeClass('current')});jQuery(this).parent('li').addClass('current');jQuery('#'+jQuery(this).attr('rel')).css('display','block');return false})}
function videoHomeTabs(){jQuery("#tabs li a").click(function(){videoHomeLoadContents(this)})};var SomethingToTimeOut
function videoHomeLoadContents(tabObject){var linkRel=jQuery(tabObject).attr("rel"),tabContainer=jQuery("#"+linkRel);if(jQuery(tabContainer).html()==""){var intID=(MPORA.globalVars.interest_id)?MPORA.globalVars.interest_id:'all';tabContainer.html('<h3 class="activityTitle"><img style="width: 16px; height: 16px;" src="'+MPORA.globalVars.global_base_url+'loadres/MPORA5/images/ajax-loader.gif" />  Loading...</h3>');var ajaxURL="/ajax/json_tab_sort_content/"+intID+"/"+linkRel+"/";switch(linkRel){case"events":ajaxURL="/ajax/json_tab_events_videos/"+intID+"/";break;case"brands":ajaxURL="/ajax/json_tab_brands_videos/"+intID+"/";break;case"movies":ajaxURL="/ajax/json_tab_movies_videos/"+intID+"/";break;case"has_hd":ajaxURL="/ajax/json_tab_hd_videos/"+intID+"/";break;case"user-videos":if(filmID!=undefined)ajaxURL="/ajax/json_tab_user_videos/"+filmID+"/";break};jQuery(tabContainer).load(ajaxURL,function(){initImageLoad()})}}
function showSkyscraper(){if(jQuery(window).width()>1345)jQuery("#skyscraper").css("display","block")}
function initCommunityActivity(){var activityHolder=jQuery("#communityActivity");if(activityHolder.length>0)setTimeout("updateCommunityActivity()",15000)}
function updateCommunityActivity(){jQuery("#communityActivity").load("/ajax/community_activity/all/ .wrapper");setTimeout("updateCommunityActivity()",15000)}
function initFooterNav(){MporaFooterNavLoaded=false;var loadfooter=function(){var footerNavOffset=parseInt(jQuery('#the_full_footer_network').offset().top),scrollLoc=jQuery(window).scrollTop(),windowHeight=jQuery(window).height(),currentElementOffset=footerNavOffset-(scrollLoc+windowHeight);if(currentElementOffset<300&&!MporaFooterNavLoaded){jQuery('#the_full_footer_network').load('/ajax/get_footer_nav/');MporaFooterNavLoaded=true;jQuery(window).unbind('scroll',loadfooter)}};jQuery(window).bind('scroll',loadfooter)}
function getCookie(NameOfCookie){if(document.cookie.length>0){begin=document.cookie.indexOf(NameOfCookie+"=");if(begin!=-1){begin+=NameOfCookie.length+1;end=document.cookie.indexOf(";",begin);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(begin,end))}};return false}
function setCookie(NameOfCookie,value,expiredays){var ExpireDate=new Date();ExpireDate.setTime(ExpireDate.getTime()+(expiredays*24*3600*1000));var domain=MPORA.globalVars.global_base_url.substr(7).substr(0,MPORA.globalVars.global_base_url.substr(7).length-1);document.cookie=NameOfCookie+"="+escape(value)+"; domain=."+domain+"; path=/; "+((expiredays==null)?"":"; expires="+ExpireDate.toGMTString())}
function delCookie(NameOfCookie){if(getCookie(NameOfCookie))document.cookie=NameOfCookie+"=; expires=Thu, 01-Jan-70 00:00:01 GMT"};var hasAlbumScriptRun=0
function initAlbumThumbs(){if(hasAlbumScriptRun==1)return;jQuery('.photoAlbum').each(function(){var photoContainer=jQuery(this),photo=jQuery('img',this),photoLink=jQuery('a',this),tmpPhotoS=jQuery('img',this).attr('src'),tmpPhotoW=jQuery('img',this).attr('width'),tmpPhotoH=jQuery('img',this).attr('height'),tmpAlbumL=jQuery('a',this).attr('href');photoContainer.empty();var photoHeight=photo.attr('height'),photoWidth=photo.attr('width'),albumEle='<div class="albumContainer" style="height:'+(photoHeight+9)+'px;width:'+(photoWidth+9)+'px;">';albumEle+='	<div class="albumBackgroundDark" style="background:#999;left:8px;top:8px;width:'+(photoWidth+1)+'px;height:'+(photoHeight+1)+'px;">&nbsp;</div>';albumEle+='	<div class="albumBackgroundLight" style="background:#777;left:8px;top:8px;width:'+(photoWidth)+'px;height:'+(photoHeight)+'px;">&nbsp;</div>';albumEle+='	<div class="albumBackgroundDark" style="background:#999;left:5px;top:5px;width:'+(photoWidth+1)+'px;height:'+(photoHeight+1)+'px;">&nbsp;</div>';albumEle+='	<div class="albumBackgroundLight" style="background:#777;left:5px;top:5px;width:'+(photoWidth)+'px;height:'+(photoHeight)+'px;">&nbsp;</div>';albumEle+='	<div class="albumBackgroundDark" style="background:#999;left:2px;top:2px;width:'+(photoWidth+1)+'px;height:'+(photoHeight+1)+'px;">&nbsp;</div>';albumEle+='	<div class="albumBackgroundLight" style="background:#777;left:2px;top:2px;width:'+(photoWidth)+'px;height:'+(photoHeight)+'px;">&nbsp;</div>';albumEle+='	<div class="albumBackgroundDark albumImageContainer" style="height:'+(photoHeight)+'px;width:'+(photoWidth)+'px;">&nbsp;</div>';albumEle+='</div>';var albumWaterMark="";albumWaterMark+="<div style='display:inline; position:absolute; width:"+(tmpPhotoW+0)+"px; height: "+(tmpPhotoH+0)+"px; background: url("+MPORA.globalVars.static_base_url+"/loadres/MPORA5/images/album_logo.png) no-repeat bottom right'>";albumWaterMark+="</div>";albumWaterMark+="<img src='"+tmpPhotoS+"' width='"+tmpPhotoW+"' height='"+tmpPhotoH+"' />";photoContainer.html(albumWaterMark);photoContainer.click(function(){window.location=tmpAlbumL;return false});photoContainer.css('cursor','pointer');hasAlbumScriptRun=1})};

/* jquery.json.js */
(function($){function toIntegersAtLease(n){return n<10?'0'+n:n};Date.prototype.toJSON=function(date){return date.getUTCFullYear()+'-'+toIntegersAtLease(date.getUTCMonth()+1)+'-'+toIntegersAtLease(date.getUTCDate())};var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};$.quoteString=function(string){if(escapeable.test(string))return'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==='string')return c;c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"';return'"'+string+'"'};$.toJSON=function(o,compact){var type=typeof (o);if(type=="undefined"){return"undefined"}else if(type=="number"||type=="boolean"){return o+""}else if(o===null)return"null";if(type=="string")return $.quoteString(o);if(type=="object"&&typeof o.toJSON=="function")return o.toJSON(compact);if(type!="function"&&typeof (o.length)=="number"){var ret=[];for(var i=0;i<o.length;i++)ret.push($.toJSON(o[i],compact));if(compact){return"["+ret.join(",")+"]"}else return"["+ret.join(", ")+"]"};if(type=="function")throw new TypeError("Unable to convert object of type 'function' to json.");ret=[];for(var k in o){var name,type=typeof (k);if(type=="number"){name='"'+k+'"'}else if(type=="string"){name=$.quoteString(k)}else continue;val=$.toJSON(o[k],compact);if(typeof (val)!="string")continue;if(compact){ret.push(name+":"+val)}else ret.push(name+": "+val)};return"{"+ret.join(", ")+"}"};$.compactJSON=function(o){return $.toJSON(o,true)};$.evalJSON=function(src){return eval("("+src+")")};$.secureEvalJSON=function(src){var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered)){return eval("("+src+")")}else throw new SyntaxError("Error parsing JSON, source is not valid.")}})(jQuery);

/* jquery.tools.min.js */
(function(d){d.tools=d.tools||{};d.tools.tabs={version:"1.0.4",conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",api:false,rotate:false},addEffect:function(e,f){c[e]=f}};var c={"default":function(f,e){this.getPanes().hide().eq(f).show();e.call()},fade:function(g,e){var f=this.getConf(),j=f.fadeOutSpeed,h=this.getPanes();if(j){h.fadeOut(j)}else h.hide();h.eq(g).fadeIn(f.fadeInSpeed,e)},slide:function(f,e){this.getPanes().slideUp(200);this.getPanes().eq(f).slideDown(400,e)},ajax:function(f,e){this.getPanes().eq(0).load(this.getTabs().eq(f).attr("href"),e)}},b;d.tools.tabs.addEffect("horizontal",function(f,e){if(!b)b=this.getPanes().eq(0).width();this.getCurrentPane().animate({width:0},function(){d(this).hide()});this.getPanes().eq(f).animate({width:b},function(){d(this).show();e.call()})})
function a(g,h,f){var e=this,j=d(this),i;d.each(f,function(k,l){if(d.isFunction(l))j.bind(k,l)});d.extend(this,{click:function(k,n){var o=e.getCurrentPane(),l=g.eq(k);if(typeof k=="string"&&k.replace("#","")){l=g.filter("[href*="+k.replace("#","")+"]");k=Math.max(g.index(l),0)};if(f.rotate){var m=g.length-1;if(k<0)return e.click(m,n);if(k>m)return e.click(0,n)};if(!l.length){if(i>=0)return e;k=f.initialIndex;l=g.eq(k)};if(k===i)return e;n=n||d.Event();n.type="onBeforeClick";j.trigger(n,[k]);if(n.isDefaultPrevented())return;c[f.effect].call(e,k,function(){n.type="onClick";j.trigger(n,[k])});n.type="onStart";j.trigger(n,[k]);if(n.isDefaultPrevented())return;i=k;g.removeClass(f.current);l.addClass(f.current);return e},getConf:function(){return f},getTabs:function(){return g},getPanes:function(){return h},getCurrentPane:function(){return h.eq(i)},getCurrentTab:function(){return g.eq(i)},getIndex:function(){return i},next:function(){return e.click(i+1)},prev:function(){return e.click(i-1)},bind:function(k,l){j.bind(k,l);return e},onBeforeClick:function(k){return this.bind("onBeforeClick",k)},onClick:function(k){return this.bind("onClick",k)},unbind:function(k){j.unbind(k);return e}});g.each(function(k){d(this).bind(f.event,function(l){e.click(k,l);return false})});if(location.hash){e.click(location.hash)}else if(f.initialIndex===0||f.initialIndex>0)e.click(f.initialIndex);h.find("a[href^=#]").click(function(k){e.click(d(this).attr("href"),k)})};d.fn.tabs=function(i,f){var g=this.eq(typeof f=="number"?f:0).data("tabs");if(g)return g;if(d.isFunction(f))f={onBeforeClick:f};var h=d.extend({},d.tools.tabs.conf),e=this.length;f=d.extend(h,f);this.each(function(l){var j=d(this),k=j.find(f.tabs);if(!k.length)k=j.children();var m=i.jquery?i:j.children(i);if(!m.length)m=e==1?d(i):j.parent().find(i);g=new a(k,m,f);j.data("tabs",g)});return f.api?g:this}})(jQuery);(function(c){var d=[];c.tools=c.tools||{};c.tools.tooltip={version:"1.1.3",conf:{effect:"toggle",fadeOutSpeed:"fast",tip:null,predelay:0,delay:30,opacity:1,lazy:undefined,position:["top","center"],offset:[0,0],cancelDefault:true,relative:false,oneInstance:true,events:{def:"mouseover,mouseout",input:"focus,blur",widget:"focus mouseover,blur mouseout",tooltip:"mouseover,mouseout"},api:false},addEffect:function(e,g,f){b[e]=[g,f]}};var b={toggle:[function(e){var f=this.getConf(),g=this.getTip(),h=f.opacity;if(h<1)g.css({opacity:h});g.show();e.call()},function(e){this.getTip().hide();e.call()}],fade:[function(e){this.getTip().fadeIn(this.getConf().fadeInSpeed,e)},function(e){this.getTip().fadeOut(this.getConf().fadeOutSpeed,e)}]}
function a(f,g){var p=this,k=c(this);f.data("tooltip",p);var l=f.next();if(g.tip){l=c(g.tip);if(l.length>1){l=f.nextAll(g.tip).eq(0);if(!l.length)l=f.parent().nextAll(g.tip).eq(0)}}
function o(u){var t=g.relative?f.position().top:f.offset().top,s=g.relative?f.position().left:f.offset().left,v=g.position[0];t-=l.outerHeight()-g.offset[0];s+=f.outerWidth()+g.offset[1];var q=l.outerHeight()+f.outerHeight();if(v=="center")t+=q/2;if(v=="bottom")t+=q;v=g.position[1];var r=l.outerWidth()+f.outerWidth();if(v=="center")s-=r/2;if(v=="left")s-=r;return{top:t,left:s}};var i=f.is(":input"),e=i&&f.is(":checkbox, :radio, select, :button"),h=f.attr("type"),n=g.events[h]||g.events[i?(e?"widget":"input"):"def"];n=n.split(/,\s*/);if(n.length!=2)throw "Tooltip: bad events configuration for "+h;f.bind(n[0],function(r){if(g.oneInstance)c.each(d,function(){this.hide()});var q=l.data("trigger");if(q&&q[0]!=this)l.hide().stop(true,true);r.target=this;p.show(r);n=g.events.tooltip.split(/,\s*/);l.bind(n[0],function(){p.show(r)});if(n[1])l.bind(n[1],function(){p.hide(r)})});f.bind(n[1],function(q){p.hide(q)});if(!c.browser.msie&&!i&&!g.predelay)f.mousemove(function(){if(!p.isShown())f.triggerHandler("mouseover")});if(g.opacity<1)l.css("opacity",g.opacity);var m=0,j=f.attr("title");if(j&&g.cancelDefault){f.removeAttr("title");f.data("title",j)};c.extend(p,{show:function(r){if(r)f=c(r.target);clearTimeout(l.data("timer"));if(l.is(":animated")||l.is(":visible"))return p
function q(){l.data("trigger",f);var t=o(r);if(g.tip&&j)l.html(f.data("title"));r=r||c.Event();r.type="onBeforeShow";k.trigger(r,[t]);if(r.isDefaultPrevented())return p;t=o(r);l.css({position:"absolute",top:t.top,left:t.left});var s=b[g.effect];if(!s)throw 'Nonexistent effect "'+g.effect+'"';s[0].call(p,function(){r.type="onShow";k.trigger(r)})};if(g.predelay){clearTimeout(m);m=setTimeout(q,g.predelay)}else q();return p},hide:function(r){clearTimeout(l.data("timer"));clearTimeout(m);if(!l.is(":visible"))return
function q(){r=r||c.Event();r.type="onBeforeHide";k.trigger(r);if(r.isDefaultPrevented())return;b[g.effect][1].call(p,function(){r.type="onHide";k.trigger(r)})};if(g.delay&&r){l.data("timer",setTimeout(q,g.delay))}else q();return p},isShown:function(){return l.is(":visible, :animated")},getConf:function(){return g},getTip:function(){return l},getTrigger:function(){return f},bind:function(q,r){k.bind(q,r);return p},onHide:function(q){return this.bind("onHide",q)},onBeforeShow:function(q){return this.bind("onBeforeShow",q)},onShow:function(q){return this.bind("onShow",q)},onBeforeHide:function(q){return this.bind("onBeforeHide",q)},unbind:function(q){k.unbind(q);return p}});c.each(g,function(q,r){if(c.isFunction(r))p.bind(q,r)})};c.prototype.tooltip=function(e){var f=this.eq(typeof e=="number"?e:0).data("tooltip");if(f)return f;var g=c.extend(true,{},c.tools.tooltip.conf);if(c.isFunction(e)){e={onBeforeShow:e}}else if(typeof e=="string")e={tip:e};e=c.extend(true,g,e);if(typeof e.position=="string")e.position=e.position.split(/,?\s/);if(e.lazy!==false&&(e.lazy===true||this.length>20)){this.one("mouseover",function(h){f=new a(c(this),e);f.show(h);d.push(f)})}else this.each(function(){f=new a(c(this),e);d.push(f)});return e.api?f:this}})(jQuery);(function(b){var a=b.tools.tooltip;a.effects=a.effects||{};a.effects.slide={version:"1.0.0"};b.extend(a.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!b.browser.msie});var c={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};b.tools.tooltip.addEffect("slide",function(d){var f=this.getConf(),g=this.getTip(),h=f.slideFade?{opacity:f.opacity}:{},e=c[f.direction]||c.up;h[e[1]]=e[0]+"="+f.slideOffset;if(f.slideFade)g.css({opacity:0});g.show().animate(h,f.slideInSpeed,d)},function(e){var g=this.getConf(),i=g.slideOffset,h=g.slideFade?{opacity:0}:{},f=c[g.direction]||c.up,d=""+f[0];if(g.bounce)d=d=="+"?"-":"+";h[f[1]]=d+"="+i;this.getTip().animate(h,g.slideOutSpeed,function(){b(this).hide();e.call()})})})(jQuery);(function(b){b.tools=b.tools||{};b.tools.scrollable={version:"1.1.2",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var c
function a(o,m){var r=this,p=b(this),d=!m.vertical,e=o.children(),k=0,i;if(!c)c=r;b.each(m,function(s,t){if(b.isFunction(t))p.bind(s,t)});if(e.length>1)e=b(m.items,o)
function l(t){var s=b(t);return m.globalNav?s:o.parent().find(t)};o.data("finder",l);var f=l(m.prev),h=l(m.next),g=l(m.prevPage),n=l(m.nextPage);b.extend(r,{getIndex:function(){return k},getClickIndex:function(){var s=r.getItems();return s.index(s.filter("."+m.activeClass))},getConf:function(){return m},getSize:function(){return r.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/m.size)},getPageIndex:function(){return Math.ceil(k/m.size)},getNaviButtons:function(){return f.add(h).add(g).add(n)},getRoot:function(){return o},getItemWrap:function(){return e},getItems:function(){return e.children(m.item)},getVisibleItems:function(){return r.getItems().slice(k,k+m.size)},seekTo:function(s,w,t){if(s<0)s=0;if(k===s)return r;if(b.isFunction(w))t=w;if(s>r.getSize()-m.size)return m.loop?r.begin():this.end();var u=r.getItems().eq(s);if(!u.length)return r;var v=b.Event("onBeforeSeek");p.trigger(v,[s]);if(v.isDefaultPrevented())return r;if(w===undefined||b.isFunction(w))w=m.speed
function x(){if(t)t.call(r,s);p.trigger("onSeek",[s])};if(d){e.animate({left:-u.position().left},w,m.easing,x)}else e.animate({top:-u.position().top},w,m.easing,x);c=r;k=s;v=b.Event("onStart");p.trigger(v,[s]);if(v.isDefaultPrevented())return r;f.add(g).toggleClass(m.disabledClass,s===0);h.add(n).toggleClass(m.disabledClass,s>=r.getSize()-m.size);return r},move:function(u,t,s){i=u>0;return this.seekTo(k+u,t,s)},next:function(t,s){return this.move(1,t,s)},prev:function(t,s){return this.move(-1,t,s)},movePage:function(w,v,u){i=w>0;var s=m.size*w,t=k%m.size;if(t>0)s+=(w>0?-t:m.size-t);return this.move(s,v,u)},prevPage:function(t,s){return this.movePage(-1,t,s)},nextPage:function(t,s){return this.movePage(1,t,s)},setPage:function(t,u,s){return this.seekTo(t*m.size,u,s)},begin:function(t,s){i=false;return this.seekTo(0,t,s)},end:function(t,s){i=true;var u=this.getSize()-m.size;return u>0?this.seekTo(u,t,s):r},reload:function(){p.trigger("onReload");return r},focus:function(){c=r;return r},click:function(u){var v=r.getItems().eq(u),s=m.activeClass,t=m.size;if(u<0||u>=r.getSize())return r;if(t==1){if(m.loop)return r.next();if(u===0||u==r.getSize()-1)i=(i===undefined)?true:!i;return i===false?r.prev():r.next()};if(t==2){if(u==k)u--;r.getItems().removeClass(s);v.addClass(s);return r.seekTo(u,time,fn)};if(!v.hasClass(s)){r.getItems().removeClass(s);v.addClass(s);var x=Math.floor(t/2),w=u-x;if(w>r.getSize()-t)w=r.getSize()-t;if(w!==u)return r.seekTo(w)};return r},bind:function(s,t){p.bind(s,t);return r},unbind:function(s){p.unbind(s);return r}});b.each("onBeforeSeek,onStart,onSeek,onReload".split(","),function(s,t){r[t]=function(u){return r.bind(t,u)}});f.addClass(m.disabledClass).click(function(){r.prev()});h.click(function(){r.next()});n.click(function(){r.nextPage()});if(r.getSize()<m.size)h.add(n).addClass(m.disabledClass);g.addClass(m.disabledClass).click(function(){r.prevPage()});var j=m.hoverClass,q="keydown."+Math.random().toString().substring(10);r.onReload(function(){if(j)r.getItems().hover(function(){b(this).addClass(j)},function(){b(this).removeClass(j)});if(m.clickable)r.getItems().each(function(s){b(this).unbind("click.scrollable").bind("click.scrollable",function(t){if(b(t.target).is("a"))return;return r.click(s)})});if(m.keyboard){b(document).unbind(q).bind(q,function(t){if(t.altKey||t.ctrlKey)return;if(m.keyboard!="static"&&c!=r)return;var u=m.keyboardSteps;if(d&&(t.keyCode==37||t.keyCode==39)){r.move(t.keyCode==37?-u:u);return t.preventDefault()};if(!d&&(t.keyCode==38||t.keyCode==40)){r.move(t.keyCode==38?-u:u);return t.preventDefault()};return true})}else b(document).unbind(q)});r.reload()};b.fn.scrollable=function(d){var e=this.eq(typeof d=="number"?d:0).data("scrollable");if(e)return e;var f=b.extend({},b.tools.scrollable.conf);d=b.extend(f,d);d.keyboardSteps=d.keyboardSteps||d.size;this.each(function(){e=new a(b(this),d);b(this).data("scrollable",e)});return d.api?e:this}})(jQuery);(function(c){c.tools=c.tools||{};c.tools.overlay={version:"1.1.2",addEffect:function(e,f,g){b[e]=[f,g]},conf:{top:"10%",left:"center",absolute:false,speed:"normal",closeSpeed:"fast",effect:"default",close:null,oneInstance:true,closeOnClick:true,closeOnEsc:true,api:false,expose:null,target:null}};var b={};c.tools.overlay.addEffect("default",function(e){this.getOverlay().fadeIn(this.getConf().speed,e)},function(e){this.getOverlay().fadeOut(this.getConf().closeSpeed,e)});var d=[]
function a(g,k){var o=this,m=c(this),n=c(window),j,i,h,e=k.expose&&c.tools.expose.version,f=k.target||g.attr("rel");i=f?c(f):null||g;if(!i.length)throw "Could not find Overlay: "+f;if(g&&g.index(i)==-1)g.click(function(p){o.load(p);return p.preventDefault()});c.each(k,function(p,q){if(c.isFunction(q))m.bind(p,q)});c.extend(o,{load:function(u){if(o.isOpened())return o;var r=b[k.effect];if(!r)throw 'Overlay: cannot find effect : "'+k.effect+'"';if(k.oneInstance)c.each(d,function(){this.close(u)});u=u||c.Event();u.type="onBeforeLoad";m.trigger(u);if(u.isDefaultPrevented())return o;h=true;if(e)i.expose().load(u);var t=k.top,s=k.left,p=i.outerWidth({margin:true}),q=i.outerHeight({margin:true});if(typeof t=="string")t=t=="center"?Math.max((n.height()-q)/2,0):parseInt(t,10)/100*n.height();if(s=="center")s=Math.max((n.width()-p)/2,0);if(!k.absolute){t+=n.scrollTop();s+=n.scrollLeft()};i.css({top:t,left:s,position:"absolute"});u.type="onStart";m.trigger(u);r[0].call(o,function(){if(h){u.type="onLoad";m.trigger(u)}});if(k.closeOnClick)c(document).bind("click.overlay",function(w){if(!o.isOpened())return;var v=c(w.target);if(v.parents(i).length>1)return;c.each(d,function(){this.close(w)})});if(k.closeOnEsc)c(document).unbind("keydown.overlay").bind("keydown.overlay",function(v){if(v.keyCode==27)c.each(d,function(){this.close(v)})});return o},close:function(q){if(!o.isOpened())return o;q=q||c.Event();q.type="onBeforeClose";m.trigger(q);if(q.isDefaultPrevented())return;h=false;b[k.effect][1].call(o,function(){q.type="onClose";m.trigger(q)});var p=true;c.each(d,function(){if(this.isOpened())p=false});if(p)c(document).unbind("click.overlay").unbind("keydown.overlay");return o},getContent:function(){return i},getOverlay:function(){return i},getTrigger:function(){return g},getClosers:function(){return j},isOpened:function(){return h},getConf:function(){return k},bind:function(p,q){m.bind(p,q);return o},unbind:function(p){m.unbind(p);return o}});c.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(p,q){o[q]=function(r){return o.bind(q,r)}});if(e){if(typeof k.expose=="string")k.expose={color:k.expose};c.extend(k.expose,{api:true,closeOnClick:k.closeOnClick,closeOnEsc:false});var l=i.expose(k.expose);l.onBeforeClose(function(p){o.close(p)});o.onClose(function(p){l.close(p)})};j=i.find(k.close||".close");if(!j.length&&!k.close){j=c('<div class="close"></div>');i.prepend(j)};j.click(function(p){o.close(p)})};c.fn.overlay=function(e){var f=this.eq(typeof e=="number"?e:0).data("overlay");if(f)return f;if(c.isFunction(e))e={onBeforeLoad:e};var g=c.extend({},c.tools.overlay.conf);e=c.extend(true,g,e);this.each(function(){f=new a(c(this),e);d.push(f);c(this).data("overlay",f)});return e.api?f:this}})(jQuery);(function(b){b.tools=b.tools||{};b.tools.expose={version:"1.0.5",conf:{maskId:null,loadSpeed:"slow",closeSpeed:"fast",closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:0.8,color:"#456",api:false}}
function a(){if(b.browser.msie){var f=b(document).height(),e=b(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f-e<20?e:f]};return[b(window).width(),b(document).height()]}
function c(h,g){var e=this,j=b(this),d=null,f=false,i=0;b.each(g,function(k,l){if(b.isFunction(l))j.bind(k,l)});b(window).resize(function(){e.fit()});b.extend(this,{getMask:function(){return d},getExposed:function(){return h},getConf:function(){return g},isLoaded:function(){return f},load:function(n){if(f)return e;i=h.eq(0).css("zIndex");if(g.maskId)d=b("#"+g.maskId);if(!d||!d.length){var l=a();d=b("<div/>").css({position:"absolute",top:0,left:0,width:l[0],height:l[1],display:"none",opacity:0,zIndex:g.zIndex});if(g.maskId)d.attr("id",g.maskId);b("body").append(d);var k=d.css("backgroundColor");if(!k||k=="transparent"||k=="rgba(0, 0, 0, 0)")d.css("backgroundColor",g.color);if(g.closeOnEsc)b(document).bind("keydown.unexpose",function(o){if(o.keyCode==27)e.close()});if(g.closeOnClick)d.bind("click.unexpose",function(o){e.close(o)})};n=n||b.Event();n.type="onBeforeLoad";j.trigger(n);if(n.isDefaultPrevented())return e;b.each(h,function(){var o=b(this);if(!/relative|absolute|fixed/i.test(o.css("position")))o.css("position","relative")});h.css({zIndex:Math.max(g.zIndex+1,i=="auto"?0:i)});var m=d.height();if(!this.isLoaded())d.css({opacity:0,display:"block"}).fadeTo(g.loadSpeed,g.opacity,function(){if(d.height()!=m)d.css("height",m);n.type="onLoad";j.trigger(n)});f=true;return e},close:function(k){if(!f)return e;k=k||b.Event();k.type="onBeforeClose";j.trigger(k);if(k.isDefaultPrevented())return e;d.fadeOut(g.closeSpeed,function(){k.type="onClose";j.trigger(k);h.css({zIndex:b.browser.msie?i:null})});f=false;return e},fit:function(){if(d){var k=a();d.css({width:k[0],height:k[1]})}},bind:function(k,l){j.bind(k,l);return e},unbind:function(k){j.unbind(k);return e}});b.each("onBeforeLoad,onLoad,onBeforeClose,onClose".split(","),function(k,l){e[l]=function(m){return e.bind(l,m)}})};b.fn.expose=function(d){var e=this.eq(typeof d=="number"?d:0).data("expose");if(e)return e;if(typeof d=="string")d={color:d};var f=b.extend({},b.tools.expose.conf);d=b.extend(f,d);this.each(function(){e=new c(b(this),d);b(this).data("expose",e)});return d.api?e:this}})(jQuery);

/* ddsmoothmenu.js */
var ddsmoothmenu={arrowimages:{down:['downarrowclass',MPORA.globalVars.static_base_url+'loadres/images/interface/nav_down.gif',12],right:['rightarrowclass',MPORA.globalVars.static_base_url+'loadres/images/interface/nav_right.gif']},transition:{overtime:300,outtime:300},shadow:{enable:false,offsetx:5,offsety:5},showhidedelay:{showdelay:100,hidedelay:200},detectwebkit:navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1,detectie6:document.all&&!window.XMLHttpRequest,getajaxmenu:function($,setting){var $menucontainer=$('#'+setting.contentsource[0]);$menucontainer.html("Loading Menu...");$.ajax({url:setting.contentsource[1],async:true,error:function(ajaxrequest){$menucontainer.html('Error fetching content. Server Response: '+ajaxrequest.responseText)},success:function(content){$menucontainer.html(content);ddsmoothmenu.buildmenu($,setting)}})},buildmenu:function($,setting){var smoothmenu=ddsmoothmenu,$mainmenu=$("#"+setting.mainmenuid+">ul");$mainmenu.parent().get(0).className=setting.classname||"ddsmoothmenu";var $headers=$mainmenu.find("ul").parent();$headers.hover(function(e){$(this).children('a:eq(0)').addClass('selected')},function(e){$(this).children('a:eq(0)').removeClass('selected')});$headers.each(function(i){var $curobj=$(this).css({zIndex:100-i}),$subul=$(this).find('ul:eq(0)').css({display:'block'});$subul.data('timers',{});this._dimensions={w:this.offsetWidth,h:this.offsetHeight,subulw:$subul.outerWidth(),subulh:$subul.outerHeight()};this.istopheader=$curobj.parents("ul").length==1?true:false;$subul.css({top:this.istopheader&&setting.orientation!='v'?this._dimensions.h+"px":0});$curobj.children("a:eq(0)").css(this.istopheader?{paddingRight:smoothmenu.arrowimages.down[2]}:{}).append('<img src="'+(this.istopheader&&setting.orientation!='v'?smoothmenu.arrowimages.down[1]:smoothmenu.arrowimages.right[1])+'" class="'+(this.istopheader&&setting.orientation!='v'?smoothmenu.arrowimages.down[0]:smoothmenu.arrowimages.right[0])+'" style="border:0;" />');if(smoothmenu.shadow.enable){this._shadowoffset={x:(this.istopheader?$subul.offset().left+smoothmenu.shadow.offsetx:this._dimensions.w),y:(this.istopheader?$subul.offset().top+smoothmenu.shadow.offsety:$curobj.position().top)};if(this.istopheader){$parentshadow=$(document.body)}else{var $parentLi=$curobj.parents("li:eq(0)");$parentshadow=$parentLi.get(0).$shadow};this.$shadow=$('<div class="ddshadow'+(this.istopheader?' toplevelshadow':'')+'"></div>').prependTo($parentshadow).css({left:this._shadowoffset.x+'px',top:this._shadowoffset.y+'px'})};$curobj.hover(function(e){var $targetul=$subul,header=$curobj.get(0);clearTimeout($targetul.data('timers').hidetimer);$targetul.data('timers').showtimer=setTimeout(function(){header._offsets={left:$curobj.offset().left,top:$curobj.offset().top};var menuleft=header.istopheader&&setting.orientation!='v'?0:header._dimensions.w;menuleft=(header._offsets.left+menuleft+header._dimensions.subulw>$(window).width())?(header.istopheader&&setting.orientation!='v'?-header._dimensions.subulw+header._dimensions.w:-header._dimensions.w):menuleft;if($targetul.queue().length<=1){$targetul.css({left:menuleft+"px",width:header._dimensions.subulw+'px'}).animate({height:'show',opacity:'show'},ddsmoothmenu.transition.overtime);if(smoothmenu.shadow.enable){var shadowleft=header.istopheader?$targetul.offset().left+ddsmoothmenu.shadow.offsetx:menuleft,shadowtop=header.istopheader?$targetul.offset().top+smoothmenu.shadow.offsety:header._shadowoffset.y;if(!header.istopheader&&ddsmoothmenu.detectwebkit)header.$shadow.css({opacity:1});header.$shadow.css({overflow:'',width:header._dimensions.subulw+'px',left:shadowleft+'px',top:shadowtop+'px'}).animate({height:header._dimensions.subulh+'px'},ddsmoothmenu.transition.overtime)}}},ddsmoothmenu.showhidedelay.showdelay)},function(e){var $targetul=$subul,header=$curobj.get(0);clearTimeout($targetul.data('timers').showtimer);$targetul.data('timers').hidetimer=setTimeout(function(){$targetul.animate({height:'hide',opacity:'hide'},ddsmoothmenu.transition.outtime);if(smoothmenu.shadow.enable){if(ddsmoothmenu.detectwebkit)header.$shadow.children('div:eq(0)').css({opacity:0});header.$shadow.css({overflow:'hidden'}).animate({height:0},ddsmoothmenu.transition.outtime)}},ddsmoothmenu.showhidedelay.hidedelay)})});$mainmenu.find("ul").css({display:'none',visibility:'visible'})},init:function(setting){if(typeof setting.customtheme=="object"&&setting.customtheme.length==2){var mainmenuid='#'+setting.mainmenuid,mainselector=(setting.orientation=="v")?mainmenuid:mainmenuid+', '+mainmenuid;document.write('<style type="text/css">\n'+mainselector+' ul li a {background:'+setting.customtheme[0]+';}\n'+mainmenuid+' ul li a:hover {background:'+setting.customtheme[1]+';}\n</style>')};this.shadow.enable=(document.all&&!window.XMLHttpRequest)?false:this.shadow.enable;jQuery(document).ready(function($){if(typeof setting.contentsource=="object"){ddsmoothmenu.getajaxmenu($,setting)}else ddsmoothmenu.buildmenu($,setting)})}};

/* jquery.lazyload.min.js */
(function($){$.fn.lazyload=function(options){var settings={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};if(options)$.extend(settings,options);var elements=this;if("scroll"==settings.event)$(settings.container).bind("scroll",function(event){var counter=0;elements.each(function(){if($.abovethetop(this,settings)||$.leftofbegin(this,settings));else if(!$.belowthefold(this,settings)&&!$.rightoffold(this,settings)){$(this).trigger("appear")}else if(counter++>settings.failurelimit)return false});var temp=$.grep(elements,function(element){return !element.loaded});elements=$(temp)});this.each(function(){var self=this;if(undefined==$(self).attr("original"))$(self).attr("original",$(self).attr("src"));if("scroll"!=settings.event||undefined==$(self).attr("src")||settings.placeholder==$(self).attr("src")||($.abovethetop(self,settings)||$.leftofbegin(self,settings)||$.belowthefold(self,settings)||$.rightoffold(self,settings))){if(settings.placeholder){$(self).attr("src",settings.placeholder)}else $(self).removeAttr("src");self.loaded=false}else self.loaded=true;$(self).one("appear",function(){if(!this.loaded)$("<img />").bind("load",function(){$(self).hide().attr("src",$(self).attr("original"))[settings.effect](settings.effectspeed);self.loaded=true}).attr("src",$(self).attr("original"))});if("scroll"!=settings.event)$(self).bind(settings.event,function(event){if(!self.loaded)$(self).trigger("appear")})});$(settings.container).trigger(settings.event);return this};$.belowthefold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).height()+$(window).scrollTop()}else var fold=$(settings.container).offset().top+$(settings.container).height();return fold<=$(element).offset().top-settings.threshold};$.rightoffold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).width()+$(window).scrollLeft()}else var fold=$(settings.container).offset().left+$(settings.container).width();return fold<=$(element).offset().left-settings.threshold};$.abovethetop=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).scrollTop()}else var fold=$(settings.container).offset().top;return fold>=$(element).offset().top+settings.threshold+$(element).height()};$.leftofbegin=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).scrollLeft()}else var fold=$(settings.container).offset().left;return fold>=$(element).offset().left+settings.threshold+$(element).width()};$.extend($.expr[':'],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"})})(jQuery);

/* login.js */
jQuery(document).ready(function(){jQuery("body").append('<div class="modal" id="loginPopup"></div>');jQuery('.requireLogin').click(function(e){var linkObj=jQuery(this);if(MPORA.globalVars.uid==0){var linkHREF=linkObj.attr('href');if(linkObj.hasClass('refresh'))linkHREF=window.location.href;if(linkHREF)if(linkHREF.substr(0,1)=='/')linkHREF=MPORA.globalVars.base_url+linkHREF.substr(1);jQuery("#loginPopup").overlay({expose:{color:'#fff',loadSpeed:200,opacity:0.4},onBeforeLoad:function(){jQuery("head").append("<link>");css=jQuery("head").children(":last");css.attr({rel:"stylesheet",type:"text/css",href:MPORA.globalVars.static_base_url+"/loadres//MPORA5/forms.css"});jQuery("head").append("<link>");css=jQuery("head").children(":last");css.attr({rel:"stylesheet",type:"text/css",href:MPORA.globalVars.static_base_url+"/loadres//MPORA5/inline_login.css"});jQuery('.leaderboard').hide();jQuery('.mpu').hide();jQuery("#loginPopup").load('/ajax/get_login_splash/',false,function(){jQuery('#loginPopup #return_url').attr('value',linkHREF)})},onClose:function(){jQuery('.leaderboard').show()},closeOnClick:true,api:true}).load();return false}})});

/* navigation.js */
jQuery(document).ready(function(){initNav()})
function initNav(){jQuery('.utilities [dropdown]').each(function(){var elm=jQuery(this),dropElm=jQuery(this).next('li'),dropdownElm=jQuery('#'+elm.attr('dropdown')),triggerHeight=elm.outerHeight(),triggerOffset=elm.offset();dropdownElm.css({position:'absolute',top:(triggerHeight+triggerOffset.top)+'px',left:triggerOffset.left+'px'});var newNavWidth=(elm.outerWidth()+dropElm.outerWidth());dropdownElm.css('width',newNavWidth+'px');dropElm.click(function(){showHideUtilNavItem(elm,dropElm,dropdownElm)});dropdownElm.mouseleave(function(){showHideUtilNavItem(elm,dropElm,dropdownElm)})})}
function showHideUtilNavItem(elm,dropElm,dropdownElm){if(dropdownElm.not(':visible').length==1){jQuery('a',elm).css({MozBorderRadiusBottomLeft:'0',BorderBottomLeftRadius:'0',WebkitBorderBottomLeftRadius:'0'});dropElm.css({MozBorderRadiusBottomRight:'0',BorderBottomRightRadius:'0',WebkitBorderBottomRightRadius:'0'});dropdownElm.animate({opacity:'show',height:'show'},'fast')}else{jQuery('a',elm).css({MozBorderRadiusBottomLeft:'3px',BorderBottomLeftRadius:'3px',WebkitBorderBottomLeftRadius:'3px'});dropElm.css({MozBorderRadiusBottomRight:'3px',BorderBottomRightRadius:'3px',WebkitBorderBottomRightRadius:'3px'});dropdownElm.animate({opacity:'hide',height:'hide'},'fast')}};

/* percistant_sidebar.js */
function moveSocialBox(){var screenSize=jQuery(window).width(),contentSize=jQuery('#wrapper').width(),theBlockSize=jQuery('#percistantSocialButtons').width(),whatWeWant=0,TheTopOrBottom=0;screenSize=Math.ceil(screenSize/2);contentSize=Math.ceil(contentSize/2);whatWeWant=screenSize-contentSize-theBlockSize-4;if(jQuery('#percistantSocialButtons').css('display')=='none')jQuery('#percistantSocialButtons').css('display','block');jQuery('#percistantSocialButtons').css('left',whatWeWant);whatWeWant=screenSize-contentSize};jQuery(document).ready(function(){moveSocialBox();jQuery(window).resize(function(){moveSocialBox()});jQuery(window).scroll(function(e){var WhenToStop=jQuery("#wrapper").height()-jQuery('#new_foot').height();if(jQuery(window).scrollTop()>WhenToStop){var theH=jQuery("#wrapper").height()-jQuery('#percistantSocialButtons').height()-26;jQuery('#percistantSocialButtons').css({position:'absolute',top:theH,border:'1px solid #F59E1A, 1px solid #F59E1A, 1px solid #F59E1A, 3px solid #F59E1A'})}else jQuery('#percistantSocialButtons').css({position:'fixed',top:212,border:'1px solid #F59E1A, 1px solid #F59E1A, 0px solid #F59E1A, 3px solid #F59E1A'})})});

/* navigation.js */
jQuery(document).ready(function(){initNav()})
function initNav(){jQuery('.utilities [dropdown]').each(function(){var elm=jQuery(this),dropElm=jQuery(this).next('li'),dropdownElm=jQuery('#'+elm.attr('dropdown')),triggerHeight=elm.outerHeight(),triggerOffset=elm.offset();dropdownElm.css({position:'absolute',top:(triggerHeight+triggerOffset.top)+'px',left:triggerOffset.left+'px'});var newNavWidth=(elm.outerWidth()+dropElm.outerWidth());dropdownElm.css('width',newNavWidth+'px');dropElm.click(function(){showHideUtilNavItem(elm,dropElm,dropdownElm)});dropdownElm.mouseleave(function(){showHideUtilNavItem(elm,dropElm,dropdownElm)})})}
function showHideUtilNavItem(elm,dropElm,dropdownElm){if(dropdownElm.not(':visible').length==1){jQuery('a',elm).css({MozBorderRadiusBottomLeft:'0',BorderBottomLeftRadius:'0',WebkitBorderBottomLeftRadius:'0'});dropElm.css({MozBorderRadiusBottomRight:'0',BorderBottomRightRadius:'0',WebkitBorderBottomRightRadius:'0'});dropdownElm.animate({opacity:'show',height:'show'},'fast')}else{jQuery('a',elm).css({MozBorderRadiusBottomLeft:'3px',BorderBottomLeftRadius:'3px',WebkitBorderBottomLeftRadius:'3px'});dropElm.css({MozBorderRadiusBottomRight:'3px',BorderBottomRightRadius:'3px',WebkitBorderBottomRightRadius:'3px'});dropdownElm.animate({opacity:'hide',height:'hide'},'fast')}};



