(function(B){var A=B.preload=function(E,F){if(E.split){E=B(E)}F=B.extend({},A.defaults,F);var D=B.map(E,function(M){if(!M){return }if(M.split){return F.base+M+F.ext}var L=M.src||M.href;if(typeof F.placeholder=="string"&&M.src){M.src=F.placeholder}if(L&&F.find){L=L.replace(F.find,F.replace)}return L||null});var G={loaded:0,failed:0,next:0,done:0,total:D.length};if(!G.total){return J()}var I="<img/>",H=F.threshold;while(--H>0){I+="<img/>"}I=B(I).load(K).error(K).bind("abort",K).each(C);function K(L){G.found=L.type=="load";G.image=this.src;var M=G.original=E[this.index];G[G.found?"loaded":"failed"]++;G.done++;if(F.placeholder&&M.src){M.src=G.found?G.image:F.notFound||M.src}if(F.onComplete){F.onComplete(G)}if(G.done<G.total){C(0,this)}else{if(I.unbind){I.unbind("load").unbind("error").unbind("abort")}I=null;J()}}function C(N,M,L){if(B.browser.msie&&G.next&&G.next%A.gap==0&&!L){setTimeout(function(){C(N,M,true)},0);return false}if(G.next==G.total){return false}M.index=G.next;M.src=D[G.next++];if(F.onRequest){G.image=M.src;G.original=E[G.next-1];F.onRequest(G)}}function J(){if(F.onFinish){F.onFinish(G)}}};A.gap=14;A.defaults={threshold:2,base:"",ext:"",replace:""};B.fn.preload=function(C){A(this,C);return this}})(jQuery);(function(B){B.dimensions={version:"1.2"};B.each(["Height","Width"],function(D,C){B.fn["inner"+C]=function(){if(!this[0]){return }var F=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+C]:A(this,C.toLowerCase())+A(this,"padding"+F)+A(this,"padding"+E)};B.fn["outer"+C]=function(F){if(!this[0]){return }var H=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";F=B.extend({margin:false},F||{});var G=this.is(":visible")?this[0]["offset"+C]:A(this,C.toLowerCase())+A(this,"border"+H+"Width")+A(this,"border"+E+"Width")+A(this,"padding"+H)+A(this,"padding"+E);return G+(F.margin?(A(this,"margin"+H)+A(this,"margin"+E)):0)}});B.each(["Left","Top"],function(D,C){B.fn["scroll"+C]=function(E){if(!this[0]){return }return E!=undefined?this.each(function(){this==window||this==document?window.scrollTo(C=="Left"?E:B(window)["scrollLeft"](),C=="Top"?E:B(window)["scrollTop"]()):this["scroll"+C]=E}):this[0]==window||this[0]==document?self[(C=="Left"?"pageXOffset":"pageYOffset")]||B.boxModel&&document.documentElement["scroll"+C]||document.body["scroll"+C]:this[0]["scroll"+C]}});B.fn.extend({position:function(){var H=0,G=0,F=this[0],I,C,E,D;if(F){E=this.offsetParent();I=this.offset();C=E.offset();I.top-=A(F,"marginTop");I.left-=A(F,"marginLeft");C.top+=A(E,"borderTopWidth");C.left+=A(E,"borderLeftWidth");D={top:I.top-C.top,left:I.left-C.left}}return D},offsetParent:function(){var C=this[0].offsetParent;while(C&&(!/^body|html$/i.test(C.tagName)&&B.css(C,"position")=="static")){C=C.offsetParent}return B(C)}});function A(C,D){return parseInt(B.curCSS(C.jquery?C[0]:C,D,true))||0}})(jQuery);(function(C){var A=C.scrollTo=function(F,E,D){A.window().scrollTo(F,E,D)};A.defaults={axis:"y",duration:1};A.window=function(){return C(C.browser.safari?"body":"html")};C.fn.scrollTo=function(F,E,D){if(typeof E=="object"){D=E;E=0}D=C.extend({},A.defaults,D);E=E||D.speed||D.duration;D.queue=D.queue&&D.axis.length>1;if(D.queue){E/=2}D.offset=B(D.offset);D.over=B(D.over);return this.each(function(){var M=this,K=C(M),L=F,J,H={},N=K.is("html,body");switch(typeof L){case"number":case"string":if(/^([+-]=)?\d+(px)?$/.test(L)){L=B(L);break}L=C(L,this);case"object":if(L.is||L.style){J=(L=C(L)).offset()}}C.each(D.axis.split(""),function(R,S){var T=S=="x"?"Left":"Top",V=T.toLowerCase(),Q="scroll"+T,O=M[Q],P=S=="x"?"Width":"Height",U=P.toLowerCase();if(J){H[Q]=J[V]+(N?0:O-K.offset()[V]);if(D.margin){H[Q]-=parseInt(L.css("margin"+T))||0;H[Q]-=parseInt(L.css("border"+T+"Width"))||0}H[Q]+=D.offset[V]||0;if(D.over[V]){H[Q]+=L[U]()*D.over[V]}}else{H[Q]=L[V]}if(/^\d+$/.test(H[Q])){H[Q]=H[Q]<=0?0:Math.min(H[Q],G(P))}if(!R&&D.queue){if(O!=H[Q]){I(D.onAfterFirst)}delete H[Q]}});I(D.onAfter);function I(O){K.animate(H,E,D.easing,O&&function(){O.call(this,F)})}function G(O){var P=N?C.browser.opera?document.body:document.documentElement:M;return P["scroll"+O]-P["client"+O]}})};function B(D){return typeof D=="object"?D:{top:D,left:D}}})(jQuery);(function(A){A.fn.hoverIntent=function(I,H){var J={sensitivity:7,interval:100,timeout:0};J=A.extend(J,H?{over:I,out:H}:I);var L,K,F,D;var E=function(M){L=M.pageX;K=M.pageY};var C=function(N,M){M.hoverIntent_t=clearTimeout(M.hoverIntent_t);if((Math.abs(F-L)+Math.abs(D-K))<J.sensitivity){A(M).unbind("mousemove",E);M.hoverIntent_s=1;return J.over.apply(M,[N])}else{F=L;D=K;M.hoverIntent_t=setTimeout(function(){C(N,M)},J.interval)}};var G=function(N,M){M.hoverIntent_t=clearTimeout(M.hoverIntent_t);M.hoverIntent_s=0;return J.out.apply(M,[N])};var B=function(P){var O=(P.type=="mouseover"?P.fromElement:P.toElement)||P.relatedTarget;while(O&&O!=this){try{O=O.parentNode}catch(P){O=this}}if(O==this){return false}var N=jQuery.extend({},P);var M=this;if(M.hoverIntent_t){M.hoverIntent_t=clearTimeout(M.hoverIntent_t)}if(P.type=="mouseover"){F=N.pageX;D=N.pageY;A(M).bind("mousemove",E);if(M.hoverIntent_s!=1){M.hoverIntent_t=setTimeout(function(){C(N,M)},J.interval)}}else{A(M).unbind("mousemove",E);if(M.hoverIntent_s==1){M.hoverIntent_t=setTimeout(function(){G(N,M)},J.timeout)}}};return this.mouseover(B).mouseout(B)}})(jQuery);jQuery.fn.toggleVal=function(C,A,B){this.each(function(){$(this).focus(function(){if(A){if($(this).val()==this.defaultValue&&A==this.defaultValue){$(this).val("")}if(B){$(this).removeClass(B)}}else{if($(this).val()==this.defaultValue){$(this).val("")}}if(C){$(this).addClass(C)}}).blur(function(){var D=A?A:this.defaultValue;if($(this).val()==""){$(this).val(D)}if(B&&A==$(this).val()){$(this).addClass(B)}if(C){$(this).removeClass(C)}})})};(function(B){var A={obj:null,index:0,max:0,element:null,width:0,timer:null,settings:{},createNavigator:function(){},navigatorActive:0,navigator:null,gotoIndex:function(C,D){if(C>A.max){C=0}$li=obj.find("li");$el=obj.find("div.slideshow_box:eq("+A.index+")");A.width=$li.width();padding=parseInt($li.css("padding-left"))+parseInt($li.css("padding-right"));margin=parseInt($li.css("margin-left"))+parseInt($li.css("margin-right"));add=padding+margin;$el.fadeOut(A.settings.fadeSpeed,function(){if(A.newindex==0||C>A.max-1){$nel=obj.find("div.slideshow_box:eq(0)");A.element.scrollLeft=0;A.index=0}else{$nel=obj.find("div.slideshow_box:eq("+C+")");A.element.scrollLeft+=(A.width+add)*(C-A.index);A.index=C}$nel.fadeIn(A.settings.fadeSpeed,D)})}};B.fn.slideshow=function(C){var D=jQuery.extend({fadeSpeed:"slow",interval:4000},C);A.settings=D;A.obj=this;obj=this;obj.find("div.slideshow_box").hide();obj.find("div.slideshow_box:eq(0)").fadeIn(D.fadeSpeed);A.element=document.getElementById(obj.attr("id"));A.element.scrollLeft=0;A.element.scrollTop=0;A.max=obj.find("li").size();A.createNavigator(obj);A.timer=window.setInterval(function(){A.gotoIndex(A.index+1)},A.settings.interval)}})(jQuery);$.fn.focusFirst=function(){var A=$(":input:visible:enabled").not("[@readonly]").get(0);A.focus()};function unlockBackground(){$("#button_likeit").css("display","block");$("#vote_likeit_comment").css("display","none");var A=85;var B=$("#button_likeit").width()+$("#button_shownext").width()+A;if($("#bgpick table").width()<B){$("#bgpick table").width(B)}$.ajax({type:"POST",url:"/includes/ajax/unlock_background.ajax.php"})}function voteBackground(){$.ajax({type:"POST",url:"/includes/ajax/vote_background.ajax.php",dataType:"script",success:function(A,B){if(error){$("#bgpicker_loginbox").css("display","block");$("#bgpicker_loginbox_arrow").css("display","block");$("#bgpicker_loginbox div").html(error)}else{msg_str=count_votes==1?bg_voting_msg_str2:bg_voting_msg_str1.replace(/%votes/,count_votes);$("#button_likeit").css("display","none");$("#vote_likeit_comment").css("display","block");$("#vote_likeit_comment").html("<div class='small'>"+msg_str+"</div>");margin_values=59;required_table_width=$("#vote_likeit_comment").width()+$("#button_shownext").width()+margin_values;if($("#bgpick table").width()<required_table_width){$("#bgpick table").width(required_table_width)}}}})}function switchBackground(C,D,G,B,E,A,F){unlockBackground();$.ajax({type:"POST",url:"/includes/ajax/set_new_background_data.ajax.php",data:"background_id="+C+"&bg_path="+D+"&bg_color="+G+"&nickname="+B+"&nickname_url="+E+"&type=session&profilbild_anz="+F,dataType:"script",success:function(){if($("#bgpick").length>0){changeBg(new_bg_key)}else{D=aBgImages[new_bg_key][1];G=aBgImages[new_bg_key][2];$.preload([D],{onFinish:function(){$("body").css({"background-repeat":"repeat-y","background-attachment":"fixed","background-position":"left top","background-image":"url('"+D+"')","background-color":G})}})}}})}function changeBg(A){bg_changer.index=A;curr_img=aBgImages[A][1];curr_color=aBgImages[A][2];bgNavActive(false);bg_changer.start($("#bgpick"),curr_img,curr_color,$bgtarget,function(){bgNavActive(true)})}function changeBgPrev(){bg_changer.index--;changeBg(bg_changer.index);return false}function changeBgNext(){$("#bgpicker_loginbox").css("display","none");$("#bgpicker_loginbox_arrow").css("display","none");unlockBackground();bg_changer.index++;if(bg_changer.index>aBgImages.length-1){bg_changer.index=0}changeBg(bg_changer.index);$.ajax({type:"POST",data:"new_key="+bg_changer.index,url:"/includes/ajax/set_new_background_key.ajax.php"})}function bgNavActive(A){if(A){$("#button_shownext").click(changeBgNext);$("#button_likeit").click(voteBackground)}else{$("#button_shownext").unbind("click",changeBgNext);$("#button_likeit").unbind("click",voteBackground)}}function loadingAnimationBox(){this.index=0;this.start=function(E,B,A,C,D){bgobj=this;$("a#bguser").text(aBgImages[bgobj.index][0]);$("#bguser").attr("href",aBgImages[bgobj.index][3]);$("#link_userimg").attr("href",aBgImages[bgobj.index][3]);$("#bg_profilbild_anz").attr("src",aBgImages[bgobj.index][4]);if($("#vote_likeit_comment").css("display")=="block"){margin_values=64;required_table_width=$("#vote_likeit_comment").width()+$("#button_shownext").width()+margin_values}else{margin_values=85;required_table_width=$("#button_likeit").width()+$("#button_shownext").width()+margin_values}$("#bgpick table").width(required_table_width);$("#bgpicker_loginbox").width(required_table_width);$("#bgpicker_loginbox_arrow").width(required_table_width+2);content_width_loading=$("#bgpick table").width()-10;$("#bgpick #loading").width(content_width_loading);$("#bgpick #loading").fadeIn("fast",function(){$("#bgpick #loading").append('<div id="bgch_loading_animation" style="display: none; padding: 3px 0 0 0;"><img style="margin: 0 auto" src="/img/loading_small.gif" alt="" /><img style="display: none" id="bgch_image_preloader" src="'+B+'" /></div>');$("#bgpick #loading #bgch_loading_animation").fadeIn("fast");$.preload([B],{onComplete:function(){C.css({"background-image":"url('"+B+"')"});C.css({"background-color":A});bgobj.stop(D)}})})};this.stop=function(A){bgch_obj=$("#bgpick #loading #bgch_loading_animation");bgch_obj.fadeOut("fast",function(){$("#bgpick #loading").fadeOut("fast",A);bgch_obj.remove()})}}function boxChanger(B,A){$("#"+B).slideUp("slow",function(){$("#"+A).slideDown("slow")})}function headnav(B,A){if($(B).length==0){return false}src=$(B).attr("src");if($(B).attr("class")=="active"&&A!=1){return false}new_src=(src.search(/_act\.gif$/)==-1?src.substr(0,src.length-4)+"_act.gif":src.substr(0,src.length-8)+".gif");$(B).attr({src:new_src})}var newsletterReminder=function(A){var A=A;$.ajax({type:"POST",timeout:7000,data:$(A+" input[name^='newsletter[']").serialize(),url:"/includes/ajax/register_newsletter.ajax.php",success:function(B){$.each($("alert",B),function(){type=this.getAttribute("type")});if(type=="success"){if(A=="#newsletter_project"){$("#newsletter_project").remove();$("#newsletter_ok_project").show().fadeOut(4000)}else{$("#content_infobox").remove();boxChanger("newsletter","newsletter_ok");$("#newsletter_register_link").attr("href",$("#newsletter_register_link").attr("href")+"&email="+$("#newsletter_email").val())}}else{$(A+" span").html($("alert",B).text()).show()}}})};var inviteSend=function(B,A){var B=B;var A=A?A:"";$.ajax({type:"POST",timeout:7000,data:$(B+" input[name^='invite[']").serialize(),url:"/includes/ajax/invite.ajax.php",success:function(C){$.each($("alert",C),function(){type=this.getAttribute("type")});if(type=="success"){if(A=="nyc_rooftop"){$(B).html('<div class="yellow" style="padding: 5px">'+invite_ok+"</div>")}else{$(B).text(invite_ok);setTimeout(function(){if(B=="#profilbox_invite"){$(B).slideUp("normal",function(){$("#profilebox").css("margin-bottom","10px")})}else{$(B).slideUp("normal")}},3000)}}else{$(B+"_inner > div.invite_box").remove();$(B+"_inner").prepend('<div style="border:1px solid #fff" class="invite_box">'+$("alert",C).text()+"</div>")}}})};var loadDefaultBgUser=function(){$("a#bguser").text("MINI Space Team");$("#bguser").attr("href","/en_us/people/profile/mini_space_team/");$("#link_userimg").attr("href","/en_us/people/profile/mini_space_team/");$("#bg_profilbild_anz").attr("src","/mediadata/community/profilepic/58.jpg");if($("#vote_likeit_comment").css("display")=="block"){margin_values=64;required_table_width=$("#vote_likeit_comment").width()+$("#button_shownext").width()+margin_values}else{margin_values=85;required_table_width=$("#button_likeit").width()+$("#button_shownext").width()+margin_values}$("#vote_likeit_comment").hide();$("#button_likeit").hide();$("#bgpick table").width(required_table_width);$("#bgpicker_loginbox").width(required_table_width);$("#bgpicker_loginbox_arrow").width(required_table_width+2);content_width_loading=$("#bgpick table").width()-10;$("#bgpick #loading").width(content_width_loading)};bg_changer=new loadingAnimationBox();$(document).ready(function(){$("#head_nav img").hover(function(){headnav(this)},function(){headnav(this)});headnav($("#head_nav img.active"),1);if($("#bgpick").attr("id")=="bgpick"){if(extbgid_exists!=-1){$("#container").css({"margin-left":"0"});$("body").css({"background-repeat":"repeat-y","background-attachment":"fixed","background-position":"left top"})}else{loadDefaultBgUser()}$bgtarget=$("body");if(extbgid_exists!=1&&extbgid_exists!=-1){changeBg(init_bg_key)}bgNavActive(true);var A=1;$("#bgpick").hover(function(){if(A==1){RBfadeDone=0;$("#bgpick #bglinks").slideDown("fast",function(){A=1})}},function(){if(A==1){A=0;$("#bgpick #bglinks").slideUp("normal",function(){A=1})}})}$("a.lang_select").click(function(B){$lp=$("#localePicker");$lp_height=$lp.height();$wnd_height=$(window).height();scrollTop=document.documentElement.scrollTop;y=(B.pageY+$lp_height-scrollTop<$wnd_height?B.pageY:B.pageY-((B.pageY+$lp_height-scrollTop)-$wnd_height));y=y-15;x=B.pageX-65;$lp.css({left:x,top:y});$lp.hover(function(){},function(){$lp.fadeOut("fast")});$lp.fadeIn("fast");return false});$("a").mouseup(function(){$(this).blur()});$("form.return_submit input, input.return_submit").keydown(function(B){if(B.keyCode==13&&$(this).attr("rel")!="no-auto-submit"){$(this).parents("form").submit();return false}});$("#bgpick table").hoverIntent(function(){if($("#footer").is(":animated")){$("#footer").stop().fadeTo(100,0);$("#container > *").not("#bgpick, div.title, script").stop().fadeTo(100,0)}$("#container > *").not("#bgpick, div.title, script").fadeOut("normal");$("#footer").fadeOut("normal")},function(){if($("#footer").is(":animated")){$("#footer").stop().fadeTo(100,1);$("#container > *").not("#bgpick, div.title, script").stop().fadeTo(100,1)}$("#container > *").not("#bgpick, div.title, script").fadeIn("normal");$("#footer").fadeIn("normal")})});