/* -*- C -*- */ /* -------------------------------------------------------------------- * Shine: The Become Interactive Client Application Framework * @(#) $Id: shine.js 56702 2008-06-30 09:50:35Z daniel $ * -------------------------------------------------------------------- * Copyright (c) 2006 Become Interactive * http://www.becomeinteractive.co.uk * All rights reserved. * -------------------------------------------------------------------- * This software is the confidential and proprietary information of * Become Interactive ("Confidential Information"). * * You shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement you * with the terms of the license agreement you entered into with * Become Interactive. * -------------------------------------------------------------------- */ var Shine; if(typeof com == "undefined") var com = new Object(); if(typeof com.uk == "undefined") com.uk = new Object(); if(typeof com.uk.become == "undefined") com.uk.become = new Object(); if(typeof com.uk.become.Browser == "undefined") com.uk.become.Browser = new Object(); com.uk.become.Request = function(method, uri) { var r; var progids = [ 'MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP' ]; this._method = method; this._uri = uri; this._req = false; this.onload = false; this.method = false; this.params = new Array(); this.formVars = new Object(); this._headers = new Object(); try { r = new XMLHttpRequest(); this._req = r; } catch(e) { for(i = 0; i < progids.length; i++) { try { r = new XMLHttpRequest(); this._req = r; } catch(e) { } } } finally { return this; } } com.uk.become.Request.prototype.header = function(n, v) { this._headers[n] = v; } com.uk.become.Request.prototype.open = function() { var h, payload, hfv; if(!this._req) { Shine.debug('Request object has no XMLHttpRequest (' + this._method + ' ' + this._uri + ')'); return false; } hfv = false; payload = ''; if(this.method) { this._method = 'POST'; this.header('Content-Type', 'application/vnd.become.rpc+xml'); payload = '' + "\n"; payload += '' + "\n"; payload += ' ' + this.method + '' + "\n"; payload += ' ' + "\n"; for(h = 0; h < this.params.length; h++) { payload += ' '; if(typeof this.params[h] == 'number') { payload += '' + this.params[h] + ''; } else if(typeof this.params[h] == 'boolean') { payload += '' + (this.params[h] ? '1' : '0') + ''; } else { payload += '' + this.params[h] + ''; } payload += '' + "\n"; } payload += ' ' + "\n"; payload += '' + "\n"; } else { for(h in this.formVars) { hfv = true; payload += encodeURIComponent(h) + '=' + encodeURIComponent(this.formVars[h]) + '&'; } if(hfv) { payload = payload.substr(0, payload.length - 1); this.header('Content-Type', 'application/x-www-form-urlencoded'); } } this._req.open(this._method, this._uri, true); for(h in this._headers) { this._req.setRequestHeader(h, this._headers[h]); // Shine.debug(h + ' = ' + this._headers[h]); } if(payload) { // Shine.debug(payload); this._req.send(payload); } else { this._req.send(null); } } com.uk.become.Shine = function(window, document) { var ua; this.version = '$Id: shine.js 56702 2008-06-30 09:50:35Z daniel $'; this._abort = false; this._window = window; this._document = document; this._loaded = false; this._validating = false; this._fieldValidators = new Array(); this._forms = new Array(); this._validateInterval = false; /* Deal with special cases when it comes to browser type */ ua = navigator.userAgent.toLowerCase(); com.uk.become.Browser.userAgent = navigator.userAgent; com.uk.become.Browser.isOpera = ((ua.indexOf("opera") != -1) || window.opera); com.uk.become.Browser.isWebTV = (ua.indexOf("webtv") != -1); com.uk.become.Browser.isIE = (ua.indexOf("msie") != -1) && !com.uk.become.Browser.isOpera && !com.uk.become.Browser.isWebTV; com.uk.become.Browser.isWebKit = (ua.indexOf('applewebkit') != -1); if(document.createElementNS) { com.uk.become.Browser.isDOM = true; } else { com.uk.become.Browser.isDOM = false; } if(com.uk.become.Browser.ieIE) { com.uk.become.Browser.ieVersion = navigator.appVersion.match(/MSIE (\d.\d)/)[1]; if(com.uk.become.Browser.ieVersion < 5 || com.uk.become.Browser.ieVersion >= 7) { this._abort = true; return false; } } this.debug(this.version); if (com.uk.become.Browser.isDOM) { this.addEventHandler(document, 'DOMContentLoaded', this.loaded); } return this; } com.uk.become.Shine.prototype.debug = function() { var args, a; args = new Array('Shine >>>'); d = args.length; for(c = 0; c < arguments.length; c++) { args[d] = arguments[c]; d++; } args = args.join(' '); if(!arguments.length) { return false; } if(com.uk.become.Browser.isWebKit) { /* WebKit raises a DOM exception if the below is executed */ if(window.console) { window.console.log(args); } } else if(com.uk.become.Browser.isOpera && window.opera.postError) { window.opera.postError(args); } else if(document.createEvent && window.dispatchEvent) { printfire = new Object(); printfire.args = new Array(args); var ev = document.createEvent('Events'); ev.initEvent('printfire', false, true); try { dispatchEvent(ev); } catch(e) { } } } com.uk.become.Shine.prototype.addEventHandler = function(element, eventName, handler) { var _this = this; if(typeof element == 'string') { element = document.getElementById(element); } if(!element) { return false; } if(com.uk.become.Browser.isDOM) { element.addEventListener(eventName, function(ev) { _this._handler = handler; _this._handler(_this, element, ev); }, false); } else if(element.attachEvent) { element.attachEvent('on' + eventName, function(ev) { _this._handler = handler; _this._handler(_this, element, window.event); }, false); } else { eval('element.on' + eventName + ' = function() { _this._handler = handler; _this._handler(_this, element, window.event); }'); } } com.uk.become.Shine.prototype.getElementClass = function(element, forceDirect) { var cn; if(element.shineStyleTarget && !forceDirect) { element = element.shineStyleTarget; } if(com.uk.become.Browser.isDOM) { cn = element.getAttribute('class'); } else { cn = element.className; } if(typeof cn != 'string') { return ''; } return cn; } com.uk.become.Shine.prototype.setElementClass = function(element, classes, replace) { var cn = this.getElementClass(element); if(element.shineStyleTarget) { element = element.shineStyleTarget; } if(typeof element.shineOriginalClass != 'string') { element.shineOriginalClass = this.getElementClass(element); } if(!classes) { classes = ''; } if(!replace) { classes = element.shineOriginalClass + ' ' + classes; } if(cn == classes) return true; if(!com.uk.become.Browser.isDOM) { element.className = classes; } else { element.setAttribute('class', classes); } } com.uk.become.Shine.prototype.hasElementClass = function(element, classname, forceDirect) { var cn; if(!forceDirect) { forceDirect = false; } cn = ' ' + this.getElementClass(element, forceDirect) + ' '; if(cn.indexOf(' ' + classname + ' ') != -1) { return true; } return false; } com.uk.become.Shine.prototype._inputHandler = function(shine, sender, event) { var valid, empty, focussed, s, data; valid = true; s = false; prevalidated = false; if(typeof sender.defaultValue != 'undefined') { if(sender.value == sender.defaultValue && sender.acErrorField) { valid = false; prevalidated = true; } } empty = (sender.value ? false : true); focussed = (sender.focussed ? true: false); data = (sender.shineValidatorData ? sender.shineValidatorData : false); if(!prevalidated && !empty && sender.shineValidator) { valid = sender.shineValidator(shine, sender, sender.value, data); } s = 'shine-input '; if(empty) { s += ' shine-input-empty'; sender.shineValidated = false; sender.shineIncomplete = true; } else if(valid) { s += ' shine-input-ok'; sender.shineValidated = true; sender.shineIncomplete = false; } else { s += ' shine-input-bad'; sender.shineValidated = false; sender.shineIncomplete = false; } if(focussed) { s += ' shine-input-focus'; } this.setElementClass(sender, s, false); } com.uk.become.Shine.prototype._inputFocus = function(shine, sender, event) { sender.focussed = true; this._inputHandler(shine, sender, event); } com.uk.become.Shine.prototype._inputBlur = function(shine, sender, event) { sender.focussed = false; this._inputHandler(shine, sender, event); } com.uk.become.Shine.prototype.addInputHandlers = function(elements, validator, data) { var c; for(c = 0; c < elements.length; c++) { this.addInputHandler(elements[c], validator, data); } } com.uk.become.Shine.prototype._createStyleWrapper = function(element) { var newel; /* Create a wrapper element around an element, and set the child's * .shineStyleTarget property to point to the new element. Useful for * elements which can't really be styled themselves (e.g., list/drop-down * boxes) */ if(element.parentNode && element.parentNode.shineStyleSource) { element.shineStyleTarget = element.parentNode; return element.parentNode; } newel = document.createElement('span'); element.parentNode.replaceChild(newel, element); newel.appendChild(element); newel.shineStyleSource = true; element.shineStyleTarget = newel; return newel; /* element.outerHTML = '' + element.outerHTML + ''; element.shineStyleTarget = element.parentNode; element.parentNode.shineStyleSource = element; return element.parentNode; */ } com.uk.become.Shine.prototype.addInputHandler = function(element, validator, data) { if(typeof element == 'string') { element = document.getElementById(element); } if(!element) { return false; } this._createStyleWrapper(element); if(element.form) { if(!element.form.shineFields) { element.form.shineFields = new Array(); } element.form.shineFields[element.form.shineFields.length] = element; if(!element.form.shineForm) { element.form.shineForm = true; this._forms[this._forms.length] = element.form; } } this.setElementClass(element, 'shine-input'); element.shineValidator = validator; element.shineValidatorData = data; element.shineValidated = false; element.shineIncomplete = true; this._fieldValidators[this._fieldValidators.length] = element; this.addEventHandler(element, 'focus', this._inputFocus); this.addEventHandler(element, 'blur', this._inputBlur); /* Return the element object for future use */ return element; } com.uk.become.Shine.prototype._validateFields = function() { var e, complete, valid; if(this._validating) { return true; } this._validating = true; for(e in this._fieldValidators) { if(!this._fieldValidators[e].nodeType) continue; this._inputHandler(this, this._fieldValidators[e], false); } for(f in this._forms) { complete = true; valid = true; if(!this._forms[f].nodeType) continue; for(e in this._forms[f].shineFields) { if(this._forms[f].shineFields[e].shineIncomplete) { complete = false; } if(!this._forms[f].shineFields[e].shineValidated) { valid = false; } } s = ''; if(complete) { s += ' form-complete'; } else { s += ' form-incomplete'; } if(valid) { s += ' form-valid'; } else { s += ' form-invalid'; } if(complete && valid) { s += ' form-valid-complete'; } else { s += ' form-not-valid-complete'; } this.setElementClass(this._forms[f], s, false); } this._validating = false; } com.uk.become.Shine.prototype.getElementsByClass = function(root, el, classname) { var c, nl, nlc, nodes, node; nodes = root.getElementsByTagName(el); nl = new Array(); nlc = 0; for(c = 0; c < nodes.length; c++) { node = nodes[c]; if(this.hasElementClass(node, classname, true)) { nl[nlc] = node; nlc++; } } return nl; } /* Length-based validator */ com.uk.become.Shine.prototype.lengthValidator = function(shine, sender, value, data) { if(value.length < data) { return false; } return true; } /* Simple e-mail address validator */ com.uk.become.Shine.prototype.emailInputValidator = function(shine, sender, value, data) { var ap, dp; ap = value.indexOf('@'); dp = value.lastIndexOf('.'); if(ap != -1 && dp != -1 && dp > ap && dp < value.length - 2) { return true; } return false; } /* Simple password validator */ com.uk.become.Shine.prototype.passwordInputValidator = function(shine, sender, value, data, p2) { if(data && data.shineValidator) { shine._inputHandler(shine, data, false); } if(value.length > 3) { return true; } return false; } /* Simple password confirmation validator (simply compares the value with the first password field) */ com.uk.become.Shine.prototype.passwordConfirmInputValidator = function(shine, sender, value, data) { var c, nodes, node; if(!data && sender.form) { /* Look for a companion password field and pair with it */ nodes = shine.getElementsByClass(sender.form, 'input', 'shine-input-password'); shine.debug('nodes=' + nodes.join(',')); for(c = 0; c < nodes.length; c++) { node = nodes[c]; if(node == sender) continue; if(!node.shineValidatorData) { node.shineValidatorData = sender; sender.shineValidatorData = node; data = node; break; } } } if(!data) return true; if(value == data.value) { return true; } return false; } com.uk.become.Shine.prototype.loaded = function(Shine, sender, ev) { var nodes; if(this._loaded) { return true; } else if(this._abort) { return false; } this._loaded = true; if(this.onload) { this.onload(Shine, this, ev); } /* Add handlers for the various classes of Shine-enabled form fields */ nodes = this.getElementsByClass(document, 'input', 'shine-input-email'); this.addInputHandlers(nodes, Shine.emailInputValidator); nodes = this.getElementsByClass(document, 'input', 'shine-input-simple'); this.addInputHandlers(nodes, Shine.lengthInputValidator, 1); nodes = this.getElementsByClass(document, 'select', 'shine-input-simple'); this.addInputHandlers(nodes, Shine.lengthInputValidator, 1); nodes = this.getElementsByClass(document, 'input', 'shine-input-password'); this.addInputHandlers(nodes, Shine.passwordInputValidator); nodes = this.getElementsByClass(document, 'input', 'shine-input-passconfirm'); this.addInputHandlers(nodes, Shine.passwordConfirmInputValidator); /* Set up form field validation */ Shine._validatorInterval = window.setInterval(function() { Shine._validateFields(); }, 150); this._validateFields(); return true; } Shine = new com.uk.become.Shine(window, document); var ua = navigator.userAgent.toLowerCase(); var opera = (ua.indexOf("opera") != -1); var ie = (ua.indexOf("msie") != -1 && !opera && (ua.indexOf("webtv") == -1)) var root_path = "/"; var html_path = "/"; var toggle_layer = ""; var input_error = Array(); function _ac_showErrors(){ var el; for(i=0;i 1 ){ for( var i=1; i= 4){win.window.focus();} }; var togglePrima = false; Prima = function() { var container = document.getElementById('prima-inner'); container.style.height = '46px'; container.style.overflow = 'hidden'; var container = document.getElementById('prima'); container.style.position = 'absolute'; container.style.left = '0'; container.style.bottom = '0'; var span = document.createElement('span'); span.id = 'toggleSpan'; span.appendChild(document.createTextNode('Click here to find out more')); container.insertBefore(span, container.firstChild); Shine.addEventHandler(span, 'click', this.toggleBanner); } Prima.prototype.toggleBanner = function(Shine, sender, ev) { var container = document.getElementById('prima-inner'); var span = document.getElementById('toggleSpan'); container._sparkleLength = 500; if(!togglePrima) { Slide(container, 46, 321); span.innerHTML = 'Click here to collapse'; } else { Slide(container, 321, 46); span.innerHTML = 'Click here to find out more'; } togglePrima = !togglePrima; } Slide = function(element, from, to) { var start, ev; start = (new Date).getTime(); element._sparkleTo = to; if(element._sparkleTimer) { clearInterval(element._sparkleTimer); } element._sparkleTimer = setInterval(function() { var time = (new Date).getTime(); var Tpos = (time - start) / element._sparkleLength; var pos; if (time >= element._sparkleLength + start) { element.style.height = to + 'px'; pos = to; clearInterval (element._sparkleTimer); element._sparkleTimer = null; /* if(pos > 0) { element.style.height = 'auto'; element._sparkleInitialHeight = element.offsetHeight; ev = new Object(); ev.expanded = true; Shine.dispatchEvent(element, 'toggle', ev); } else { element.style.height = '46px'; ev = new Object(); ev.expanded = false; // Shine.dispatchEvent(element, 'toggle', ev); } */ } else { //this time-position, sinoidal transition thing is from script.aculo.us pos = ((-Math.cos(Tpos*Math.PI)/2) + 0.5) * (to - from) + from; element.style.height = pos + 'px'; } }, 13); } /** * SWFObject v1.4.1: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ * * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for * legal reasons. */ 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(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey){ if (!document.createElement || !document.getElementById) { return; } this.DETECT_KEY = detectKey ? detectKey : 'detectflash'; this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY); this.params = new Object(); this.variables = new Object(); this.attributes = new Array(); if(swf) { this.setAttribute('swf', swf); } if(id) { this.setAttribute('id', id); } if(w) { this.setAttribute('width', w); } if(h) { this.setAttribute('height', h); } if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); } this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute('version'), useExpressInstall); if(c) { this.addParam('bgcolor', c); } var q = quality ? quality : 'high'; this.addParam('quality', q); this.setAttribute('useExpressInstall', useExpressInstall); this.setAttribute('doExpressInstall', false); var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location; this.setAttribute('xiRedirectUrl', xir); this.setAttribute('redirectUrl', ''); if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); } } deconcept.SWFObject.prototype = { setAttribute: function(name, value){ this.attributes[name] = value; }, getAttribute: function(name){ return this.attributes[name]; }, addParam: function(name, value){ this.params[name] = value; }, getParams: function(){ return this.params; }, addVariable: function(name, value){ this.variables[name] = value; }, getVariable: function(name){ return this.variables[name]; }, getVariables: function(){ return this.variables; }, getVariablePairs: function(){ var variablePairs = new Array(); var key; var variables = this.getVariables(); for(key in variables){ variablePairs.push(key +"="+ variables[key]); } return variablePairs; }, getSWFHTML: function() { var swfNode = ""; if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture if (this.getAttribute("doExpressInstall")) this.addVariable("MMplayerType", "PlugIn"); swfNode = ' 0){ swfNode += 'flashvars="'+ pairs +'"'; } swfNode += '/>'; } else { // PC IE if (this.getAttribute("doExpressInstall")) this.addVariable("MMplayerType", "ActiveX"); swfNode = ''; swfNode += ''; var params = this.getParams(); for(var key in params) { swfNode += ''; } var pairs = this.getVariablePairs().join("&"); if(pairs.length > 0) {swfNode += '';} swfNode += ""; } return swfNode; }, getNodes: function() { var node; if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); } node = document.createElement('embed'); node.setAttribute('type', 'application/x-shockwave-flash'); node.setAttribute('src', this.getAttribute('swf')); node.setAttribute('width', this.getAttribute('width')); node.setAttribute('height', this.getAttribute('height')); node.setAttribute('id', this.getAttribute('id')); var params = this.getParams(); for(var key in params) { node.setAttribute(key, params[key]); } pairs = this.getVariablePairs().join("&"); if (pairs.length > 0) { node.setAttribute('flashvars', pairs); } } else { // PC IE if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); } node = document.createElement('object'); node.setAttribute('classid', 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'); node.setAttribute('width', this.getAttribute('width')); node.setAttribute('height', this.getAttribute('height')); node.setAttribute('id', this.getAttribute('id')); node.appendChild(this.createParamNode('movie', this.getAttribute('swf'))); var params = this.getParams(); for(var key in params) { node.appendChild(this.createParamNode(key, params[key])); } var pairs = this.getVariablePairs().join("&"); if(pairs.length > 0) { node.appendChild(this.createParamNode('flashvars', pairs)); } } return node; }, write: function(elementId){ if(this.getAttribute('useExpressInstall')) { // check to see if we need to do an express install var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]); if (this.installedVer.versionIsValid(expressInstallReqVer) && !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 elementId == 'string') ? document.getElementById(elementId) : elementId; if(!n) { return false; } if(document.createElementNS) { while(n.hasChildNodes()) { n.removeChild(n.childNodes[0]); } n.appendChild(this.getNodes()); } else { n.innerHTML = this.getSWFHTML(); } return true; }else{ if(this.getAttribute('redirectUrl') != "") { document.location.replace(this.getAttribute('redirectUrl')); } } return false; } } /* ---- detection functions ---- */ deconcept.SWFObjectUtil.getPlayerVersion = function(reqVer, xiInstall){ var PlayerVersion = new deconcept.PlayerVersion([0,0,0]); if(navigator.plugins && navigator.mimeTypes.length){ var x = navigator.plugins["Shockwave Flash"]; if(x && x.description) { PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")); } }else{ try{ var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); for (var i=3; axo!=null; i++) { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i); PlayerVersion = new deconcept.PlayerVersion([i,0,0]); } }catch(e){} if (reqVer && PlayerVersion.major > reqVer.major) return PlayerVersion; // version is ok, skip minor detection // this only does the minor rev lookup if the user's major version // is not 6 or we are checking for a specific minor or revision number // see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/ if (!reqVer || ((reqVer.minor != 0 || reqVer.rev != 0) && PlayerVersion.major == reqVer.major) || PlayerVersion.major != 6 || xiInstall) { try{ PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")); }catch(e){} } } return PlayerVersion; } deconcept.PlayerVersion = function(arrVersion){ this.major = parseInt(arrVersion[0]) != null ? parseInt(arrVersion[0]) : 0; this.minor = parseInt(arrVersion[1]) || 0; this.rev = parseInt(arrVersion[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; } /* ---- get value of query string param ---- */ deconcept.util = { getRequestParameter: function(param){ var q; if(typeof document.location != 'undefined') { if(typeof document.location.search != 'undefined') { q = document.location.search; } else if(typeof document.location.hash != 'undefined') { q = document.location.hash; } } if(q){ var startIndex = q.indexOf(param +"="); var endIndex = (q.indexOf("&", startIndex) > -1) ? q.indexOf("&", startIndex) : q.length; if (q.length > 1 && startIndex > -1) { return q.substring(q.indexOf("=", startIndex)+1, endIndex); } } return ""; } } /* fix for video streaming bug */ deconcept.SWFObjectUtil.cleanupSWFs = function() { var objects = document.getElementsByTagName("OBJECT"); for (var i=0; i < objects.length; i++) { for (var x in objects[i]) { if (typeof objects[i][x] == 'function') { objects[i][x] = null; } } } } if (typeof window.onunload == 'function') { var oldunload = window.onunload; window.onunload = function() { deconcept.SWFObjectUtil.cleanupSWFs(); oldunload(); } } else { window.onunload = deconcept.SWFObjectUtil.cleanupSWFs; } /* add Array.push if needed (ie5) */ if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }} /* add some aliases for ease of use/backwards compatibility */ var getQueryParamValue = deconcept.util.getRequestParameter; var FlashObject = deconcept.SWFObject; // for legacy support var SWFObject = deconcept.SWFObject; var XHTMLNS = "http://www.w3.org/1999/xhtml"; var CURRENT_NICE_TITLE; var browser = new Browser(); function makeNiceTitles() { if (!document.createElement || !document.getElementsByTagName) return; // add namespace methods to HTML DOM; this makes the script work in both // HTML and XML contexts. if(!document.createElementNS) { document.createElementNS = function(ns,elt) { return document.createElement(elt); } } if( !document.spans ) { document.spans = document.getElementsByTagName("span"); } for (var i=0;i STD_WIDTH) { w = STD_WIDTH; } else if ((STD_WIDTH>t_pixels) && (t_pixels>h_pixels)) { w = t_pixels; } else if ((STD_WIDTH>t_pixels) && (h_pixels>t_pixels)) { w = h_pixels; } else { w = STD_WIDTH; } */ w = STD_WIDTH; d.style.width = w + 'px'; mpos = findPosition(lnk); mx = mpos[0]; my = mpos[1]; d.style.left = (mx) + 'px'; d.style.top = (my+20) + 'px'; if (window.innerWidth && ((mx+w) >= window.innerWidth)) { d.style.left = (window.innerWidth - w - 25) + "px"; } if (document.body.scrollWidth && ((mx+w) >= document.body.scrollWidth)) { d.style.left = (document.body.scrollWidth - w - 25) + "px"; } document.getElementsByTagName("body")[0].appendChild(d); CURRENT_NICE_TITLE = d; } // Add an eventListener to browsers that can do it somehow. // Originally by the amazing Scott Andrew. function addEvent(obj, evType, fn){ if (obj.addEventListener){ obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } function hideNiceTitle(e) { if (!document.getElementsByTagName) return; if (CURRENT_NICE_TITLE) { document.getElementsByTagName("body")[0].removeChild(CURRENT_NICE_TITLE); CURRENT_NICE_TITLE = null; } } function getParent(el, pTagName) { if (el == null) return null; else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) // Gecko bug, supposed to be uppercase return el; else return getParent(el.parentNode, pTagName); } function getMousePosition(event) { if (browser.isIE) { x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft; y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop; } if (browser.isNS) { x = event.clientX + window.scrollX; y = event.clientY + window.scrollY; } return [x,y]; } // Determine browser and version. function Browser() { // blah, browser detect, but mouse-position stuff doesn't work any other way var ua, s, i; this.isIE = false; this.isNS = false; this.version = null; ua = navigator.userAgent; s = "MSIE"; if ((i = ua.indexOf(s)) >= 0) { this.isIE = true; this.version = parseFloat(ua.substr(i + s.length)); return; } s = "Netscape6/"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = parseFloat(ua.substr(i + s.length)); return; } // Treat any other "Gecko" browser as NS 6.1. s = "Gecko"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = 6.1; return; } } function window_onload() { _ac_showErrors(); showErrors(); demoWindows(); pdfProblem(); externalLinks(); popups(); makeNiceTitles(); if(Shine) Shine.loaded(Shine, Shine, false); } window.onload = window_onload;