// Version 2.3; portal function sp_collapse_object(id, has_image) { mode = document.getElementById("sp_object_" + id).style.display == '' ? 0 : 1; document.getElementById("sp_object_" + id).style.display = mode ? '' : 'none'; if (typeof(has_image) == "undefined" || has_image == true) document.getElementById("sp_collapse_" + id).src = smf_images_url + (mode ? '/collapse.gif' : '/expand.gif'); } function sp_image_resize() { var possible_images = document.getElementsByTagName("img"); for (var i = 0; i < possible_images.length; i++) { if (possible_images[i].className != "bbc_img sp_article") continue; var temp_image = new Image(); temp_image.src = possible_images[i].src; if (temp_image.width > 300) { possible_images[i].height = (300 * temp_image.height) / temp_image.width; possible_images[i].width = 300; } else { possible_images[i].width = temp_image.width; possible_images[i].height = temp_image.height; } } if (typeof(window_oldSPImageOnload) != "undefined" && window_oldSPImageOnload) { window_oldSPImageOnload(); window_oldSPImageOnload = null; } } function sp_submit_shout(shoutbox_id, sSessionVar, sSessionId) { if (window.XMLHttpRequest) { shoutbox_indicator(shoutbox_id, true); var shout_body = ""; if (typeof(smf_editorArray) == "undefined") shout_body = escape(textToEntities(document.getElementById('new_shout_' + shoutbox_id).value.replace(//g, "&#"))).replace(/\+/g, "%2B"); else shout_body = escape(document.getElementById('new_shout_' + shoutbox_id).value.replace(//g, "").php_to8bit()).replace(/\+/g, "%2B"); sendXMLDocument(smf_prepareScriptUrl(smf_scripturl) + 'action=portal;sa=shoutbox;xml', 'shoutbox_id=' + shoutbox_id + '&shout=' + shout_body + '&' + sSessionVar + '=' + sSessionId, onShoutReceived); document.getElementById('new_shout_' + shoutbox_id).value = ''; return false; } } function sp_delete_shout(shoutbox_id, shout_id, sSessionVar, sSessionId) { if (window.XMLHttpRequest) { shoutbox_indicator(shoutbox_id, true); sendXMLDocument(smf_prepareScriptUrl(smf_scripturl) + 'action=portal;sa=shoutbox;xml', 'shoutbox_id=' + shoutbox_id + '&delete=' + shout_id + '&' + sSessionVar + '=' + sSessionId, onShoutReceived); return false; } } function sp_refresh_shout(shoutbox_id, last_refresh) { if (window.XMLHttpRequest) { shoutbox_indicator(shoutbox_id, true); getXMLDocument(smf_prepareScriptUrl(smf_scripturl) + 'action=portal;sa=shoutbox;shoutbox_id=' + shoutbox_id + ';time=' + last_refresh + ';xml', onShoutReceived); return false; } } function onShoutReceived(XMLDoc) { var shouts = XMLDoc.getElementsByTagName("smf")[0].getElementsByTagName("shout"); var shoutbox_id, shout, ss_id, ss_author, ss_time, ss_timeclean, ss_delete_link, ss_body, error, ss_is_me, new_body = '', color_text = ''; shoutbox_id = XMLDoc.getElementsByTagName("smf")[0].getElementsByTagName("shoutbox")[0].childNodes[0].nodeValue; updated = XMLDoc.getElementsByTagName("smf")[0].getElementsByTagName("updated")[0].childNodes[0].nodeValue; if (updated == 1) { error = XMLDoc.getElementsByTagName("smf")[0].getElementsByTagName("error")[0].childNodes[0].nodeValue; warning = XMLDoc.getElementsByTagName("smf")[0].getElementsByTagName("warning")[0].childNodes[0].nodeValue; if (warning != 0) new_body += '