function ToggleRegion(A){var A=$(A);if(A.next().length>0){A.parent().toggleClass("closed")}}function ToggleProject(A){$(".leftmenu ul").removeClass("active");var B=$("#project_"+A);B.parent().addClass("active");if(!B.parent().parent().is(":visible")){ToggleRegion(B.parent().parent().parent().children("a").get(0))}}function ShowProject(C){var A=C.id.split("_")[1];var B=document.getElementById("projectsglobe");if(B!=null){B.ShowProject(A)}}function SetInputBehaviour(A){var C=$("#"+A);var B=C.val();C.focus(function(){var D=$(this);if(D.val()==B){D.val("");D.blur(function(){var E=$(this);if(E.val()==""){E.val(B)}})}})}function ToggleCategoryCountry(A){if(A.options[A.selectedIndex].value=="0"){$(".bycountry").hide();$(".bycategory").show()}else{$(".bycategory").hide();$(".bycountry").show()}}function RedirectToMedia(A){var B=A.options[A.selectedIndex].value;if(B.length>0){location.href=B}}function ShowPicture(D){if(!$(D).is(".active")){var E=$(".pager .pages").children("a");var B=E.index(D);var A=$(".mediadetail .back").children();A.hide();$(A.get(B)).show();var C=$(D).parent().parent();ToggleButtons(C,E.length,B)}}function ShowPreviousPicture(D){var A=$(".mediadetail .back").children();var B=A.index($(".mediadetail .back").children(":visible"));if(B>0){A.hide();$(A.get(B-1)).show()}var C=$(D).parent();ToggleButtons(C,A.length,B-1)}function ShowNextPicture(D){var A=$(".mediadetail .back").children();var B=A.index($(".mediadetail .back").children(":visible"));if(B<A.length-1){A.hide();$(A.get(B+1)).show()}var C=$(D).parent();ToggleButtons(C,A.length,B+1)}function ToggleButtons(C,A,B){if(B==0){C.find(".prev").addClass("disabled");C.find(".next").removeClass("disabled")}else{if(B==A-1){C.find(".prev").removeClass("disabled");C.find(".next").addClass("disabled")}else{C.find(".prev").removeClass("disabled");C.find(".next").removeClass("disabled")}}var D=C.find(".pages").children("a");D.removeClass("active");$(D.get(B)).addClass("active")}function InitPictures(){if(window.jQuery){$(function(){$(".mediadetail .back").children(".intro").each(function(B){var A=$(this);var C=Math.floor((312-A.height())/2);A.css("paddingTop",C+"px")});$(".mediadetail .back").children(".picture").each(function(A){var G=$(this);var E=G.find("img");var D=E.css("width");var C=parseInt(D.substr(0,D.length-2),10);var F=E.css("height");var H=parseInt(F.substr(0,F.length-2),10);if(G.parent().height()-H>0){E.css("margin-top",((G.parent().height()-H)/2)+"px")}if(G.parent().width()-C>0){E.css("margin-left",((G.parent().width()-C)/2)+"px")}G.width(G.parent().width());G.height(G.parent().height());var B=G.find(".description");if(B.children("p").length>0){G.hover(function(){B.show()},function(){B.hide()})}})})}}function Ellipsis(C){var A=C.width();var B=C.html();C.html("<span>"+B+"</span>");C=$(C.children("span").get(0));if(C.outerWidth()>A){while(B.length>0&&C.outerWidth()>A){B=B.substr(0,B.length-1);C.html(B+"...")}}}var sProjectMovieHtml="";function showPlayer(A,E,B,C){$(".projectinfo > div").hide("slide",{direction:"left"},1500);$(".rightbar .banners").hide("slide",{direction:"right"},1500);var D={};D={fvMovieUrl:A,fvPictureUrls:E,fvPictureAuthors:B,fvAudioUrl:C};$(".projectmovie").fadeIn(1500,function(){sProjectMovieHtml=$(".projectmovie").html();swfobject.embedSWF("/swf/pageplayer.swf","projectmovie","742","452","9.0.115","/swf/expressInstall.swf",D,{scale:"noscale",wmode:"opaque",allowScriptAccess:"always"},false)})}function closePlayer(){setTimeout("removePlayer()",100)}function removePlayer(){swfobject.removeSWF("projectmovie");$(".projectmovie .movieborder").before(sProjectMovieHtml);$(".projectmovie").fadeOut(2000);$(".rightbar .banners").show("slide",{direction:"right"},1500);$(".projectinfo > div").show("slide",{direction:"left"},1500)}function bannerRedirect(B,A){if(A!=null&&A.length>0){B+=A}location.href=B}function newsLetterBannerRedirect(A,C,B){var D=$.trim($("#"+A).val());if(D.length>0&&D!=C){bannerRedirect(B,"?action=subscribe&email="+D)}}function donateBannerRedirect(B,F,G,C){var E=document.getElementById(F);var A=RequiredFieldValidatorEvaluateIsValid(E);if(A){var D=document.getElementById(G);A=RangeValidatorEvaluateIsValid(D);if(A){bannerRedirect(C,"?amount="+$.trim($("#"+B).val()))}}}function ChangeButton(B,A){Page_ClientValidate("Donate");if(Page_IsValid){$(B).hide();$("#"+A).show()}return Page_IsValid}function toggleInternationalWebsites(B){var A=$(B).parent().find(".dropdown");if(A.is(":visible")){$(B).parent().find(".dropdown").slideUp(200)}else{$(B).parent().find(".dropdown").slideDown(200)}}function hideInternationalWebsites(A){$(oButton).parent().find(".dropdown").slideUp(200)}function toggleTellAFriend(B){if(window.jQuery){var A=$(".tellafriend");if(A.is(":visible")){closeTellAFriend()}else{A.show();var B=$(B);A.css("top",(B.position().top+16)+"px");A.css("left",(B.position().left-238)+"px")}}}function closeTellAFriend(){if(window.jQuery){showTellAFriendForm(true);$(".tellafriend").hide()}}function showTellAFriendForm(A){if(A){$(".tellafriend input:text, .tellafriend textarea").val("")}$(".tellafriend .form").show();$(".tellafriend .sent").hide()}function adjustHeight(){var B=$(".leftbar").height();var A=$(".main").height();if(B>A){$(".main").height(B)}else{$(".leftbar").height(A)}}jQuery(document).ready(function(){if($(".continentContainer").length>0){$(".continentContainer").append($(".projectinfo"))}})