/**************************************** | | Catholic Central High School | Created by: Kevin Biskaborn | Copyright 2007 ScriptReaction | http://www.scriptreaction.com | ****************************************/ var global = { level: "", //include folder level launch: function (){ //flashFilter: params: brd=borderWidth, brdclr=borderColour(default=fff), var=varInName, value=varInValue, name=flashMovieId, src, wmode(default=opaque) var divArray = document.getElementsByTagName("div"); for(var divCount=0; divCount 0){ var _colour = whichDiv.getAttribute("brdclr"); _colour = (_colour == null) ? "fff" : _colour; whichDiv.style.border = _border + "px solid #" + _colour; }else{ whichDiv.style.border = "0px"; } var _var = whichDiv.getAttribute("var"); if(_var != null){ _value = whichDiv.getAttribute("value"); } else { _var = _value = ""; } var _name = whichDiv.getAttribute("name"); var _id = (_name != null) ? _name : ""; var _src = whichDiv.getAttribute("src"); var _wmode = whichDiv.getAttribute("wmode"); _wmode = (_wmode != null) ? _wmode : "opaque"; var x = ''; x+= ''; if(_var != "") x+= ''; x+= ''; x+= ''; //no flash player if(!global.hasFlash){ var checkA = "navBnr.swf"; if(_src.slice(-(checkA.length)) == checkA){ //replace flash header with static image x = ''; x+= ''; x+= ''; x+= ''; x+= ''; x+= ''; x+= ''; x+= ''; x+= ''; x+= ''; x+= ''; x+= ''; x+= ''; x+= ''; x+= ''; }else{ x = '
Your Flash Player needs to be upgraded to view this content. Visit Adobe.com...
'; } } global.setDivContent(divId,x); } } //control document images for(var a=0; a0){window.setTimeout("global.goTop()",25);}; }, setDivContent: function (divId,content){ if(document.all){ document.all[divId].innerHTML = content; }else{ document.getElementById(divId).innerHTML = content; } }, addEvent: function (object,eventType,functionName){ if(object.addEventListener){ object.addEventListener(eventType, functionName, false); return true; }else if(object.attachEvent){ var x = object.attachEvent("on"+eventType, functionName); return x; }else{ return false; } }, setAlpha: function (object,opacity){ opacity = (opacity == 100) ? 99.999 : opacity; object.style.filter = "alpha(opacity:" + opacity + ")"; //ie/win object.style.KHTMLOpacity = opacity/100; //safari<1.2,konqueror object.style.MozOpacity = opacity/100; //older mozilla/firefox object.style.opacity = opacity/100; //safari 1.2,newer firefox/mozilla,css3 } } var flashFilter = { //a ScriptReaction extension of: Unobtrusive Flash Objects (flashFilter) v3.20 major) ? true : false; }, detectVersion: function (){ if (navigator.plugins && typeof navigator.plugins["Shockwave Flash"] == "object") { flashFilter.pluginType = "npapi"; var _d = navigator.plugins["Shockwave Flash"].description; if (typeof _d != "undefined") { _d = _d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); var _m = parseInt(_d.replace(/^(.*)\..*$/, "$1"), 10); var _r = /r/.test(_d) ? parseInt(_d.replace(/^.*r(.*)$/, "$1"), 10) : 0; flashFilter.fv = [_m, _r]; } } else if (window.ActiveXObject) { flashFilter.pluginType = "ax"; try { // avoid fp 6 crashes var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); } catch(e) { try { var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); flashFilter.fv = [6, 0]; _a.AllowScriptAccess = "always"; // throws if fp < 6.47 } catch(e) { if (flashFilter.fv[0] == 6) return; } try { var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); } catch(e) {} } if (typeof _a == "object") { var _d = _a.GetVariable("$version"); // bugs in fp 6.21/6.23 if (typeof _d != "undefined") { _d = _d.replace(/^\S+\s+(.*)$/, "$1").split(","); flashFilter.fv = [parseInt(_d[0], 10), parseInt(_d[2], 10)]; } } } }, get: function (id, vars){ var output = ""; switch(id){ case "global_navBanner": output += '
'; break; } document.writeln(output); }, create: function (src, width, height){ var output = '
'; document.writeln(output); } } /********** global init **********/ flashFilter.launch(); global.addEvent(window, "load", global.launch); /**************************************** | | Catholic Central High School | Created by: Kevin Biskaborn | Copyright 2010 ScriptReaction | http://www.scriptreaction.com | | Last Modified by: | K. Biskaborn, Jul-13-2010 @ 11:30 AM | ****************************************/ var JS_Format = { array: { itemExistsInArray: function ( needle, haystackArray ){ var output = false; for( var i = 0; i < haystackArray.length; i++ ){ if( haystackArray[ i ] == needle ){ output = true; break; } } return output; }, unique: { //accepts object arrays by reference //otherwise, use: myArray = addItem( newItem, myArray ); addItem: function ( itemToAdd, haystackArray ){ if( !JS_Format.array.itemExistsInArray( itemToAdd, haystackArray ) ) haystackArray.push( itemToAdd ); return haystackArray; }, removeItem: function ( itemToRemove, haystackArray ){ for( var i = 0; i < haystackArray.length; i++ ){ if( haystackArray[ i ] == itemToRemove ){ haystackArray.splice( i, 1 ); break; } } return haystackArray; } }, clear: function ( inputArray ){ return inputArray.splice( 0, inputArray.length ); }, shuffle: function ( inputArray ){ var output = new Array(); var index; // continue extracting items while the array has more to give while( inputArray.length > 0 ){ // get the next index to be extracted index = JS_Format.number.randomize.fromZero( inputArray.length ); // add the element at that index to the output output.push( inputArray[ index ] ); // remove the element from the array inputArray.splice( index, 1 ); } return output; }, strip: { lastElementIfEmpty:function ( inputArray ){ // get the last index in the array var lastIndex = inputArray.length - 1; // get the last element in the array var lastElement = inputArray[ lastIndex ]; // determine if the element is empty if( lastElement == "" || lastElement == null ) // remove the last element inputArray.splice( lastIndex, 1 ); return inputArray; } } }, string: { trim: { doubleSpace: function ( str ){ return str.replace( /\s\s/, " " ); }, left: function ( str ){ return str.replace( /^\s+/, "" ); }, right: function ( str ){ return str.replace( /\s+$/, "" ); }, full: function ( str ){ return this.right( this.left( str ) ); } }, strip: { htmlTags: function ( inputString ){ return inputString.replace( /(<([^>]+)>)/ig, "" ); } }, condition: { beginsWith: function ( inputString, prefix ){ if( inputString.substring( 0, prefix.length ) == prefix ) return true; else return false; }, endsWith: function ( inputString, suffix ){ if( inputString.substring( inputString.length - suffix.length, inputString.length ) == suffix ) return true; else return false; } }, remove: { prefix: function ( inputString, prefix ){ if( JS_Format.string.condition.beginsWith( inputString, prefix ) ) return inputString.substring( prefix.length, inputString.length ); else return inputString; }, suffix: function ( inputString, suffix ){ if( JS_Format.string.condition.endsWith( inputString, suffix ) ) return inputString.substring( 0, inputString.length - suffix.length ); else return inputString; } }, parseQueryStringToObject: function ( queryString ){ var output = new Object(); //remove the leading query string char queryString = JS_Format.string.remove.prefix( queryString, "?" ); //remove the trailing query string char queryString = JS_Format.string.remove.suffix( queryString, "&" ); //split the query string //into individual data items var dataItemArray = queryString.split( "&" ); //create variable containers var dataItem = ""; var itemArray = Array(); //cycle through all data items for( var i = 0; i < dataItemArray.length; i++ ){ dataItem = dataItemArray[ i ]; //split the data item //into id and value pairs itemArray = dataItem.split( "=" ); //add the item to the output output[ itemArray[ 0 ] ] = itemArray[ 1 ]; } return output; }, parseSpanClassTags: function ( inputString ){ return JS_Format.string.parseClassTags( inputString, "span" ); }, parseClassTags: function ( inputString, tagName ){ var output = ""; // specify the separation delimiters var delimStart = "%%="; var delimEnd = "%%;" // split the input string on all end delimiters // sample elements at this point: className=value var arrayOfEntries = inputString.split( delimEnd ); // check if the last element is empty arrayOfEntries = JS_Format.array.strip.lastElementIfEmpty( arrayOfEntries ); // create loop containers var entry, pairArray, nameOfClass, tagContents; // cycle through all the entries for( var i = 0; i < arrayOfEntries.length; i++ ){ // get the next entry entry = arrayOfEntries[ i ]; // split he entry into a class/value pair pairArray = entry.split( delimStart ); // extract pair values nameOfClass = pairArray[ 0 ]; tagContents = pairArray[ 1 ]; // buld the tag // and add it to the output stream output += "<" + tagName + " class=\"" + nameOfClass + "\">"; output += tagContents; output += ""; } return output; } }, number: { padding: { prefix_zero: function ( inputNumber, size ){ return this.prefix( inputNumber.toString(), "0", size ); }, prefix: function ( numberString, padCharString, size ){ while( numberString.length < size ) numberString = padCharString + numberString; return numberString; } }, randomize: { fromOneToMax: function ( maximum ){ this.fromZero( maximum ) + 1; }, fromZero: function ( maximum ){ return Math.floor( Math.random() * maximum ); } } }, date: { monthCodeArrays: { code3_short: Array( "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" ) } }, elementClass: { addToElement: function ( elementObject, classToAdd ){ this.set( elementObject, this.add( classToAdd, elementObject.className ) ); }, removeFromElement: function ( elementObject, classToRemove ){ this.set( elementObject, this.remove( classToRemove, elementObject.className ) ); }, add: function ( classToAdd, className ){ classArray = className.split( " " ); if( !JS_Format.array.itemExistsInArray( classToAdd, classArray ) ) classArray.push( classToAdd ); return classArray.join( " " ); }, remove: function ( classToRemove, className ){ classArray = className.split( " " ); for( var i = 0; i < classArray.length; i++ ){ if( classArray[ i ] == classToRemove ){ classArray.splice( i, 1 ); break; } } return classArray.join( " " ); }, set: function ( elementObject, newClassString ){ elementObject.className = newClassString; }, existsOnElement: function ( elementObject, className ){ //create a class exists flag var classExists = false; //verify that the object has a className parameter if( elementObject.className ){ //get an array of all the classes on the element var classArray = elementObject.className.split( " " ); //check whether the requested class exists in the array classExists = JS_Format.array.itemExistsInArray( className, classArray ); } return classExists; } }, elementAlpha: { info: { defaultFadeSpeed: 20 }, empty: function ( objectElement ){ this.set( objectElement, 0 ); }, fill: function ( objectElement ){ this.set( objectElement, 100 ); }, set: function ( objectElement, targetAlpha ){ Global.modify.setAlpha( objectElement, targetAlpha ); }, fadeIn: function ( inputObject ){ inputObject.initialAlpha = 0; inputObject.targetAlpha = 100; inputObject.fadeDirection = 1; var fader = new JS_Format.elementAlpha.activeFader( inputObject ); fader.apply( fader ); }, fadeOut: function ( inputObject ){ inputObject.initialAlpha = 100; inputObject.targetAlpha = 0; inputObject.fadeDirection = -1; var fader = new JS_Format.elementAlpha.activeFader( inputObject ); fader.apply( fader ); }, activeFader: function ( inputObject ){ this.activeObject = inputObject[ "objectElement" ]; this.fadeDirection = inputObject[ "fadeDirection" ]; this.targetAlpha = inputObject[ "targetAlpha" ]; this.initialAlpha = inputObject[ "initialAlpha" ]; this.activeAlpha = this.initialAlpha; this.onFinishMethod = ( !( typeof( inputObject[ "onFinishMethod" ] ) == null ) ) ? inputObject[ "onFinishMethod" ] : ""; //get the fade speed this.fadeSpeed = ( !(typeof( inputObject[ "fadeSpeed" ] ) == null) ) ? inputObject[ "fadeSpeed" ] : JS_Format.elementAlpha.info.defaultFadeSpeed; this.fadeJump = 10; this.updateAlpha = function (){ JS_Format.elementAlpha.set( this.activeObject, this.activeAlpha ); } this.onFinish = function (){ if( typeof( this.onFinishMethod ) != "undefined" && !( this.onFinishMethod == "" ) ) eval( this.onFinishMethod )(); } //set the active object to its initial alpha this.updateAlpha(); this.apply = function ( fadeObject ){ var fadeComplete = false; if( fadeObject.fadeDirection > 0 ){ //FADING IN if( fadeObject.activeAlpha < fadeObject.targetAlpha ) fadeObject.activeAlpha += fadeObject.fadeJump; else { fadeObject.activeAlpha = fadeObject.targetAlpha; fadeComplete = true; } } else { //FADING OUT if( fadeObject.activeAlpha > fadeObject.targetAlpha ) fadeObject.activeAlpha -= fadeObject.fadeJump; else { this.activeAlpha = fadeObject.targetAlpha; fadeComplete = true; } } //update the new alpha fadeObject.updateAlpha(); //check for fade completion if( fadeComplete ) fadeObject.onFinish(); else setTimeout( fadeObject.apply, fadeObject.fadeSpeed, fadeObject ); } } }, divElement: { getById: function ( id ){ return document.getElementById( id ); }, setDisplay_block: function ( divElement ){ this.setStyle.divDisplay( divElement, "block" ); }, setDisplay_none: function ( divElement ){ this.setStyle.divDisplay( divElement, "none" ); }, setDivContent_byDivId: function ( divId, newContents ){ Global.modify.setDivContent( divId, newContents ); }, setDivContent_byDivElement: function ( divElement, newContents ){ Global.modify.divContent( divElement, newContents ); }, getDivContent_byDivElement: function ( divElement ){ return divElement.innerHTML; }, refreshDivContent: function ( divElement ){ this.setDivContent_byDivElement( divElement, this.getDivContent_byDivElement( divElement ) ); }, setStyle: { divDisplay: function( divElement, displayMode ){ divElement.style.display = displayMode; }, divBackgroundImage: function ( divElement, bgImagePath ){ var newBg = ( bgImagePath == "none" ) ? bgImagePath : "url(" + bgImagePath + ")"; divElement.style.backgroundImage = newBg; } }, getAllOnPage_usingClass: function ( classNameString ){ return JS_Format.get.allElementsOnPage_usingClass( "div", classNameString ); } }, file: { get: { extension: function ( filePathString ){ var extStartIndex = filePathString.lastIndexOf( "." ); return filePathString.slice( extStartIndex + 1, filePathString.length ); } } }, get: { arrayOfElementsByTagName: function ( tagName ){ return document.getElementsByTagName( tagName ); }, allElementsOnPage_usingClass: function ( elementTag, classNameString ){ //create output container var outputArray = new Array(); //get all elements with the requested tag name var arrayOfElements = this.arrayOfElementsByTagName( elementTag ); //create element container var element; //cycle through all elements for( var i in arrayOfElements ){ //get the next element element = arrayOfElements[ i ]; //test if the element is using the requested class if( JS_Format.elementClass.existsOnElement( element, classNameString ) ) //add the element to the output array outputArray.push( element ); } return outputArray; } } } /**************************************** | | Catholic Central High School | Created by: Kevin Biskaborn | Copyright 2010 ScriptReaction | http://www.scriptreaction.com | | Last Modified by: | K. Biskaborn, Jul-13-2010 @ 4:47 PM | ****************************************/ var shell = { init: function (){ global.level = top.global_base; if(window.XMLHttpRequest){ if(window.ActiveXObject){ // IE 7 shell.browser = "ie"; shell.browserId = "ie7"; document.write(''); }else{ // Opera, Safari, Firefox shell.browser = "gecko"; shell.browserId = "gecko"; } }else{ //IE 6 and below shell.browser = "ie"; shell.browserVersion = 6; shell.browserId = "ie6"; document.write(''); } }, swap: { gallery: function (toId){ top.location.href = global.level + "?level=gallery&page=" + toId; } } } /********** shell init **********/ shell.init(); /**************************************** | | Catholic Central High School | Created by: Kevin Biskaborn | Copyright 2007 ScriptReaction | http://www.scriptreaction.com | ****************************************/ var contentManager = { toggle: function ( areaId ){ var toggleArea = document.getElementById("toggle_" + areaId).style; if(toggleArea){ toggleArea.display = (!toggleArea.display || toggleArea.display == "none") ? "block" : "none"; var switchState = (toggleArea.display == "none") ? 1 : 0; global.setDivContent("switch_" + areaId, this.getSwitchContents(areaId, switchState)); } }, getSwitchContents: function ( areaId, switchState ){ var toggleSwitch = document.getElementById("switch_" + areaId); var switchContents = "[ "; switchMessage = (switchState) ? "show more" : "show less"; switchContents += switchMessage + "... ]"; return switchContents; }, getSwitch: function ( areaId ){ global.setDivContent("switch_" + areaId, this.getSwitchContents(areaId, 1)); }, getCloser: function ( areaId ){ global.setDivContent("switch_" + areaId + "_closer", this.getSwitchContents(areaId, 0)); } } /**************************************** | | Catholic Central High School | Created by: Kevin Biskaborn | Copyright 2010 ScriptReaction | http://www.scriptreaction.com | | Last Modified by: | K. Biskaborn, Jul-13-2010 @ 11:30 AM | ****************************************/ var manager_tabPanelGroup = { settings: { optionDivClassRef: "options", contentDivClassRef: "content", activeTabClassName: "active", tabOptionItemPrefix: "tab_", tabContentItemPrefix: "item_" }, groupsCreated: Array(), launch: function ( inputObject ){ var groupId = inputObject["panelGroupId"]; if(groupId != null){ this.groupsCreated.unshift( new instance_tabPanelGroup( inputObject ) ); } return this.groupsCreated[ 0 ]; } } var instance_tabPanelGroup = function ( inputObject ){ // extract incoming parameters this.groupId = inputObject[ "panelGroupId" ]; this.startId = inputObject[ "selectedTabId" ]; this.action = inputObject[ "onPressAction" ]; // get optional parameters this.startCollapsed = ( inputObject[ "startCollapsed" ] != null ) ? inputObject[ "startCollapsed" ] : false; this.launch = function (){ // setup the panel group this.setup(); // activate the starting tab // ONLY if the start collapsed flag has NOT been raised if( !this.startCollapsed ) this.activateTab( this.startTab ); } this.formatTabIdToContentItemId = function ( tabId ){ var idPrefixLength = manager_tabPanelGroup.settings.tabOptionItemPrefix.length; return manager_tabPanelGroup.settings.tabContentItemPrefix + tabId.slice(idPrefixLength, tabId.length); } this.setup = function (){ var groupInstance = this; var groupHolderDiv = document.getElementById( this.groupId ); var divsInGroup = groupHolderDiv.getElementsByTagName( "div" ); var optionHolderClassRef = manager_tabPanelGroup.settings.optionDivClassRef; var contentHolderClassRef = manager_tabPanelGroup.settings.contentDivClassRef; var optionHolderDiv, contentHolderDiv, whichDiv = null; //extract the option holder from the group div for( var i = 0; i < divsInGroup.length; i++ ){ whichDiv = divsInGroup[ i ]; if( optionHolderDiv == null && whichDiv.className == optionHolderClassRef ) optionHolderDiv = whichDiv; if( contentHolderDiv == null && JS_Format.elementClass.existsOnElement( whichDiv, contentHolderClassRef ) ) contentHolderDiv = whichDiv; } //extract the content items from the content holder this.contentItems = contentHolderDiv.getElementsByTagName( "div" ); //extract the options from the option holder var tabOptions_items = optionHolderDiv.getElementsByTagName( "li" ); this.tabOptions = new Array(); this.startTab = null; var itemId, whichItem, whichHref; // get the total number of options var optionTotal = tabOptions_items.length; // check for a RANDOM starting tab if( this.startId == "random" ){ // choose the index var randomIndex = JS_Format.number.randomize.fromZero( optionTotal ); // randomly select the id of one of the option tabs this.startId = tabOptions_items[ randomIndex ].id; } // cycle through all options for( var i = 0; i < optionTotal; i++ ){ // get the next item element whichItem = tabOptions_items[ i ]; itemId = whichItem.id; // check if item name is defined if( itemId ){ whichHref = whichItem.getElementsByTagName( "a" )[ 0 ]; whichItem.onclick = function (){ groupInstance.handleClick( this ); } whichHref.onclick = function (){ this.blur(); return false; } //save the tab item this.tabOptions.push( whichItem ); //set starting tab if( this.startTab == null && itemId == this.startId ) this.startTab = whichItem; } } //default to first tab if starting tab not specified if( this.startTab == null ) this.startTab = this.tabOptions[ 0 ]; } this.activateTabById = function ( tabId ){ for( var i = 0; i < this.tabOptions.length; i++ ){ if( this.tabOptions[ i ].id == tabId ){ this.handleClick( this.tabOptions[ i ] ); break; } } } this.handleClick = function ( tabItem ){ this.deactivateAll(); this.activateTab( tabItem ); } this.activateTab = function ( tabItem ){ tabItem.className = manager_tabPanelGroup.settings.activeTabClassName; this.activate_action( tabItem ); } this.deactivateTab = function ( tabItem ){ tabItem.className = ""; this.deactivate_action( tabItem ); } this.deactivateAll = function (){ for(var i = 0; i < this.tabOptions.length; i++) this.deactivateTab(this.tabOptions[i]); } this.getTabContentItem = function ( tabItem ){ var contentItem; for(var i = 0; i < this.contentItems.length; i++){ var contentItem = this.contentItems[i]; if(contentItem.id == this.formatTabIdToContentItemId(tabItem.id)) break; } return contentItem; } this.activate_action = function ( tabItem ){ var itemId = tabItem.value; if(this.action == "default"){ this.getTabContentItem( tabItem ).style.display = "block"; } } this.deactivate_action = function ( tabItem ){ var itemId = tabItem.value; if(this.action == "default"){ this.getTabContentItem( tabItem ).style.display = "none"; } } //initilize the object this.launch(); }