var currentPhotoIndexShowing=1;var adFailedToLoad=false;function onLoad(){setNavBtns();setTimeout(function(){initAnalytics()},2000)}function initAnalytics(){if(googleAnalyticsEnabled){var A=document.createElement("script");A.src="http://www.google-analytics.com/ga.js";document.getElementsByTagName("head")[0].appendChild(A);setTimeout(function(){if(typeof _gat==="object"){pageTracker=_gat._getTracker("UA-561578-1");pageTracker._trackPageview()}else{setTimeout(function(){if(typeof _gat==="object"){pageTracker=_gat._getTracker("UA-561578-1");pageTracker._trackPageview()}},5000)}},2000)}}function setNavBtns(){var A=document.getElementById("signupDomId");if(getRadiusWin()){A.style.display="none"}else{var B=(radiusIMTranslations.classes.joinNow||"profileJoinNowBtn_en");document.getElementById("signupBtnDomId").className="profileJoinNowBtn "+B;A.style.display=""}}function runRadiusMethod(B,A,C){var D=getRadiusWin();if(D){A(D);if(C==undefined||!C){D.radius.focusWindow(document.getElementById("focusErrorMsgDomId"))}}else{openNewRadiusWin(B,USERNAME)}}function getRadiusWin(){var A=null;try{if(window.opener.radius.loginedUsername){A=window.opener}}catch(B){}try{if(window.newRadiusWin.radius.loginedUsername){A=window.newRadiusWin}}catch(B){}return A}function sendMsg(){runRadiusMethod("sendmsg",function(A){A.radius.profileIM(USERNAME)})}function addFriend(){runRadiusMethod("addfriend",function(A){A.radius.profileAdd(USERNAME)})}function showOnMap(){runRadiusMethod("showonmap",function(A){A.radius.profileShowOnMap(lat,lng)})}function sendGift(){runRadiusMethod("sendgift",function(A){A.radius.windows.getGiftShopWindow().open({username:USERNAME})})}function reportAbuse(){var A=(radiusIMTranslations.reportAbuse||"report abuse")+"?";if(window.confirm(A)){document.getElementById("reportAbusivePhotos").style.display="none";document.getElementById("reportAbusivePhotosSent").style.display="";runRadiusMethod("reportabuse",function(B){B.radius.profileAbuse(USERNAME)},true)}}function openNewRadiusWin(B,A){if(B){window.newRadiusWin=window.open("/?"+B+"="+A,"radiusIM")}else{window.newRadiusWin=window.open("/","radiusIM")}}function friendClick(A){window.location="/profiles/"+A}function setLanguage(B,A){setCookie("lang",B,365);window.location=window.location}function setCookie(E,D,C){var B=new Date();var A=new Date();A.setTime(B.getTime()+3600000*24*C);document.cookie=E+"="+escape(D)+";path=/;expires="+A.toGMTString()}function showLargePhotoOverlay(F,A){showNextPrevBtns();setShadeHeight();hideAds();if(A!=undefined){var C=A}else{var D=document.getElementById("largePhotoImg");var C=D.src}if(C!=undefined&&C!=null){var E=document.getElementById("largePhotoOverlayImg");if(F!=undefined&&F){E.style.width="50%";var B=C.replace("_242.",".");B=B.replace("_96.",".");B=B.replace("_49.",".");B=B.replace("_48.",".");B=B.replace("_640.",".");E.onerror=""}else{var B=C.replace("_242.","_640.");B=B.replace("_96.","_640.");B=B.replace("_48.","_640.");B=B.replace("_49.","_640.");E.onerror=onLargeImgError}var G=function(){document.getElementById("largePhotoOverlayShade").style.filter="alpha(opacity=80)"};$("#largePhotoOverlayShade").fadeIn(300,G);document.getElementById("largePhotoOverlay").style.display="";E.src=B}}function hideLargePhotoOverlay(){document.getElementById("largePhotoOverlayImg").src="http://s2-s3cdn.radiusim.com/hudson-PATCH-0.86.002/images/loading_fp.gif";document.getElementById("largePhotoOverlay").style.display="none";document.getElementById("largePhotoOverlayShade").style.display="none";document.getElementById("largePhotoOverlayImg").style.width="";showAds()}function onLargeImgError(B){var A=document.getElementById("largePhotoOverlayImg");A.onerror=null;showLargePhotoOverlay(true,A.src)}function setShadeHeight(){var B=document.documentElement;var A=document.getElementById("largePhotoOverlayShade");var D=B.scrollHeight;if(D==0){var C="100%"}else{var C=D+"px"}A.style.height=C}function iconClick(D,A,B,E){var C=document.getElementById("largePhotoImg");C.src=D.src.replace(A+".jpg",B+".jpg");showLargePhotoOverlay();currentPhotoIndexShowing=E}function movePhoto(C){var B=currentPhotoIndexShowing;if(B==photosLength&&C==1){var A=1}else{if(B==1&&C==-1){var A=photosLength}else{var A=B+1*C}}if(currentPhotoIndexShowing!=A){currentPhotoIndexShowing=A;var D=document.getElementById("thumb"+A).src;setTimeout(function(){showLargePhotoOverlay(false,D)},10)}return false}function showNextPrevBtns(){if(photosLength>1){var A=""}else{var A="none"}document.getElementById("prevBtn").style.display=A;document.getElementById("nextBtn").style.display=A}function largeDefPhotoClick(){showLargePhotoOverlay()}function hideAds(){if(adsEnabled&&!adFailedToLoad){document.getElementById("adContainer").style.visibility="hidden"}}function showAds(){if(adsEnabled&&!adFailedToLoad){document.getElementById("adContainer").style.visibility="visible"}}function stopPropAndPreventDef(A){if(A){if(A.stopPropagation){A.stopPropagation()}A.cancelBubble=true;A.returnValue=false;if(A.preventDefault){A.preventDefault()}}};