2 function openClose(theID) {
3 if(document.getElementById(theID).style.display == "block") {
4 document.getElementById(theID).style.display = "none"
7 document.getElementById(theID).style.display = "block"
11 function openMenu(theID) {
12 document.getElementById(theID).style.display = "block"
15 function closeMenu(theID) {
16 document.getElementById(theID).style.display = "none"
19 function commentOpen(obj,id) {
20 if(obj.value == 'Comment') {
22 obj.className = "comment-edit-text-full";
23 openMenu("comment-edit-submit-wrapper-" + id);
26 function commentClose(obj,id) {
28 obj.value = 'Comment';
29 obj.className="comment-edit-text-empty";
30 closeMenu("comment-edit-submit-wrapper-" + id);
40 $(document).ready(function() {
41 $.ajaxSetup({cache: false});
42 msie = $.browser.msie ;
44 // Allow folks to stop the ajax page updates with the pause/break key
45 $(document).keypress(function(event) {
46 if(event.keyCode == '19') {
47 event.preventDefault();
57 function NavUpdate() {
59 if($('#live-network').length) { src = 'network'; liveUpdate(); }
60 if($('#live-profile').length) { src = 'profile'; liveUpdate(); }
63 $.get("ping",function(data) {
64 $(data).find('result').each(function() {
65 var net = $(this).find('net').text();
66 if(net == 0) { net = ''; }
67 $('#net-update').html(net);
68 var home = $(this).find('home').text();
69 if(home == 0) { home = ''; }
70 $('#home-update').html(home);
71 var mail = $(this).find('mail').text();
72 if(mail == 0) { mail = ''; }
73 $('#mail-update').html(mail);
74 var intro = $(this).find('intro').text();
75 if(intro == 0) { intro = ''; }
76 $('#notify-update').html(intro);
80 setTimeout(NavUpdate,30000);
84 function liveUpdate() {
85 if((src == null) || (stopped)) { return; }
86 if($('.comment-edit-text-full').length) {
87 livetime = setTimeout(liveUpdate, 10000);
92 $.get('update_' + src + '?msie=' + ((msie) ? 1 : 0),function(data) {
93 $('.wall-item-outside-wrapper',data).each(function() {
94 var ident = $(this).attr('id');
95 if($('#' + ident).length == 0) {
96 $('img',this).each(function() {
97 $(this).attr('src',$(this).attr('dst'));
99 $('#' + prev).after($(this));
103 $('#' + ident + ' ' + '.wall-item-ago').replaceWith($(this).find('.wall-item-ago'));
104 $('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($(this).find('.wall-item-comment-wrapper'));
105 $('#' + ident + ' ' + '.my-comment-photo').each(function() {
106 $(this).attr('src',$(this).attr('dst'));
117 function confirmDelete() {
118 return confirm("Delete this item?");
121 function imgbright(node) {
122 $(node).attr("src",$(node).attr("src").replace('hide','show'));
123 $(node).css('width',24);
124 $(node).css('height',24);
127 function imgdull(node) {
128 $(node).attr("src",$(node).attr("src").replace('show','hide'));
129 $(node).css('width',16);
130 $(node).css('height',16);