
var rockId="0";var journalLocation="";var map=null;var geocoder=null;var co=1;var marker=new Array();var markerText=new Array();var mySaveTime="10";var timeLength="60";var reminderTimer;var titleTimer;var showTitleObj;var sizeTimer="";var sizeTries=0;var resizeDiv="";var toolsTimer=null;var profileTimer=null;var gift_ju=0;function showRockComment(){$("rockCommentDiv").style.display="block";}
function updateRockCaption(){var msg="";var jId=0;var rId=0;if($("newRockCaption").value!=""){msg=encodeURIComponent($("newRockCaption").value);}else{msg=" ";}
if($("jId")){jId=$("jId").value;}
if($("rId")){rId=$("rId").value;}
var TRAjax=new ajaxObject("http://www.trujournal.com/ajax/update_rock_caption.php",processRockCaption);TRAjax.update("rockId="+rockId+"&jId="+jId+"&rId="+rId+"&msg="+msg,'POST');}
function processRockCaption(responseText,responseStatus){if(responseStatus==200){var m=eval('('+responseText+')');var rockStr="Remove Token Rock";if($("rId")){rockStr="Remove Gift Rock";}
$("myRockCaption").innerHTML="<div id='tokenrockDiv' style='display: block;width: 163px;'><div style='text-align: right'><a href='javascript:void(0);' onclick='removeTokenRock();' class='red_link'>"+rockStr+"</a></div><div style='padding-top: 11px'>"+m.msg+"</div><div><a href='javascript:void(0);' onclick='showRockComment();' class='red_link'>Edit Comment</a></div></div>";$("newRockCaption").value=m.msg;hideCaption();}}
function hideCaption(){$("rockCommentDiv").style.display="none";}
function testForm(){if($("journal_title").value==""){alert("You have to provide a title before saving.");$("journal_title").focus();}else{$("insert").value="1";TRForms.submitForm();}}
function showTitle(oObj){showTitleObj=oObj;titleTimer=setTimeout("do_showTitle()",100);}
function do_showTitle(){clearTimeout(titleTimer);$(showTitleObj+"_title_text").innerHTML=$(showTitleObj+"_title").value;}
function showFriendRequests(){location.href='friends_requests.php';return true;}
function showNewMessages(){location.href='inbox.php';return true;}
function showGiftrock(oId){var thisLink="giftrock_view.php?rId="+oId;if(gift_ju!="0"){thisLink+="&gId="+gift_ju;}
location.href=thisLink;return true;}
function sfd(){TREffects.moveDown("friendRequests",20);}
function snm(){TREffects.moveDown("newMessages",20);}
function startReminder(){reminderTimer=window.setTimeout("saveReminder();",mySaveTime*1000*timeLength);}
function saveReminder(){clearTimeout(reminderTimer);if(confirm("You have not saved in a little while, would you like to do so now?")){$("insert").value="1";TRForms.submitForm();}else{reminderTimer=window.setTimeout("saveReminder()",mySaveTime*1000*timeLength);}}
function deleteThisPost(){var test=$("deleteBox");if(test.checked==true){if(confirm("Are you sure you want to delete this entry?")){$("act").value="delete";TRForms.submitForm();}}}
function do_form(oStr,thisAction){if($(oStr+"_title").value.length=="0"){alert("You must give this Entry a title first.");$(oStr+"_title").focus();}else{$("act").value=thisAction;$("insert").value="1";TRForms.submitForm();}}
function showTerms(){var fo=window.open("/profile/terms.php","Terms_Window","width=500,height=400,scrollbars=1");return true;}
function showPrivacy(){window.open("/profile/privacy.php","Privacy_win","width=500, height=400,scrollbars=1");return true;}
function getResizeDiv(){if(resizeDiv==""){resizeDiv="body_container";}
resize();}
function menu_g_over(){TRMenu.showDropMenu("giftrockSelect",300);}
function menu_g_out(){TRMenu.hideDropMenu("giftrockSelect",700);}
function menu_s_over(){TRMenu.showDropMenu("searchType",300);}
function menu_s_out(){TRMenu.hideDropMenu("searchType",700);}
function menu_searchFriend(){location.href='friends_find.php?q='+$("mySearch").value;}
function menu_searchJournal(oStr){if($("mySearch").value.length<4){alert("Search strings need to be atleast 4 characters");}else{if(oStr=="mine"){location.href="journal.php?q="+$("mySearch").value;}else{location.href="journal.php?all=1&q="+$("mySearch").value;}}}
function showTools(){clearTimeout(toolsTimer);$("tools_menu").style.display="block";$("div_logout").style.zIndex=parseInt($("tools_menu").style.zIndex)+1;}
function hideTools(){toolsTimer=setTimeout("do_hideTools()",500);}
function do_hideTools(){clearTimeout(toolsTimer);$("tools_menu").style.display="none";$("div_logout").style.zIndex=parseInt($("tools_menu").style.zIndex)-1;}
function showProfile(){clearTimeout(profileTimer);$("friend_profile_menu").style.display="block";}
function hideProfile(){profileTimer=setTimeout("do_hideProfile()",500);}
function do_hideProfile(){clearTimeout(profileTimer);$("friend_profile_menu").style.display="none";}
function menu_blog(){location.href="blog.php";return false;}
function menu_profile(){location.href="profile_edit.php";return false;}
