//****************************************Global var hostUrl='http://'+window.location.hostname+'/'; var imageUrl='http://image.ascension-central.org'; function getElementInit() { if (/msie/i.test (navigator.userAgent)) //only override IE { document.nativeGetElementById = document.getElementById; document.getElementById = function(id) { var elem = document.nativeGetElementById(id); if(elem) { //make sure that it is a valid match on id if(elem.id == id) { return elem; } else { //otherwise find the correct element for(var i=1;i opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } } //change the opacity for different browsers function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; } function shiftOpacity(id, millisec,collapse) { //if an element is invisible, make it visible, else make it ivisible if(!collapse) { opacity(id, 0, 100, millisec); } else { opacity(id, 100, 0, millisec);} } function collapse(node,type) { if (type==1) { vSibling = node.nextSibling; while (vSibling.nodeType==3) //Firefox hack, since nextSibling in firefox returns whitespaces as textNodes vSibling = vSibling.nextSibling; if(node.nodeType==1) { if (vSibling.nodeType==1) //Is it an element { t='collapse'; vSibling.setAttribute('class',t); } } } else node.setAttribute('class','collapse'); } function expand(node,type) { if (type==1) { vSibling = node.nextSibling; while (vSibling.nodeType==3) //Firefox hack, since nextSibling in firefox returns whitespaces as textNodes vSibling = vSibling.nextSibling; if(node.nodeType==1) { if (vSibling.nodeType==1) //Is it an element { c=vSibling.childNodes; var i=0; var child=0; while ((i < c.length)) { if (c[i].nodeType==1) child++; i++; } if (child!=0) { shiftOpacity(vSibling.id, 900,false); vSibling.setAttribute('class','category'); } } } } else node.setAttribute('class','category'); } /*function setCookie(c_name,value,expiredays) { var exdate=new Date(); exdate.setDate(exdate.getDate()+expiredays); document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString()); }*/ //Set_Cookie( 'mycookie', 'visited 9 times', 30, '/', '', '' );. function setCookie( name, value, expires, path, domain, secure ) { // set time, it's in milliseconds var today = new Date(); today.setTime( today.getTime() ); /* if the expires variable is set, make the correct expires time, the current script below will set it for x number of days, to make it for hours, delete * 24, for minutes, delete * 60 * 24 */ if ( expires ) { expires = expires * 1000 * 60 * 60 * 24; } var expires_date = new Date( today.getTime() + (expires) ); document.cookie = name + "=" +escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" ); } function set_time_zoneCookie(){ var now = new Date(); var later = new Date(); // Set time for how long the cookie should be saved // Set cookie for the time zone offset in minutes setCookie("time_zone_offset",now.getTimezoneOffset(), 365,'/','',''); // Create two new dates var d1 = new Date(); var d2 = new Date(); // Date one is set to January 1st of this year // Guaranteed not to be in DST for northern hemisphere, // and guaranteed to be in DST for southern hemisphere // (If DST exists on client PC) d1.setDate(1); d1.setMonth(1); // Date two is set to July 1st of this year // Guaranteed to be in DST for northern hemisphere, // and guaranteed not to be in DST for southern hemisphere // (If DST exists on client PC) d2.setDate(1); d2.setMonth(7); // If time zone offsets match, no DST exists for this time zone if(parseInt(d1.getTimezoneOffset())==parseInt(d2.getTimezoneOffset())) { setCookie("time_zone_dst", "0", 365,'/','',''); } // DST exists for this time zone - check if it is currently active else { // Find out if we are on northern or southern hemisphere // Hemisphere is positive for northern, and negative for southern var hemisphere = parseInt(d1.getTimezoneOffset())-parseInt(d2.getTimezoneOffset()); // Current date is still before or after DST, not containing DST if((hemisphere>0 && parseInt(d1.getTimezoneOffset())==parseInt(now.getTimezoneOffset())) || (hemisphere<0 && parseInt(d2.getTimezoneOffset())==parseInt(now.getTimezoneOffset()))) { setCookie("time_zone_dst", "0", 365,'/','',''); } // DST is active right now with the current date else { setCookie("time_zone_dst", "1", 365,'/','',''); } } } var openLists = [], oIcount = 0; function addJavascript(jsname,pos) { var th = document.getElementsByTagName(pos)[0]; var s = document.createElement('script'); s.setAttribute('type','text/javascript'); s.setAttribute('src',jsname); th.appendChild(s); } function compactMenu(oID,oAutoCol,oPlMn,oMinimalLink) { if( !document.getElementsByTagName || !document.childNodes || !document.createElement ) { return; } var baseElement = document.getElementById( oID ); if( !baseElement ) { return; } compactChildren( baseElement, 0, oID, oAutoCol, oPlMn, baseElement.tagName.toUpperCase(), oMinimalLink && oPlMn ); } function compactChildren( oOb, oLev, oBsID, oCol, oPM, oT, oML ) { if( !oLev ) { oBsID = escape(oBsID); if( oCol ) { openLists[oBsID] = []; } } for( var x = 0, y = oOb.childNodes; x < y.length; x++ ) { if( y[x].tagName ) { //for each immediate LI child var theNextUL = y[x].getElementsByTagName( oT )[0]; if( theNextUL ) { //collapse the first UL/OL child theNextUL.style.display = 'none'; //create a link for expanding/collapsing var newLink = document.createElement('A'); newLink.setAttribute( 'href', oPM ); newLink.onclick = new Function( 'clickSmack(this,' + oLev + ',\'' + oBsID + '\',' + oCol + ',\'' + escape(oT) + '\');return false;' ); //wrap everything upto the child U/OL in the link if( oML ) { var theHTML = ''; } else { var theT = y[x].innerHTML.toUpperCase().indexOf('<'+oT); var theA = y[x].innerHTML.toUpperCase().indexOf('= oLevel; x-=1 ) { if( openLists[oBsID][x] ) { openLists[oBsID][x].style.display = 'none'; if( oLevel != x ) { openLists[oBsID][x] = null; } } } if( oThisOb == openLists[oBsID][oLevel] ) { openLists[oBsID][oLevel] = null; } else { oThisOb.style.display = 'block'; openLists[oBsID][oLevel] = oThisOb; } } else { oThisOb.style.display = ( oThisOb.style.display == 'block' ) ? 'none' : 'block'; } } function stateToFromStr(oID,oFStr) { if( !document.getElementsByTagName || !document.childNodes || !document.createElement ) { return ''; } var baseElement = document.getElementById( oID ); if( !baseElement ) { return ''; } if( !oFStr && typeof(oFStr) != 'undefined' ) { return ''; } if( oFStr ) { oFStr = oFStr.split(':'); } for( var oStr = '', l = baseElement.getElementsByTagName(baseElement.tagName), x = 0; l[x]; x++ ) { if( oFStr && MWJisInTheArray( l[x].MWJuniqueID, oFStr ) && l[x].style.display == 'none' ) { l[x].parentNode.getElementsByTagName('a')[0].onclick(); } else if( l[x].style.display != 'none' ) { oStr += (oStr?':':'') + l[x].MWJuniqueID; } } return oStr; } function MWJisInTheArray(oNeed,oHay) { for( var i = 0; i < oHay.length; i++ ) { if( oNeed == oHay[i] ) { return true; } } return false; } function selfLink(oRootElement,oClass,oExpand,oLink) { var tmpLink; if(!document.getElementsByTagName||!document.childNodes) { return; } oRootElement = document.getElementById(oRootElement); if( oLink ) { tmpLink = document.createElement('a'); tmpLink.setAttribute('href',oLink); } for( var x = 0, y = oRootElement.getElementsByTagName('a'); y[x]; x++ ) { if( y[x].getAttribute('href') && !y[x].href.match(/#$/) && getRealAddress(y[x]) == getRealAddress(oLink?tmpLink:location) ) { y[x].className = (y[x].className?(y[x].className+' '):'') + oClass; if( oExpand ) { oExpand = false; for( var oEl = y[x].parentNode, ulStr = ''; oEl != oRootElement && oEl != document.body; oEl = oEl.parentNode ) { if( oEl.tagName && oEl.tagName == oRootElement.tagName ) { ulStr = oEl.MWJuniqueID + (ulStr?(':'+ulStr):''); } } stateToFromStr(oRootElement.id,ulStr); } } } } function getRealAddress(oOb) { return oOb.protocol + ( ( oOb.protocol.indexOf( ':' ) + 1 ) ? '' : ':' ) + oOb.hostname + ( ( typeof(oOb.pathname) == typeof(' ') && oOb.pathname.indexOf('/') != 0 ) ? '/' : '' ) + oOb.pathname + oOb.search; } function expandCollapseAll(oElID,oState) { if(!document.getElementsByTagName||!document.childNodes) { return; } var oEl = document.getElementById(oElID); var oT = oEl.tagName; var oULs = oEl.getElementsByTagName(oT); for( var i = 0, oLnk; i < oULs.length; i++ ) { if( typeof(oULs[i].MWJuniqueID) != 'undefined' ) { oLnk = oULs[i].parentNode.getElementsByTagName( 'a' )[0]; if( oLnk && ( ( oState && oULs[i].style.display == 'none' ) || ( !oState && oULs[i].style.display != 'none' ) ) ) { oLnk.onclick(); } } } } // JavaScript Document /*************************************************************************************** Nested list collapsing script written by Mark Wilton-Jones - 21/11/2003 Version 2.3.0 - this script takes existing HTML nested UL or OL lists, and collapses them Updated 13/02/2004 to allow links in root of expanding branch Updated 09/09/2004 to allow state to be saved Updated 07/10/2004 to allow page address links to be highlighted Updated 28/11/2004 to allow you to force expand/collapse links to use just the extraHTML Updated 23/09/2006 to add expandCollapseAll and to allow selfLink to locate custom links **************************************************************************************** Please see http://www.howtocreate.co.uk/jslibs/ for details and a demo of this script Please see http://www.howtocreate.co.uk/jslibs/termsOfUse.html for terms of use _________________________________________________________________________ You can put as many lists on the page as you like, each list may have a different format. To use: _________________________________________________________________________ Inbetween the tags, put: _________________________________________________________________________ Define the HTML. Note that to correctly nest lists, child OLs or ULs should be children of an LI element, not direct descendents of their parent OL/UL. The text used to expand the branch should be written between the
  • tag and the
      tag, and should only contain HTML that is permitted inside an 'A' element. Note; Opera 7 will lose any style attributes you define in this text - use classes instead. ________________________________________________________________________ Now you need to trigger the collapsing, using tag. If using either onload technique, you must not use any other scripts that rely on the onload event. compactMenu(theRootID,shouldAutoCollapse,extraHTML[,useMinimalLink]); oID = string: ID of root nest element, must be a UL or OL; this will not be collapsed, but any child UL/OLs will be (note, if the root nest element is a UL, all child lists should be ULs - the same is true for OLs; if the root nest element is OL, all child lists should be OLs) shouldAutoCollapse = bool: auto-collapse unused branches extraHTML = string: HTML to insert to collapsible branches - usually '± ' useMinimalLink = bool: normally the expand/collapse link will use both extraHTML and the original list item text - if the list item text is already a link, this will not be included - set this option to true to force the script to use only the extraHTML as the link, even if the rest of the list item is not a link - this option will only be respected if you also provide some extraHTML eg 1. eg 2. eg 3. stateToFromStr(theRootID); oID = string: ID of root nest element, must be a UL or OL; returns a string representing all expanding branches - can be used with my cookie script to save state when unloading the page stateToFromStr(theRootID,stringRepresentation); oID = string: ID of root nest element, must be a UL or OL; stringRepresentation = string: string representation of expanded branches, as created above must be called _after_ collapsing the list - values can be recovered from cookies using my cookie script note: this facility will not be able to take changes in the list structure into account - use session cookies or short-term cookies to avoid longer term structure change problems selfLink(theRootID,newClass,shouldExpandBranch[,linkHref]); theRootID = string: ID of root nest element, must be a UL or OL; newClass = string: new class name to add to any existing class names shouldExpandBranch = bool: expand branches to show the first matching link linkHref = string: by default, it will try to locate links to the current page address - you can override that here by giving a specific address that it should look for. Allows you to highlight links to the current page that appear in the list must be called _after_ collapsing the list address hash and port are not included in the comparison - links containing href="#" are always ignored expandCollapseAll(theRootID,shouldExpand); theRootID = string: ID of root nest element, must be a UL or OL that has been collapsed using compactMenu shouldExpand = bool: says if it should expand all branches (true) or collapse all branches (false) Expands/collapses all branches in a collapsed list. Must not be used with auto-collapsing lists. My cookie script is available on http://www.howtocreate.co.uk/jslibs/ ____________________________________________________________________________________________________*/ var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i]?)\n/g, '$1'+ breakTag +'\n'); } function replace_html(el, html) { //This is a replacement for innerHTML, since innerHTML does not function properly in explorer if( el ) { var oldEl = (typeof el === "string" ? document.getElementById(el) : el); var newEl = document.createElement(oldEl.nodeName); // Preserve any properties we care about (id and class in this example) newEl.id = oldEl.id; newEl.className = oldEl.className; //set the new HTML and insert back into the DOM newEl.innerHTML = html; if(oldEl.parentNode) oldEl.parentNode.replaceChild(newEl, oldEl); else oldEl.innerHTML = html; //return a reference to the new element in case we need it return newEl; } } function removeBook(bookId,type,id) { var xmlhttp; var queryString = "?bookid=" + bookId + "&type=" + type + "&id=" + id; //Sending over javascript variables to PHP if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { alert('book removed'); window.location.reload(); } } // Send Method Which file to send to Parameters Asyncronous xmlhttp.open("GET", hostUrl + "process/common/removeBook.php" + queryString, true); xmlhttp.send(null); //The actual send command } function deletePost(id) { var xmlhttp; var queryString = "?id=" + id; //Sending over javascript variables to PHP if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { element=document.getElementById('commentBox' + id); element.setAttribute('style','display:none'); } } // Send Method Which file to send to Parameters Asyncronous xmlhttp.open("GET", hostUrl + "process/common/deleteComment.php" + queryString, true); xmlhttp.send(null); //The actual send command } function commentPost(commentId,type,sectionId) { var xmlhttp; tinyMCE.execCommand('mceAddControl',true,'commentField'+commentId); tinyMCE.triggerSave(); tinyMCE.execCommand('mceRemoveControl',true,'commentField'+commentId); element=document.getElementById('commentField' + commentId); content=element.value; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { window.location.reload(); // alert(xmlhttp.responseText); } } var param="&type=" + type + "&content=" + escape(content) + "§ionid=" + sectionId + "&replyid=" + commentId; xmlhttp.open("POST", hostUrl + "process/common/commentPost.php", true); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", param.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.send(param); //The actual send command*/ } function moreWallPosts(type,sectionId,name,from) { var queryString = "?type=" + type + "§ionid=" + sectionId + "&name=" + name + "&from=" + from; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { // alert("hello"); element=document.getElementById('mainWall'); resp=xmlhttp.responseText; element.innerHTML=resp; } } // Send Method Which file to send to Parameters Asyncronous xmlhttp.open("GET", hostUrl + "process/common/moreWallPosts.php" + queryString, true); xmlhttp.send(null); //The actual send command } function wallPost(type,sectionId) { var xmlhttp; tinyMCE.execCommand('mceAddControl',true,'wall'); tinyMCE.triggerSave();tinyMCE.execCommand('mceRemoveControl',true,'wall'); element=document.getElementById('wall'); content=element.value; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { window.location.reload(); // alert(xmlhttp.responseText); } } var param="&type=" + type + "&content=" + escape(content) + "§ionid=" + sectionId; xmlhttp.open("POST", hostUrl + "process/common/wallPost.php", true); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", param.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.send(param); //The actual send command*/ } function showCaptcha() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { element=document.getElementById('captchaWrapper'); element.setAttribute('style','border:1px #ccc dashed;float:left;height:130px;padding-bottom:5px'); element=document.getElementById('captcha'); element2=document.getElementById('captchaField'); element2.value=""; resp=xmlhttp.responseText; element.innerHTML=resp; } } // Send Method Which file to send to Parameters Asyncronous xmlhttp.open("GET", hostUrl + "process/common/showCaptcha.php", true); xmlhttp.send(null); //The actual send command } function validateForm(name,except) { var xmlhttp; switch(name) { case 'twinflame': element=document.getElementById('country'); country=element.value; var queryString = "?name=" + name + "&country=" + country; break; case 'message': element=document.getElementById('toMember'); toMember=element.value; var queryString = "?name=" + name + "&tomember=" + toMember; break; case 'blog': element=document.getElementById('title'); title=element.value; element=document.getElementById('category'); category=element.value; var queryString = "?name=" + name + "&title=" + escape(title) + "&category=" + category; break; case 'topic': element=document.getElementById('title'); title=element.value; var queryString = "?name=" + name + "&title=" + escape(title); break; case 'calendar': element=document.getElementById('shortdescription'); descript=element.value; var queryString = "?name=" + name + "&descript=" + escape(descript); break; case 'member': element=document.getElementById('username'); username=element.value; element=document.getElementById('password'); password=element.value; element=document.getElementById('email'); email=element.value; element=document.getElementById('captchaField'); captchaField=element.value; var queryString = "?name=" + name + "&username=" + escape(username) + "&password=" + escape(password) + "&email=" + escape(email) + "&captchaField=" + captchaField; break; case 'memberEdit': element=document.getElementById('password'); password=element.value; element=document.getElementById('emailmember'); email=element.value; var queryString = "?name=" + name + "&password=" + escape(password) + "&email=" + escape(email); break; case 'group': element=document.getElementById('groupname'); groupname=element.value; element=document.getElementById('email'); email=element.value; element=document.getElementById('category'); category=element.value; var queryString = "?name=" + name + "&email=" + escape(email) + "&groupname=" + escape(groupname) + "&category=" + category; break; case 'groupEdit': element=document.getElementById('groupname'); groupname=element.value; element=document.getElementById('email'); email=element.value; element=document.getElementById('url'); url=element.value; element=document.getElementById('category'); category=element.value; var queryString = "?name=" + name + "&email=" + escape(email) + "&groupname=" + escape(groupname) + "&url=" + escape(url) + "&except=" + escape(except) + "&category=" + category; break; case 'ascendLink': element=document.getElementById('intro'); intro=element.value; element=document.getElementById('title'); title=element.value; element=document.getElementById('category'); category=element.value; var queryString = "?name=" + name + "&intro=" + escape(intro) + "&category=" + category + "&title=" + escape(title); break; case 'book': element=document.getElementById('ISBN'); ISBN=element.value; element=document.getElementById('title'); title=element.value; element=document.getElementById('author'); author=element.value; var queryString = "?name=" + name + "&author=" + escape(author) + "&ISBN=" + ISBN + "&title=" + escape(title); break; } //Sending over javascript variables to PHP if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { val=xmlhttp.responseText; var process; process='Please wait
      Processing...'; if (val) { switch(name) { case 'twinflame': document.twinflame.submit();break; case 'message': document.message.submit(); break; case 'member': document.member.submit(); break; case 'memberEdit': var el; el=document.getElementById('memberDisplay'); el.setAttribute('style','display:none'); el2=document.getElementById('process'); el2.setAttribute('style','text-align:center;font-size:16px;color:#A09FC2;font-weight:bold;float:left;padding:200px'); el2.innerHTML=process; document.member.submit(); break; case 'group': var el; el=document.getElementById('groupDisplay'); el.setAttribute('style','display:none'); el2=document.getElementById('process'); el2.setAttribute('style','text-align:center;font-size:16px;color:#A09FC2;font-weight:bold;float:left;padding:200px'); el2.innerHTML=process; document.group.submit(); break; case 'groupEdit': var el; el=document.getElementById('groupDisplay'); el.setAttribute('style','display:none'); el2=document.getElementById('process'); el2.setAttribute('style','text-align:center;font-size:16px;color:#A09FC2;font-weight:bold;float:left;padding:200px'); el2.innerHTML=process; document.groupEdit.submit(); break; case 'ascendLink': document.ascendLink.submit(); break; case 'calendar': var el; el=document.getElementById('calendarDisplay'); el.setAttribute('style','display:none'); el2=document.getElementById('process'); el2.setAttribute('style','text-align:center;font-size:16px;color:#A09FC2;font-weight:bold;float:left;padding:200px'); el2.innerHTML=process; document.calendar.submit(); break; case 'topic': var el; el=document.getElementById('topicDisplay'); el.setAttribute('style','display:none'); el2=document.getElementById('process'); el2.setAttribute('style','text-align:center;font-size:16px;color:#A09FC2;font-weight:bold;float:left;padding:200px'); el2.innerHTML=process; document.composeTopic.submit(); break; case 'blog': var el; el=document.getElementById('blogDisplay'); el.setAttribute('style','display:none'); el2=document.getElementById('process'); el2.setAttribute('style','text-align:center;font-size:16px;color:#A09FC2;font-weight:bold;float:left;padding:200px'); el2.innerHTML=process; document.composeBlog.submit();break; case 'book': document.addBook.submit(); break; } } else alert("Some or one of the field(s) are not filled out correctly!") } } // Send Method Which file to send to Parameters Asyncronous xmlhttp.open("GET", hostUrl + "process/common/validateForm.php" + queryString, true); xmlhttp.send(null); //The actual send command } function validate(type,except) { var xmlhttp; element=document.getElementById(type) var elementX; elementX=escape(element.value); var queryString = "?type=" + type + "&element=" + elementX + "&except=" + except; //Sending over javascript variables to PHP if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { element2=document.getElementById(type + 'Val'); element2.innerHTML=xmlhttp.responseText; } } // Send Method Which file to send to Parameters Asyncronous xmlhttp.open("GET", hostUrl + "process/common/validate.php" + queryString, true); xmlhttp.send(null); //The actual send command } //Channeling specific function messagePeriod(period,id) { var xmlhttp; var queryString = "?period=" + period + "&id=" + id; //Sending over javascript variables to PHP if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { element=document.getElementById('period'); element.innerHTML=xmlhttp.responseText; } } // Send Method Which file to send to Parameters Asyncronous xmlhttp.open("GET", hostUrl + "process/channeling/messagePeriod.php" + queryString, true); xmlhttp.send(null); //The actual send command } //Admin moderator function setMod(moderateId,modCode,type,id,element) { value=""; for (var i = 0; i < element.length; i++) { if (element.options[i].selected) { text=element.options[i].text; value=element.options[i].value; break; } } var xmlhttp; var queryString = "?type=" + type + "&id=" + id + "&warning=" + value + "&modCode=" + modCode + "&moderateId=" + moderateId; //Sending over javascript variables to PHP if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { //alert(xmlhttp.responseText); window.location.reload(); } } // Send Method Which file to send to Parameters Asyncronous xmlhttp.open("GET", hostUrl + "process/admin/setMod.php" + queryString, true); xmlhttp.send(null); //The actual send command } //Admin Channeling function removeOptionSelected(element) { var i; for (i = element.length - 1; i>=0; i--) { if (element.options[i].selected) { element.remove(i); break; } } } function selectAll() { list=document.getElementById('listB'); list2=document.getElementById('list2B'); for (i = list.length - 1; i>=0; i--) list.options[i].selected=true; for (i = list2.length - 1; i>=0; i--) list2.options[i].selected=true; } function removeOptionSelectedB(element,id) { var i; for (i = element.length - 1; i>=0; i--) { if (element.options[i].selected) { text=element.options[i].text; value=element.options[i].value; element.remove(i); break; } } element=document.getElementById(id); appendOptionLast(text,value,element); } function appendOptionLast(text,value,list) { var opt = document.createElement('option'); opt.text = text; opt.value = value; try { list.add(opt, null); // standards compliant; doesn't work in IE } catch(ex) { list.add(opt); // IE only } } function setGroup(element,id) { text=null; value=null; for (var i = 0; i < element.length; i++) { if (element.options[i].selected) { text=element.options[i].text; value=element.options[i].value; elementB=document.getElementById(id); removeOptionSelected(element); appendOptionLast(text,value,elementB); break; } } } function setStyle(element,fontColor, bgColor) { element.style.backgroundColor=bgColor; element.style.color= fontColor; } function setCurrent(element,fontColor, bgColor) { var doc = document.getElementsByTagName('div'); for (var i = 0; i < doc.length; i++) { $regExp=/^subCat/; if (doc[i].id.match($regExp)) { if (doc[i].style.backgroundColor) doc[i].style.backgroundColor=''; } } element.style.backgroundColor=bgColor; element.style.color= fontColor; $regExp=/\d*$/; document.getElementById('part2').categoryId.value=element.id.match($regExp); } function updateCat(element,chk,type) { var t=document.getElementById(chk) if (type=='cat') { var parent=element.parentNode; //parent has to be declared or IE spits out errors var c=parent.childNodes; if (t.checked==false) { parent.setAttribute('class','unchecked'); for(i=0;i '; } } // Send Method Which file to send to Parameters Asyncronous xmlhttp.open("GET",hostUrl + "process/common/addFav.php" + queryString, true); xmlhttp.send(null); //The actual send command } function commentForm(tag,comId,sectionId,sectionType,indent) { var type='reply'; if (comId==0) //New comment type='new'; boxy=document.getElementById(tag); var visibleHTML='

      Post Comment
      '; var hiddenHTML=''; if (boxy) { if (boxy.style.visibility=='hidden') { boxy.innerHTML=visibleHTML; boxy.style.visibility='visible'; tinyMCE.init ({ // General options mode : "exact", elements: "replyBox", theme : "advanced", editor_selector : "mceSimple", theme_advanced_toolbar_align : "left", theme_advanced_disable : "cleanup", theme_advanced_buttons1 : "bold,italic,underline,formatselect,fontselect,fontsizeselect,forecolor,backcolor,undo,link,unlink,bullist,numlist,charmap", theme_advanced_buttons2 :"", theme_advanced_buttons3 :"", forced_root_block : false, force_p_newlines : false, remove_linebreaks : false, force_br_newlines : true, remove_trailing_nbsp : false, verify_html : false, content_css : hostUrl + "/css/tinyMCE/myContent.css?" + new Date().getTime(), }); } else if (boxy.style.visibility=='visible') { boxy.style.visibility='hidden'; boxy.innerHTML=hiddenHTML; } if (boxy.style.height=='0%') boxy.style.height='100%'; else if (boxy.style.height=='100%') boxy.style.height='0%'; } else { alert("There is no element in the tag: " + tag); } } function processSectionPoints(sectionId,sectionType) { var xmlhttp; var queryString = "?sectionId=" + sectionId + "§ionType=" + sectionType; //Sending over javascript variables to PHP if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { window.location.reload(); } } // Send Method Which file to send to Parameters Asyncronous xmlhttp.open("GET",hostUrl + "process/common/processSectionPoints.php" + queryString, true); xmlhttp.send(null); //The actual send command } //************************************************Comment specific functions*********************************************************** function showComment(id) { element=document.getElementById('comment' + id); element.setAttribute('style','text-align:right;float:left;height:200px;width:400px'); //document.getElementById('wall').focus(); tinyMCE.init ({ // General options //plugins : "tabfocus", mode : "exact", elements: "commentField" + id, theme : "advanced", editor_selector : "mceSimple", theme_advanced_toolbar_align : "left", theme_advanced_disable : "cleanup,styleselect", theme_advanced_buttons1 : "bold,italic,underline,formatselect,fontselect,fontsizeselect,forecolor,backcolor,undo,link,unlink,bullist,numlist,charmap", theme_advanced_buttons2 :"", theme_advanced_buttons3 :"", forced_root_block : false, force_p_newlines : 'false', remove_linebreaks : false, force_br_newlines : true, remove_trailing_nbsp : false, verify_html : false, content_css : hostUrl + "/css/tinyMCE/myContent.css?" + new Date().getTime(), }); } function showTinyMCE() { wrapper=document.getElementById('wallWrapper'); wrapper.setAttribute('style','padding-bottom:30px;float:left;height:250px;width:600px;'); //document.getElementById('wall').focus(); tinyMCE.init ({ // General options //plugins : "tabfocus", mode : "exact", elements: "wall", theme : "advanced", editor_selector : "mceSimple", theme_advanced_toolbar_align : "left", theme_advanced_disable : "cleanup,styleselect", theme_advanced_buttons1 : "bold,italic,underline,formatselect,fontselect,fontsizeselect,forecolor,backcolor,undo,link,unlink,bullist,numlist,charmap", theme_advanced_buttons2 :"", theme_advanced_buttons3 :"", forced_root_block : false, force_p_newlines : 'false', remove_linebreaks : false, force_br_newlines : true, remove_trailing_nbsp : false, verify_html : false, content_css : hostUrl + "/css/tinyMCE/myContent.css?" + new Date().getTime(), }); //tinyMCE.execCommand('mceAddControl',true,'wall'); //tinyMCE.execInstanceCommand("mce_editor_0", "mceFocus"); //tinyMCE.activeEditor.focus(); } function processPoints(type,comId) { var xmlhttp; var queryString = "?comId=" + comId + "&type=" + type; //Sending over javascript variables to PHP if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { window.location.reload(); } } // Send Method Which file to send to Parameters Asyncronous xmlhttp.open("GET", hostUrl + "process/comment/processPoints.php" + queryString, true); xmlhttp.send(null); //The actual send command } function updateComment() //AJAX Function { boxy=document.getElementById("commentSection"); var xmlhttp; var orderType=document.order.orderBy.value; //Roll down menu chosen option var sectionId=document.order.sectionId.value; //Setting javascript variables from PHP variables var sectionType=document.order.sectionType.value; var threshold=document.order.threshold.value; var queryString = "?ordertype=" + orderType + "§ionid=" + sectionId + "§ionType=" + sectionType + "&threshold=" + threshold; //Sending over javascript variables to PHP if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { document.getElementById("temp0").innerHTML=''; boxy.innerHTML=xmlhttp.responseText; //Recieving the PHP file output compactMenu('lemId',true,' Replies',true); //alert(xmlhttp.responseText); } } // Send Method Which file to send to Parameters Asyncronous xmlhttp.open("GET",hostUrl + "process/comment/outputComment.php" + queryString, true); xmlhttp.send(null); //The actual send command return true; } function onSubmit(sectionType,type,indent) { var str; tinyMCE.execCommand('mceAddControl',true,'replyBox'); tinyMCE.triggerSave(); tinyMCE.execCommand('mceRemoveControl',true,'replyBox'); var comment=document.compose.comment.value; var comId=0; if (type=='reply') var comId=document.compose.comId.value; var sectionId=document.compose.sectionId.value; var xmlhttp; var queryString = "?comment=" + escape(comment) + "&comId=" + comId + "§ionId=" + sectionId + "&indent=" + indent + "§ionType=" + sectionType; //Sending over javascript variables to PHP if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { //Reacieving the PHP file output str=xmlhttp.responseText; if (str!="unlogged") { /*$tag="temp"+comId; box=document.getElementById($tag); if(box) { replace_html(box, str); } */ window.location.reload(); } else alert("You are not logged in!"); } } //alert("What the?"); // Send Method Which file to send to Parameters Asyncronous xmlhttp.open("GET",hostUrl + "process/comment/processComment.php" + queryString, true); xmlhttp.send(null); //The actual send command }