var request = makeObject(); function mytabs(tabvalue, gender){ if (gender == 0) { g = "My ";}
else if (gender == 1) { g = "His ";}
else if (gender == 2) { g = "Her ";}
else if (gender == 3) { g = "";}
Stories = "url(images/index_r17_c17.jpg)"; Stories_link = "<a href='javascript:control_mypersonal_tab(1,0,1,"+gender+")' class='link-tabs'>"+ g + "Stories</a>"; Stories_left_img = "<img src='images/index_r19_c16.jpg' width='8' height='21' border='0' id='index_r19_c16'/>"; Stories_left_upper_img = "<img src='images/index_r17_c16.jpg' width='8' height='7' border='0' id='index_r17_c16' />"; Stories_right_img = "<img src='images/index_r18_c19.jpg' width='6' height='23' border='0' id='index_r18_c19' />"; Stories_right_upper_img = "<img src='images/index_r17_c19.jpg' width='6' height='5' border='0' id='index_r17_c19' />"; Journal = "url(images/index_r17_c17.jpg)"; Journal_link = "<a href='javascript:control_mypersonal_tab(2,0,1,"+gender+")' class='link-tabs'>"+ g + "Journal</a>"; Journal_left_img = "<img src='images/index_r19_c16.jpg' width='8' height='21' border='0' id='index_r19_c16'/>"; Journal_left_upper_img = "<img src='images/index_r17_c16.jpg' width='8' height='7' border='0' id='index_r17_c16' />"; Journal_right_img = "<img src='images/index_r18_c19.jpg' width='6' height='23' border='0' id='index_r18_c19' />"; Journal_right_upper_img = "<img src='images/index_r17_c19.jpg' width='6' height='5' border='0' id='index_r17_c19' />"; Comments = "url(images/index_r17_c17.jpg)"; Comments_link = "<a href='javascript:control_mypersonal_tab(4,0,1,"+gender+")' class='link-tabs'>"+ g + "Comments</a>"; Comments_left_img = "<img src='images/index_r19_c16.jpg' width='8' height='21' border='0' id='index_r19_c16'/>"; Comments_left_upper_img = "<img src='images/index_r17_c16.jpg' width='8' height='7' border='0' id='index_r17_c16' />"; Comments_right_img = "<img src='images/index_r18_c19.jpg' width='6' height='23' border='0' id='index_r18_c19' />"; Comments_right_upper_img = "<img src='images/index_r17_c19.jpg' width='6' height='5' border='0' id='index_r17_c19' />"; Bookmarks = "url(images/index_r17_c17.jpg)"; Bookmarks_link = "<a href='javascript:control_mypersonal_tab(5,0,1,"+gender+")' class='link-tabs'>"+ g + "Bookmarks</a>"; Bookmarks_left_img = "<img src='images/index_r19_c16.jpg' width='8' height='21' border='0' id='index_r19_c16'/>"; Bookmarks_left_upper_img = "<img src='images/index_r17_c16.jpg' width='8' height='7' border='0' id='index_r17_c16' />"; Bookmarks_right_img = "<img src='images/index_r18_c19.jpg' width='6' height='23' border='0' id='index_r18_c19' />"; Bookmarks_right_upper_img = "<img src='images/index_r17_c19.jpg' width='6' height='5' border='0' id='index_r17_c19' />"; Tags = "url(images/index_r17_c17.jpg)"; Tags_link = "<a href='javascript:control_mypersonal_tab(6,0,1,"+gender+")' class='link-tabs'>"+ g + "Tags</a>"; Tags_left_img = "<img src='images/index_r19_c16.jpg' width='8' height='21' border='0' id='index_r19_c16'/>"; Tags_left_upper_img = "<img src='images/index_r17_c16.jpg' width='8' height='7' border='0' id='index_r17_c16' />"; Tags_right_img = "<img src='images/index_r18_c19.jpg' width='6' height='23' border='0' id='index_r18_c19' />"; Tags_right_upper_img = "<img src='images/index_r17_c19.jpg' width='6' height='5' border='0' id='index_r17_c19' />"; Cheer = "url(images/index_r17_c17.jpg)"; Cheer_link = "<a href='javascript:control_mypersonal_tab(7,0,1,"+gender+")' class='link-tabs'>"+ g + "Cheers</a>"; Cheer_left_img = "<img src='images/index_r19_c16.jpg' width='8' height='21' border='0' id='index_r19_c16'/>"; Cheer_left_upper_img = "<img src='images/index_r17_c16.jpg' width='8' height='7' border='0' id='index_r17_c16' />"; Cheer_right_img = "<img src='images/index_r18_c19.jpg' width='6' height='23' border='0' id='index_r18_c19' />"; Cheer_right_upper_img = "<img src='images/index_r17_c19.jpg' width='6' height='5' border='0' id='index_r17_c19' />"; group = "url(images/index_r17_c17.jpg)"; group_link = "<a href='javascript:control_mypersonal_tab(8,0,1,"+gender+")' class='link-tabs'>"+ g + "Groups</a>"; group_left_img = "<img src='images/index_r19_c16.jpg' width='8' height='21' border='0' id='index_r19_c16'/>"; group_left_upper_img = "<img src='images/index_r17_c16.jpg' width='8' height='7' border='0' id='index_r17_c16' />"; group_right_img = "<img src='images/index_r18_c19.jpg' width='6' height='23' border='0' id='index_r18_c19' />"; group_right_upper_img = "<img src='images/index_r17_c19.jpg' width='6' height='5' border='0' id='index_r17_c19' />"; if (tabvalue == 1) { Stories = "url(images/index_r17_c11.jpg)"; Stories_link = g + "Stories"; Stories_left_img = "<img src='images/index_r19_c10.jpg' width='8' height='21' border='0' id='index_r19_c10'/>"; Stories_left_upper_img = "<img src='images/index_r17_c10.jpg' width='8' height='7' border='0' id='index_r17_c10'/>"; Stories_right_img = "<img src='images/index_r19_c14.jpg' width='6' height='21' border='0' id='index_r19_c14'/>"; Stories_right_upper_img = "<img src='images/index_r17_c14.jpg' width='6' height='7' border='0' id='index_r17_c14'/>";}
else if (tabvalue == 2) { Journal = "url(images/index_r17_c11.jpg)"; Journal_link = g + "Journal"; Journal_left_img = "<img src='images/index_r19_c10.jpg' width='8' height='21' border='0' id='index_r19_c10'/>"; Journal_left_upper_img = "<img src='images/index_r17_c10.jpg' width='8' height='7' border='0' id='index_r17_c10'/>"; Journal_right_img = "<img src='images/index_r19_c14.jpg' width='6' height='21' border='0' id='index_r19_c14'/>"; Journal_right_upper_img = "<img src='images/index_r17_c14.jpg' width='6' height='7' border='0' id='index_r17_c14'/>";}
else if (tabvalue == 4) { Comments = "url(images/index_r17_c11.jpg)"; Comments_link = g + "Comments"; Comments_left_img = "<img src='images/index_r19_c10.jpg' width='8' height='21' border='0' id='index_r19_c10'/>"; Comments_left_upper_img = "<img src='images/index_r17_c10.jpg' width='8' height='7' border='0' id='index_r17_c10'/>"; Comments_right_img = "<img src='images/index_r19_c14.jpg' width='6' height='21' border='0' id='index_r19_c14'/>"; Comments_right_upper_img = "<img src='images/index_r17_c14.jpg' width='6' height='7' border='0' id='index_r17_c14'/>";}
else if (tabvalue == 5) { Bookmarks = "url(images/index_r17_c11.jpg)"; Bookmarks_link = g + "Bookmarks"; Bookmarks_left_img = "<img src='images/index_r19_c10.jpg' width='8' height='21' border='0' id='index_r19_c10'/>"; Bookmarks_left_upper_img = "<img src='images/index_r17_c10.jpg' width='8' height='7' border='0' id='index_r17_c10'/>"; Bookmarks_right_img = "<img src='images/index_r19_c14.jpg' width='6' height='21' border='0' id='index_r19_c14'/>"; Bookmarks_right_upper_img = "<img src='images/index_r17_c14.jpg' width='6' height='7' border='0' id='index_r17_c14'/>";}
else if (tabvalue == 6) { Tags = "url(images/index_r17_c11.jpg)"; Tags_link = g + "Tags"; Tags_left_img = "<img src='images/index_r19_c10.jpg' width='8' height='21' border='0' id='index_r19_c10'/>"; Tags_left_upper_img = "<img src='images/index_r17_c10.jpg' width='8' height='7' border='0' id='index_r17_c10'/>"; Tags_right_img = "<img src='images/index_r19_c14.jpg' width='6' height='21' border='0' id='index_r19_c14'/>"; Tags_right_upper_img = "<img src='images/index_r17_c14.jpg' width='6' height='7' border='0' id='index_r17_c14'/>";}
else if (tabvalue == 7) { Cheer = "url(images/index_r17_c11.jpg)"; Cheer_link = g + "Cheers"; Cheer_left_img = "<img src='images/index_r19_c10.jpg' width='8' height='21' border='0' id='index_r19_c10'/>"; Cheer_left_upper_img = "<img src='images/index_r17_c10.jpg' width='8' height='7' border='0' id='index_r17_c10'/>"; Cheer_right_img = "<img src='images/index_r19_c14.jpg' width='6' height='21' border='0' id='index_r19_c14'/>"; Cheer_right_upper_img = "<img src='images/index_r17_c14.jpg' width='6' height='7' border='0' id='index_r17_c14'/>";}
else if (tabvalue == 8) { group = "url(images/index_r17_c11.jpg)"; group_link = g + "Groups"; group_left_img = "<img src='images/index_r19_c10.jpg' width='8' height='21' border='0' id='index_r19_c10'/>"; group_left_upper_img = "<img src='images/index_r17_c10.jpg' width='8' height='7' border='0' id='index_r17_c10'/>"; group_right_img = "<img src='images/index_r19_c14.jpg' width='6' height='21' border='0' id='index_r19_c14'/>"; group_right_upper_img = "<img src='images/index_r17_c14.jpg' width='6' height='7' border='0' id='index_r17_c14'/>";}
document.getElementById('Stories_left_upper_img_td').innerHTML=Stories_left_upper_img; document.getElementById('Stories_left_img_td').innerHTML=Stories_left_img; document.getElementById('Stories_link_td').style.background = Stories; document.getElementById('Stories_link_td').innerHTML=Stories_link; document.getElementById('Stories_right_upper_img_td').innerHTML=Stories_right_upper_img; document.getElementById('Stories_right_img_td').innerHTML=Stories_right_img; if (document.getElementById('Journal_left_upper_img_td')) { document.getElementById('Journal_left_upper_img_td').innerHTML=Journal_left_upper_img; document.getElementById('Journal_left_img_td').innerHTML=Journal_left_img; document.getElementById('Journal_link_td').style.background=Journal; document.getElementById('Journal_link_td').innerHTML=Journal_link; document.getElementById('Journal_right_upper_img_td').innerHTML=Journal_right_upper_img; document.getElementById('Journal_right_img_td').innerHTML=Journal_right_img;}
document.getElementById('Comments_left_upper_img_td').innerHTML=Comments_left_upper_img; document.getElementById('Comments_left_img_td').innerHTML=Comments_left_img; document.getElementById('Comments_link_td').style.background=Comments; document.getElementById('Comments_link_td').innerHTML=Comments_link; document.getElementById('Comments_right_upper_img_td').innerHTML=Comments_right_upper_img; document.getElementById('Comments_right_img_td').innerHTML=Comments_right_img; if(document.getElementById('Bookmarks_left_upper_img_td')) { document.getElementById('Bookmarks_left_upper_img_td').innerHTML=Bookmarks_left_upper_img; document.getElementById('Bookmarks_left_img_td').innerHTML=Bookmarks_left_img; document.getElementById('Bookmarks_link_td').style.background=Bookmarks; document.getElementById('Bookmarks_link_td').innerHTML=Bookmarks_link; document.getElementById('Bookmarks_right_upper_img_td').innerHTML=Bookmarks_right_upper_img; document.getElementById('Bookmarks_right_img_td').innerHTML=Bookmarks_right_img;}
document.getElementById('Tags_left_upper_img_td').innerHTML=Tags_left_upper_img; document.getElementById('Tags_left_img_td').innerHTML=Tags_left_img; document.getElementById('Tags_link_td').style.background=Tags; document.getElementById('Tags_link_td').innerHTML=Tags_link; document.getElementById('Tags_right_upper_img_td').innerHTML=Tags_right_upper_img; document.getElementById('Tags_right_img_td').innerHTML=Tags_right_img; document.getElementById('Cheer_left_upper_img_td').innerHTML=Cheer_left_upper_img; document.getElementById('Cheer_left_img_td').innerHTML=Cheer_left_img; document.getElementById('Cheer_link_td').style.background=Cheer; document.getElementById('Cheer_link_td').innerHTML=Cheer_link; document.getElementById('Cheer_right_upper_img_td').innerHTML=Cheer_right_upper_img; document.getElementById('Cheer_right_img_td').innerHTML=Cheer_right_img; document.getElementById('group_left_upper_img_td').innerHTML=group_left_upper_img; document.getElementById('group_left_img_td').innerHTML=group_left_img; document.getElementById('group_link_td').style.background=group; document.getElementById('group_link_td').innerHTML=group_link; document.getElementById('group_right_upper_img_td').innerHTML=group_right_upper_img; document.getElementById('group_right_img_td').innerHTML=group_right_img;}
function reload_dropdown()
{ var dropdown_sort = document.getElementById("lst_sort"); dropdown_sort.selectedIndex=0;}
function control_sorting(selected_value,sortorder,tab, gender)
{ control_mypersonal_tab(selected_value,sortorder,tab, gender);}
function ajaxcontent(url){ document.getElementById('content_div').style.textAlign='center'; document.getElementById('content_div').innerHTML='<img src="images/working.gif"  />'; request.open('post', url,true); request.onreadystatechange = parseInfocontent; request.send('');}
function parseInfocontent(){ if(request.readyState == 4){ var answer = request.responseText; document.getElementById('content_div').innerHTML=''; document.getElementById('content_div').style.textAlign='left'; document.getElementById('content_div').innerHTML=answer;}
}
function control_mypersonal_tab(selected_value, sortorder, tab, gender) { if(tab==1)
reload_dropdown(); if(selected_value!='') { document.frm_sort.hidden_mypersonal_tab.value = selected_value; tab_value = document.frm_sort.hidden_mypersonal_tab.value;}
else
{ tab_value = 1;}
sortorder = sortorder; if(tab_value==1)
{ mytabs(tab_value, gender); ajaxcontent('ajax_mystories.php?sortorder='+sortorder);}
else if(tab_value==2)
{ mytabs(tab_value, gender); ajaxcontent('ajax_myjournalentries.php?sortorder='+sortorder);}
else if(tab_value==4)
{ mytabs(tab_value, gender); ajaxcontent('ajax_mycomments.php?sortorder='+sortorder);}
else if(tab_value==5)
{ mytabs(tab_value, gender); ajaxcontent('ajax_mybookmarks.php?sortorder='+sortorder);}
else if(tab_value==6)
{ mytabs(tab_value, gender); ajaxcontent('ajax_mytags.php?sortorder='+sortorder);}
else if(tab_value==7)
{ mytabs(tab_value, gender); ajaxcontent('ajax_mycheers.php?sortorder='+sortorder);}
else if(tab_value==8)
{ mytabs(tab_value, gender); ajaxcontent('ajax_groups.php?sortorder='+sortorder);}
}
function ajaxpaging(pageno, a)
{ if (document.frm_sort.hidden_mypersonal_tab.value == '') { document.frm_sort.hidden_mypersonal_tab.value = 1;}
tab_value = document.frm_sort.hidden_mypersonal_tab.value; sortorder=document.frm_sort.lst_sort.value; if(tab_value==1)
{ ajaxcontent('ajax_mystories.php?pno='+pageno+'&sortorder='+sortorder);}
else if(tab_value==2)
{ ajaxcontent('ajax_myjournalentries.php?pno='+pageno+'&sortorder='+sortorder);}
else if(tab_value==3)
{ ajaxcontent('ajax_mypetitions.php?pno='+pageno+'&sortorder='+sortorder);}
else if(tab_value==4)
{ ajaxcontent('ajax_mycomments.php?sortorder='+sortorder);}
else if(tab_value==5)
{ ajaxcontent('ajax_mybookmarks.php?sortorder='+sortorder);}
else if(tab_value==6)
{ ajaxcontent('ajax_mytags.php?sortorder='+sortorder);}
else if(tab_value==7)
{ ajaxcontent('ajax_mycheers.php?pno='+pageno+'&sortorder='+sortorder);}
else if(tab_value==8)
{ ajaxcontent('ajax_groups.php?pno='+pageno+'&sortorder='+sortorder);}
}
function deletestory(story_id){ answer = window.confirm("Are you sure you want to delete this story?"); if (answer == true) { ajax_deletestroy('ajax_deletestory.php?storyid='+story_id);}
}
function ajax_deletestroy(url){ document.getElementById('content_div').style.textAlign='center'; document.getElementById('content_div').innerHTML='<img src="images/working.gif"  />'; request.open('post', url,true); request.onreadystatechange = parseInfo_deletestory; request.send('');}
function parseInfo_deletestory(){ if(request.readyState == 4){ var answer = request.responseText; sortorder=document.frm_sort.lst_sort.value; ajaxcontent('ajax_mystories.php?sortorder='+sortorder);}
}
function deletejournal(journal_id){ answer = window.confirm("Are you sure you want to delete this journal?"); if (answer == true) { ajax_deletejournal('ajax_deletejournal.php?journalid='+journal_id);}
}
function ajax_deletejournal(url){ document.getElementById('content_div').style.textAlign='center'; document.getElementById('content_div').innerHTML='<img src="images/working.gif"  />'; request.open('post', url,true); request.onreadystatechange = parseInfo_deletejournal; request.send('');}
function parseInfo_deletejournal(){ if(request.readyState == 4){ var answer = request.responseText; sortorder=document.frm_sort.lst_sort.value; ajaxcontent('ajax_myjournalentries.php?sortorder='+sortorder);}
}
function deletepetition(petition_id){ answer = window.confirm("Are you sure you want to delete this petition?"); if (answer == true) { ajax_deletepetition('ajax_deletepetition.php?petitionid='+petition_id);}
}
function ajax_deletepetition(url){ document.getElementById('content_div').style.textAlign='center'; document.getElementById('content_div').innerHTML='<img src="images/working.gif"  />'; request.open('post', url,true); request.onreadystatechange = parseInfo_deletepetition; request.send('');}
function parseInfo_deletepetition(){ if(request.readyState == 4){ var answer = request.responseText; sortorder=document.frm_sort.lst_sort.value; ajaxcontent('ajax_mypetitions.php?sortorder='+sortorder);}
}
function story_comments(index,total)
{ if(document.getElementById('story'+index).style.display == 'block') { document.getElementById('story'+index).style.display = 'none';}
else { for(i=0;i<total;i++) { document.getElementById('story'+i).style.display = 'none';}
document.getElementById('story'+index).style.display = 'block';}
}
function journal_comments(index,total)
{ if(document.getElementById('journal'+index).style.display == 'block') { document.getElementById('journal'+index).style.display = 'none';}
else { for(i=0;i<total;i++) { document.getElementById('journal'+i).style.display = 'none';}
document.getElementById('journal'+index).style.display = 'block';}
}
function petition_comments(index,total)
{ if(document.getElementById('petition'+index).style.display == 'block') { document.getElementById('petition'+index).style.display = 'none';}
else { for(i=0;i<total;i++) { document.getElementById('petition'+i).style.display = 'none';}
document.getElementById('petition'+index).style.display = 'block';}
}
function forum_comments(index,total)
{ if(document.getElementById('forum'+index).style.display == 'block') { document.getElementById('forum'+index).style.display = 'none';}
else { for(i=0;i<total;i++) { document.getElementById('forum'+i).style.display = 'none';}
document.getElementById('forum'+index).style.display = 'block';}
}
