$j(document).ready(function(){$j("#about_project .cancel").livequery("click",function(){$j(this).parents(".form-container").slideUp("slow");$j("#project_info .display").slideDown("slow");$j("#project_info .edit").fadeIn();return false;});$j("#project_info .edit").livequery("click",function(){$this=$j(this);$j("#project_info .display").slideUp("slow");$j("#project_info .form-container").load($this.attr("href")+"?format=js",null,function(){$j(this).slideDown("slow");});$this.fadeOut();return false;});$j("#project_info .restore").livequery("click",function(){$this=$j(this);$reload=$this.parents(".reload");var reload_url=$this.attr("href");$reload.find("#about_project").slideUp("slow",function(){$reload.empty();$reload.load(reload_url,null,function(){$j("#about_project").slideDown("slow");});});return false;});});$j(document).ready(function(){$j("#about_user .cancel").livequery("click",function(){$j(this).parents(".form-container").slideUp("slow");$j("#about_user .display").slideDown("slow");$j("#about_user .edit").fadeIn();return false;});$j("#about_user .edit").livequery("click",function(){$this=$j(this);$j("#about_user .display").slideUp("slow");$j("#about_user .form-container").load($this.attr("href")+"?format=js",null,function(){$j(this).slideDown("slow");});$this.fadeOut();return false;});$j("#about_user .restore").livequery("click",function(){$this=$j(this);$reload=$this.parents(".reload");var reload_url=$this.attr("href");$reload.find("#about_user").slideUp("slow",function(){$reload.empty();$reload.load(reload_url,null,function(){$j("#about_user").slideDown("slow");});});return false;});});$j(document).ready(function(){if($j("#hosted_instances_add").notOnPage()){return ;}$j("#hosted_instances_add form").submit(function(){var isSuccess=true;$j("#hosted_instances_add .field").removeClass("withErrors");if($j("#hosted_instances_add #hosted_instance_title").val()==""){isSuccess=false;$j("#hosted_instances_add #hosted_instance_title").parents(".field").addClass("withErrors");}if($j("#hosted_instances_add #hosted_instance_url").val()==""){isSuccess=false;$j("#hosted_instances_add #hosted_instance_url").parents(".field").addClass("withErrors");}if($j("#hosted_instances_add #hosted_instance_antispam").val()==""){isSuccess=false;$j("#hosted_instances_add #hosted_instance_antispam").parents(".field").addClass("withErrors");}if(isSuccess){$j(this).find(".progress").show();return true;}else{return false;}});});$j(document).ready(function(){if($j("#project_grid").notOnPage()){return ;}$j("#project_grid .pagination a").livequery("click",function(){$j("#project_grid").load($j(this).attr("href")+"&ajax=true");return false;});$j.ajaxSetup({beforeSend:function(){$j("#project_grid .note").hide();$j("#project_grid .loading").show();},complete:function(){$j("#project_grid .loading").hide();$j("#project_grid .note").show();}});shortcut.add("LEFT",function(){$j("#project_grid .pagination *:first-child").click();});shortcut.add("RIGHT",function(){$j("#project_grid .pagination *:last-child").click();});$j("#project_grid .pagination *:first-child").attr("title","Shortcut: LEFT ARROW");$j("#project_grid .pagination *:last-child").attr("title","Shortcut: RIGHT ARROW");});$j(document).ready(function(){if($j("#screenshots").notOnPage()){return ;}$j("#screenshots .screenshot").hover(function(){$j(this).find(".delete").show();},function(){$j(this).find(".delete").hide();});$j("#view_slideshow_link").click(function(){if($j(".lightview").onPage()){Lightview.show($j(".lightview").get(0));}return false;});$j("#main_screenshot").click(function(e){e.preventDefault();$findScreen=$j(".lightview[href='"+$j(this).attr("href")+"']");if($findScreen.onPage()){Lightview.show($findScreen.get(0));}});$("screenshots").observe("lightview:opened",function(event){$j(".lv_Data .lv_ChangeDefault").remove();$findScreen=$j(".lightview[href='"+$j(event.target).attr("href")+"']");if($findScreen.onPage()){switchDefault=$findScreen.parents(".screenshot").find(".switch-default .lv_Button").get(0);$j("<li class='lv_ChangeDefault'></li>").append(switchDefault).appendTo(".lv_Data");}});});$j(document).ready(function(){if($j("#screenshots_add").notOnPage()){return ;}$j("#screenshots_add form").submit(function(){$j(this).find(".progress").show();});});$j(document).ready(function(){if($j("#versions_add").notOnPage()){return ;}$j("#versions_add .set-upload").click(function(){$j("#versions_add .attach-link").hide();$j("#versions_add .attach-link input").val("");$j("#versions_add .attach-download").show();return false;});$j("#versions_add .set-link").click(function(){$j("#versions_add .attach-download").hide();$j("#versions_add .attach-download input").val("");$j("#versions_add .attach-link").show();return false;});$j("#versions_add form").submit(function(){var isSuccess=true;$j("#versions_add .field").removeClass("withErrors");if($j("#versions_add #version_title").val()==""){isSuccess=false;$j("#versions_add #version_title").parents(".field").addClass("withErrors");}if(isSuccess){$j(this).find(".progress").show();return true;}else{return false;}});});