function ajaxUpdatePostNCall(instance,requestURL,para,instance2,requestURL2){ $(instance).update(''); requestURL = requestURL + '?' + new Date().getTime(); var myAjax = new Ajax.Updater(instance, requestURL, { method: 'post', parameters: para, evalScripts: true, onComplete: function(){ var cookieLan = readCookie("lan"); if(cookieLan=="cn"){ tc2sc(instance); } var myAjax2 = new Ajax.Updater(instance2, requestURL2, { method: 'get', parameters: para, evalScripts: true, onComplete: function(transport){ if(!transport.responseText.blank()){ $(instance2).show(); }else{ $(instance2).hide(); } } }); } }); } function ajaxUpdateFeeds(instance,requestURL,para,loader){ requestURL = requestURL + "?" + new Date().getTime(); var myAjax = new Ajax.Updater(instance, requestURL, { method: 'get', parameters: para, evalScripts: true, onLoad: function(){ var cookieLan = readCookie("lan"); if(cookieLan=="cn"){ tc2sc(instance); } } }); } focus_item = 'dummy'; function change_comment_form(feed_id){ if(focus_item=='dummy'){//dummy 直接 appear var styles = $H({ display: "block" }); var styles2 = $H({ width: "462px"}); var styles3 = $H({ width: "454px"}); //$('my_comment_cover'+feed_id).setStyle(styles.toObject()); $('my_comment_btn'+feed_id).setStyle(styles.toObject()); $('comment_textarea_wrap'+feed_id).setStyle(styles.toObject()); //$('my_comment_content'+feed_id).setStyle(styles2.toObject()); //$('add_comment_text'+feed_id).setStyle(styles3.toObject()); if($('add_comment_text'+feed_id).value=='Write a comment...'){ $('add_comment_text'+feed_id).value=''; } focus_item = feed_id; return false; }else{ var styles = $H({ display: "none" }); var styles2 = $H({ width: "494px"}); //$('my_comment_cover'+focus_item).setStyle(styles.toObject()); $('my_comment_btn'+focus_item).setStyle(styles.toObject()); //$('my_comment_content'+focus_item).setStyle(styles2.toObject()); //$('add_comment_text'+focus_item).setStyle(styles2.toObject()); //$('add_comment_text'+focus_item).value='Write a comment...'; if($('add_comment_text'+focus_item).value==''){ $('add_comment_text'+focus_item).value='Write a comment...'; } styles = $H({ display: "block" }); styles2 = $H({ width: "462px"}); styles3 = $H({ width: "454px"}); //$('my_comment_cover'+feed_id).setStyle(styles.toObject()); $('my_comment_btn'+feed_id).setStyle(styles.toObject()); //$('my_comment_content'+feed_id).setStyle(styles2.toObject()); //$('add_comment_text'+feed_id).setStyle(styles3.toObject()); if($('add_comment_text'+feed_id).value=='Write a comment...'){ $('add_comment_text'+feed_id).value=''; } focus_item = feed_id; return false; } } function feedSendComment(feed_id,type,thing_id,owner_id){ var comment = $('add_comment_text'+feed_id).value; if(comment=='Write a comment...'||comment==''){ systemMsg('Content cannot be empty.'); return; }else{ ajaxUpdatePost('comment-block'+feed_id,'/db_includes/ajax_add_comment_action.php','comment='+encodeURIComponent(comment)+'&type='+type+'&thing_id='+thing_id+'&owner_id='+owner_id+'&feed_id='+feed_id); $('add_comment_text'+feed_id).value=''; } } function sz(t) { a = t.value.split('\n'); b=0; for (x=0;x < a.length; x++) { if (a[x].length >= 48) b+= Math.floor(a[x].length/48); } b+= a.length; var newpx = (b*16)+'px'; var styles2 = $H({ height: newpx}); if(((b*16) <= 200)&&((b*16) > 48)) t.setStyle(styles2.toObject()); } window.activeVoxoutMenu=function(menu_item){ for(i=0; i<$$('ul.voxout_menu li').length; i++){ $$('ul.voxout_menu li')[i].className = 'inactive'; } menu_item.className = 'active'; };