
function loading(){document.getElementById("loader").className="loading_show";}
function recentRedirect(passedURL,item){chart=document.chart_date.chart.value;lastIO=parseInt(passedURL.lastIndexOf('/'));newURL=passedURL.substring(0,lastIO)+"/"+chart;document.location.href=newURL;}
function closeAllComments(leaveOpen){if(leaveOpen!=1){document.getElementById("journal_1").className="journal_tab_hide";eval("document.getElementById('j_img_1').src='/images/arrow_expand_closed.gif'");}
if(leaveOpen==1){document.getElementById("journal_1_recent").className='journal_tab_hide';document.getElementById("journal_2_recent").className='journal_tab_show';document.getElementById("journal_3_recent").className='journal_tab_show';document.getElementById("journal_4_recent").className='journal_tab_show';}
if(leaveOpen!=2){document.getElementById("journal_2").className="journal_tab_hide";eval("document.getElementById('j_img_2').src='/images/arrow_expand_closed.gif'");}
if(leaveOpen==2){document.getElementById("journal_1_recent").className='journal_tab_show';document.getElementById("journal_2_recent").className='journal_tab_hide';document.getElementById("journal_3_recent").className='journal_tab_show';document.getElementById("journal_4_recent").className='journal_tab_show';}
if(leaveOpen!=3){document.getElementById("journal_3").className="journal_tab_hide";eval("document.getElementById('j_img_3').src='/images/arrow_expand_closed.gif'");}
if(leaveOpen==3){document.getElementById("journal_1_recent").className='journal_tab_show';document.getElementById("journal_2_recent").className='journal_tab_show';document.getElementById("journal_3_recent").className='journal_tab_hide';document.getElementById("journal_4_recent").className='journal_tab_show';}
if(leaveOpen!=4){document.getElementById("journal_4").className="journal_tab_hide";eval("document.getElementById('j_img_4').src='/images/arrow_expand_closed.gif'");}
if(leaveOpen==4){document.getElementById("journal_1_recent").className='journal_tab_show';document.getElementById("journal_2_recent").className='journal_tab_show';document.getElementById("journal_3_recent").className='journal_tab_show';document.getElementById("journal_4_recent").className='journal_tab_hide';}}
function closeAllAnalyze(){document.getElementById("expander_body_1").className="expander_body_hide";document.getElementById("expander_body_2").className="expander_body_hide";document.getElementById("expander_body_3").className="expander_body_hide";document.getElementById("expander_body_4").className="expander_body_hide";document.getElementById("expander_body_5").className="expander_body_hide";document.getElementById("expander_head_1").className="expander_px_top";document.getElementById("expander_head_2").className="expander_px";document.getElementById("expander_head_3").className="expander_px";document.getElementById("expander_head_4").className="expander_px";document.getElementById("expander_head_5").className="expander_px";}
function changeClass(changeClass,classOn,classOff){closeAllComments(changeClass);var whichpost=document.getElementById("journal_"+changeClass);var whichpost_recent=document.getElementById("journal_"+changeClass+"_recent");if(whichpost.className==classOn){whichpost.className=classOff;whichpost_recent.className=classOn;}else{whichpost.className=classOn;eval("document.getElementById('j_img_"+changeClass+"').src='/images/arrow_expand_open.gif'");}}
function changeClassAnalyze(changeClassNum,action,top){var whichpost=document.getElementById("expander_head_"+changeClassNum);if(action=="clicked"){closeAllAnalyze();if(whichpost.className=='expander_px'+top){eval("whichpost.className = 'expander_px"+top+"_on'");document.getElementById("expander_body_"+changeClassNum).className='expander_body_show';}else{eval("whichpost.className = 'expander_px"+top+"'");document.getElementById("expander_body_"+changeClassNum).className='expander_body_hide';}}
if(action=="over"&&top=="top"){whichpost.className='expander_px_top_on';}
if(action=="off"&&top=="top"&&document.getElementById("expander_body_"+changeClassNum).className!='expander_body_show'){whichpost.className='expander_px_top';}
if(action=="over"&&top!="top"){whichpost.className='expander_px_on';}
if(action=="off"&&top!="top"&&document.getElementById("expander_body_"+changeClassNum).className!='expander_body_show'){whichpost.className='expander_px';}}
function changeClassWeekly(changeClassNum,action){var whichpost=document.getElementById("expander_head_"+changeClassNum);if(action=="clicked"){

document.getElementById("year_08").className="expander_body_hide";document.getElementById("expander_head_08").className="expander_px_top_year";document.getElementById("year_09").className="expander_body_hide";document.getElementById("expander_head_09").className="expander_px_top_year";document.getElementById("year_10").className="expander_body_hide";document.getElementById("expander_head_10").className="expander_px_top_year";eval("whichpost.className = 'expander_px_top_year_on'");document.getElementById("year_"+changeClassNum).className='expander_body_show';}
if(action=="over"){whichpost.className='expander_px_top_year_on';}
if(action=="off"&&document.getElementById("year_"+changeClassNum).className!='expander_body_show'){whichpost.className='expander_px_top_year';}}
var thisDispMonth="";function dispMonth(mNum){if(thisDispMonth!=""){document.getElementById('monthHolder_'+thisDispMonth).getElementsByTagName('div')[0].className='expander_body_hide';document.getElementById('monthHolder_'+thisDispMonth).getElementsByTagName('div')[1].className='expander_body_hide';document.getElementById('monthHolder_'+thisDispMonth).getElementsByTagName('div')[2].className='expander_body_hide';document.getElementById('monthHolder_'+thisDispMonth).getElementsByTagName('div')[3].className='expander_body_hide';document.getElementById('monthHolder_'+thisDispMonth).getElementsByTagName('div')[4].className='expander_body_hide';if(document.getElementById('monthHolder_'+thisDispMonth).getElementsByTagName('div')[5]) {document.getElementById('monthHolder_'+thisDispMonth).getElementsByTagName('div')[5].className='expander_body_hide';} if(document.getElementById('monthHolder_'+thisDispMonth).getElementsByTagName('div')[6]) {document.getElementById('monthHolder_'+thisDispMonth).getElementsByTagName('div')[6].className='expander_body_hide';} if(document.getElementById('monthHolder_'+thisDispMonth).getElementsByTagName('div')[7]) {document.getElementById('monthHolder_'+thisDispMonth).getElementsByTagName('div')[7].className='expander_body_hide';} }
thisDispMonth=mNum;document.getElementById('monthHolder_'+mNum).getElementsByTagName('div')[0].className='expander_body_show';document.getElementById('monthHolder_'+mNum).getElementsByTagName('div')[1].className='expander_body_show';document.getElementById('monthHolder_'+mNum).getElementsByTagName('div')[2].className='expander_body_show';document.getElementById('monthHolder_'+mNum).getElementsByTagName('div')[3].className='expander_body_show';document.getElementById('monthHolder_'+mNum).getElementsByTagName('div')[4].className='expander_body_show';}
function monthYearRoll(item,action,monthYear){if(action=="over"){item.className='expander_px_on';}
if(action=="off"){item.className='expander_px';}
if(action=="off"&&document.getElementById('monthHolder_'+monthYear).getElementsByTagName('div')[0].className=='expander_body_show'){item.className='expander_px_on';}}
function changeClassProf(changeClass,classOn,classOff){closeAllComments();var whichpost=document.getElementById("journal_"+changeClass);if(whichpost.className==classOn){whichpost.className=classOff;}else{whichpost.className=classOn;eval("document.getElementById('j_img_"+changeClass+"').src='/images/arrow_expand_open.gif'");}}
function changeClassSimple(theID){var whichpost=document.getElementById(theID);if(whichpost.className=="expander_body_show"){whichpost.className="expander_body_hide";}else{whichpost.className="expander_body_show";}}
function closeAllPics(){document.getElementById("profile_pic_tab_1").className="journal_tab_hide";document.getElementById("profile_pic_tab_2").className="journal_tab_hide";eval("document.getElementById('j_img_1').src='/images/arrow_expand_closed.gif'");eval("document.getElementById('j_img_2').src='/images/arrow_expand_closed.gif'");}
function changeClassPic(changeClass,classOn,classOff){closeAllPics();var whichpost=document.getElementById("profile_pic_tab_"+changeClass);if(whichpost.className==classOn){whichpost.className=classOff;}else{whichpost.className=classOn;eval("document.getElementById('j_img_"+changeClass+"').src='/images/arrow_expand_open.gif'");}}
function manipulateUpload(classOn,classOff){var whichpost=document.getElementById("upload_tab");if(whichpost.className==classOn){whichpost.className=classOff;eval("document.getElementById('arrow_btn').src='/images/arrow_expand_closed.gif'");}else{whichpost.className=classOn;eval("document.getElementById('arrow_btn').src='/images/arrow_expand_open.gif'");}}
function deleteComment(theElementID,theID,theUserID){new Ajax.Updater({success:theElementID},'/includes/data_process.php',{method:'post',parameters:{id:theID,user_id:theUserID,todo:'delete_comment'},insertion:Insertion.Top,onSuccess:function test(){$(theElementID).update();$(theElementID).innerHTML;var post_numberID=theElementID.substr(0,theElementID.lastIndexOf("_"));var temp_num_comments=eval(post_numberID+"_number_comments");if(post_numberID=="journal_1")journal_1_number_comments=(temp_num_comments-1);if(post_numberID=="journal_2")journal_2_number_comments=(temp_num_comments-1);if(post_numberID=="journal_3")journal_3_number_comments=(temp_num_comments-1);if(post_numberID=="journal_4")journal_4_number_comments=(temp_num_comments-1);$(post_numberID+'_numcomm').innerHTML=temp_num_comments-1;}})}
function deleteActivity(theElementID,theID,theUserID,todoFunction){new Ajax.Updater({success:theElementID},'/includes/data_process.php',{method:'post',parameters:{id:theID,user_id:theUserID,todo:todoFunction},insertion:Insertion.Top,onSuccess:function test(){$(theElementID).update();}})}
function doingNow(theElementID){msg=document.forms['f1'].ustatus.value;new Ajax.Updater({success:theElementID},'/includes/data_process.php',{method:'post',parameters:{msg:msg,todo:"doing_box"},insertion:Insertion.Top,onSuccess:function test(){document.location.href="/profile/";}})}
function friendsInCommon(theElementID,inCommon){new Ajax.Updater({success:theElementID},'/includes/data_process.php',{method:'post',parameters:{friends_in_common:inCommon,todo:'get_in_common'},insertion:Insertion.Top,onSuccess:function(oXHR,oJson){$(theElementID).innerHTML="";}})}
function sendMsg(theElementID,user_id,potential_uid,msg,msg_direction,todo){new Ajax.Updater({success:theElementID},'/includes/data_process.php',{method:'post',parameters:{uid:user_id,pid:potential_uid,msg:msg,msg_direction:msg_direction,todo:'send_msg'},insertion:Insertion.Top,onSuccess:function(oXHR,oJson){$(theElementID).update();$(theElementID).innerHTML="Your message has been sent";}})}
function sendMsgReply(theElementID,user_id,potential_uid,msg,main_msg_id,msg_direction){new Ajax.Updater({success:theElementID},'/includes/data_process.php',{method:'post',parameters:{uid:user_id,pid:potential_uid,msg:msg,main_msg_id:main_msg_id,msg_direction:msg_direction,todo:'send_msg_reply'},insertion:Insertion.Top,onSuccess:function(oXHR,oJson){$(theElementID).update();$(theElementID).innerHTML="Your message has been sent";}})}
var removed_num=0;var removed_tot=0;function removeMsg(theElementID,msgid,uid,number_of_msgs,total_msgs){new Ajax.Updater({success:theElementID},'/includes/data_process.php',{method:'post',parameters:{uid:uid,msgid:msgid,todo:'remove_msg'},insertion:Insertion.Top,onSuccess:function(oXHR,oJson){$(theElementID).update();if(number_of_msgs!=0){$("num_msgs_msg").innerHTML="("+((number_of_msgs-1)-removed_num)+")";$("tot_msgs").innerHTML="("+((total_msgs-1)-removed_tot)+")";removed_num=(removed_num+1);removed_tot=(removed_tot+1);}}})}
function confirmFriend(theElementID,user_id,potential_uid,number_of_msgs,total_msgs){new Ajax.Updater({success:theElementID},'/includes/data_process.php',{method:'post',parameters:{uid:user_id,pid:potential_uid,todo:'confirm_friend'},insertion:Insertion.Top,onSuccess:function(oXHR,oJson){$(theElementID).update();$(theElementID).innerHTML="Friend Confirmed";$("num_msgs").innerHTML="("+((number_of_msgs-1)-removed_num)+")";$("tot_msgs").innerHTML="("+((total_msgs-1)-removed_tot)+")";removed_num=(removed_num+1);removed_tot=(removed_tot+1);}})}
function ignoreFriend(theElementID,potential_uid,number_of_msgs,total_msgs){new Ajax.Updater({success:theElementID},'/includes/data_process.php',{method:'post',parameters:{pid:potential_uid,todo:'ignore_user'},insertion:Insertion.Top,onSuccess:function(oXHR,oJson){$(theElementID).update();$("num_msgs").innerHTML="("+((number_of_msgs-1)-removed_num)+")";$("tot_msgs").innerHTML="("+((total_msgs-1)-removed_tot)+")";$(theElementID).innerHTML="";removed_num=(removed_num+1);removed_tot=(removed_tot+1);}})}
function deleteFriend(theElementID,fid,uid){new Ajax.Updater({success:theElementID},'/includes/data_process.php',{method:'post',parameters:{uid:uid,friend_id:fid,todo:'delete_friend'},insertion:Insertion.Top,onSuccess:function(oXHR,oJson){$(theElementID).update();}})}
var s9_NS=(document.layers)?1:0;var s9_IE=(document.all&&document.getElementById)?1:0;var s9_N6=(!document.all&&document.getElementById)?1:0;var s9_hideMenu=null;var is_NS=s9_NS;var is_IE=s9_IE;var is_N6=s9_N6;function doStyleChange(obj){if(is_IE){eval('document.all.'+obj+'.style.visibility="visible"');eval('document.all.'+obj+'.style.display="block"');}
if(is_NS){eval('document.'+obj+'.visibility="visible"');eval('document.'+obj+'.display="block"');}
if(is_N6){the_obj=document.getElementById(obj);the_obj.style.visibility="visible";the_obj.style.display="block";}}
function reDoStyleChange(obj){if(is_IE){eval('document.all.'+obj+'.style.visibility="hidden"');eval('document.all.'+obj+'.style.display="none"');}
if(is_NS){eval('document.'+obj+'.visibility="hidden"');eval('document.'+obj+'.display="none"');}
if(is_N6){the_obj=document.getElementById(obj);the_obj.style.visibility="hidden";the_obj.style.display="none";}}
function checkContactForm(){if(document.contact_form.name.value==''){alert("You must enter your name.");document.contact_form.name.focus();return false;}
if(document.contact_form.email.value==''){alert("You must enter your address.");document.contact_form.email.focus();return false;}
if(document.contact_form.subject.value==''){alert("You must enter a subject.");document.contact_form.subject.focus();return false;}
if(document.contact_form.comm.value==''){alert("Comment/Question field is empty.");document.contact_form.comm.focus();return false;}
echeck(document.contact_form.email.value);document.contact_form.submit();}
function checkFriendInvite(){if(document.invite.name_friends.value==''){alert("You must enter your friends name.");document.invite.name_friends.focus();return false;}
if(document.invite.email_friends.value==''){alert("You must enter your friends email address.");document.invite.email_friends.focus();return false;}
if(document.invite.name_user.value==''){alert("You must enter your name.");document.invite.name_user.focus();return false;}
if(document.invite.email_user.value==''){alert("Your must enter your email address.");document.invite.email_user.focus();return false;}
echeck(document.invite.email_friends.value);echeck(document.invite.email_user.value);document.invite.submit();}
function echeck(str){var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if(str.indexOf(at)==-1){alert("Your email address appears to be invalid.")
return false}
if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr){alert("Your email address appears to be invalid.")
return false}
if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr){alert("Your email address appears to be invalid.")
return false}
if(str.indexOf(at,(lat+1))!=-1){alert("Your email address appears to be invalid.")
return false}
if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){alert("Your email address appears to be invalid.")
return false}
if(str.indexOf(dot,(lat+2))==-1){alert("Your email address appears to be invalid.")
return false}
if(str.indexOf(" ")!=-1){alert("Your email address appears to be invalid.")
return false}
return true;}
function sendOff(formNum){msg=eval("document.snd_msg_"+formNum+".comm.value");user_id=eval("document.snd_msg_"+formNum+".user_id.value");potential_uid=eval("document.snd_msg_"+formNum+".potential_friend_id.value");todo=eval("document.snd_msg_"+formNum+".todo.value");theElementID=eval("document.snd_msg_"+formNum+".theElementID.value");if(msg==""){alert("You did not enter a message");return false;}else{sendMsg(theElementID,user_id,potential_uid,msg,"sender",todo);}}
function removeFriend(theElementID,fid,uid){var answer=confirm("Are you sure you want to remove this friend?")
if(answer){deleteFriend(theElementID,fid,uid);}}
function checkAll(field) { for (i = 0; i < field.length; i++) field[i].checked = true ; } function uncheckAll(field) { for (i = 0; i < field.length; i++) field[i].checked = false ; }
