document.domain = 'ddx.com.au'; var asual = {util: {}}; asual.util.Browser = new function() { var supported = false; var version = -1; var agent = navigator.userAgent; var ie = false; var camino = false; var safari = false; var opera = false; var mozilla = false; if (/MSIE/.test(agent)) { ie = true; version = parseFloat(agent.substring(agent.indexOf('MSIE') + 4)); supported = version >= 6; } else if (/AppleWebKit/.test(agent)) { safari = true; version = parseFloat(agent.substring(agent.indexOf('Safari') + 7)); supported = version >= 312; } else if (/Opera/.test(agent)) { opera = true; version = parseFloat(navigator.appVersion); supported = version >= 9.02; } else if (/Camino/.test(agent)) { camino = true; version = parseFloat(agent.substring(agent.indexOf('Camino') + 7)); supported = version >= 1; } else if (/Firefox/.test(agent)) { mozilla = true; version = parseFloat(agent.substring(agent.indexOf('Firefox') + 8)); supported = version >= 1; } else if (/Netscape/.test(agent)) { mozilla = true; version = parseFloat(agent.substring(agent.indexOf('Netscape') + 9)); supported = version >= 8; } else if (/Mozilla/.test(agent) && /rv:/.test(agent)) { mozilla = true; version = parseFloat(agent.substring(agent.indexOf('rv:') + 3)); supported = version >= 1.8; } this.isSupported = function() { return supported; } this.getVersion = function() { return version; } this.isIE = function() { return ie; } this.isSafari = function() { return safari; } this.isOpera = function() { return opera; } this.isCamino = function() { return camino; } this.isMozilla = function() { return mozilla; } } asual.util.Functions = new function() { this.extend = function(superclass, subclass) { function inheritance() {} inheritance.prototype = superclass.prototype; subclass.prototype = new inheritance(); subclass.prototype.constructor = subclass; subclass.superConstructor = superclass; subclass.superClass = superclass.prototype; for (var p in superclass) { if (p != 'prototype') subclass[p] = superclass[p]; } return subclass; } this.bindAsListener = function(method, obj, win) { return function(evt) { return method.call(obj, evt || ((win) ? win.event : window.event)); } } } asual.util.Events = new function() { var cache = new Array(); this.addListener = function(obj, type, listener) { if (obj.addEventListener){ obj.addEventListener(type, listener, false); } else if (obj.attachEvent){ obj.attachEvent('on' + type, listener); } else { obj['on' + type] = listener; } cache.push({o: obj, t: type, l: listener}); } this.removeListener = function(obj, type, listener) { if (obj.removeEventListener){ obj.removeEventListener(type, listener, false); } else if (obj.detachEvent){ obj.detachEvent('on' + type, listener); } else { obj['on' + type] = listener; } } var unload = function() { for (var i = 0, evt; evt = cache[i]; i++) { asual.util.Events.removeListener(evt.o, evt.t, evt.l); } } if (asual.util.Browser.isIE() || asual.util.Browser.isSafari()) { this.addListener(window, 'unload', asual.util.Functions.bindAsListener(unload, this)); } } SWFAddressEvent = function(type) { this.type = type; this.target = [SWFAddress][0]; this.value = SWFAddress.getValue(); this.path = SWFAddress.getPath(); this.parameters = new Array(); var names = SWFAddress.getParameterNames(); for (var i = 0, n; n = names[i]; i++) { this.parameters[n] = SWFAddress.getParameter(n); } } SWFAddressEvent.INIT = 'init'; SWFAddressEvent.CHANGE = 'change'; SWFAddress = new function() { var browser = asual.util.Browser; var iframe, form, supported = browser.isSupported(); var swfaddr, swfobj, swfid, swfupdate = false; var swftitle = document.title; var swflength = history.length; var swfhistory = new Array(); var listeners = new Object(); var swftrackingEnabled = true; var swfhistoryEnabled = true; var js = 'ddx-seo-1.2.php';//'swfaddress.js'; var swf = 'swfaddress.swf'; var html = 'js/swfaddress.html'; var d = top.document; var h = top.history; var l = top.location; if ((!supported && l.href.indexOf('#') != -1) || (browser.isSafari() && browser.getVersion() < 412 && l.href.indexOf('#') != -1 && l.search != '')){ d.open(); d.write('
'); d.close(); } var getURL = function(url) { var scripts = document.getElementsByTagName('script'); for (var i = 0, s; s = scripts[i]; i++) { if (s.src.indexOf(js) > -1) { return (new String(s.src)).replace(js, url); } } } var getHash = function() { var index = l.href.indexOf('#'); if (index != -1) { return l.href.substring(index).replace(/^#/g, ''); } return ''; } var hash = getHash(); var titleListener = function() { if (browser.isIE() && d.title != swftitle) { SWFAddress.setTitle(swftitle); } } var listen = function() { if (browser.isSafari()) { if (swflength != h.length && !swfupdate) { swflength = h.length; if (typeof swfhistory[swflength - 1] != 'undefined') { hash = swfhistory[swflength - 1]; } update(); } } else if (browser.isIE()) { if (hash != getHash()) { if (browser.getVersion() < 7) { l.reload(); } else { setValue(getHash(), false); } } } else if (hash != l.hash) { hash = getHash(); /* if (browser.isMozilla() && browser.getVersion() >= 2) { var hcheck = false; for (var i = 0; i < swfhistory.length; i++) { if (swfhistory[i] == hash) { hcheck = true; break; } } if (!hcheck) { l.reload(); return; } }*/ update(); } titleListener(); } var init = function() { dispatch('init'); } var change = function() { dispatch('change'); } var dispatch = function(type) { if (SWFAddress.hasEventListener(type)) { SWFAddress.dispatchEvent(new SWFAddressEvent(type)); } type = type.substr(0, 1).toUpperCase() + type.substring(1); if(typeof SWFAddress['on' + type] == 'function') { SWFAddress['on' + type](); } } var update = function() { var addr = hash; if (addr != swfaddr) { swfaddr = addr; var obj = document[swfid] || document.getElementById(swfid); if (obj) { obj = (typeof obj != 'undefined' && typeof obj.setSWFAddressValue != 'undefined') ? obj : ((typeof obj.getElementsByTagName('object')[0] != 'undefined' && typeof obj.getElementsByTagName('object')[0].setSWFAddressValue != 'undefined') ? obj.getElementsByTagName('object')[0] : null); if (obj.setSWFAddressValue) { obj.setSWFAddressValue(addr); } } if (swfobj && swfobj.call) { swfobj.call('setSWFAddressValue', addr); } change(); } } var track = function() { if (swftrackingEnabled && typeof urchinTracker != 'undefined'){ var path = l.pathname + SWFAddress.getValue(); path = path.replace(/\/\//, '/'); path = path.replace(/^\/$/, ''); urchinTracker(path); } } var loadSuccess = function() { if (iframe.contentWindow && iframe.contentWindow.location) { try{ var win = iframe.contentWindow; win.document.title = d.title = swftitle; var src = win.location.href; if (src.indexOf('?') > -1) { hash = src.substring(src.indexOf('?') + 1); } else { hash = ''; } if (hash != getHash()) { update(); l.hash = '#' + hash; } }catch(e){ // } } } var load = function() { var content = document.createElement('div'); document.body.appendChild(content); content.id = 'swfaddress'; content.style.position = 'absolute'; content.style.left = content.style.top = '-9999px'; if (browser.isIE() || browser.isSafari()) { content.innerHTML = ''; //content.innerHTML = ''; iframe = content.getElementsByTagName('iframe')[0]; } if (browser.isIE()) { asual.util.Events.addListener(iframe, 'load', asual.util.Functions.bindAsListener(loadSuccess, this)); } if (browser.isSafari()) { form = document.createElement('form'); form.id = 'swfaddress-form'; form.method = 'get'; content.appendChild(form); if (typeof l.swfaddress == 'undefined') { l.swfaddress = new Object(); } if (typeof l.swfaddress.history != 'undefined') { swfhistory = l.swfaddress.history.split(','); } } if (browser.isOpera() && typeof swfid == 'undefined') { content.innerHTML = ''; } track(); update(); setTimeout(init, 1); setTimeout(change, 2); setInterval(listen, 50); } var setValue = function(addr, force) { if (!supported) return null; if (addr == 'null') { addr = ''; } if (swfaddr == addr) { return; } hash = addr; if (force) { swfaddr = addr; update(); } else { update(); swfaddr = addr; } swfhistory[history.length] = hash; if (browser.isSafari()) { if (swfhistoryEnabled) { l.swfaddress.history = swfhistory.toString(); swfupdate = true; swflength = history.length + 1; if (browser.getVersion() < 412) { if (l.search == '') { form.action = '#' + hash; form.submit(); } } else { var evt = document.createEvent('MouseEvents'); evt.initEvent('click', true, true); var anchor = document.createElement('a'); anchor.href = '#' + hash; anchor.dispatchEvent(evt); } swfupdate = false; } else { l.hash = '#' + hash; } } else if (force) { if (swfhistoryEnabled) { l.hash = '#' + hash; } else { l.replace('#' + hash); } } if (browser.isIE() && swfhistoryEnabled) { var win = iframe.contentWindow; var query = '?' + getHash(); win.location.assign(win.location.pathname + query); } track(); change(); } this.onInit = null; this.onChange = null; this.toString = function() { return '[class SWFAddress]'; } this.back = function() { h.back(); } this.forward = function() { h.forward(); } this.go = function(delta) { h.go(delta); } this.addEventListener = function (type, listener) { if (typeof listeners[type] == 'undefined') { listeners[type] = new Array(); } listeners[type].push(listener); } this.removeEventListener = function (type, listener) { if (typeof listeners[type] != 'undefined') { for (var i = 0, l; l = listeners[type][i]; i++) { if (l == listener) break; } listeners[type].splice(i, 1); } } this.dispatchEvent = function (event) { if (typeof listeners[event.type] != 'undefined') { event.target = this; for (var i = 0, l; l = listeners[event.type][i]; i++) { l(event); } } } this.hasEventListener = function (type) { return (typeof listeners[type] != 'undefined' && listeners[type].length > 0); } this.getHistoryEnabled = function() { return swfhistoryEnabled; } this.setHistoryEnabled = function(enabled) { swfhistoryEnabled = enabled; } this.getTrackingEnabled = function() { return swftrackingEnabled; } this.setTrackingEnabled = function(enabled) { swftrackingEnabled = enabled; } this.openLink = function(url, target) { switch(target) { case '_blank': window.open(url); break; case '_self': self.location = url; break; case '_top': loc = url; break; default: self.location = url; break; } } this.openPopup = function(url, name, options, handler) { var w = window.open(url, name, options); } this.getSWFObject = function() { if (!supported) return null; return swfobj; } this.setSWFObject = function(swfobject) { if (!supported) return null; swfobj = swfobject; } this.getId = function() { if (!supported) return null; return swfid; } this.setId = function(id) { if (!supported) return null; swfid = id; } this.getTitle = function() { if (!supported) return null; return d.title; } this.setTitle = function(title) { if (!supported) return null; if (title == 'null') { title = ''; } if (typeof title != 'undefined') { swftitle = title; d.title = swftitle; } } this.getStatus = function() { if (!supported) return null; return top.status; } this.setStatus = function(status) { if (!supported) return null; if (!browser.isSafari()) { if (status == 'null' || typeof status == 'undefined') { status = ''; } if (status.indexOf("http://") == 0 || status.indexOf("https://") == 0) { // Status is a full url, don't append to current href } else { var index = l.href.indexOf('#'); if (index == -1) { status = l.href + '#' + status; } else { status = l.href.substr(0, index) + '#' + status; } } top.status = status; } } this.resetStatus = function() { top.status = ''; } this.getValue = function() { if (!supported) return null; return hash; } this.setValue = function(value) { setValue(value, true); } this.getPath = function() { var value = this.getValue(); if (value.indexOf('?') != -1) { return value.split('?')[0]; } else { return value; } } this.getQueryString = function() { var value = this.getValue(); var index = value.indexOf('?'); if (index != -1 && index < value.length) { return value.substr(index + 1); } return ''; } this.getParameter = function(param) { var value = this.getValue(); var index = value.indexOf('?'); if (index != -1) { value = value.substr(index + 1); var params = value.split('&'); var p, i = params.length; while(i--) { p = params[i].split('='); if (p[0] == param) { return p[1]; } } } return ''; } this.getParameterNames = function() { var value = this.getValue(); var index = value.indexOf('?'); var names = new Array(); if (index != -1) { value = value.substr(index + 1); if (value != '' && value.indexOf('=') != -1) { var params = value.split('&'); var i = 0; while(i < params.length) { names.push(params[i].split('=')[0]); i++; } } } return names; } if (!supported) return; for (var i = 1; i < swflength; i++) { swfhistory.push(''); } swfhistory.push(l.hash.replace(/^#/g, '')); if (browser.isIE() && l.hash != getHash()) { l.hash = '#' + getHash(); } swfaddr = this.getValue(); titleListener(); if (browser.isIE()) { document.write(""); document.getElementById("__ie_ondomload").onreadystatechange = function() { if (this.readyState == "complete") { this.parentNode.removeChild(this); load(); } }; } else if (browser.isSafari()) { var timer = setInterval(function() { if (/loaded|complete/.test(document.readyState)) { clearInterval(timer); load(); } }, 10); } else if (typeof document.addEventListener != "undefined") { document.addEventListener("DOMContentLoaded", load, null); } } if (typeof deconcept != 'undefined' && deconcept.SWFObject) { asual.SWFAddressObject = asual.util.Functions.extend(deconcept.SWFObject, function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) { asual.SWFAddressObject.superConstructor.apply(this, arguments); SWFAddress.setSWFObject(this); SWFAddress.setId(id); this.setAttribute('style', ';'); if (this.getAttribute('version').major < 8) this.addVariable('$swfaddress', SWFAddress.getValue()); } ) SWFObject = deconcept.SWFObject = asual.SWFAddressObject; } if (typeof SWFFix != 'undefined') { asual.SWFAddressRegisterFix = SWFFix.registerObject; SWFFix.registerObject = function(objectIdStr, configObj) { SWFAddress.setId(objectIdStr); asual.SWFAddressRegisterFix.apply(this, arguments); } asual.SWFAddressCreateFix = SWFFix.createSWF; SWFFix.createSWF = function(attObj, parObj, el) { SWFAddress.setId(attObj.id); asual.SWFAddressCreateFix.apply(this, arguments); } }