LOADING='<img src="/images/loading.gif">';KEY_ENTER=13;SESSION_NAME="_whitecanvas_session";function beta_signup_success(responseText,statusText){$("#fb_content_root").hide();$("#fb_content_signup").html(html);$("#fb_content_signup").show()}function beforeSubmit(){}function justFBContent(el,cont){var f=$("div."+cont);for(var i=0;i<f.length;i++){$(f[i]).hide()}if(el=="root"){$("#rootIcon").hide()}else{$("#rootIcon").show()}$("#"+cont+"_"+el).fadeIn(500);return false}function showFBContent(el,cont){var f=$("div."+cont);for(var i=0;i<f.length;i++){$(f[i]).hide()}if(el=="root"){$("#rootIcon").hide()}else{$("#rootIcon").show()}$("#"+cont+"_"+el).fadeIn(500,function(){$("#"+cont+"_"+el+" form").ajaxForm();$("form input.upload").hide()});return false}function showFBContentWithFullAjaxForm(el,cont){par="root";var f=$("div."+cont);for(var i=0;i<f.length;i++){$(f[i]).hide()}if(el=="root"){$("#rootIcon").hide()}else{$("#rootIcon").show()}$("#"+cont+"_"+el).fadeIn(500,function(){$("#"+cont+"_"+el+" form").ajaxForm({beforeSubmit:function(){if(this.url.match(/fb=(.*)/)&&this.url.match(/fb=(.*)/)[1]){par=this.url.match(/fb=(.*)/)[1]}},success:function(responseText){$("div.pgYield").html(responseText);$("input[@type=file]").styleFileInput({image:"/images/buttons/BrowseBtn.png",imageheight:24,imagewidth:80,width:200});$("div#ajax_messages div").notice();if($(".fb").length>0){par=$(".fb").attr("id")}if($("div.fb_content")){showFBContent(par,"fb_content")}do_pagination()}});$("form input.upload").hide()});return false}function showFBCloseAfter(el,cont){par="root";var f=$("div."+cont);for(var i=0;i<f.length;i++){$(f[i]).hide()}if(el=="root"){$("#rootIcon").hide()}else{$("#rootIcon").show()}$("#"+cont+"_"+el).fadeIn(500,function(){$("#"+cont+"_"+el+" form").ajaxForm({success:function(responseText){$(document).trigger("close.facebox")}});$("form input.upload").hide()});return false}function loadFBAccount(el,cont){var f=$("div."+cont);var par="root";for(var i=0;i<f.length;i++){$(f[i]).hide()}if(el=="root"){$("#rootIcon").hide()}else{$("#rootIcon").show()}$("#"+cont+"_"+el).fadeIn(500,function(){$("#"+cont+"_"+el+" form").ajaxForm({beforeSubmit:function(){if(this.url.match(/fb=(.*)/)[1]){par=this.url.match(/fb=(.*)/)[1]}},success:function(responseText){$("div.pgYield").html(responseText);$("input[@type=file]").styleFileInput({image:"/images/buttons/BrowseBtn.png",imageheight:24,imagewidth:80,width:200});$("ul#ajax_messages li").notice();if($("div.fb_content")){if(par=="compose"){showFBContent(par,"fb_content")}else{showFBContentWithFullAjaxForm(par,"fb_content")}}}})});return false}function loadFBContent(el,cont){var f=$("div."+cont);for(var i=0;i<f.length;i++){$(f[i]).hide()}if(el=="root"){$("#rootIcon").hide()}else{$("#rootIcon").show()}$("#"+cont+"_"+el).fadeIn(500,function(){$("#"+cont+"_"+el+" form").ajaxForm({success:function(responseText){$("div.pgYield").html(responseText);$("input[@type=file]").styleFileInput({image:"/images/buttons/BrowseBtn.png",imageheight:24,imagewidth:80,width:200});$("div#ajax_messages").notice();if($("div.fb_content")){showFBContent("root","fb_content")}do_pagination()}})});return false}function reset_progress_form(){if($("div.progressbar")){$("div.progressbar").progressbar("progress",100).fadeOut(500,function(){$("form[@enctype='multipart/form-data']").fadeIn(500,function(){$("input.file").example("Select another file to upload...")})})}}function ajs_click($url){$.ajax({url:$url,dataType:"script",beforeSend:function(){$("#loading").show("fast");$(".pgYield").hide("fast")},complete:function(){$("#loading").hide("fast")},success:function(html){$(".pgYield").show("slow");$(".pgYield").html(html)}});return false}function updatePreviews(img,sel){var scaleX=250/sel.width;var scaleY=250/sel.height;$("#med_thumb img").css({width:Math.round(scaleX*$("#full_image img").get(0).width)+"px",height:Math.round(scaleY*$("#full_image img").get(0).height)+"px",marginLeft:"-"+Math.round(scaleX*sel.x1)+"px",marginTop:"-"+Math.round(scaleY*sel.y1)+"px"})
}function updateForm(sel){$("#thumb_form form input.x_coord").val(sel.x);$("#thumb_form form input.y_coord").val(sel.y);$("#thumb_form form input.crop_width").val(sel.w);$("#thumb_form form input.crop_height").val(sel.h)}(function($){$.fn.styleFileInput=function(options){var settings={width:options.width||250};if(options){$.extend(settings,options)}return this.each(function(){var self=this;var wrapper=$("<div class='file_browse_wrapper'>");var filename=$('<input class="file">').addClass($(self).attr("class")).css({display:"inline-block","float":"left",width:settings.width+"px",padding:"6px 5px 7px"});$(self).before(filename);$(self).wrap(wrapper);$(self).css({position:"relative",height:settings.imageheight+"px",width:settings.width+"px",display:"inline",cursor:"pointer",opacity:"0.0"});if($.browser.mozilla){if(/Win/.test(navigator.platform)){$(self).css("margin-left","-225px")}else{$(self).css("margin-left","-225px")}}else{if($.browser.safari){$(self).css("margin-left","-150px")}else{$(self).css("margin-left",settings.imagewidth+settings.width+"px")}}$("form.fileupload input[@type=submit]").hide();$(self).bind("change",function(){$("input.upload").show();filename.val($(self).val())})})}})(jQuery);function bindMessageAutocomplete(){$("#message_to").liveUpdate("message_search_results").focus()}function fireVideoAddToCanvas(){$("#add_canvas_submit").click()}function deleteMessages(){markAs("delete")}function deleteInboxMessages(){var checked={};var checked_count=0;$(".msg_check").each(function(i){if(this.checked){checked[this.id]="1";checked_count+=1}});if(checked_count==0){return }var post_url=String(window.location).replace(/(\/users\/\d+).*/,"$1/messages/delete");$.ajax({type:"POST",url:post_url,data:checked,success:function(html){$("#fb_content_root").html(html);attach_events();do_pagination()}})}function deleteSentMessages(){var checked={};checked.return_to="sent";var checked_count=0;$(".sent_msg_check").each(function(i){if(this.checked){checked[this.id]="1";checked_count+=1}});if(checked_count==0){return }var post_url=String(window.location).replace(/(\/users\/\d+).*/,"$1/messages/delete");$.ajax({type:"POST",url:post_url,data:checked,success:function(html){$("#fb_content_sent").html(html);attach_events();do_pagination()}})}function deleteCanvasItems(){var checked={};checked.multi="1";var checked_count=0;$(".msg_check").each(function(i){if(this.checked){checked[this.id]="1";checked_count+=1}});if(checked_count==0){return }var post_url=String(window.location).replace(/(\/users\/\d+).*/,"$1/canvas_items/delete");$.ajax({type:"DELETE",url:post_url,data:checked,success:function(html){$("#fb_content_manage").html(html);attach_events();do_pagination()}})}function toggle_checkboxes(){if($(".msg_check:first").is(":checked")){$(".msg_check").each(function(){this.checked=false})}else{$(".msg_check").each(function(){this.checked=true})}$(".check_all").checked=$(".msg_check:first").is(":checked")}function toggle_sent_checkboxes(){if($(".sent_msg_check:first").is(":checked")){$(".sent_msg_check").each(function(){this.checked=false})}else{$(".sent_msg_check").each(function(){this.checked=true})}$(".sent_msg_check").checked=$(".sent_msg_check:first").is(":checked")}function markAsRead(){markAs("mark_read")}function markAsUnRead(){markAs("mark_unread")}function markAs(type){var checked={};var checked_count=0;$(".msg_check").each(function(i){if(this.checked){checked[this.id]="1";checked_count+=1}});if(checked_count==0){return }var post_url=String(window.location).replace(/(\/users\/\d+).*/,"$1/messages/"+type);$.ajax({type:"POST",url:post_url,dataType:"json",data:checked,success:function(html){$("#facebox").html(html);attach_events()},complete:function(){attach_events()}})}function initialize_profile_customizer(){if($("#colorpicker_link").get(0)){color_picker("#colorpicker_background",$("#user_profile_background"),function(){$("body").css("background-color",color)});color_picker("#colorpicker_link",$("#user_profile_link_color"),function(){$("#profile_customization_hook a").css("color",color)
});color_picker("#colorpicker_font",$("#user_profile_font_color"),function(){$("#profile_customization_hook").css("color",color)});$("#user_profile_font_color").next().click(function(){$("#colorpicker_font").toggle();$("#colorpicker_background").hide();$("#colorpicker_link").hide()});$("#user_profile_background").next().click(function(){$("#colorpicker_background").toggle();$("#colorpicker_font").hide();$("#colorpicker_link").hide()});$("#user_profile_link_color").next().click(function(){$("#colorpicker_link").toggle();$("#colorpicker_font").hide();$("#colorpicker_background").hide()})}}function initialize_column_positioning(){$("ul.elements").sortable({items:"> li",handle:"h2.section",placeholder:"active",cursor:"move",connectWith:$("ul.elements"),start:function(e,ui){current=ui.item.parents("ul.elements");ui.helper.css({width:current.css("width")})},change:function(e,ui){current=ui.item.parents("ul.elements");ui.helper.css({width:current.css("width")})},update:function(e,ui){current=ui.item.parents("ul.elements");if(ui.element.get(0).id==current.get(0).id){form=$("form",ui.item);column=current.get(0).id.replace(/^.+_(\d+)$/,"$1");position=0;item=ui.item;do{item=item.prev("li");position++}while(item.get(0));$('input[@name="element[column]"]',form).val(column);$('input[@name="element[position]"]',form).val(position);$.ajax({type:"POST",url:jsonify(form.get(0).action),data:form.formSerialize()+"&trigger="+ui.item.get(0).id,dataType:"json",beforeSend:function(xhr){trigger=ajax_trigger(this.data);trigger.addClass("waiting")},success:function(xhr){},error:function(xhr){trigger=ajax_trigger(this.data);trigger.highlight("#f00",500);show_error(json(xhr.responseText).html)},complete:function(xhr){trigger=ajax_trigger(this.data);trigger.removeClass("waiting")}})}}})}function color_picker(link,field,callback){$.farbtastic(link,function(){color=this.color;field.val(color);field.next().attr("style","background-color:"+color);callback()}).setColor(field.val())}function initialize_overview(){$("#overview .editable").editable();$("#audio_page_description, #video_page_description").example("Description...")}function initialize_discussion(){$("#post_submit").ajax_post(function(json){replace_discussion(json)});$("#topic_submit").ajax_post(function(json){replace_discussion(json)});$("ul#discussion_topics a").jsonify().click(function(){$.getJSON(this.href,function(json){replace_discussion(json)});return false})}function replace_discussion(html){$("#page_discussions").html(html);initialize_discussion();$("input, textarea").activate()}jQuery.fn.replace_discussion=function(el){href=formatify($(el).get(0).id,"tab");$.getJSON(href,function(json){$("#page_discussions").html(html);initialize_discussion();initialize_overview();$("input, textarea").activate()});return false};jQuery.fn.increase_font_size=function(target,value_callback){$(this).click(function(){var currentFontSize=$(target).css("font-size");var currentFontSizeNum=parseFloat(currentFontSize,10);var newFontSize=currentFontSizeNum*1.2;$(target).css("font-size",newFontSize);$(value_callback).val(newFontSize)})};jQuery.fn.canvasable=function(){this.click(function(){form=$(this).parents("form");$.ajax({type:"POST",url:jsonify(form.get(0).action)+"?trigger="+form.get(0).id,data:form.formSerialize(),dataType:"json",success:function(data){show_success(data.success);$("a.logo_normal").fadeOut(100,function(){$("img.logo_effect").fadeIn().animate({opacity:1},100).fadeOut(100,function(){$("a.logo_normal").fadeIn(100)})})},error:function(xhr){trigger=ajax_trigger(this.url);trigger.highlight("#f00",500);show_error(json(xhr.responseText).errors)}});return false});return this};jQuery.fn.decrease_font_size=function(target,value_callback){$(this).click(function(){var currentFontSize=$(target).css("font-size");var currentFontSizeNum=parseFloat(currentFontSize,10);var newFontSize=currentFontSizeNum*0.8;$(target).css("font-size",newFontSize);$(value_callback).val(newFontSize)})};jQuery.fn.audio_playlist=function(){$(this).each(function(i){$(this).flash({src:"/swf/audioplayer.swf?mediaType=audioAlbum&mediaSrc="+formatify(strip_host($("a.tracks",this).get(0).href),"xspf"),width:490,height:392},{expressInstall:true,version:"9"})
});return this};jQuery.fn.video_player=function(){var a=[];var link=$("a",this);for(var i=0;i<link.length;i++){a.push(link[i].href)}if(a[1]==null){a[1]="hide"}$(this).each(function(i){$(this).flash({src:"/swf/mediaplayer.swf",width:660,height:400,flashvars:{mediaType:"video",mediaSrc:a[0],addToCanvas:a[1]}},{expressInstall:true,version:"9"})});return this};function strip_host(url){return url.replace(/^http:\/\/(?:.+?)\/(.+)$/,"/$1")}jQuery.fn.form_action_with_session_key=function(){return this.get(0).action+"?"+SESSION_NAME+"="+$("#session_key").val()};function replace_domain(original,replacement){if(original.match(/^(http|https):\/\/.+$/)){return original.replace(/^(http|https):\/\/.+?\/(.+)$/,replacement+"$2")}else{return replacement+original.replace(/^\/(.*)$/,"$1")}}function uploader_error(uploader,message){$(".upload_status",uploader.customSettings.form).hide();uploader.customSettings.field.show();show_error(message)}jQuery.fn.highlight=function(color,speed){if(undef(speed)){speed=500}this.effect("highlight",{color:color},speed,function(){$(this).attr("style","")})};function undef(object){typeof object=="undefined"}jQuery.fn.activate=function(){this.focus(function(){$(this).addClass("active")});this.blur(function(){$(this).removeClass("active")});return this};jQuery.fn.editable=function(success){if(typeof success=="undefined"){success=function(){trigger=ajax_trigger(this.data);trigger.highlight("#ffff99",500)}}$(this).keypress(function(e){if(e.keyCode==KEY_ENTER){$(this).trigger("change");return false}});$(this).activate();$(this).change(function(){form=$(this).parents("form").get(0);$.ajax({type:"POST",url:jsonify(form.action),data:$(form).formSerialize()+"&trigger="+this.id,dataType:"json",beforeSend:function(xhr){trigger=ajax_trigger(this.data)},success:success,error:function(xhr){trigger=ajax_trigger(this.data);trigger.highlight("#ffff99",500);show_error(json(xhr.responseText).html)},complete:function(xhr){trigger=ajax_trigger(this.data);trigger.removeClass("waiting")}})})};jQuery.fn.ajax_post=function(success){this.click(function(){form=$(this).parents("form");$.ajax({type:"POST",url:jsonify(form.get(0).action),data:form.formSerialize()+"&trigger="+this.id,dataType:"json",beforeSend:function(xhr){trigger=ajax_trigger(this.data);trigger.addClass("waiting")},success:success,error:function(xhr){trigger=ajax_trigger(this.data);trigger.highlight("#f00",500);show_error(json(xhr.responseText).errors)},complete:function(xhr){trigger=ajax_trigger(this.data);trigger.removeClass("waiting")}});return false})};function ajax_trigger(data){return $("#"+data.match(/trigger=(.*)/)[1])}jQuery.fn.notice_unless_empty=function(delay){this.each(function(){if(!$(this).html().match(/^\s+$/)){$(this).notice()}});return this};function rjs_notice(e){$(e).notice_unless_empty()}jQuery.fn.notice=function(delay){if(typeof delay=="undefined"){delay=3000}if(!$(this).text()==""){$(this).slideDown("fast").animate({opacity:1},delay).slideUp("fast",function(){$("div#alertContainer").remove()})}};function show_error(text){show_message("error",text)}function show_notice(text){show_message("notice",text)}function show_success(text){show_message("success",text)}function show_message(klass,text){var messages=$("ul#messages");if(typeof text!="object"){text=[text]}for(var i=0;i<text.length;i++){timestamp=(new Date()).getTime();messages.append('<li id="'+timestamp+'" class="'+klass+'">'+text[i]+"</li>");message=$("#"+timestamp,messages);message.notice()}}function json(data){return eval("("+data+")")}function jsonify(url){return formatify(url,"json")}jQuery.fn.jsonify=function(){this.each(function(){this.href=jsonify(this.href)});return this};function tabify(url){return formatify(url,"tab")}jQuery.fn.tabify=function(){this.each(function(){this.href=tabify(this.href)});return this};function formatify(url,format){return url.replace(/^([^\?#]*)(.*)$/,"$1."+format+"$2")}jQuery.fn.hoverable=function(){this.hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")
});return this};jQuery.fn.clickable=function(){this.mousedown(function(){$(this).addClass("click")}).mouseup(function(){$(this).removeClass("click")}).mouseout(function(){$(this).removeClass("click")});return this};jQuery.fn.clear_on_empty=function(text){if($(this).val()==0){var status=$("#user_status");status.val(text)}$(this).click(function(){$(this).val("")})};var base_ac_options={minChars:1,matchSubset:1,matchContains:1,cacheLength:10};function formatMessageAutocompleteResult(value){return value[0].replace(/<img.*>/,"").replace(/<span.*\/span>/,"")}function removeRecipient(recipient_id){show_notice("Recipient removed");$("#holder-"+recipient_id).empty().remove();return false}function addRecipient(j_recipient,recipient_id,login){$("input#message_to").val("");div="<div id='holder-"+recipient_id+"' class='mail_to'>";div=div+"<input type='hidden' name='recipient-"+recipient_id+"' />";div=div+"<li>"+login+" <a href='#' onClick='removeRecipient("+recipient_id+");'>[X]</a></li>";div=div+"</div>";$("#recipient_list").append(div)}function clearMsgAutoComplete(){$(".search_wrapper").hide()}function handleMessageAutocomplete(j_recipient,recipient_id,login){addRecipient(j_recipient,recipient_id,login);$("#message_search_results").hide();$(".search_wrapper").hide();attach_events()}jQuery.fn.msg_ac=function(url){this.autocomplete(url,$.extend(base_ac_options,{formatMatch:formatMessageAutocompleteResult,formatResult:formatMessageAutocompleteResult}));$("#message_to").result(function(result_event,data,formatted){if($("#recipient_list div").length>10){show_error("At most 10 recipients allowed")}else{try{result=formatted.match(/<span.*>(.*)<\/span>(.*)/);addRecipient($("#recipient_list"),result[1],result[2]);show_notice("Recipient added");$("#message_to").val("")}catch(e){show_error("Error adding recipient")}}})};function setup_image_page(){reset_progress_form();$(".editable").editable;$("#upload_images li .textfield").example("Enter title...");$("a.delete").click(function(){$(this).parent("form").submit()});$("a.confirm").confirm({msg:"Confirm Delete: ",timeout:0,wrapper:'<span class="delete"></span>',separator:"&nbsp; / &nbsp;",dialogShow:"fadeIn",dialogSpeed:"slow"})}jQuery.fn.ac=function(url,extra){if(typeof extra=="undefined"){extra={}}this.autocomplete(url,$.extend(base_ac_options,{extraParams:extra,selectFirst:false,multiple:false})).result(function(event,item){$(event.target).change()})};$(document).ready(function($){$("input#q").autocomplete("/search",{minChars:4,delay:500,highlight:false,scroll:false,width:225,autoFill:false});$("a[rel*=facebox]").facebox();$("a[rel*=new-page]").facebox({closeImage:"/images/rails.png"});$("#banner_image img").Jcrop({addClass:"custom",bgColor:"white",bgOpacity:0.5,cornerHandles:true,sideHandles:false,setSelect:[0,50,800,285],aspectRatio:2.81/1,onChange:updateForm});$("#full_image img").Jcrop({addClass:"custom",bgColor:"white",setSelect:[100,100,350,350],bgOpacity:0.5,aspectRatio:1,onChange:updateForm});$("#messages li").notice();attach_events()});function comment_delete(e){var clicked=false;$("a[id=comment_delete]").hide();$("div[id=comment]").bind("mouseover",function(e){var events=$(this).children("form").children("#comment_delete");if(clicked==false){$(events).show()}$(events).click(function(){clicked=true;events.hide()})});$("div[id=comment]").bind("mouseout",function(e){$(this).children("form").children("#comment_delete").hide()});$("div[id=comment]").bind("mouseleave",function(e){clicked=false})}function make_comment(){$("div[id=comments]").find("form").each(function(){$(this).ajaxForm({target:$(this).parent().parent().parent(),beforeSubmit:validate,success:function(responseText,statusText,form){make_comment(),comment_delete(),attach_delete_link(),$(this).clearForm()}})});function validate(formData,jqForm,options){for(var i=0;i<formData.length;i++){if(!formData[i].value){alert("Please enter a valid comment"+formElement);return false}}}}function attach_delete_link(){$("a.delete").click(function(){$(this).parent("form").submit()
});$("a.confirm").confirm({msg:"Confirm Delete: ",timeout:0,wrapper:'<span class="delete"></span>',separator:"&nbsp; / &nbsp;",dialogShow:"fadeIn",dialogSpeed:"slow"})}function do_pagination(){$("#managePortfolio").pagination({blocks:"#managePortfolio div#page_",prev_link:"#arrows_portfolioManage div.arrows a.page-prev",next_link:"#arrows_portfolioManage div.arrows a.page-next",prev_link_inactive:"#arrows_portfolioManage div.arrows div.page-prev-inactive",next_link_inactive:"#arrows_portfolioManage div.arrows div.page-next-inactive",text:"#arrows_portfolioManage div.text"});$("#publicPortfolio").pagination({blocks:"#publicPortfolio div#page_",prev_link:"#arrows_portfolioManage div.arrows a.page-prev",next_link:"#arrows_portfolioManage div.arrows a.page-next",prev_link_inactive:"#arrows_portfolioManage div.arrows div.page-prev-inactive",next_link_inactive:"#arrows_portfolioManage div.arrows div.page-next-inactive",text:"#arrows_portfolioManage div.text"});$("#request_blocks").pagination({blocks:"#request_blocks div#page_",prev_link:"#networkRequests div.arrows a.page-prev",next_link:"#networkRequests div.arrows a.page-next",prev_link_inactive:"#networkRequests div.arrows div.page-prev-inactive",next_link_inactive:"#networkRequests div.arrows div.page-next-inactive",text:"#networkRequests div.text"});$("#sent_blocks").pagination({blocks:"#sent_blocks div#page_",prev_link:"#networkSent div.arrows a.page-prev",next_link:"#networkSent div.arrows a.page-next",prev_link_inactive:"#networkSent div.arrows div.page-prev-inactive",next_link_inactive:"#networkSent div.arrows div.page-next-inactive",text:"#networkSent div.text"});$("#friendship_blocks").pagination({blocks:"#friendship_blocks div#page_",prev_link:"#networkFriends div.arrows a.page-prev",next_link:"#networkFriends div.arrows a.page-next",prev_link_inactive:"#networkFriends div.arrows div.page-prev-inactive",next_link_inactive:"#networkFriends div.arrows div.page-next-inactive",text:"#networkFriends div.text"});$("#inbox_blocks").pagination({blocks:"#inbox_blocks div#page_",prev_link:"#inboxControls div.arrows a.page-prev",next_link:"#inboxControls div.arrows a.page-next",prev_link_inactive:"#inboxControls div.arrows div.page-prev-inactive",next_link_inactive:"#inboxControls div.arrows div.page-next-inactive",text:"#inboxControls div.text"});$("#outbox_blocks").pagination({blocks:"#outbox_blocks div#page_",prev_link:"#outboxControls div.arrows a.page-prev",next_link:"#outboxControls div.arrows a.page-next",prev_link_inactive:"#outboxControls div.arrows div.page-prev-inactive",next_link_inactive:"#outboxControls div.arrows div.page-next-inactive",text:"#outboxControls div.text"});$("#manage_posts").pagination({blocks:"#manage_posts div#page_",prev_link:"#manageCanvasControls div.arrows a.page-prev",next_link:"#manageCanvasControls div.arrows a.page-next",prev_link_inactive:"#manageCanvasControls div.arrows div.page-prev-inactive",next_link_inactive:"#manageCanvasControls div.arrows div.page-next-inactive",text:"#manageCanvasControls div.text"});$("#canvasItems").pagination({blocks:"#canvas_items div#page_",prev_link:"#canvasControls div.arrows a.page-prev",next_link:"#canvasControls div.arrows a.page-next",prev_link_inactive:"#canvasControls div.arrows div.page-prev-inactive",next_link_inactive:"#canvasControls div.arrows div.page-next-inactive",text:"#canvasControls div.text"});$("#canvasItems_about").pagination({blocks:"#canvas_items div#page_",prev_link:"#canvasControls div.arrows a.page-prev",next_link:"#canvasControls div.arrows a.page-next",prev_link_inactive:"#canvasControls div.arrows div.page-prev-inactive",next_link_inactive:"#canvasControls div.arrows div.page-next-inactive",text:"#canvasControls div.text"})}$(document).bind("afterReveal.facebox",function(){attach_events();if($("#root_box").length){showFBContent($("#root_box").val(),"fb_content")}else{if($("div.fb_content").length){el="root";if($(".fb").length>0){el=$(".fb").attr("id")}if(el=="compose"){showFBContentWithFullAjaxForm(el,"fb_content")
}else{if(el=="account"){showFBCloseAfter(el,"fb_content")}else{showFBContent(el,"fb_content")}}}}do_pagination()});$(".fb_content").bind("focus",function(){alert("fb_content_focus");attach_events()});jQuery.fn.password_fu_check=function(){var password_val=$("#account_password").val();if(password_val!=""){$("#password_fu").hide()}};function attach_events(){$("div#ajax_messages").notice();$("input.submit").hoverable();$(".editable").editable();$(".increase_font").increase_font_size("#profile_customization_hook","#user_profile_font_size");$(".decrease_font").decrease_font_size("#profile_customization_hook","#user_profile_font_size");$("form.add_to_canvas input[@type=submit]").canvasable().hoverable().clickable();$("input, textarea").activate();bindMessageAutocomplete();$("a.delete").click(function(){$(this).parent("form").submit()});$("a.confirm").confirm({msg:"Confirm Delete: ",timeout:0,wrapper:'<span class="delete"></span>',separator:"&nbsp; / &nbsp;",dialogShow:"fadeIn",dialogSpeed:"slow"});$("input.check_all").bind("change",function(){toggle_checkboxes()});$("input.sent_check_all").bind("change",function(){toggle_sent_checkboxes()});$("form#new_user").validate();$("form").validate();if($("#post_create").get(0)){$(".blog_post_canvas a.cancel").click(function(){$("input.textfield, textarea",".blog_post_canvas").val("");$(".blog_post_canvas").fadeOut("slow");return false});$(".blog_post_update").click(function(){$(".blog_post_canvas").fadeIn("slow");$("#post_create").validate()})}$("span[id=edit_post]").click(function(){$(this).parent().parent().siblings(".edit_post_form").fadeIn("slow");$(this).parent().parent().siblings("#post_item").hide("slow");$(this).parent().parent().siblings(".edit_post_form").children("#edit_blog_post").validate()});$("a[id=blog_edit_cancel]").click(function(){$(this).parent().parent().siblings("#post_item").fadeIn("slow");$(this).parent().parent(".edit_post_form").hide("slow");return false});$("input[@type=file]").styleFileInput({image:"/images/buttons/BrowseBtn.png",imageheight:24,imagewidth:80,width:200});$("div.progressbar").progressbar({interval:2000,duration:2000,width:224}).hide();$("div.pscreenshot").progressbar({interval:2000,duration:2000,width:224}).hide();$("div.pbackground").progressbar({interval:2000,duration:2000,width:224}).hide();$("div.pvideo").progressbar({interval:2000,duration:2000,width:224}).hide();if(wcup==true){$("form.fileupload").uploadProgress();$("form.multiupload").uploadProgress({showform:true})}$("#audio_playlist").audio_playlist();$("#video_player").video_player();$("#slideshow").scrollable({items:".images",size:1,speed:200,horizontal:true,prev:"a.prev",next:"a.next"});$("textarea[id=comment_comment]").example("Share your comments");$("input#q").example("Search...");$("input[id=account_login]").example("Email");$("input[@name='track[title]']").example("Enter track title...");$("input.file").example(function(){$("input.upload").hide();$(this).val("Select file to upload...")});$("input.video_upload").example(function(){$("input.upload").hide();$(this).val("Select file to upload...")});$("#upload_images li .textfield").example("Enter title...");$("#user_status").example("Current status...");$("#user_homepage").example("Set your homepage...");$("#user_location").example("Enter your location...");$("#user_profile_inspiration").example("Enter some inspiration...");$("#message_to").example("Enter recipient name here...");$("#user_profile_user_status").example("Status...");$("#email_store_email").example("email");var beta_signup_options={beforeSubmit:beforeSubmit,success:beta_signup_success};$("#feedback_form").submit(function(){$(this).ajaxSubmit({target:".pgYield",success:function(){$("#fb_content_content").hide();$("#fb_content_thanks").show()}})});var compose_options={target:".pgYield",success:function(){$("#fb_content_reply").hide();$("#fb_content_compose").hide();$("#fb_content_sent").hide();$("#fb_content_root").show();attach_events()}};$("#message_submit").bind("click",function(){$("#new_message").ajaxSubmit(compose_options);return false});$("#fb_content_compose form").ajaxForm({success:function(responseText){$("div.pgYield").html(responseText);$("input[@type=file]").styleFileInput({image:"/images/buttons/BrowseBtn.png",imageheight:24,imagewidth:80,width:200});$("ul#ajax_messages li").notice();if($("div.fb_content")){showFBContent("root","fb_content")
}do_pagination()}});$("#alertError, #alertSuccess").notice_unless_empty();$("a#signup").click(function(){$("form#new_user_session").hide();$("form#new_user").show();return false});$("a#login").click(function(){$("form#new_user").hide();$("form#new_user_session").show();return false});$("ul.friends_menu").tabs();$("#mark_read_link").bind("click",markAsRead);$("#mark_unread_link").bind("click",markAsUnRead);$("#inbox_message_delete_link").bind("click",deleteInboxMessages);$("#sent_message_delete_link").bind("click",deleteSentMessages);$("#manage_posts_delete_link").bind("click",deleteCanvasItems);$("#inbox_message_delete_link").confirm();$("#sent_message_delete_link").confirm();$("#inbox_mainbox .msg_check").bind("change",function(){var checked={};var checked_count=0;$("#inbox_mainbox .msg_check").each(function(i){if(this.checked){checked[this.id]="1";checked_count+=1}});if(checked_count==0){$("#inbox_message_delete_link").attr("disabled","disabled")}else{$("#inbox_message_delete_link").removeAttr("disabled")}});$("#sent_mainbox .sent_msg_check").bind("change",function(){var checked={};var checked_count=0;$("#sent_mainbox .sent_msg_check").each(function(i){if(this.checked){checked[this.id]="1";checked_count+=1}});if(checked_count==0){$("#sent_message_delete_link").attr("disabled","disabled")}else{$("#sent_message_delete_link").removeAttr("disabled")}});var reply_options={target:".pgYield",success:function(){$("#fb_content_reply").hide();$("#fb_content_compose").hide();$("#fb_content_sent").hide();attach_events()}};$("#msg_reply_submit").bind("click",function(){$("#reply_form").ajaxSubmit(reply_options);return false});$("#delete_msg_form").ajaxForm({target:".pgYield",success:function(){attach_events();do_pagination();$("#fb_content_reply").hide();$("#fb_content_compose").hide();$("#fb_content_sent").hide()}});$(".message_reply").bind("click",function(){showFBContent("reply","fb_content");$("#Request_mainBox").hide();return false});$(".close_after_sending").bind("click",function(){$(document).trigger("close.facebox");window.location.reload()});$("#cancel_new_message").bind("click",function(){$.ajax({url:"/users/"+$("#user_user_id").val()+"/messages",dataType:"script",beforeSend:function(){$("#loading").show("fast");$(".pgYield").hide("fast")},complete:function(){$("#loading").hide("fast")},success:function(html){$(".pgYield").show("slow");$(".pgYield").html(html);attach_events()}})});if($("#page_overview")){initialize_overview()}if($("#page_discussions")){initialize_discussion()}$("a.rjs").click(function(){$.ajax({url:this.href,dataType:"script",beforeSend:function(){$("#loading").show("fast");$(".pgYield").hide("fast")},complete:function(){$("#loading").hide("fast")},success:function(html){$(".pgYield").show("slow");$(".pgYield").html(html);attach_events();do_pagination()}});return false});$("a.rjs_mailbox").click(function(){$.ajax({url:this.href,dataType:"script",beforeSend:function(){$("#loading").show("fast");$(".pgYield").hide("fast")},complete:function(){$("#loading").hide("fast")},success:function(html){$(".pgYield").show("slow");$(".fb_content_root").html(html)}});return false});$("a.loader").click(function(){$.ajax({url:this.href,selector:this.rel,dataType:"script",beforeSend:function(){$("#loading").show("fast");$(".pgYield").hide("fast")},complete:function(){$("#loading").hide("fast")},success:function(html){$(".pgYield").show("slow");$(this.selector).html(html);attach_events()}});return false});$("#network").click(function(){$(this).children("img").replaceWith("<img src='/images/icons/networkOFF.png' width = '81' id ='net_image' />")});$("#mail").click(function(){$(this).children("img").replaceWith("<img src='/images/icons/mailOFF.png' width = '81' id ='mail_image' />")});$("#password_fu").click(function(){$(this).hide();$("#account_password").focus()});$("#password_fu").password_fu_check();$("#account_password").blur(function(){var state=$(this).val();if(state==""){$("#password_fu").show()}});$("#account_password").focus(function(){$("#password_fu").hide()
});$("#user_pwd_change").show();$("#user_account_update").show();$("#user_profile_submit").show();$("#user_image_submit").show();$("#user_header_image_submit").show();$("#blog_post_submit").show();$("#msg_delete_btn").show();$("#scrollable").scrollable({items:".items",size:3,speed:200,horizontal:true,loop:true,prev:"a.prev",next:"a.next"});$(".title_field").attr("maxlength","100");do_pagination();make_comment();comment_delete();$("#message_to").bind("blur",function(){setTimeout(function(){$(".search_wrapper").hide()},200)})};