var hideOnLoad=false;var isFriend="";var keyUserId="";var sidinfo="";var viewUserId="";var isIE=false;var showBlogCommentsThread=-1;var accordionTime=0.7;function pageInit(c,a){try{checkBrowser();initLoading();if($("myT"+c)!=null){if(hideOnLoad){showContents("myT"+c)}}else{if(hideOnLoad){showContents("myTAbout")}}if($("editAbout")!=null){hideDiv("editAbout")}$("postNewComment").hide();loadBlogCommentTemplate();initBlog(c);initPhoto(c);initVideo(c);initFavs();if(a!="null"){showBlogCommentsThread=a;if(hideOnLoad){showContents("myTBlog")}}if(!hideOnLoad){isFirstBlogPage=true;loadblogPage(1);isFirstCommentPage=true;loadcommentPage(1)}}catch(b){alert(b)}}function scrollToElement(b){var c=$(b);var d=c.parentNode;while(d.className!="mytsection"&&d!=null){d=d.parentNode}d.scrollTo(0,0);c.style.position="relative";
var a=c.offsetTop;scroll(0,a)}function checkBrowser(){isIE=Prototype.Browser.IE}function findTagId(c,g){var f=null;var a=c.getElementsByTagName("*");var d="";for(var b=0;b<a.length;b++){d+=a[b].id+"\n";if(a[b].id==g){f=a[b]}}return f}function fd(a,d){var b="";try{b=a.getElementsByTagName(d)[0].firstChild.data}catch(c){}return b}function sectionSwitchPre(a){if(a=="myTBlog"){isFirstBlogPage=true;loadblogPage(1)}else{if(a=="myTComments"){isFirstCommentPage=true;loadcommentPage(1)}else{if(a=="myTFriendsFull"){}}}}function showContents(f){sectionSwitchPre(f);try{var c=document.getElementsByTagName("div");for(var b=0;b<c.length;b++){if(c[b].id.indexOf("myT")==0&&c[b].id!=f){if(!c[b].blindState||c[b].blindState=="down"){new Effect.BlindUp(c[b],{duration:accordionTime});c[b].blindState="up"}}}var a=$(f);if(a.blindState=="up"){new Effect.BlindDown(a,{duration:accordionTime});
a.blindState="down"}}catch(d){alert(d)}}function fixIE(b){var a=$(b);a.hide();a.show()}function toggleMainSection(b){var a=$(b);if(!a.blindState||a.blindState=="down"){new Effect.BlindUp(a,{duration:accordionTime});a.blindState="up"}else{sectionSwitchPre(b);new Effect.BlindDown(a,{duration:accordionTime});a.blindState="down"}}var topY=0;function initLoading(){var c=$("mainTopPosition");var a=$("loadingDiv");a.style.position="absolute";$("loadingDiv").show();var b=(c.offsetWidth/2)-(a.offsetWidth/2);topY=c.offsetTop;new Effect.MoveBy("loadingDiv",0,b,{duration:0});$("loadingDiv").hide()}function shL(){if(window.scrollY>topY){$("fixedLoadingDiv").show()}$("loadingDiv").show()}function hiL(){$("loadingDiv").hide();$("fixedLoadingDiv").hide()}function storeAbout(){var c=$F("aboutText");var b=function(h){try{var d=h.responseXML;
var f=d.getElementsByTagName("renderedText")[0].firstChild.data;$("aboutTextHolder").innerHTML=unescape(f);hiL()}catch(g){alert(g)}};var a=new Ajax.Request("/mytStoreAbout.do"+sidinfo,{method:"post",postBody:"uid="+viewUserId+"&about="+c,onComplete:b});shL()}function initBlog(a){if(a==="Blog"){if(window.location.hash==="#post"){postNewBlog()}else{if(window.location.hash.match(/#\d+/)){window.setTimeout("showBlogHash()",1000)}}}}function showBlogHash(){if(!loadedFirstBlogPage){window.setTimeout("showBlogHash()",1000)}else{$("blogEntry-"+window.location.hash.substring(1)).scrollTo()}}var curBlogPage=1;var npags=0;var ncpags=0;var loadedFirstBlogPage=false;function renderBlogPager(a,b){npags=a;renderPager(a,b,"blog")}function renderPager(g,n,o){try{var m=" | ";var c=$(o+"Pager");var k="";var b=7;var h=7;
if(n<1){n=1}var a=true;var f=true;if(n==1){a=false}if(n>=g){f=false}if(a){k+=rbpl(1,"First",o)+m;k+=rbpl(n-1,"Previous",o)+m}var j=n-b;if(j<1){j=1}for(;j<n;j++){k+=rbpl(j,j,o)+m}k+="<b>"+n+"</b>";j=n+1;for(;j<(n+h)&&j<=g;j++){k+=m+rbpl(j,j,o)}if(f){k+=m+rbpl(n+1,"Next",o);k+=m+rbpl(g,"Last",o)}c.innerHTML="<center>"+k+"</center>"}catch(l){alert("renderPager: "+l)}}function rbpl(b,a,c){return'<a href="javascript:load'+c+"Page("+b+');">'+a+"</a>"}var isFirstBlogPage=true;var cbtrack=0;function loadblogPage(f){try{var d=function(t){try{curBlogPage=f;var q=t.responseXML;var C=q.getElementsByTagName("blogEntry");var l="";for(var u=0;u<C.length;u++){var k=document.createElement("div");k.innerHTML=$("blogFormatDiv").innerHTML;var B=C[u];var s=B.getAttribute("id");var w=fd(B,"topicId");var v=formatDateTime(fd(B,"postYear"),fd(B,"postMonth"),fd(B,"postDay"),fd(B,"postHour"),fd(B,"postMinute"),"MONTH/DAY/YEAR at HOUR:MINUTEAPM");
findTagId(k,"blogEntry-0").id="blogEntry-"+s;findTagId(k,"blogComments-0").id="blogComments-"+s;findTagId(k,"title").innerHTML=fd(B,"title");findTagId(k,"postDate").innerHTML="posted "+v;findTagId(k,"body").innerHTML=fd(B,"body");findTagId(k,"entryAnchor").name=s;findTagId(k,"entryAnchor").id="entryAnchor-"+s;var p=findTagId(k,"cmts");var A=fd(B,"commentSize");if(A>0){var h=findTagId(p,"commentsLink");h.href="javascript:loadBlogComments("+w+");";h.innerHTML=A+" Comments"}else{p.innerHTML="0 Comments"}var y=findTagId(k,"alcom");if(fd(B,"commentAllow")=="true"){var n=findTagId(y,"pclll");n.href="javascript:postBlogComment("+w+");"}else{y.parentNode.removeChild(y)}var r=findTagId(k,"aled");if(fd(B,"edAllow")=="true"){findTagId(r,"eclll").href="javascript:editBlogEntry("+s+");";findTagId(r,"dclll").href="javascript:deleteBlogEntry("+s+");"
}else{r.parentNode.removeChild(r)}l+=k.innerHTML}$("mainBlogArea").innerHTML=l;renderBlogPager(npags,f);var j=window.location.href;if(j.indexOf("#")>0&&window.location.hash.match(/blog-\d+/)){try{var m=j.substring(j.indexOf("#"));if(m.indexOf("#blog-")==0){var s=m.substring(6);if($("entryAnchor-"+s)==null){if((f+1)<=npags){loadblogPage(f+1)}}else{scrollToElement("entryAnchor-"+s)}}}catch(z){}}else{if(!isFirstBlogPage){window.scrollTo(0,0);$("myTBlog").scrollTo()}else{isFirstBlogPage=false}}if(showBlogCommentsThread>-1){if($("entryAnchor-"+showBlogCommentsThread)==null){if((f+1)<=npags){loadblogPage(f+1)}}else{loadBlogComments(showBlogCommentsThread);showBlogCommentsThread=-1}}loadedFirstBlogPage=true;hiL()}catch(z){alert(z)}};var b=25;var c=(b*(f-1));var a=new Ajax.Request("/getBlogPage.do"+sidinfo+"?uid="+viewUserId+"&begin="+c+"&num="+b,{onComplete:d});
shL()}catch(g){alert(g)}}function loadBlogComments(d,a){var c=function(t){try{var q=t.responseXML;var y=$("blogComments-"+d);var k="";var h=q.getElementsByTagName("comment");for(var u=0;u<h.length;u++){var j=document.createElement("div");j.innerHTML=blogCommentTpl;var w=formatDateTime(fd(h[u],"postYear"),fd(h[u],"postMonth"),fd(h[u],"postDay"),fd(h[u],"postHour"),fd(h[u],"postMinute"),"MONTH/DAY/YEAR<br>HOUR:MINUTEAPM");var A=h[u].getAttribute("id");findTagId(j,"title").innerHTML=fd(h[u],"title");var l='<a href="/myTNation.do'+sidinfo+"?id="+fd(h[u],"authorId")+'">'+fd(h[u],"authorName")+"</a>";l+="<br/>"+w;findTagId(j,"replier").innerHTML=l;var v=fd(h[u],"avatarImg");if(v!="/avatar_images/null"){findTagId(j,"avatarImage").innerHTML='<img src="'+v+'" '+fd(h[u],"avatarSize")+" />"}findTagId(j,"body").innerHTML=unescape(fd(h[u],"body"));
findTagId(j,"blogEntryTemplate").id="blogEntry-"+A;findTagId(j,"bCommentAnchor").name=A;findTagId(j,"bCommentAnchor").id="bCommentAnchor-"+A;var r=findTagId(j,"delEntryP");var f=r.innerHTML;r.innerHTML="";if(fd(h[u],"allowDel")=="true"){r.innerHTML=f;var p=findTagId(j,"editDelete");var m=p.innerHTML;p.innerHTML="";if(fd(h[u],"allowED")=="true"){p.innerHTML=m;findTagId(r,"editLink").href="javascript:editBlogEntry("+A+");"}findTagId(r,"deleteLink").href="javascript:deleteBlogEntry("+A+");"}k+=j.innerHTML}y.innerHTML=k+"<p>"+((isFriend=="true")?'<a href="javascript:postBlogComment('+d+');">Post Comment</a></p>':"")+'<p><a href="javascript:showAllBlogs();">Return to Blogs</a></p>';showOnlyBlog(d);$(y.id).show();var g=window.location.href;if(g.indexOf("#")>0){try{var n=g.substring(g.indexOf("#"));if(n.indexOf("#bcom-")==0){var s=n.substring(6);
scrollToElement("bCommentAnchor-"+s)}}catch(z){}}else{scroll(0,topY)}hiL();if(a){postBlogCommentReal(d)}}catch(z){alert(z)}};var b=new Ajax.Request("/getBlogComments.do"+sidinfo+"?threadId="+d,{onComplete:c});shL()}var blogCommentTpl="";function loadBlogCommentTemplate(){blogCommentTpl=$("blogCommentTemplate").innerHTML}function postNewBlog(){$("blogId").value="-1";$("blogTitle").value="";$("blogMode").value="new";$("blogBody").value="";$("postNewBlog").show();$("blogSubmit").focus();$("blogBody").focus();$("blogTitle").focus()}function postBlogComment(a){loadBlogComments(a,true)}function postBlogCommentReal(a){var b=$("blogEntry-"+a).getElementsByTagName("h2")[0].firstChild.data;$("blogId").value=a;$("blogTitle").value="Re: "+b;$("blogBody").value="";$("blogMode").value="comment";$("postNewBlog").show();
$("blogSubmit").focus();$("blogBody").focus()}function editBlogEntry(c){var b=function(g){try{var d=g.responseXML;$("blogId").value=c;$("blogTitle").value=fd(d,"title");$("blogBody").value=unescape(fd(d,"body"));$("blogMode").value="edit";$("postNewBlog").show();$("blogSubmit").focus();$("blogBody").focus();hiL()}catch(f){alert(f)}};var a=new Ajax.Request("/getBlogEntry.do"+sidinfo+"?id="+c,{onComplete:b});shL()}function deleteBlogEntry(c){var b=function(g){try{var d=fd(g.responseXML,"success");hiL();if(d=="true"){$("blogEntry-"+c).hide()}else{alert("error storing blog!")}}catch(f){alert(f)}};var a=new Ajax.Request("/blogDelete.do"+sidinfo,{onComplete:b,method:"post",postBody:"id="+c});shL()}function submitBlog(){var g=$F("blogId");var f=$F("blogTitle");var a=$F("blogBody");var d=$F("blogMode");var e="";
if(f==""){e+="You must include a title\n"}if(a==""){e+="You must include a body\n"}if(e.length>0){alert(e);return}$("postNewBlog").hide();var c=function(k){try{var h=fd(k.responseXML,"success");hiL();if(h=="true"){var j="/myTNation.do"+sidinfo+"?id="+viewUserId+"&section=Blog";if(d=="comment"){loadBlogComments(g)}else{loadblogPage(curBlogPage);scroll(0,topY)}}else{alert("error storing blog!")}}catch(i){alert(i)}};var b=new Ajax.Request("/blogSubmitNew.do"+sidinfo,{onComplete:c,method:"post",postBody:"id="+g+"&mode="+d+"&title="+escape(f)+"&body="+escape(a)})}function showOnlyBlog(f){try{var a=$("mainBlogArea");var d=a.firstChild;while(d!=null){if(d.id!=null&&d.id.indexOf("blogEntry-")==0){$(d.id).hide()}d=d.nextSibling}$("blogEntry-"+f).show();$("blogPager").hide();$("blogsLink").href="javascript:showContents('myTBlog');showAllBlogs();"
}catch(b){alert(b)}}function showAllBlogs(){try{var b=$("mainBlogArea");var a=b.getElementsByTagName("div");for(var d=0;d<a.length;d++){if(a[d].id!=null&&a[d].id.indexOf("blogComments-")==0){$(a[d].id).hide()}}$("postNewBlog").hide();var g=b.firstChild;while(g!=null){if(g.id!=null&&g.id.indexOf("blogEntry-")==0){$(g.id).show()}g=g.nextSibling}$("blogsLink").href="javascript:showContents('myTBlog');";$("blogPager").show();scroll(0,0)}catch(f){alert(f)}}var curCommentPage=1;function renderCommentPager(a,b){ncpags=a;renderPager(a,b,"comment")}var isFirstCommentPage=true;function loadcommentPage(f){try{$("postNewComment").hide();var d=function(l){try{curCommentPage=f;var z=l.responseXML;var s=z.getElementsByTagName("comment");var A="";for(var r=0;r<s.length;r++){var u=document.createElement("div");u.innerHTML=$("commentTemplate").innerHTML;
var w=s[r];var k=w.getAttribute("id");findTagId(u,"mytcomment-0").id="mytcomment-"+k;findTagId(u,"title").innerHTML=fd(w,"title");var y=findTagId(u,"posterLink");y.href="/myTNation.do"+sidinfo+"?id="+fd(w,"authorId");y.innerHTML=fd(w,"authorName");var q=formatDateTime(fd(w,"postYear"),fd(w,"postMonth"),fd(w,"postDay"),fd(w,"postHour"),fd(w,"postMinute"),"MONTH/DAY/YEAR at HOUR:MINUTEAPM");findTagId(u,"postDate").innerHTML=q;findTagId(u,"commentAnchor").name=k;findTagId(u,"commentAnchor").id="commentAnchor-"+k;var m=fd(w,"avatar");if(m!=null&&m!=""){findTagId(u,"avImg").innerHTML=m}else{var j=findTagId(u,"avatar");j.parentNode.removeChild(j)}findTagId(u,"body").innerHTML=fd(w,"body");var h=findTagId(u,"edSpan");if(fd(w,"delAllow")=="true"){findTagId(u,"eddlll").href="javascript:deleteComment("+k+");";
var n=findTagId(h,"edit");if(fd(w,"edAllow")=="true"){findTagId(n,"edilll").href="javascript:editComment("+k+");"}else{n.parentNode.removeChild(n)}}else{h.parentNode.removeChild(h)}A+=u.innerHTML}$("mainComments").innerHTML=A;renderCommentPager(ncpags,f);var t=window.location.href;if(t.indexOf("#")>0&&window.location.hash.match(/comm-\d+/)){try{var p=t.substring(t.indexOf("#"));if(p.indexOf("#comm-")==0){var k=p.substring(6);scrollToElement("commentAnchor-"+k)}}catch(v){}}else{if(!isFirstCommentPage){$("myTComments").scrollTo()}else{isFirstCommentPage=false}}hiL()}catch(v){alert(v)}};var b=25;var c=(b*(f-1));var a=new Ajax.Request("/getCommentPage.do"+sidinfo+"?uid="+viewUserId+"&begin="+c+"&num="+b,{onComplete:d});shL()}catch(g){alert(g)}}function postNewComment(){$("commentId").value=-1;$("commentTitle").value="";
$("commentBody").value="";$("commentMode").value="new";$("postNewComment").show();$("commentSubmit").focus();$("commentBody").focus();$("commentTitle").focus()}function editComment(c){var b=function(g){try{var d=g.responseXML;$("commentId").value=c;$("commentTitle").value=fd(d,"title");$("commentBody").value=unescape(fd(d,"body"));$("commentMode").value="edit";$("postNewComment").show();$("commentSubmit").focus();$("commentBody").focus();hiL()}catch(f){alert(f)}};var a=new Ajax.Request("/getMyTComment.do"+sidinfo+"?id="+c,{onComplete:b});shL()}function deleteComment(c){var b=function(g){try{var d=fd(g.responseXML,"success");hiL();if(d=="true"){$("mytcomment-"+c).hide()}else{alert("error deleting comment!")}}catch(f){alert(f)}};var a=new Ajax.Request("/myTCommentDelete.do"+sidinfo,{onComplete:b,method:"post",postBody:"id="+c});
shL()}function postComment(){var d=$F("commentMode");var h=$F("commentId");var g=$F("commentTitle");var a=$F("commentBody");var f=viewUserId;var e="";if(g==""){e+="You must include a title\n"}if(a==""){e+="You must include a body\n"}if(e.length>0){alert(e);return}var c=function(k){try{var i=fd(k.responseXML,"success");hiL();if(i=="true"){loadcommentPage(curCommentPage)}else{alert("error storing comment!")}}catch(j){alert(j)}};var b=new Ajax.Request("/myTCommentSubmit.do"+sidinfo,{onComplete:c,method:"post",postBody:"id="+h+"&aboutId="+f+"&mode="+d+"&title="+escape(g)+"&body="+escape(a)});shL()}var sortActive=false;function initSort(){var k=function(n){try{var i=Sortable.serialize(n);i="uid="+viewUserId+"&"+i;var l=new Ajax.Request("/sortFriends.do"+sidinfo,{method:"post",postBody:i})}catch(m){alert(m)
}};try{var f=$("friendsList").getElementsByTagName("a");for(var d=0;d<f.length;d++){if(f[d].id=="friendLink"){var j=f[d].parentNode;var b=j.id;var a=f[d].childNodes;while(a.length>0){var g=a[0];f[d].removeChild(g);j.appendChild(g);a=f[d].childNodes}var c=$F("friendName-"+b);var h=document.createElement("a");h.href="javascript:removeFriend("+b+',"'+c+'");';h.id="friendremove-"+b;h.innerHTML="Remove";j.parentNode.appendChild(h);f[d].parentNode.removeChild(f[d])}}}catch(g){alert(g)}Sortable.create("friendsList",{overlap:"horizontal",ghosting:false,constraint:false,onUpdate:k});sortActive=true;$("sortToggleLink").firstChild.data="Save Friends"}function stopSort(){try{var a=$("friendsList").getElementsByTagName("span");for(var c=0;c<a.length;c++){var b=document.createElement("a");var h=a[c].id;b.href="/myTNation.do"+sidinfo+"?id="+h;
b.id="friendLink";var d=a[c].childNodes;while(d.length>0){var f=d[0];a[c].removeChild(f);b.appendChild(f);d=a[c].childNodes}a[c].appendChild(b);var g=$("friendremove-"+h);while(g!=null){g.parentNode.removeChild(g);g=$("friendremove-"+h)}}}catch(f){alert(f)}sortActive=false;Sortable.destroy("friendsList");$("sortToggleLink").firstChild.data="Sort Friends"}function toggleSort(){if(sortActive){stopSort()}else{initSort()}}function removeFriend(c,d){var b=function(j){try{var g=j.responseXML;if(fd(g,"success")=="true"){var f=$("friend_"+c);if(f!=null){f.parentNode.removeChild(f)}var h=$("shortFriend_"+c);if(h!=null){h.parentNode.removeChild(h)}}hiL()}catch(i){alert(i)}};if(confirm("Are you sure you want to remove "+d+"?")){var a=new Ajax.Request("/removeFriend.do"+sidinfo,{onComplete:b,method:"post",postBody:"id="+c})
}shL()}function sendPM(c){var b=c.elements.subject;var d=c.elements.message;var a="";if(b.value=="Subject"||b.value==""){a+="You must include a Subject.\n"}if(d.value=="Message"||d.value==""){a+="You must include a Message.\n"}if(a.length>0){alert(a);return false}c.submit()}function sendEmail(c){var b=c.elements.subject;var d=c.elements.message;var a="";if(b.value=="Subject"||b.value==""){a+="You must include a Subject.\n"}if(d.value=="Message"||d.value==""){a+="You must include a Message.\n"}if(a.length>0){alert(a);return false}c.submit()}function initVideo(a){$("myTVideos").show();$("fullSizeVideo").hide();if(a!="Videos"){if(hideOnLoad){$("myTVideos").hide()}}else{if(window.location.hash==="#upload"){showDiv("uploadVideoForm");setTimeout("$('uploadVideoForm').scrollTo()",2000)}else{if(window.location.hash.match(/#\d+/)){window.setTimeout("showVideoHash()",1000)
}}}}function showVideoHash(){showVideo(window.location.hash.substring(1));$("myTVideos").scrollTo()}function showVideo(f){var c=$F("fullVideoWidth-"+f);var e=$F("fullVideoHeight-"+f);var a=$F("fullVideoFile-"+f);$("fvid").innerHTML=f;var d='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+c+'" height="'+e+'" id="FLVPlayer">';d+='<param name="movie" value="FLVPlayer_Progressive.swf" />';d+='<param name="salign" value="lt" />';d+='<param name="quality" value="high" />';d+='<param name="scale" value="noscale" />';d+='<param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_2&streamName='+a+'&autoPlay=false&autoRewind=false" />';d+='<embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_2&streamName='+a+'&autoPlay=false&autoRewind=false" quality="high" scale="noscale" width="'+c+'" height="'+e+'" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
d+="</embed>";d+="</object>";$("fullVideoLink").innerHTML=d;if($("fullVideoCaption-"+f).firstChild!=null){$("fullVideoCaption").firstChild.data=$("fullVideoCaption-"+f).firstChild.data;$("ephCaption").value=$("fullVideoCaption-"+f).firstChild.data}else{$("fullVideoCaption").firstChild.data="";$("ephCaption").value=""}$("fullVideoId").value=f;var b=function(g){if(isIE){setTimeout("fixIE('myTVideos')",10)}};Effect.toggle("videoThumbSet","blind",{duration:0.5,queue:"front"});Effect.toggle("fullSizeVideo","blind",{duration:0.5,queue:"end",afterFinish:b})}function hideVideo(){Effect.toggle("fullSizeVideo","blind",{duration:0.5,queue:"front"});Effect.toggle("videoThumbSet","blind",{duration:0.5,queue:"end"});$("fullVideoEdit").hide()}function showEditVideo(){$("fullVideoEdit").show()}function editVideo(){var b=$F("evidCaption");
var d=$F("fullVideoId");var c=function(g){try{$("fullVideoCaption").innerHTML=b;$("fullVideoCaption-"+d).innerHTML=b;hiL()}catch(f){alert(f)}};var a=new Ajax.Request("/editMyTVideo.do"+sidinfo,{onComplete:c,method:"post",postBody:"id="+d+"&caption="+escape(b)});shL()}function deleteVideo(){if(confirm("Are you sure you want to delete this video?")){var c=$F("fullVideoId");var b=$("videoLi-"+c);b.parentNode.removeChild(b);hideVideo();var a=new Ajax.Request("/deleteMyTVideo.do"+sidinfo,{method:"post",postBody:"id="+c})}}function uploadVideo(a){if(a.form.elements.caption.value==""){alert("You must include a caption.")}else{a.value="Uploading...";a.disabled=true;a.form.submit()}}function uploadPhoto(a){if(a.form.elements.caption.value==""){alert("You must include a caption.")}else{a.value="Uploading...";a.disabled=true;
a.form.submit()}}function initPhoto(a){$("myTPhotos").show();$("fullSizePhoto").hide();if(a!="Photos"){if(hideOnLoad){$("myTPhotos").hide()}}else{if(window.location.hash==="#upload"){showDiv("uploadPhotoForm");setTimeout("$('uploadPhotoForm').scrollTo()",2000)}else{if(window.location.hash.match(/#\d+/)){setTimeout("showPhotoHash()",1000)}}}}function showPhotoHash(){showPhoto(window.location.hash.substring(1));$("myTPhotos").scrollTo()}function showPhoto(c){var b=$("fullPhotoImg");b.height=$F("fullPhotoHeight-"+c);b.width=$F("fullPhotoWidth-"+c);b.src=$F("fullPhotoFile-"+c);$("fpid").innerHTML=c;if($("fullPhotoCaption-"+c).firstChild!=null){$("fullPhotoCaption").firstChild.data=$("fullPhotoCaption-"+c).firstChild.data;$("ephCaption").value=$("fullPhotoCaption-"+c).firstChild.data}else{$("fullPhotoCaption").firstChild.data="";
$("ephCaption").value=""}$("fullPhotoId").value=c;var a=function(d){if(isIE){setTimeout("fixIE('myTPhotos')",10)}$("myTPhotos").scrollTo()};Effect.toggle("photoThumbSet","blind",{duration:0.5,queue:"front"});Effect.toggle("fullSizePhoto","blind",{duration:0.5,queue:"end",afterFinish:a})}function hidePhoto(){Effect.toggle("fullSizePhoto","blind",{duration:0.5,queue:"front"});Effect.toggle("photoThumbSet","blind",{duration:0.5,queue:"end"});$("fullPhotoEdit").hide()}function showEditPhoto(){$("fullPhotoEdit").show()}function editPhoto(){var b=$F("ephCaption");var d=$F("fullPhotoId");var c=function(g){try{$("fullPhotoCaption").innerHTML=b;$("fullPhotoCaption-"+d).innerHTML=b;hiL()}catch(f){alert(f)}};var a=new Ajax.Request("/editMyTPhoto.do"+sidinfo,{onComplete:c,method:"post",postBody:"id="+d+"&caption="+escape(b)});
shL()}function deletePhoto(){if(confirm("Are you sure you want to delete this photo?")){var c=$F("fullPhotoId");var b=$("photoLi-"+c);b.parentNode.removeChild(b);hidePhoto();var a=new Ajax.Request("/deleteMyTPhoto.do"+sidinfo,{method:"post",postBody:"id="+c})}}var emode=false;function initFavs(){try{}catch(a){alert(a)}}function editFavs(){try{if(!emode){var b=$("favies").getElementsByTagName("a");for(var d=0;d<b.length;d++){var c=b[d];c.oldref=c.href;c.oldBody=c.firstChild.data;c.firstChild.data="Remove "+c.oldBody;c.href="javascript:delFav('"+c.id+"');"}emode=true;$("efava").firstChild.data="Save Favorites"}else{var b=$("favies").getElementsByTagName("a");for(var d=0;d<b.length;d++){var c=b[d];c.href=c.oldref;c.firstChild.data=c.oldBody}emode=false;$("efava").firstChild.data="Edit Favorites"}}catch(f){alert(f)
}}function delFav(b){try{var c=$(b);var d=b.substring(4);c.parentNode.removeChild(c);var a=new Ajax.Request("/deleteMyTFavorite.do"+sidinfo,{method:"post",postBody:"id="+d})}catch(c){alert(c)}};
