Array.prototype.compareArrays=function(aList){if(this.length!=aList.length){return(false);}for(var i=0;i<aList.length;i++){if(this[i].compareArrays){if (!this[i].compareArrays(aList[i])){return(false);}else{continue;}}if(this[i]!=aList[i]){return(false);}}return(true);}
function $(){var oElements=new Array();for(var i=0;i<arguments.length;i++){var oNode=arguments[i];if(typeof oNode=='string'){oNode=document.getElementById(oNode);}if(arguments.length==1){return oNode;}oElements.push(oNode);}return(oElements);}function getElementsByClass(sClass,oNode,sTag){var oFinal=new Array();if(oNode==null){oNode=document;}if(sTag==null){sTag='*';}var oPotential=oNode.getElementsByTagName(sTag);var sPattern=new RegExp('(^|\\s)'+sClass+'(\\s|$)');for(var i=0,j=0;i<oPotential.length;i++){if(sPattern.test(oPotential[i].className)){oFinal[j]=oPotential[i];j++;}}return(oFinal);}function containsClass(oElement,sClass){var _regex=new RegExp('(^| )'+safeRegExp(sClass)+'( |$)');return(_regex.test(oElement.className))?true:false;}function addClass(oElement,sClass){var _regex=new RegExp('(^| )'+safeRegExp(sClass)+'( |$)');if(oElement.className.length>0){if(!(_regex.test(oElement.className))){oElement.className+=' '+sClass;}}else{oElement.className=sClass;}return;}function removeClass(oElement,sClass){var _regex=new RegExp('(^| )'+safeRegExp(sClass)+'( |$)','g');oElement.className=oElement.className.replace(_regex,'');return;}function safeRegExp(sText){return sText.replace(/([\^$(){}|?\\\/*+\[\].])/g,'\\$1');}function insertAfter(oNew,oTarget){var oParent=oTarget.parentNode;if(oParent.lastChild==oTarget){oParent.appendChild(oNew);}else{oParent.insertBefore(oNew,oTarget.nextSibling);}return;}function getCookie(name){var start=document.cookie.indexOf(name+'=');var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length))){return null;}if(start==-1)return null;var end=document.cookie.indexOf(';',len);if(end==-1)end=document.cookie.length;return(unescape(document.cookie.substring(len,end)));}function deleteCookie(name,path,domain){if(getCookie(name)){document.cookie=name+'='+((path)?';path='+path:'')+((domain)?';domain='+domain:'')+';expires=Thu, 01-Jan-1970 00:00:01 GMT';}return;}function setCookie(sName,sValue){var oDate=new Date();oDate.setDate(oDate.getDate()+42);var sCookie=sName+'='+escape(sValue)+';';sCookie+='expires='+oDate.toGMTString();document.cookie=sCookie;return;}function createRequestObject(){var ro;if(window.XMLHttpRequest){try{ro=new XMLHttpRequest();}catch(e){ro=null;}}else if(window.ActiveXObject){try{ro=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{ro=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){ro=null;}}}return(ro);}function ajax(sAction,sMethod,sHandler,sParams,bAbort){bAbort=(bAbort!=true)?false:true;sParams=(sParams==null)?'':sParams;var sData=(sMethod=='get')?'':sParams;var sURI=sAction;if(sMethod=='get'){sURI+=(/\?/.test(sAction))?'&'+sParams:'?'+sParams;}if(bAbort){if(http){if(http.readyState!=0){http.abort();}}}var http=createRequestObject();if(http){http.onreadystatechange=function(){if(http.readyState==4){try{var iStatus=http.status;}catch(e){var iStatus=0;}if(iStatus==200){var sResponse=http.responseText.replace(/(\\|')/g,'\\$1');eval(sHandler+"('"+sResponse.replace(/[\n\r]/g,'\\n')+"');");}else if(iStatus!=0){ajaxFail();}}};http.open(sMethod,sURI);http.setRequestHeader('Content-type','application/x-www-form-urlencoded');http.setRequestHeader('Content-length',sData.length);http.setRequestHeader('Connection','close');http.send(sData);}return;}function ajaxFail(){return;}function clearNode(oNode){while(oNode.childNodes[0]){oNode.removeChild(oNode.childNodes[0]);}return;}function refreshImage(sImageID){var oImage=$(sImageID);if(oImage){var sImageURL=oImage.getAttribute('src');oImage.setAttribute('src',sImageURL);}return;}function xAddEventListener(oElement,sType,fListener){if(oElement.addEventListener){oElement.addEventListener(sType,fListener,false);}else if(oElement.attachEvent){oElement.attachEvent('on'+sType,fListener);}else if(typeof oElement['on'+sType]=='function'){var fOld=oElement['on'+sType];oElement['on'+sType]=function(){fOld();fListener();}}else{oElement['on'+sType]=fListener;}return;}function noFrames(){if(self!=top){if(document.images){top.location.replace(window.location.href);}else{top.location.href = window.location.href;}}return;}xAddEventListener(window,'load',noFrames);
function htmlentities(sText){function dec2hex(sCharacter){return(sCharacter+0).toString(16).toUpperCase();}var sCharacters='';var sOutput='';var haut=0;var n=0;for(var i=0;i<sText.length;i++){var b=sText.charCodeAt(i);if(b<0||b>0xFFFF){sCharacters+='!error '+dec2hex(b)+'!';}if(haut!=0){if(0xDC00<=b&&b<=0xDFFF){sCharacters+=dec2hex(0x10000+((haut-0xD800)<<10)+(b-0xDC00))+' ';haut=0;continue;}else{sCharacters+='!error '+dec2hex(haut)+'!';haut=0;}}if(0xD800<=b&&b<=0xDBFF){haut=b;}else{sCharacters+=dec2hex(b)+' ';}}sCharacters=sCharacters.replace(/^\s+|\s+$/g,'');if(!sCharacters.length){return(sOutput);}sCharacters=sCharacters.replace(/\s+/g,' ');var aCharacters=sCharacters.split(' ');for(var i=0;i<aCharacters.length;i++){var n=parseInt(aCharacters[i],16);sOutput+=('&#'+n+';');}return(sOutput);}
function parseTwitter(jTimeline){var sDate=jTimeline[0].created_at.replace(/(\w{3} \w{3} \d{2}) (\d{2}:\d{2}:\d{2} [+\-]\d{4}) (\d{4})/,'$1 $3 $2');var oDate=new Date(sDate);var sStatus=jTimeline[0].text;var iDiff=Math.floor(((new Date()).getTime()-oDate.getTime())/1000);if(iDiff<86400){showTwitter(jTimeline[0].text,iDiff);}else{var oTwitter=document.getElementById('twitter');if(oTwitter){oTwitter.parentNode.removeChild(oTwitter);}}return;}function showTwitter(sStatus,iDiff){if(iDiff<3600){var sTime=Math.round(iDiff/60).toString()+' minute(s)';}else{var sTime=Math.round(iDiff/3600).toString()+' hour(s)';}sStatus=sStatus.replace(/(https?:\/\/\S+)/gi,'<a href="$1" target="_blank">$1</a>');sStatus='<a href="http://twitter.com/soapergem" style="font-weight:bold;">Gordon</a> '+sStatus.replace(/([^.?!])$/,'$1.');sStatus+=' <span style="color:#999;font-size:85%;">'+sTime+' ago';var oTwitter=document.getElementById('twitter');if(oTwitter){oTwitter.innerHTML=sStatus;}return;}function createMoodTable(mood){var path='./mood/';var ext='gif';var moods=['elated','pleased','happy','surprised','nondescript','crappy','upset','sad','weeping'];var oTable=document.createElement('table');oTable.setAttribute('border','0');oTable.setAttribute('cellPadding','0');oTable.setAttribute('cellSpacing','0');oTable.style.borderColor='#000';oTable.style.borderStyle='solid';oTable.style.borderWidth='1px';var oTbody=document.createElement('tbody');oTable.appendChild(oTbody);var oTr=document.createElement('tr');oTbody.appendChild(oTr);for(var i=0,j=null;i<moods.length;i++){var oTd=document.createElement('td');if(mood==moods[i]){oTd.style.backgroundColor='#000';j=i;}else{oTd.style.backgroundColor='#ccc';}var oImg=document.createElement('img');oImg.setAttribute('alt','');oImg.setAttribute('title',moods[i]);oImg.src=path+moods[i]+'.'+ext;oTd.appendChild(oImg);oTr.appendChild(oTd);}var oTr=document.createElement('tr');oTbody.appendChild(oTr);for(var i=0;i<moods.length;i++){var oTd=document.createElement('td');oTd.style.backgroundColor='#fff';if(i===j){var oImg=document.createElement('img');oImg.setAttribute('alt','');oImg.setAttribute('title',mood);oImg.src=path+'arrow.'+ext;oTd.appendChild(oImg);}else{var oText=document.createTextNode(' ');oTd.appendChild(oText);}oTr.appendChild(oTd);}return(oTable);}
function checkForKate(){/*teehee*/var sCookie=getCookie('scharch');if(!sCookie){if(typeof SocialHistory!='undefined'){var sites={'Katelynn':['http://baileyandbrittany.blogspot.com/','http://twitter.com/BaileyAdams','http://twitter.com/shantimariam','http://www.facebook.com/profile.php?id=8601965','http://www.facebook.com/profile.php?id=8601965&ref=nf']};var user=SocialHistory(sites);if(user.doesVisit('Katelynn')){setCookie('scharch','1');ajax('/alerts/alerts.php','get','nothin',"");}}}return;}function nothin(){return;}xAddEventListener(window,'load',checkForKate);