// Version 2.3.2; portal.js // Define the version of SMF that we are using. if (typeof(smf_editorArray) == "undefined") portal_smf_version = 1.1; else portal_smf_version = 2; 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 != (portal_smf_version == 1.1 ? "sp_article" : "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 (portal_smf_version == 1.1) 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 to handle the receiving of new shout data from the xml request. function onShoutReceived(XMLDoc) { var shouts = XMLDoc.getElementsByTagName("smf")[0].getElementsByTagName("shout"); var shoutbox_id, updated, error, warning, reverse, shout, id, author, time, timeclean, delete_link, body, is_me, new_body = ''; 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; reverse = XMLDoc.getElementsByTagName("smf")[0].getElementsByTagName("reverse")[0].childNodes[0].nodeValue; if (warning != 0) new_body += '
| ' + sPickText + ' |
| ');
for (i = 0; i < sp_smileys.length; i++)
{
sp_smileys[i][2] = sp_smileys[i][2].replace(/"/g, '"');
sp_smileys[i][0] = sp_smileys[i][0].replace(/"/g, '"');
this.oSmileyPopupWindow.document.write(' |
| ' + sCloseText + ' |