/*(function() {
var timer; function fireContentLoadedEvent() {
if (document.loaded) return; if (timer) window.clearTimeout(timer); document.loaded = true; document.fire('dom:loaded'); }
function checkReadyState() {
if (document.readyState === 'complete') {
document.stopObserving('readystatechange', checkReadyState); fireContentLoadedEvent(); }
}
function pollDoScroll() {
try { document.documentElement.doScroll('left'); }
catch (e) {
timer = pollDoScroll.defer(); return; }
fireContentLoadedEvent(); }
if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false); } else {
document.observe('readystatechange', checkReadyState); if (window == top)
timer = pollDoScroll.defer(); }
Event.observe(window, 'load', fireContentLoadedEvent); })(); */
/* rsh.js */
/*
Copyright (c) 2007 Brian Dillard and Brad Neuberg:
Brian Dillard | Project Lead | bdillard@pathf.com | http://blogs.pathf.com/agileajax/
Brad Neuberg | Original Project Creator | http://codinginparadise.org
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
dhtmlHistory: An object that provides history, history data, and bookmarking for DHTML and Ajax applications.
dependencies:
* the historyStorage object included in this file.
*/
window.dhtmlHistory = {
/*Public: User-agent booleans*/
isIE: false,
isOpera: false,
isSafari: false,
isSafari3: false,
isKonquerer: false,
isGecko: false,
isSupported: false,
/*Public: Create the DHTML history infrastructure*/
create: function(options) {
/*
options - object to store initialization parameters
options.debugMode - boolean that causes hidden form fields to be shown for development purposes.
options.toJSON - function to override default JSON stringifier
options.fromJSON - function to override default JSON parser
*/
var that = this; /*set user-agent flags*/
var UA = navigator.userAgent.toLowerCase(); var platform = navigator.platform.toLowerCase(); var vendor = navigator.vendor || ""; var version = (UA.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1]; if (vendor === "KDE") {
this.isKonqueror = true; this.isSupported = false; } else if (typeof window.opera !== "undefined") {
this.isOpera = true; this.isSupported = true; } else if (typeof document.all !== "undefined") {
this.isIE = true; this.isSupported = true; } else if (vendor.indexOf("Apple Computer, Inc.") > -1) {
if (parseInt(version, 10) < 420) {
this.isSafari = true; } else {
this.isSafari3 = true; }
this.isSupported = this.isSafari3; } else if (UA.indexOf("gecko") != -1) {
this.isGecko = true; this.isSupported = true; }
/*Set up the historyStorage object; pass in init parameters*/
window.historyStorage.setup(options); /*Execute browser-specific setup methods*/
if (this.isSafari) {
this.createSafari(); } else if (this.isOpera) {
this.createOpera(); }
/*Get our initial location*/
var initialHash = this.getCurrentLocation(); /*Save it as our current location*/
this.currentLocation = initialHash; /*Now that we have a hash, create IE-specific code*/
if (this.isIE) {
this.createIE(initialHash); }
/*Add an unload listener for the page; this is needed for FF 1.5+ because this browser caches all dynamic updates to the
page, which can break some of our logic related to testing whether this is the first instance a page has loaded or whether
it is being pulled from the cache*/
var unloadHandler = function() {
that.firstLoad = null; }; this.addEventListener(window, 'unload', unloadHandler); /*Determine if this is our first page load; for IE, we do this in this.iframeLoaded(), which is fired on pageload. We do it
there because we have no historyStorage at this point, which only exists after the page is finished loading in IE*/
if (this.isIE) {
/*The iframe will get loaded on page load, and we want to ignore this fact*/
this.ignoreLocationChange = true; } else {
if (!historyStorage.hasKey(this.PAGELOADEDSTRING)) {
/*This is our first page load, so ignore the location change and add our special history entry*/
this.ignoreLocationChange = true; this.firstLoad = true; historyStorage.put(this.PAGELOADEDSTRING, true); } else {
/*This isn't our first page load, so indicate that we want to pay attention to this location change*/
this.ignoreLocationChange = false; /*For browsers other than IE, fire a history change event; on IE, the event will be thrown automatically when its
hidden iframe reloads on page load. Unfortunately, we don't have any listeners yet; indicate that we want to fire
an event when a listener is added.*/
this.fireOnNewListener = true; }
}
/*Other browsers can use a location handler that checks at regular intervals as their primary mechanism; we use it for IE as
well to handle an important edge case; see checkLocation() for details*/
var locationHandler = function() {
that.checkLocation(); }; setInterval(locationHandler, 100); },
/*Public: Initialize our DHTML history. You must call this after the page is finished loading.*/
initialize: function() {
/*IE needs to be explicitly initialized. IE doesn't autofill form data until the page is finished loading, so we have to wait*/
if (this.isIE) {
/*If this is the first time this page has loaded*/
if (!historyStorage.hasKey(this.PAGELOADEDSTRING)) {
/*For IE, we do this in initialize(); for other browsers, we do it in create()*/
this.fireOnNewListener = false; this.firstLoad = true; historyStorage.put(this.PAGELOADEDSTRING, true); }
/*Else if this is a fake onload event*/
else {
this.fireOnNewListener = true; this.firstLoad = false; }
}
},
/*Public: Adds a history change listener. Note that only one listener is supported at this time.*/
addListener: function(listener) {
this.listener = listener; /*If the page was just loaded and we should not ignore it, fire an event to our new listener now*/
if (this.fireOnNewListener) {
this.fireHistoryEvent(this.currentLocation); this.fireOnNewListener = false; }
},
/*Public: Generic utility function for attaching events*/
addEventListener: function(o, e, l) {
if (o.addEventListener) {
o.addEventListener(e, l, false); } else if (o.attachEvent) {
o.attachEvent('on' + e, function() {
l(window.event); }); }
},
/*Public: Add a history point.*/
add: function(newLocation, historyData) {
if (this.isSafari) {
/*Remove any leading hash symbols on newLocation*/
newLocation = this.removeHash(newLocation); /*Store the history data into history storage*/
historyStorage.put(newLocation, historyData); /*Save this as our current location*/
this.currentLocation = newLocation; /*Change the browser location*/
window.location.hash = newLocation; /*Save this to the Safari form field*/
this.putSafariState(newLocation); } else {
/*Most browsers require that we wait a certain amount of time before changing the location, such
as 200 MS; rather than forcing external callers to use window.setTimeout to account for this,
we internally handle it by putting requests in a queue.*/
var that = this; var addImpl = function() {
/*Indicate that the current wait time is now less*/
if (that.currentWaitTime > 0) {
that.currentWaitTime = that.currentWaitTime - that.waitTime; }
/*Remove any leading hash symbols on newLocation*/
newLocation = that.removeHash(newLocation); /*IE has a strange bug; if the newLocation is the same as _any_ preexisting id in the
document, then the history action gets recorded twice; throw a programmer exception if
there is an element with this ID*/
if (document.getElementById(newLocation) && that.debugMode) {
var e = "Exception: History locations can not have the same value as _any_ IDs that might be in the document,"
+ " due to a bug in IE; please ask the developer to choose a history location that does not match any HTML"
+ " IDs in this document. The following ID is already taken and cannot be a location: " + newLocation; throw new Error(e); }
/*Store the history data into history storage*/
historyStorage.put(newLocation, historyData); /*Indicate to the browser to ignore this upcomming location change since we're making it programmatically*/
that.ignoreLocationChange = true; /*Indicate to IE that this is an atomic location change block*/
that.ieAtomicLocationChange = true; /*Save this as our current location*/
that.currentLocation = newLocation; /*Change the browser location*/
window.location.hash = newLocation; /*Change the hidden iframe's location if on IE*/
if (that.isIE) {
that.iframe.src = "/js/blank.html?" + newLocation; }
/*End of atomic location change block for IE*/
that.ieAtomicLocationChange = false; }; /*Now queue up this add request*/
window.setTimeout(addImpl, this.currentWaitTime); /*Indicate that the next request will have to wait for awhile*/
this.currentWaitTime = this.currentWaitTime + this.waitTime; }
},
/*Public*/
isFirstLoad: function() {
return this.firstLoad; },
/*Public*/
getVersion: function() {
return "0.6"; },
/*Get browser's current hash location; for Safari, read value from a hidden form field*/
/*Public*/
getCurrentLocation: function() {
var r = (this.isSafari
? this.getSafariState()
: this.getCurrentHash()
); return r; },
/*Public: Manually parse the current url for a hash; tip of the hat to YUI*/
getCurrentHash: function() {
var r = window.location.href; var i = r.indexOf("#"); return (i >= 0
? r.substr(i + 1)
: ""
); },
/*- - - - - - - - - - - -*/
/*Private: Constant for our own internal history event called when the page is loaded*/
PAGELOADEDSTRING: "DhtmlHistory_pageLoaded",
/*Private: Our history change listener.*/
listener: null,
/*Private: MS to wait between add requests - will be reset for certain browsers*/
waitTime: 200,
/*Private: MS before an add request can execute*/
currentWaitTime: 0,
/*Private: Our current hash location, without the "#" symbol.*/
currentLocation: null,
/*Private: Hidden iframe used to IE to detect history changes*/
iframe: null,
/*Private: Flags and DOM references used only by Safari*/
safariHistoryStartPoint: null,
safariStack: null,
safariLength: null,
/*Private: Flag used to keep checkLocation() from doing anything when it discovers location changes we've made ourselves
programmatically with the add() method. Basically, add() sets this to true. When checkLocation() discovers it's true,
it refrains from firing our listener, then resets the flag to false for next cycle. That way, our listener only gets fired on
history change events triggered by the user via back/forward buttons and manual hash changes. This flag also helps us set up
IE's special iframe-based method of handling history changes.*/
ignoreLocationChange: null,
/*Private: A flag that indicates that we should fire a history change event when we are ready, i.e. after we are initialized and
we have a history change listener. This is needed due to an edge case in browsers other than IE; if you leave a page entirely
then return, we must fire this as a history change event. Unfortunately, we have lost all references to listeners from earlier,
because JavaScript clears out.*/
fireOnNewListener: null,
/*Private: A variable that indicates whether this is the first time this page has been loaded. If you go to a web page, leave it
for another one, and then return, the page's onload listener fires again. We need a way to differentiate between the first page
load and subsequent ones. This variable works hand in hand with the pageLoaded variable we store into historyStorage.*/
firstLoad: null,
/*Private: A variable to handle an important edge case in IE. In IE, if a user manually types an address into their browser's
location bar, we must intercept this by calling checkLocation() at regular intervals. However, if we are programmatically
changing the location bar ourselves using the add() method, we need to ignore these changes in checkLocation(). Unfortunately,
these changes take several lines of code to complete, so for the duration of those lines of code, we set this variable to true.
That signals to checkLocation() to ignore the change-in-progress. Once we're done with our chunk of location-change code in
add(), we set this back to false. We'll do the same thing when capturing user-entered address changes in checkLocation itself.*/
ieAtomicLocationChange: null,
/*Private: Create IE-specific DOM nodes and overrides*/
createIE: function(initialHash) {
/*write out a hidden iframe for IE and set the amount of time to wait between add() requests*/
this.waitTime = 400; /*IE needs longer between history updates*/
var styles = (historyStorage.debugMode
? 'width: 800px;height:80px;border:1px solid black;'
: historyStorage.hideStyles
); var iframeID = "rshHistoryFrame"; var iframeHTML = '<iframe frameborder="0" id="' + iframeID + '" style="' + styles + '" src="/js/blank.html?' + initialHash + '"></iframe>'; document.write(iframeHTML); this.iframe = document.getElementById(iframeID); },
/*Private: Create Opera-specific DOM nodes and overrides*/
createOpera: function() {
this.waitTime = 400; /*Opera needs longer between history updates*/
var imgHTML = '<img src="javascript:location.href=\'javascript:dhtmlHistory.checkLocation();\';" style="' + historyStorage.hideStyles + '" />'; document.write(imgHTML); },
/*Private: Create Safari-specific DOM nodes and overrides*/
createSafari: function() {
var formID = "rshSafariForm"; var stackID = "rshSafariStack"; var lengthID = "rshSafariLength"; var formStyles = historyStorage.debugMode ? historyStorage.showStyles : historyStorage.hideStyles; var inputStyles = (historyStorage.debugMode
? 'width:800px;height:20px;border:1px solid black;margin:0;padding:0;'
: historyStorage.hideStyles
); var safariHTML = '<form id="' + formID + '" style="' + formStyles + '">'
+ '<input type="text" style="' + inputStyles + '" id="' + stackID + '" value="[]"/>'
+ '<input type="text" style="' + inputStyles + '" id="' + lengthID + '" value=""/>'
+ '</form>'; document.write(safariHTML); this.safariStack = document.getElementById(stackID); this.safariLength = document.getElementById(lengthID); if (!historyStorage.hasKey(this.PAGELOADEDSTRING)) {
this.safariHistoryStartPoint = history.length; this.safariLength.value = this.safariHistoryStartPoint; } else {
this.safariHistoryStartPoint = this.safariLength.value; }
},
/*Private: Safari method to read the history stack from a hidden form field*/
getSafariStack: function() {
var r = this.safariStack.value; return historyStorage.fromJSON(r); },
/*Private: Safari method to read from the history stack*/
getSafariState: function() {
var stack = this.getSafariStack(); var state = stack[history.length - this.safariHistoryStartPoint - 1]; return state; },
/*Private: Safari method to write the history stack to a hidden form field*/
putSafariState: function(newLocation) {
var stack = this.getSafariStack(); stack[history.length - this.safariHistoryStartPoint] = newLocation; this.safariStack.value = historyStorage.toJSON(stack); },
/*Private: Notify the listener of new history changes.*/
fireHistoryEvent: function(newHash) {
/*extract the value from our history storage for this hash*/
var historyData = historyStorage.get(newHash); /*call our listener*/
this.listener.call(null, newHash, historyData); },
/*Private: See if the browser has changed location. This is the primary history mechanism for Firefox. For IE, we use this to
handle an important edge case: if a user manually types in a new hash value into their IE location bar and press enter, we want to
to intercept this and notify any history listener.*/
checkLocation: function() {
/*Ignore any location changes that we made ourselves for browsers other than IE*/
if (!this.isIE && this.ignoreLocationChange) {
this.ignoreLocationChange = false; return; }
/*If we are dealing with IE and we are in the middle of making a location change from an iframe, ignore it*/
if (!this.isIE && this.ieAtomicLocationChange) {
return; }
/*Get hash location*/
var hash = this.getCurrentLocation(); /*Do nothing if there's been no change*/
if (hash == this.currentLocation) {
return; }
/*In IE, users manually entering locations into the browser; we do this by comparing the browser's location against the
iframe's location; if they differ, we are dealing with a manual event and need to place it inside our history, otherwise
we can return*/
this.ieAtomicLocationChange = true; if (this.isIE && this.getIframeHash() != hash) {
this.iframe.src = "/js/blank.html?" + hash; }
else if (this.isIE) {
/*the iframe is unchanged*/
return; }
/*Save this new location*/
this.currentLocation = hash; this.ieAtomicLocationChange = false; /*Notify listeners of the change*/
this.fireHistoryEvent(hash); },
/*Private: Get the current location of IE's hidden iframe.*/
getIframeHash: function() {
var doc = this.iframe.contentWindow.document; var hash = String(doc.location.search); if (hash.length == 1 && hash.charAt(0) == "?") {
hash = ""; }
else if (hash.length >= 2 && hash.charAt(0) == "?") {
hash = hash.substring(1); }
return hash; },
/*Private: Remove any leading hash that might be on a location.*/
removeHash: function(hashValue) {
var r; if (hashValue === null || hashValue === undefined) {
r = null; }
else if (hashValue === "") {
r = ""; }
else if (hashValue.length == 1 && hashValue.charAt(0) == "#") {
r = ""; }
else if (hashValue.length > 1 && hashValue.charAt(0) == "#") {
r = hashValue.substring(1); }
else {
r = hashValue; }
return r; },
/*Private: For IE, tell when the hidden iframe has finished loading.*/
iframeLoaded: function(newLocation) {
/*ignore any location changes that we made ourselves*/
if (this.ignoreLocationChange) {
this.ignoreLocationChange = false; return; }
/*Get the new location*/
var hash = String(newLocation.search); if (hash.length == 1 && hash.charAt(0) == "?") {
hash = ""; }
else if (hash.length >= 2 && hash.charAt(0) == "?") {
hash = hash.substring(1); }
/*Keep the browser location bar in sync with the iframe hash*/
window.location.hash = hash; /*Notify listeners of the change*/
this.fireHistoryEvent(hash); }
}; /*
historyStorage: An object that uses a hidden form to store history state across page loads. The mechanism for doing so relies on
the fact that browsers save the text in form data for the life of the browser session, which means the text is still there when
the user navigates back to the page. This object can be used independently of the dhtmlHistory object for caching of Ajax
session information.
dependencies:
* json2007.js (included in a separate file) or alternate JSON methods passed in through an options bundle.
*/
window.historyStorage = {
/*Public: Set up our historyStorage object for use by dhtmlHistory or other objects*/
setup: function(options) {
/*
options - object to store initialization parameters - passed in from dhtmlHistory or directly into historyStorage
options.debugMode - boolean that causes hidden form fields to be shown for development purposes.
options.toJSON - function to override default JSON stringifier
options.fromJSON - function to override default JSON parser
*/
/*process init parameters*/
if (typeof options !== "undefined") {
if (options.debugMode) {
this.debugMode = options.debugMode; }
if (options.toJSON) {
this.toJSON = options.toJSON; }
if (options.fromJSON) {
this.fromJSON = options.fromJSON; }
}
/*write a hidden form and textarea into the page; we'll stow our history stack here*/
var formID = "rshStorageForm"; var textareaID = "rshStorageField"; var formStyles = this.debugMode ? historyStorage.showStyles : historyStorage.hideStyles; var textareaStyles = (historyStorage.debugMode
? 'width: 800px;height:80px;border:1px solid black;'
: historyStorage.hideStyles
); var textareaHTML = '<form id="' + formID + '" style="' + formStyles + '">'
+ '<textarea id="' + textareaID + '" style="' + textareaStyles + '"></textarea>'
+ '</form>'; document.write(textareaHTML); this.storageField = document.getElementById(textareaID); if (typeof window.opera !== "undefined") {
this.storageField.focus(); /*Opera needs to focus this element before persisting values in it*/
}
},
/*Public*/
put: function(key, value) {
this.assertValidKey(key); /*if we already have a value for this, remove the value before adding the new one*/
if (this.hasKey(key)) {
this.remove(key); }
/*store this new key*/
this.storageHash[key] = value; /*save and serialize the hashtable into the form*/
this.saveHashTable(); },
/*Public*/
get: function(key) {
this.assertValidKey(key); /*make sure the hash table has been loaded from the form*/
this.loadHashTable(); var value = this.storageHash[key]; if (value === undefined) {
value = null; }
return value; },
/*Public*/
remove: function(key) {
this.assertValidKey(key); /*make sure the hash table has been loaded from the form*/
this.loadHashTable(); /*delete the value*/
delete this.storageHash[key]; /*serialize and save the hash table into the form*/
this.saveHashTable(); },
/*Public: Clears out all saved data.*/
reset: function() {
this.storageField.value = ""; this.storageHash = {}; },
/*Public*/
hasKey: function(key) {
this.assertValidKey(key); /*make sure the hash table has been loaded from the form*/
this.loadHashTable(); return (typeof this.storageHash[key] !== "undefined"); },
/*Public*/
isValidKey: function(key) {
return (typeof key === "string"); },
/*Public - CSS strings utilized by both objects to hide or show behind-the-scenes DOM elements*/
showStyles: 'border:0;margin:0;padding:0;',
hideStyles: 'left:-1000px;top:-1000px;width:1px;height:1px;border:0;position:absolute;',
/*Public - debug mode flag*/
debugMode: false,
/*- - - - - - - - - - - -*/
/*Private: Our hash of key name/values.*/
storageHash: {},
/*Private: If true, we have loaded our hash table out of the storage form.*/
hashLoaded: false,
/*Private: DOM reference to our history field*/
storageField: null,
/*Private: Assert that a key is valid; throw an exception if it not.*/
assertValidKey: function(key) {
var isValid = this.isValidKey(key); if (!isValid && this.debugMode) {
throw new Error("Please provide a valid key for window.historyStorage. Invalid key = " + key + "."); }
},
/*Private: Load the hash table up from the form.*/
loadHashTable: function() {
if (!this.hashLoaded) {
var serializedHashTable = ""; if (this.storageField != null) {
serializedHashTable = this.storageField.value; }
if (serializedHashTable !== "" && serializedHashTable !== null) {
this.storageHash = this.fromJSON(serializedHashTable); this.hashLoaded = true; }
}
},
/*Private: Save the hash table into the form.*/
saveHashTable: function() {
this.loadHashTable(); var serializedHashTable = this.toJSON(this.storageHash); this.storageField.value = serializedHashTable; },
/*Private: Bridges for our JSON implementations - both rely on 2007 JSON.org library - can be overridden by options bundle*/
toJSON: function(o) {
return o.toJSONString(); },
fromJSON: function(s) {
return s.parseJSON(); }
}; Ajax.CachedRequest = Class.create(Ajax.Request, {
initialize: function($super, url, options) {
options = options || {}; var onSuccess = options.onSuccess || Prototype.K; if (!Ajax.CachedRequest.cache[url + '?' + Object.toQueryString(options.parameters)] || options.reload) {
options.onSuccess = function(transport) {
Ajax.CachedRequest.cache[url + '?' + Object.toQueryString(options.parameters)] = transport.responseText; onSuccess(transport); }
$super(url, options); }
else {
this.dispatch.defer(); onSuccess(Ajax.CachedRequest.cache[url + '?' + Object.toQueryString(options.parameters)]); }
},
dispatch: function() {
Ajax.Responders.dispatch('onComplete', null); }
}); Ajax.CachedRequest.cache = {}; /**
* SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
*
* SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
*/
if (typeof deconcept == "undefined") { var deconcept = new Object(); } if (typeof deconcept.util == "undefined") { deconcept.util = new Object(); } if (typeof deconcept.SWFObjectUtil == "undefined") { deconcept.SWFObjectUtil = new Object(); } deconcept.SWFObject = function(_1, id, w, h, _5, c, _7, _8, _9, _a) { if (!document.getElementById) { return; } this.DETECT_KEY = _a ? _a : "detectflash"; this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY); this.params = new Object(); this.variables = new Object(); this.attributes = new Array(); if (_1) { this.setAttribute("swf", _1); } if (id) { this.setAttribute("id", id); } if (w) { this.setAttribute("width", w); } if (h) { this.setAttribute("height", h); } if (_5) { this.setAttribute("version", new deconcept.PlayerVersion(_5.toString().split("."))); } this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion(); if (!window.opera && document.all && this.installedVer.major > 7) { deconcept.SWFObject.doPrepUnload = true; } if (c) { this.addParam("bgcolor", c); } var q = _7 ? _7 : "high"; this.addParam("quality", q); this.setAttribute("useExpressInstall", false); this.setAttribute("doExpressInstall", false); var _c = (_8) ? _8 : window.location; this.setAttribute("xiRedirectUrl", _c); this.setAttribute("redirectUrl", ""); if (_9) { this.setAttribute("redirectUrl", _9); } }; deconcept.SWFObject.prototype = { useExpressInstall: function(_d) { this.xiSWFPath = !_d ? "expressinstall.swf" : _d; this.setAttribute("useExpressInstall", true); }, setAttribute: function(_e, _f) { this.attributes[_e] = _f; }, getAttribute: function(_10) { return this.attributes[_10]; }, addParam: function(_11, _12) { this.params[_11] = _12; }, getParams: function() { return this.params; }, addVariable: function(_13, _14) { this.variables[_13] = _14; }, getVariable: function(_15) { return this.variables[_15]; }, getVariables: function() { return this.variables; }, getVariablePairs: function() { var _16 = new Array(); var key; var _18 = this.getVariables(); for (key in _18) { _16[_16.length] = key + "=" + _18[key]; } return _16; }, getSWFHTML: function() { var _19 = ""; if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); this.setAttribute("swf", this.xiSWFPath); } _19 = "<embed type=\"application/x-shockwave-flash\" src=\"" + this.getAttribute("swf") + "\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\" style=\"" + this.getAttribute("style") + "\""; _19 += " id=\"" + this.getAttribute("id") + "\" name=\"" + this.getAttribute("id") + "\" "; var _1a = this.getParams(); for (var key in _1a) { _19 += [key] + "=\"" + _1a[key] + "\" "; } var _1c = this.getVariablePairs().join("&"); if (_1c.length > 0) { _19 += "flashvars=\"" + _1c + "\""; } _19 += "/>"; } else { if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); this.setAttribute("swf", this.xiSWFPath); } _19 = "<object id=\"" + this.getAttribute("id") + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\" style=\"" + this.getAttribute("style") + "\">"; _19 += "<param name=\"movie\" value=\"" + this.getAttribute("swf") + "\" />"; var _1d = this.getParams(); for (var key in _1d) { _19 += "<param name=\"" + key + "\" value=\"" + _1d[key] + "\" />"; } var _1f = this.getVariablePairs().join("&"); if (_1f.length > 0) { _19 += "<param name=\"flashvars\" value=\"" + _1f + "\" />"; } _19 += "</object>"; } return _19; }, write: function(_20) { if (this.getAttribute("useExpressInstall")) { var _21 = new deconcept.PlayerVersion([6, 0, 65]); if (this.installedVer.versionIsValid(_21) && !this.installedVer.versionIsValid(this.getAttribute("version"))) { this.setAttribute("doExpressInstall", true); this.addVariable("MMredirectURL", escape(this.getAttribute("xiRedirectUrl"))); document.title = document.title.slice(0, 47) + " - Flash Player Installation"; this.addVariable("MMdoctitle", document.title); } } if (this.skipDetect || this.getAttribute("doExpressInstall") || this.installedVer.versionIsValid(this.getAttribute("version"))) { var n = (typeof _20 == "string") ? document.getElementById(_20) : _20; n.innerHTML = this.getSWFHTML(); return true; } else { if (this.getAttribute("redirectUrl") != "") { document.location.replace(this.getAttribute("redirectUrl")); } } return false; } }; deconcept.SWFObjectUtil.getPlayerVersion = function() { var _23 = new deconcept.PlayerVersion([0, 0, 0]); if (navigator.plugins && navigator.mimeTypes.length) { var x = navigator.plugins["Shockwave Flash"]; if (x && x.description) { _23 = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")); } } else { if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0) { var axo = 1; var _26 = 3; while (axo) { try { _26++; axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + _26); _23 = new deconcept.PlayerVersion([_26, 0, 0]); } catch (e) { axo = null; } } } else { try { var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); } catch (e) { try { var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); _23 = new deconcept.PlayerVersion([6, 0, 21]); axo.AllowScriptAccess = "always"; } catch (e) { if (_23.major == 6) { return _23; } } try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); } catch (e) { } } if (axo != null) { _23 = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")); } } } return _23; }; deconcept.PlayerVersion = function(_29) { this.major = _29[0] != null ? parseInt(_29[0]) : 0; this.minor = _29[1] != null ? parseInt(_29[1]) : 0; this.rev = _29[2] != null ? parseInt(_29[2]) : 0; }; deconcept.PlayerVersion.prototype.versionIsValid = function(fv) { if (this.major < fv.major) { return false; } if (this.major > fv.major) { return true; } if (this.minor < fv.minor) { return false; } if (this.minor > fv.minor) { return true; } if (this.rev < fv.rev) { return false; } return true; }; deconcept.util = { getRequestParameter: function(_2b) { var q = document.location.search || document.location.hash; if (_2b == null) { return q; } if (q) { var _2d = q.substring(1).split("&"); for (var i = 0; i < _2d.length; i++) { if (_2d[i].substring(0, _2d[i].indexOf("=")) == _2b) { return _2d[i].substring((_2d[i].indexOf("=") + 1)); } } } return ""; } }; deconcept.SWFObjectUtil.cleanupSWFs = function() { var _2f = document.getElementsByTagName("OBJECT"); for (var i = _2f.length - 1; i >= 0; i--) { _2f[i].style.display = "none"; for (var x in _2f[i]) { if (typeof _2f[i][x] == "function") { _2f[i][x] = function() { }; } } } }; if (deconcept.SWFObject.doPrepUnload) { if (!deconcept.unloadSet) { deconcept.SWFObjectUtil.prepUnload = function() { __flash_unloadHandler = function() { }; __flash_savedUnloadHandler = function() { }; window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs); }; window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload); deconcept.unloadSet = true; } } if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }; } var getQueryParamValue = deconcept.util.getRequestParameter; var FlashObject = deconcept.SWFObject; var SWFObject = deconcept.SWFObject; /*==================================================
$Id: tabber.js,v 1.9 2006/04/27 20:51:51 pat Exp $
tabber.js by Patrick Fitzgerald pat@barelyfitz.com
Documentation can be found at the following URL:
http://www.barelyfitz.com/projects/tabber/
License (http://www.opensource.org/licenses/mit-license.php)
Copyright (c) 2006 Patrick Fitzgerald
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==================================================*/
function tabberObj(argsObj) {
var arg; /* name of an argument to override */
/* Element for the main tabber div. If you supply this in argsObj,
then the init() method will be called.
*/
this.div = null; /* Class of the main tabber div */
this.classMain = "tabber"; /* Rename classMain to classMainLive after tabifying
(so a different style can be applied)
*/
this.classMainLive = "tabberlive"; /* Class of each DIV that contains a tab */
this.classTab = "tabbertab"; /* Class to indicate which tab should be active on startup */
this.classTabDefault = "tabbertabdefault"; /* Class for the navigation UL */
this.classNav = "tabbernav"; /* When a tab is to be hidden, instead of setting display='none', we
set the class of the div to classTabHide. In your screen
stylesheet you should set classTabHide to display:none.  In your
print stylesheet you should set display:block to ensure that all
the information is printed.
*/
this.classTabHide = "tabbertabhide"; /* Class to set the navigation LI when the tab is active, so you can
use a different style on the active tab.
*/
this.classNavActive = "tabberactive"; /* Elements that might contain the title for the tab, only used if a
title is not specified in the TITLE attribute of DIV classTab.
*/
this.titleElements = ['h2', 'h3', 'h4', 'h5', 'h6']; /* Should we strip out the HTML from the innerHTML of the title elements?
This should usually be true.
*/
this.titleElementsStripHTML = true; /* If the user specified the tab names using a TITLE attribute on
the DIV, then the browser will display a tooltip whenever the
mouse is over the DIV. To prevent this tooltip, we can remove the
TITLE attribute after getting the tab name.
*/
this.removeTitle = true; /* If you want to add an id to each link set this to true */
this.addLinkId = false; /* If addIds==true, then you can set a format for the ids.
<tabberid> will be replaced with the id of the main tabber div.
<tabnumberzero> will be replaced with the tab number
(tab numbers starting at zero)
<tabnumberone> will be replaced with the tab number
(tab numbers starting at one)
<tabtitle> will be replaced by the tab title
(with all non-alphanumeric characters removed)
*/
this.linkIdFormat = '<tabberid>nav<tabnumberone>'; /* You can override the defaults listed above by passing in an object:
var mytab = new tabber({property:value,property:value}); */
for (arg in argsObj) { this[arg] = argsObj[arg]; }
/* Create regular expressions for the class names; Note: if you
change the class names after a new object is created you must
also change these regular expressions.
*/
this.REclassMain = new RegExp('\\b' + this.classMain + '\\b', 'gi'); this.REclassMainLive = new RegExp('\\b' + this.classMainLive + '\\b', 'gi'); this.REclassTab = new RegExp('\\b' + this.classTab + '\\b', 'gi'); this.REclassTabDefault = new RegExp('\\b' + this.classTabDefault + '\\b', 'gi'); this.REclassTabHide = new RegExp('\\b' + this.classTabHide + '\\b', 'gi'); /* Array of objects holding info about each tab */
this.tabs = new Array(); /* If the main tabber div was specified, call init() now */
if (this.div) {
this.init(this.div); /* We don't need the main div anymore, and to prevent a memory leak
in IE, we must remove the circular reference between the div
and the tabber object. */
this.div = null; }
}
/*--------------------------------------------------
Methods for tabberObj
--------------------------------------------------*/
tabberObj.prototype.init = function(e) {
/* Set up the tabber interface.
e = element (the main containing div)
Example:
init(document.getElementById('mytabberdiv'))
*/
var
childNodes, /* child nodes of the tabber div */
i, i2, /* loop indices */
t, /* object to store info about a single tab */
defaultTab = 0, /* which tab to select by default */
DOM_ul, /* tabbernav list */
DOM_li, /* tabbernav list item */
DOM_a, /* tabbernav link */
aId, /* A unique id for DOM_a */
headingElement; /* searching for text to use in the tab */
/* Verify that the browser supports DOM scripting */
if (!document.getElementsByTagName) { return false; }
/* If the main DIV has an ID then save it. */
if (e.id) {
this.id = e.id; }
/* Clear the tabs array (but it should normally be empty) */
this.tabs.length = 0; /* Loop through an array of all the child nodes within our tabber element. */
childNodes = e.childNodes; for (i = 0; i < childNodes.length; i++) {
/* Find the nodes where class="tabbertab" */
if (childNodes[i].className &&
childNodes[i].className.match(this.REclassTab)) {
/* Create a new object to save info about this tab */
t = new Object(); /* Save a pointer to the div for this tab */
t.div = childNodes[i]; /* Add the new object to the array of tabs */
this.tabs[this.tabs.length] = t; /* If the class name contains classTabDefault,
then select this tab by default.
*/
if (childNodes[i].className.match(this.REclassTabDefault)) {
defaultTab = this.tabs.length - 1; }
}
}
/* Create a new UL list to hold the tab headings */
DOM_ul = document.createElement("ul"); DOM_ul.className = this.classNav; /* Loop through each tab we found */
for (i = 0; i < this.tabs.length; i++) {
t = this.tabs[i]; /* Get the label to use for this tab:
From the title attribute on the DIV,
Or from one of the this.titleElements[] elements,
Or use an automatically generated number.
*/
t.headingText = t.div.title; /* Remove the title attribute to prevent a tooltip from appearing */
if (this.removeTitle) { t.div.title = ''; }
if (!t.headingText) {
/* Title was not defined in the title of the DIV,
So try to get the title from an element within the DIV.
Go through the list of elements in this.titleElements
(typically heading elements ['h2','h3','h4'])
*/
for (i2 = 0; i2 < this.titleElements.length; i2++) {
headingElement = t.div.getElementsByTagName(this.titleElements[i2])[0]; if (headingElement) {
t.headingText = headingElement.innerHTML; if (this.titleElementsStripHTML) {
t.headingText.replace(/<br>/gi, " "); t.headingText = t.headingText.replace(/<[^>]+>/g, ""); }
break; }
}
}
if (!t.headingText) {
/* Title was not found (or is blank) so automatically generate a
number for the tab.
*/
t.headingText = i + 1; }
/* Create a list element for the tab */
DOM_li = document.createElement("li"); /* Save a reference to this list item so we can later change it to
the "active" class */
t.li = DOM_li; /* Create a link to activate the tab */
DOM_a = document.createElement("a"); DOM_a.appendChild(document.createTextNode(t.headingText)); DOM_a.href = "javascript:void(null);"; DOM_a.title = t.headingText; DOM_a.onclick = this.navClick; /* Add some properties to the link so we can identify which tab
was clicked. Later the navClick method will need this.
*/
DOM_a.tabber = this; DOM_a.tabberIndex = i; /* Do we need to add an id to DOM_a? */
if (this.addLinkId && this.linkIdFormat) {
/* Determine the id name */
aId = this.linkIdFormat; aId = aId.replace(/<tabberid>/gi, this.id); aId = aId.replace(/<tabnumberzero>/gi, i); aId = aId.replace(/<tabnumberone>/gi, i + 1); aId = aId.replace(/<tabtitle>/gi, t.headingText.replace(/[^a-zA-Z0-9\-]/gi, '')); DOM_a.id = aId; }
/* Add the link to the list element */
DOM_li.appendChild(DOM_a); /* Add the list element to the list */
DOM_ul.appendChild(DOM_li); }
/* Add the UL list to the beginning of the tabber div */
e.insertBefore(DOM_ul, e.firstChild); /* Make the tabber div "live" so different CSS can be applied */
e.className = e.className.replace(this.REclassMain, this.classMainLive); /* Activate the default tab, and do not call the onclick handler */
this.tabShow(defaultTab); /* If the user specified an onLoad function, call it now. */
if (typeof this.onLoad == 'function') {
this.onLoad({ tabber: this }); }
return this; }; tabberObj.prototype.navClick = function(event) {
/* This method should only be called by the onClick event of an <A>
element, in which case we will determine which tab was clicked by
examining a property that we previously attached to the <A>
element.
Since this was triggered from an onClick event, the variable
"this" refers to the <A> element that triggered the onClick
event (and not to the tabberObj).
When tabberObj was initialized, we added some extra properties
to the <A> element, for the purpose of retrieving them now. Get
the tabberObj object, plus the tab number that was clicked.
*/
var
rVal, /* Return value from the user onclick function */
a, /* element that triggered the onclick event */
self, /* the tabber object */
tabberIndex, /* index of the tab that triggered the event */
onClickArgs; /* args to send the onclick function */
a = this; if (!a.tabber) { return false; }
self = a.tabber; tabberIndex = a.tabberIndex; /* Remove focus from the link because it looks ugly.
I don't know if this is a good idea...
*/
a.blur(); /* If the user specified an onClick function, call it now.
If the function returns false then do not continue.
*/
if (typeof self.onClick == 'function') {
onClickArgs = { 'tabber': self, 'index': tabberIndex, 'event': event }; /* IE uses a different way to access the event object */
if (!event) { onClickArgs.event = window.event; }
rVal = self.onClick(onClickArgs); if (rVal === false) { return false; }
}
self.tabShow(tabberIndex); return false; }; tabberObj.prototype.tabHideAll = function() {
var i; /* counter */
/* Hide all tabs and make all navigation links inactive */
for (i = 0; i < this.tabs.length; i++) {
this.tabHide(i); }
}; tabberObj.prototype.tabHide = function(tabberIndex) {
var div; if (!this.tabs[tabberIndex]) { return false; }
/* Hide a single tab and make its navigation link inactive */
div = this.tabs[tabberIndex].div; /* Hide the tab contents by adding classTabHide to the div */
if (!div.className.match(this.REclassTabHide)) {
div.className += ' ' + this.classTabHide; }
this.navClearActive(tabberIndex); return this; }; tabberObj.prototype.tabShow = function(tabberIndex) {
/* Show the tabberIndex tab and hide all the other tabs */
var div; if (!this.tabs[tabberIndex]) { return false; }
/* Hide all the tabs first */
this.tabHideAll(); /* Get the div that holds this tab */
div = this.tabs[tabberIndex].div; /* Remove classTabHide from the div */
div.className = div.className.replace(this.REclassTabHide, ''); /* Mark this tab navigation link as "active" */
this.navSetActive(tabberIndex); /* If the user specified an onTabDisplay function, call it now. */
if (typeof this.onTabDisplay == 'function') {
this.onTabDisplay({ 'tabber': this, 'index': tabberIndex }); }
return this; }; tabberObj.prototype.navSetActive = function(tabberIndex) {
/* Note: this method does *not* enforce the rule
that only one nav item can be active at a time.
*/
/* Set classNavActive for the navigation list item */
this.tabs[tabberIndex].li.className = this.classNavActive; return this; }; tabberObj.prototype.navClearActive = function(tabberIndex) {
/* Note: this method does *not* enforce the rule
that one nav should always be active.
*/
/* Remove classNavActive from the navigation list item */
this.tabs[tabberIndex].li.className = ''; return this; }; /*==================================================*/
function tabberAutomatic(tabberArgs) {
/* This function finds all DIV elements in the document where
class=tabber.classMain, then converts them to use the tabber
interface.
tabberArgs = an object to send to "new tabber()"
*/
var
tempObj, /* Temporary tabber object */
divs, /* Array of all divs on the page */
i; /* Loop index */
if (!tabberArgs) { tabberArgs = {}; }
/* Create a tabber object so we can get the value of classMain */
tempObj = new tabberObj(tabberArgs); /* Find all DIV elements in the document that have class=tabber */
/* First get an array of all DIV elements and loop through them */
divs = document.getElementsByTagName("div"); for (i = 0; i < divs.length; i++) {
/* Is this DIV the correct class? */
if (divs[i].className &&
divs[i].className.match(tempObj.REclassMain)) {
/* Now tabify the DIV */
tabberArgs.div = divs[i]; divs[i].tabber = new tabberObj(tabberArgs); }
}
return this; }
/*==================================================*/
function tabberAutomaticOnLoad(tabberArgs) {
/* This function adds tabberAutomatic to the window.onload event,
so it will run after the document has finished loading.
*/
var oldOnLoad; if (!tabberArgs) { tabberArgs = {}; }
/* Taken from: http://simon.incutio.com/archive/2004/05/26/addLoadEvent */
oldOnLoad = window.onload; if (typeof window.onload != 'function') {
window.onload = function() {
tabberAutomatic(tabberArgs); }; } else {
window.onload = function() {
oldOnLoad(); tabberAutomatic(tabberArgs); }; }
}
/*==================================================*/
/* Run tabberAutomaticOnload() unless the "manualStartup" option was specified */
if (typeof tabberOptions == 'undefined') {
tabberAutomaticOnLoad(); } else {
if (!tabberOptions['manualStartup']) {
tabberAutomaticOnLoad(tabberOptions); }
}
var Accordion = Class.create({
initialize: function(id, defaultExpandedCount) {
if (!$(id)) throw ("Attempted to initalize accordion with id: " + id + " which was not found."); this.accordion = $(id); this.options = {
toggleClass: "accordion-toggle",
toggleActive: "accordion-toggle-active",
contentClass: "accordion-content"
}
this.contents = this.accordion.select('div.' + this.options.contentClass); this.isAnimating = false; this.maxHeight = 0; this.current = defaultExpandedCount ? this.contents[defaultExpandedCount - 1] : this.contents[0]; this.toExpand = null; this.checkMaxHeight(); this.initialHide(); this.attachInitialMaxHeight(); var clickHandler = this.clickHandler.bindAsEventListener(this); this.accordion.observe('click', clickHandler); },
expand: function(el) {
this.toExpand = el.next('div.' + this.options.contentClass); if (this.current != this.toExpand) {
this.toExpand.show(); this.animate(); }
},
checkMaxHeight: function() {
for (var i = 0; i < this.contents.length; i++) {
if (this.contents[i].getHeight() > this.maxHeight) {
this.maxHeight = this.contents[i].getHeight(); }
}
},
attachInitialMaxHeight: function() {
this.current.previous('div.' + this.options.toggleClass).addClassName(this.options.toggleActive); if (this.current.getHeight() != this.maxHeight) this.current.setStyle({ height: this.maxHeight + "px" }); },
clickHandler: function(e) {
var el = e.element(); if (el.hasClassName(this.options.toggleClass) && !this.isAnimating) {
this.expand(el); } else if (el.up("div") != null && el.up("div").hasClassName(this.options.toggleClass) && !this.isAnimating) {
this.expand(el.up("div")); }
},
initialHide: function() {
for (var i = 0; i < this.contents.length; i++) {
if (this.contents[i] != this.current) {
this.contents[i].hide(); this.contents[i].setStyle({ height: 0 }); }
}
},
animate: function() {
var effects = new Array(); var options = {
sync: true,
scaleFrom: 0,
scaleContent: false,
transition: Effect.Transitions.sinoidal,
scaleMode: {
originalHeight: this.maxHeight,
originalWidth: this.accordion.getWidth()
},
scaleX: false,
scaleY: true
}; effects.push(new Effect.Scale(this.toExpand, 100, options)); options = {
sync: true,
scaleContent: false,
transition: Effect.Transitions.sinoidal,
scaleX: false,
scaleY: true
}; effects.push(new Effect.Scale(this.current, 0, options)); var myDuration = 0.75; new Effect.Parallel(effects, {
duration: myDuration,
fps: 35,
queue: {
position: 'end',
scope: 'accordion'
},
beforeStart: function() {
this.isAnimating = true; this.current.previous('div.' + this.options.toggleClass).removeClassName(this.options.toggleActive); this.toExpand.previous('div.' + this.options.toggleClass).addClassName(this.options.toggleActive); } .bind(this),
afterFinish: function() {
this.current.hide(); this.toExpand.setStyle({ height: this.maxHeight + "px" }); this.current = this.toExpand; this.isAnimating = false; } .bind(this)
}); }
}); 