/*! SWFObject v2.1
Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
This software is released under the MIT License
*/
var swfobject = function() {
var UNDEF = "undefined",
OBJECT = "object",
SHOCKWAVE_FLASH = "Shockwave Flash",
SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
FLASH_MIME_TYPE = "application/x-shockwave-flash",
EXPRESS_INSTALL_ID = "SWFObjectExprInst",
win = window,
doc = document,
nav = navigator,
domLoadFnArr = [],
regObjArr = [],
objIdArr = [],
listenersArr = [],
script,
timer = null,
storedAltContent = null,
storedAltContentId = null,
isDomLoaded = false,
isExpressInstallActive = false;
/* Centralized function for browser feature detection
- Proprietary feature detection (conditional compiling) is used to detect Internet Explorer's features
- User agent string detection is only used when no alternative is possible
- Is executed directly for optimal performance
*/
var ua = function() {
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
playerVersion = [0,0,0],
d = null;
if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
d = nav.plugins[SHOCKWAVE_FLASH].description;
if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
playerVersion[2] = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
}
}
else if (typeof win.ActiveXObject != UNDEF) {
var a = null, fp6Crash = false;
try {
a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".7");
}
catch(e) {
try {
a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".6");
playerVersion = [6,0,21];
a.AllowScriptAccess = "always"; // Introduced in fp6.0.47
}
catch(e) {
if (playerVersion[0] == 6) {
fp6Crash = true;
}
}
if (!fp6Crash) {
try {
a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
}
catch(e) {}
}
}
if (!fp6Crash && a) { // a will return null when ActiveX is disabled
try {
d = a.GetVariable("$version"); // Will crash fp6.0.21/23/29
if (d) {
d = d.split(" ")[1].split(",");
playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
}
}
catch(e) {}
}
}
var u = nav.userAgent.toLowerCase(),
p = nav.platform.toLowerCase(),
webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
ie = false,
windows = p ? /win/.test(p) : /win/.test(u),
mac = p ? /mac/.test(p) : /mac/.test(u);
/*@cc_on
ie = true;
@if (@_win32)
windows = true;
@elif (@_mac)
mac = true;
@end
@*/
return { w3cdom:w3cdom, pv:playerVersion, webkit:webkit, ie:ie, win:windows, mac:mac };
}();
/* Cross-browser onDomLoad
- Based on Dean Edwards' solution: http://dean.edwards.name/weblog/2006/06/again/
- Will fire an event as soon as the DOM of a page is loaded (supported by Gecko based browsers - like Firefox -, IE, Opera9+, Safari)
*/
var onDomLoad = function() {
if (!ua.w3cdom) {
return;
}
addDomLoadEvent(main);
if (ua.ie && ua.win) {
try { // Avoid a possible Operation Aborted error
doc.write(""); // String is split into pieces to avoid Norton AV to add code that can cause errors
script = getElementById("__ie_ondomload");
if (script) {
addListener(script, "onreadystatechange", checkReadyState);
}
}
catch(e) {}
}
if (ua.webkit && typeof doc.readyState != UNDEF) {
timer = setInterval(function() { if (/loaded|complete/.test(doc.readyState)) { callDomLoadFunctions(); }}, 10);
}
if (typeof doc.addEventListener != UNDEF) {
doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, null);
}
addLoadEvent(callDomLoadFunctions);
}();
function checkReadyState() {
if (script.readyState == "complete") {
script.parentNode.removeChild(script);
callDomLoadFunctions();
}
}
function callDomLoadFunctions() {
if (isDomLoaded) {
return;
}
if (ua.ie && ua.win) { // Test if we can really add elements to the DOM; we don't want to fire it too early
var s = createElement("span");
try { // Avoid a possible Operation Aborted error
var t = doc.getElementsByTagName("body")[0].appendChild(s);
t.parentNode.removeChild(t);
}
catch (e) {
return;
}
}
isDomLoaded = true;
if (timer) {
clearInterval(timer);
timer = null;
}
var dl = domLoadFnArr.length;
for (var i = 0; i < dl; i++) {
domLoadFnArr[i]();
}
}
function addDomLoadEvent(fn) {
if (isDomLoaded) {
fn();
}
else {
domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
}
}
/* Cross-browser onload
- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
- Will fire an event as soon as a web page including all of its assets are loaded
*/
function addLoadEvent(fn) {
if (typeof win.addEventListener != UNDEF) {
win.addEventListener("load", fn, false);
}
else if (typeof doc.addEventListener != UNDEF) {
doc.addEventListener("load", fn, false);
}
else if (typeof win.attachEvent != UNDEF) {
addListener(win, "onload", fn);
}
else if (typeof win.onload == "function") {
var fnOld = win.onload;
win.onload = function() {
fnOld();
fn();
};
}
else {
win.onload = fn;
}
}
/* Main function
- Will preferably execute onDomLoad, otherwise onload (as a fallback)
*/
function main() { // Static publishing only
var rl = regObjArr.length;
for (var i = 0; i < rl; i++) { // For each registered object element
var id = regObjArr[i].id;
if (ua.pv[0] > 0) {
var obj = getElementById(id);
if (obj) {
regObjArr[i].width = obj.getAttribute("width") ? obj.getAttribute("width") : "0";
regObjArr[i].height = obj.getAttribute("height") ? obj.getAttribute("height") : "0";
if (hasPlayerVersion(regObjArr[i].swfVersion)) { // Flash plug-in version >= Flash content version: Houston, we have a match!
if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements
fixParams(obj);
}
setVisibility(id, true);
}
else if (regObjArr[i].expressInstall && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) { // Show the Adobe Express Install dialog if set by the web page author and if supported (fp6.0.65+ on Win/Mac OS only)
showExpressInstall(regObjArr[i]);
}
else { // Flash plug-in and Flash content version mismatch: display alternative content instead of Flash content
displayAltContent(obj);
}
}
}
else { // If no fp is installed, we let the object element do its job (show alternative content)
setVisibility(id, true);
}
}
}
/* Fix nested param elements, which are ignored by older webkit engines
- This includes Safari up to and including version 1.2.2 on Mac OS 10.3
- Fall back to the proprietary embed element
*/
function fixParams(obj) {
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
if (nestedObj) {
var e = createElement("embed"), a = nestedObj.attributes;
if (a) {
var al = a.length;
for (var i = 0; i < al; i++) {
if (a[i].nodeName == "DATA") {
e.setAttribute("src", a[i].nodeValue);
}
else {
e.setAttribute(a[i].nodeName, a[i].nodeValue);
}
}
}
var c = nestedObj.childNodes;
if (c) {
var cl = c.length;
for (var j = 0; j < cl; j++) {
if (c[j].nodeType == 1 && c[j].nodeName == "PARAM") {
e.setAttribute(c[j].getAttribute("name"), c[j].getAttribute("value"));
}
}
}
obj.parentNode.replaceChild(e, obj);
}
}
/* Show the Adobe Express Install dialog
- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
*/
function showExpressInstall(regObj) {
isExpressInstallActive = true;
var obj = getElementById(regObj.id);
if (obj) {
if (regObj.altContentId) {
var ac = getElementById(regObj.altContentId);
if (ac) {
storedAltContent = ac;
storedAltContentId = regObj.altContentId;
}
}
else {
storedAltContent = abstractAltContent(obj);
}
if (!(/%$/.test(regObj.width)) && parseInt(regObj.width, 10) < 310) {
regObj.width = "310";
}
if (!(/%$/.test(regObj.height)) && parseInt(regObj.height, 10) < 137) {
regObj.height = "137";
}
doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
dt = doc.title,
fv = "MMredirectURL=" + win.location + "&MMplayerType=" + pt + "&MMdoctitle=" + dt,
replaceId = regObj.id;
// For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
// In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
if (ua.ie && ua.win && obj.readyState != 4) {
var newObj = createElement("div");
replaceId += "SWFObjectNew";
newObj.setAttribute("id", replaceId);
obj.parentNode.insertBefore(newObj, obj); // Insert placeholder div that will be replaced by the object element that loads expressinstall.swf
obj.style.display = "none";
var fn = function() {
obj.parentNode.removeChild(obj);
};
addListener(win, "onload", fn);
}
createSWF({ data:regObj.expressInstall, id:EXPRESS_INSTALL_ID, width:regObj.width, height:regObj.height }, { flashvars:fv }, replaceId);
}
}
/* Functions to abstract and display alternative content
*/
function displayAltContent(obj) {
if (ua.ie && ua.win && obj.readyState != 4) {
// For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
// In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
var el = createElement("div");
obj.parentNode.insertBefore(el, obj); // Insert placeholder div that will be replaced by the alternative content
el.parentNode.replaceChild(abstractAltContent(obj), el);
obj.style.display = "none";
var fn = function() {
obj.parentNode.removeChild(obj);
};
addListener(win, "onload", fn);
}
else {
obj.parentNode.replaceChild(abstractAltContent(obj), obj);
}
}
function abstractAltContent(obj) {
var ac = createElement("div");
if (ua.win && ua.ie) {
ac.innerHTML = obj.innerHTML;
}
else {
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
if (nestedObj) {
var c = nestedObj.childNodes;
if (c) {
var cl = c.length;
for (var i = 0; i < cl; i++) {
if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
ac.appendChild(c[i].cloneNode(true));
}
}
}
}
}
return ac;
}
/* Cross-browser dynamic SWF creation
*/
function createSWF(attObj, parObj, id) {
var r, el = getElementById(id);
if (el) {
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
attObj.id = id;
}
if (ua.ie && ua.win) { // IE, the object element and W3C DOM methods do not combine: fall back to outerHTML
var att = "";
for (var i in attObj) {
if (attObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries, like Object.prototype.toJSONString = function() {}
if (i.toLowerCase() == "data") {
parObj.movie = attObj[i];
}
else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
att += ' class="' + attObj[i] + '"';
}
else if (i.toLowerCase() != "classid") {
att += ' ' + i + '="' + attObj[i] + '"';
}
}
}
var par = "";
for (var j in parObj) {
if (parObj[j] != Object.prototype[j]) { // Filter out prototype additions from other potential libraries
par += '';
}
}
el.outerHTML = '';
objIdArr[objIdArr.length] = attObj.id; // Stored to fix object 'leaks' on unload (dynamic publishing only)
r = getElementById(attObj.id);
}
else if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements: fall back to the proprietary embed element
var e = createElement("embed");
e.setAttribute("type", FLASH_MIME_TYPE);
for (var k in attObj) {
if (attObj[k] != Object.prototype[k]) { // Filter out prototype additions from other potential libraries
if (k.toLowerCase() == "data") {
e.setAttribute("src", attObj[k]);
}
else if (k.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
e.setAttribute("class", attObj[k]);
}
else if (k.toLowerCase() != "classid") { // Filter out IE specific attribute
e.setAttribute(k, attObj[k]);
}
}
}
for (var l in parObj) {
if (parObj[l] != Object.prototype[l]) { // Filter out prototype additions from other potential libraries
if (l.toLowerCase() != "movie") { // Filter out IE specific param element
e.setAttribute(l, parObj[l]);
}
}
}
el.parentNode.replaceChild(e, el);
r = e;
}
else { // Well-behaving browsers
var o = createElement(OBJECT);
o.setAttribute("type", FLASH_MIME_TYPE);
for (var m in attObj) {
if (attObj[m] != Object.prototype[m]) { // Filter out prototype additions from other potential libraries
if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
o.setAttribute("class", attObj[m]);
}
else if (m.toLowerCase() != "classid") { // Filter out IE specific attribute
o.setAttribute(m, attObj[m]);
}
}
}
for (var n in parObj) {
if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // Filter out prototype additions from other potential libraries and IE specific param element
createObjParam(o, n, parObj[n]);
}
}
el.parentNode.replaceChild(o, el);
r = o;
}
}
return r;
}
function createObjParam(el, pName, pValue) {
var p = createElement("param");
p.setAttribute("name", pName);
p.setAttribute("value", pValue);
el.appendChild(p);
}
/* Cross-browser SWF removal
- Especially needed to safely and completely remove a SWF in Internet Explorer
*/
function removeSWF(id) {
var obj = getElementById(id);
if (obj && (obj.nodeName == "OBJECT" || obj.nodeName == "EMBED")) {
if (ua.ie && ua.win) {
if (obj.readyState == 4) {
removeObjectInIE(id);
}
else {
win.attachEvent("onload", function() {
removeObjectInIE(id);
});
}
}
else {
obj.parentNode.removeChild(obj);
}
}
}
function removeObjectInIE(id) {
var obj = getElementById(id);
if (obj) {
for (var i in obj) {
if (typeof obj[i] == "function") {
obj[i] = null;
}
}
obj.parentNode.removeChild(obj);
}
}
/* Functions to optimize JavaScript compression
*/
function getElementById(id) {
var el = null;
try {
el = doc.getElementById(id);
}
catch (e) {}
return el;
}
function createElement(el) {
return doc.createElement(el);
}
/* Updated attachEvent function for Internet Explorer
- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
*/
function addListener(target, eventType, fn) {
target.attachEvent(eventType, fn);
listenersArr[listenersArr.length] = [target, eventType, fn];
}
/* Flash Player and SWF content version matching
*/
function hasPlayerVersion(rv) {
var pv = ua.pv, v = rv.split(".");
v[0] = parseInt(v[0], 10);
v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
v[2] = parseInt(v[2], 10) || 0;
return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
}
/* Cross-browser dynamic CSS creation
- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
*/
function createCSS(sel, decl) {
if (ua.ie && ua.mac) {
return;
}
var h = doc.getElementsByTagName("head")[0], s = createElement("style");
s.setAttribute("type", "text/css");
s.setAttribute("media", "screen");
if (!(ua.ie && ua.win) && typeof doc.createTextNode != UNDEF) {
s.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
}
h.appendChild(s);
if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
var ls = doc.styleSheets[doc.styleSheets.length - 1];
if (typeof ls.addRule == OBJECT) {
ls.addRule(sel, decl);
}
}
}
function setVisibility(id, isVisible) {
var v = isVisible ? "visible" : "hidden";
if (isDomLoaded && getElementById(id)) {
getElementById(id).style.visibility = v;
}
else {
createCSS("#" + id, "visibility:" + v);
}
}
/* Filter to avoid XSS attacks
*/
function urlEncodeIfNecessary(s) {
var regex = /[\\\"<>\.;]/;
var hasBadChars = regex.exec(s) != null;
return hasBadChars ? encodeURIComponent(s) : s;
}
/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
*/
var cleanup = function() {
if (ua.ie && ua.win) {
window.attachEvent("onunload", function() {
// remove listeners to avoid memory leaks
var ll = listenersArr.length;
for (var i = 0; i < ll; i++) {
listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
}
// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
var il = objIdArr.length;
for (var j = 0; j < il; j++) {
removeSWF(objIdArr[j]);
}
// cleanup library's main closures to avoid memory leaks
for (var k in ua) {
ua[k] = null;
}
ua = null;
for (var l in swfobject) {
swfobject[l] = null;
}
swfobject = null;
});
}
}();
return {
/* Public API
- Reference: http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation
*/
registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr) {
if (!ua.w3cdom || !objectIdStr || !swfVersionStr) {
return;
}
var regObj = {};
regObj.id = objectIdStr;
regObj.swfVersion = swfVersionStr;
regObj.expressInstall = xiSwfUrlStr ? xiSwfUrlStr : false;
regObjArr[regObjArr.length] = regObj;
setVisibility(objectIdStr, false);
},
getObjectById: function(objectIdStr) {
var r = null;
if (ua.w3cdom) {
var o = getElementById(objectIdStr);
if (o) {
var n = o.getElementsByTagName(OBJECT)[0];
if (!n || (n && typeof o.SetVariable != UNDEF)) {
r = o;
}
else if (typeof n.SetVariable != UNDEF) {
r = n;
}
}
}
return r;
},
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj) {
if (!ua.w3cdom || !swfUrlStr || !replaceElemIdStr || !widthStr || !heightStr || !swfVersionStr) {
return;
}
widthStr += ""; // Auto-convert to string
heightStr += "";
if (hasPlayerVersion(swfVersionStr)) {
setVisibility(replaceElemIdStr, false);
var att = {};
if (attObj && typeof attObj === OBJECT) {
for (var i in attObj) {
if (attObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries
att[i] = attObj[i];
}
}
}
att.data = swfUrlStr;
att.width = widthStr;
att.height = heightStr;
var par = {};
if (parObj && typeof parObj === OBJECT) {
for (var j in parObj) {
if (parObj[j] != Object.prototype[j]) { // Filter out prototype additions from other potential libraries
par[j] = parObj[j];
}
}
}
if (flashvarsObj && typeof flashvarsObj === OBJECT) {
for (var k in flashvarsObj) {
if (flashvarsObj[k] != Object.prototype[k]) { // Filter out prototype additions from other potential libraries
if (typeof par.flashvars != UNDEF) {
par.flashvars += "&" + k + "=" + flashvarsObj[k];
}
else {
par.flashvars = k + "=" + flashvarsObj[k];
}
}
}
}
addDomLoadEvent(function() {
createSWF(att, par, replaceElemIdStr);
if (att.id == replaceElemIdStr) {
setVisibility(replaceElemIdStr, true);
}
});
}
else if (xiSwfUrlStr && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) {
isExpressInstallActive = true; // deferred execution
setVisibility(replaceElemIdStr, false);
addDomLoadEvent(function() {
var regObj = {};
regObj.id = regObj.altContentId = replaceElemIdStr;
regObj.width = widthStr;
regObj.height = heightStr;
regObj.expressInstall = xiSwfUrlStr;
showExpressInstall(regObj);
});
}
},
getFlashPlayerVersion: function() {
return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
},
hasFlashPlayerVersion: hasPlayerVersion,
createSWF: function(attObj, parObj, replaceElemIdStr) {
if (ua.w3cdom) {
return createSWF(attObj, parObj, replaceElemIdStr);
}
else {
return undefined;
}
},
removeSWF: function(objElemIdStr) {
if (ua.w3cdom) {
removeSWF(objElemIdStr);
}
},
createCSS: function(sel, decl) {
if (ua.w3cdom) {
createCSS(sel, decl);
}
},
addDomLoadEvent: addDomLoadEvent,
addLoadEvent: addLoadEvent,
getQueryParamValue: function(param) {
var q = doc.location.search || doc.location.hash;
if (param == null) {
return urlEncodeIfNecessary(q);
}
if (q) {
var pairs = q.substring(1).split("&");
for (var i = 0; i < pairs.length; i++) {
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
}
}
}
return "";
},
// For internal usage only
expressInstallCallback: function() {
if (isExpressInstallActive && storedAltContent) {
var obj = getElementById(EXPRESS_INSTALL_ID);
if (obj) {
obj.parentNode.replaceChild(storedAltContent, obj);
if (storedAltContentId) {
setVisibility(storedAltContentId, true);
if (ua.ie && ua.win) {
storedAltContent.style.display = "block";
}
}
storedAltContent = null;
storedAltContentId = null;
isExpressInstallActive = false;
}
}
}
};
}();
/**
* this code is borrowed from Appcelerator (appcelerator.org).
* the borrowed code is heavily modified, so the remoteLoad function will work
* without the overhead of the rest of the framework.
*
* the external API is preserved from Appcelerator, so you should be able
* to swap this out for the actual full Appcelerator framework, without breaking
* your code. (should you decide you need the full framework, that is).
*/
/*!
* This file is part of Appcelerator.
*
* Copyright 2006-2008 Appcelerator, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
Appcelerator = {
Browser: {
},
Core: {
fetching: { },
HeadElement: null,
initialize: function() {
this.HeadElement = document.getElementsByTagName('head')[0];
}
},
URI: {
absolutizeURI: function(path, base) {
// stub
return path;
}
}
}
APPCELERATOR_DEBUG = true;
(function() {
var ua = navigator.userAgent.toLowerCase();
Appcelerator.Browser.isPreCompiler = (ua.indexOf('Appcelerator Compiler') > -1);
Appcelerator.Browser.isOpera = (ua.indexOf('opera') > -1);
Appcelerator.Browser.isSafari = (ua.indexOf('safari') > -1);
Appcelerator.Browser.isSafari2 = false;
Appcelerator.Browser.isSafari3 = false;
Appcelerator.Browser.isIE = !!(window.ActiveXObject);
Appcelerator.Browser.isIE6 = false;
Appcelerator.Browser.isIE7 = false;
Appcelerator.Browser.isIE8 = false;
if (Appcelerator.Browser.isSafari)
{
var webKitFields = RegExp("( applewebkit/)([^ ]+)").exec(ua);
if (webKitFields[2] > 400 && webKitFields[2] < 500)
{
Appcelerator.Browser.isSafari2 = true;
}
else if (webKitFields[2] > 500 && webKitFields[2] < 600)
{
Appcelerator.Browser.isSafari3 = true;
}
}
})();
Logger =
{
console:function(type,msg)
{
try
{
if (console && console[type]) console[type](msg);
}
catch(e)
{
}
},
debug:function(msg) { if (APPCELERATOR_DEBUG) this.console('debug',msg); },
info:function(msg) { this.console('info',msg); },
error:function(msg) { this.console('error',msg); },
warn:function(msg) { this.console('warn',msg); },
trace:function(msg) { if (APPCELERATOR_DEBUG) this.console('debug',msg); },
fatal:function(msg) { this.console('error',msg); }
};
function $D(msg) {
Logger.debug(msg);
}
function $A(iterable) {
if (!iterable) return [];
if (iterable.toArray) return iterable.toArray();
var length = iterable.length, results = new Array(length);
while (length--) results[length] = iterable[length];
return results;
}
Object.extend = function(destination, source) {
for (var property in source)
destination[property] = source[property];
return destination;
};
Object.extend(Function.prototype, {
curry_appcelerator: function() {
if (!arguments.length) return this;
var __method = this, args = $A(arguments);
return function() {
return __method.apply(this, args.concat($A(arguments)));
}
},
delay_appcelerator: function() {
var __method = this, args = $A(arguments), timeout = args.shift() * 1000;
return window.setTimeout(function() {
return __method.apply(__method, args);
}, timeout);
}
});
Function.prototype.defer_appcelerator = Function.prototype.delay_appcelerator.curry_appcelerator(0.01);
/**
* dynamically load a remote file
*
* @param tag - Name of the tag to insert into the DOM, for
* example, "script" or "link."
* @param type - Content type of external file, for example,
* "text/css" or "text/javascript."
* @param path - full path to the resource
* @param onload - function to invoke upon load
* @param onerror - function to invoke upon error
*/
Appcelerator.Core.remoteLoad = function(tag, type, path, onload, onerror)
{
$D('remoteLoad '+tag+',type='+type+',path='+path+',onload='+onload+',onerror='+onerror);
// fixup the URI
path = Appcelerator.URI.absolutizeURI(path, Appcelerator.DocumentPath);
var array = Appcelerator.Core.fetching[path];
if (array)
{
if (onload)
{
array.push(onload);
}
return;
}
if (onload)
{
Appcelerator.Core.fetching[path]=[onload];
}
var element = document.createElement(tag);
element.setAttribute('type', type);
switch(tag)
{
case 'script':
element.setAttribute('src',path);
break;
case 'link':
element.setAttribute('href',path);
element.setAttribute('rel','stylesheet');
break;
}
var timer = null;
var loader = function()
{
$D('loaded '+path);
if (timer) clearTimeout(timer);
var callbacks = Appcelerator.Core.fetching[path];
if (callbacks)
{
for (var c=0;c 0) {
var key = params[i].substring(0, eqPos);
var val = params[i].substring(eqPos+1);
this.qsParams[key] = val;
}
}
}
}
}
/**
* Attach a window/document onLoad event rather than
* overwriting any existing onLoad handlers.
*/
lg_lib.addOnLoadEvent = function(fn){
if (window.attachEvent){
window.attachEvent('onload', fn);
} else if (window.addEventListener) {
window.addEventListener('load', fn, false);
} else {
document.addEventListener('load', fn, false);
}
}
/**
* Define short-cuts to user agents and platforms.
*/
lg_lib.getUserSpecs = function(){
this.ua = navigator.userAgent.toLowerCase();
this.isSafari = this.ua.indexOf("safari") > -1;
this.isIPhone = this.ua.indexOf("iphone") > -1;
this.pl = navigator.platform.toLowerCase();
this.isMac = this.pl.indexOf("mac") > -1;
}
/**
* If flagged to open the site in a popup window,
* trigger that behavior now.
*/
lg_lib.handleBodyLoad = function(){
if (this.doBodyOnLoad){
this.openRemote();
}
}
/**
* Historically, this method displayed content in a sized HTML
* popup window. However, with the launch of the DIV overlay,
* all links to popup content in the mod site text fields were
* converted to overlay links. However, there were a few SWF
* components (logos, menu column bottom/top elements) that
* included calls to this function. Consequently, it's been
* converted to an adapter that routes requests to the
* OverlayManager's openOverlay function. While the original
* function didn't include width and height arguments, it is
* assumed that all SWF components included the dimensions in
* the call.
*/
lg_lib.launchPopup = function(path, filename, contentWidth, contentHeight){
//this.overlayManager.openOverlay(path, filename, contentWidth, contentHeight);
lg_lib.launchPopupActual(path, filename, contentWidth, contentHeight);
}
/**
* [DEPRECATED] Proxy function for lauching popup. There are some old
* custom Flash components that call this method without
* using the lg_lib namespace.
*/
launchPopup = function(path, filename, contentWidth, contentHeight){
lg_lib.launchPopup(path, filename, contentWidth, contentHeight);
}
/**
* [DEPRECATED] Displays content in a sized HTML popup window.
* Clients are now encouraged to use the DIV overlay to display
* content rather than an HTML popup window. Formerly called
* launchPopup(). Accessed by prepending the string "popup:"
* to links.
*/
lg_lib.launchPopupActual = function(path, filename, contentWidth, contentHeight){
// NB: If dimensions are defined, they won't be part of
// the filename argument. Dimensions will be arguments[2]
// and arguments[3].
if (filename != ""){
fileExtension = filename.substr(filename.indexOf("."));
if (fileExtension.toLowerCase() == ".jpg"){
assetType = "image";
} else if (fileExtension.toLowerCase() == ".mov"){
assetType = "movie";
} else if (fileExtension.toLowerCase() == ".html" || fileExtension.toLowerCase() == ".php"){
assetType = "html";
}
} else {
assetType = "html"
}
if (assetType != "html"){
windowWidth = contentWidth + 40;
windowHeight = contentHeight + 30;
if (assetType == "movie"){
windowHeight += 25;
} else {
windowHeight += 15;
}
} else {
windowWidth = contentWidth;
windowHeight = contentHeight;
}
var windowName = "assetwindow";
if (document.all || this.isSafari) {
iW = document.body.clientWidth;
iH = document.body.clientHeight;
iL = window.screenLeft;
iT = window.screenTop;
} else if (document.layers || document.getElementById) {
iW = window.outerWidth;
iH = window.outerHeight;
iL = screenX;
iT = screenY;
} else {
iW = screen.availWidth;
iH = screen.availHeight;
iL = 0;
iT = 0;
}
var initXPos = iL + ((iW - windowWidth)/2);
var initYPos = iT + ((iH - windowHeight)/2);
var windowOptions = "toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=1,copyhistory=0,width=" + windowWidth + ",height=" + windowHeight + ",top=" + initYPos + ",left=" + initXPos + ",screeny=" + initYPos + ",screenx=" + initXPos;
if (assetType != "html"){
windowOptions += ",scrollbars=0";
var winPath = "/render_popup.php?layout=custom&assetType=" + assetType + "&path=" + path + "&URI=" + filename + "&width=" + contentWidth + "&height=" + contentHeight;
} else {
windowOptions += ",scrollbars=1";
if (path.substr(0,4) != 'http' && path.substr(0,1) != '/'){
path = '/' + path;
}
var winPath = path+filename;
}
var remote = window.open(winPath, windowName, windowOptions);
if (parseInt(navigator.appVersion) >= 4){
remote.window.focus();
}
}
/**
* Mechanism for managing display of content in an overlay DIV. Two things
* necessitate this manager class: 1) The Overlay class requires a set of
* style sheets and script libraries that aren't loaded by default, and 2)
* we only want a single instance of the overlay to exist at any one time.
*
* @param appDomain [String] - Application domain.
* @param appVersion [String] - To be used when system is migrated to
* lightgalleries.net.
* @param siteMatteColor [Hex String] - Color of matte in mod site. This
* color is used for the scrimColor and the matteColor if the matteThickness is set to 0.
* @param scrimOpacity [Number] - Opacity of scrim.
* @param scrimColor [Hex String] - Color of scrim, which matches site's
* matte. By using the matte color, we create the illusion of the
* site dimming down rather than darkening, which is what happens
* if the color isn't set to match the matte color.
* @param borderThickness [Number] - Thickness of border around content.
* @param borderColor [Hex String] - Color of border around content.
* @param matteThickness [Hex String] - Thickness of matte around content.
* @param matteColor [Hex String] - Color of matte around content.
* Regardless of the matte thickness setting, this color appears behind
* the content during load. So this can be thought of as a background
* color as well.
* @param videoControlsColor [Hex String] - Color to use for the video controls.
*/
lg_lib.OverlayManager = function(appDomain, appVersion, clientServerName, scrimOpacity, scrimColor, borderThickness, borderColor, matteThickness, matteColor, videoControlsColor){
/*
* overlay [Obj Ref] - Pointer to the single instance
of the LGOverlay class that exists when openOverlay()
is called.
* baseFilePath [String] - Prepend to all external resource
paths, including support file (style sheets and script
libraries) and images used in the overlay.
* totalSupportFilesLoaded [Number] - As support files finish
loading, this counter is incremented. Used to determine
whether or not all support files are loaded.
* supportFiles [Array of Objects] - Information necessary to
load support files, including whether or not each file
is loaded, the tag, type and path to the file.
*/
this.overlay = null;
//this.clientServerPath = "http://" + clientServerName + "/";
this.baseURL = appDomain + "/app/" + appVersion + "/templates/";
this.scrimOpacity = scrimOpacity;
this.scrimColor = scrimColor;
this.borderThickness = borderThickness;
this.borderColor = borderColor;
this.matteThickness = matteThickness;
this.matteColor = matteColor;
this.videoControlsColor = videoControlsColor;
this.totalSupportFilesLoaded = 0;
this.supportFiles = [];
this.supportFiles.push({isLoaded:false, tag:"link", type:"text/css", path:this.baseURL + clientServerName + "/styles/overlay.css?ver=" + appVersion});
this.supportFiles.push({isLoaded:false, tag:"script", type:"text/javascript", path:this.baseURL + "scripts/prototype_1.6.1.js"});//
//this.supportFiles.push({isLoaded:false, tag:"script", type:"text/javascript", path:this.baseURL + "scripts/scrpl/scriptaculous.js?load=effects,builder"});
this.supportFiles.push({isLoaded:false, tag:"script", type:"text/javascript", path:this.baseURL + "scripts/scrpl/effects.js"});
this.supportFiles.push({isLoaded:false, tag:"script", type:"text/javascript", path:this.baseURL + "scripts/scrpl/builder.js"});
this.supportFiles.push({isLoaded:false, tag:"script", type:"text/javascript", path:this.baseURL + "scripts/overlay/qtp_poster.js"});
this.supportFiles.push({isLoaded:false, tag:"script", type:"text/javascript", path:this.baseURL + "scripts/overlay/overlay.js"});
}
/**
* This is actually a proxy. The overlay can't be opened directly
* because the style sheets and script libraries necessary to
* render the overlay are loaded as needed. This function checks
* to see if the style sheets and script libraries are loaded, and
* if not, loads them. If they're already loaded, the overlay is
* shown.
*
* @param path [String] - Path to resource to be displayed in the
* overlay. Can be relative or a full URL.
* @param filename [String] - Name of resource to be displayed.
* @param contentWidth [Number] - Width of resource.
* @param contentHeight [Number] - Height of resource.
*/
lg_lib.OverlayManager.prototype.openOverlay = function(path, filename, contentWidth, contentHeight){
this.path = path;
this.filename = filename;
this.contentWidth = contentWidth;
this.contentHeight = contentHeight;
// If this is a movie, automatically add 16 pixels
// to the content height to account for the controller.
/*
var fExt = this.filename.substr(this.filename.lastIndexOf(".")+1,3).toLowerCase();
if (fExt == 'mov' || fExt == 'mp4' || fExt == 'm4v'){
this.contentHeight += 18;
}
*/
this.additionalOptionsStr = arguments[4];
if (this.areSupportFilesLoaded()){
this.openOverlayActual();
} else {
this.showSupportLoader(true);// show loader
this.loadSupportFiles();
}
}
/**
* Display an overlay window using the attributes set in the
* openOverlay() method. This is where the Overlay class is
* actually instantiated.
*/
lg_lib.OverlayManager.prototype.openOverlayActual = function(){
// If an overlay is already open, close it now.
if(this.overlay != null){
this.overlay.closeOverlay();
}
this.showSupportLoader(false);// hide loader if its there
var overlayObj = {};
overlayObj.content = this.path + this.filename;
overlayObj.options = {};
overlayObj.options.baseURL = this.baseURL;
//overlayObj.options.siteURL = this.clientServerPath;
overlayObj.options.overlayColor = this.scrimColor;
overlayObj.options.fixedSize = true;
overlayObj.options.initialWidth = this.contentWidth-20;
overlayObj.options.initialHeight = this.contentHeight-20;
overlayObj.options.contentWidth = this.contentWidth;
overlayObj.options.contentHeight = this.contentHeight;
overlayObj.options.overlayOpacity = this.scrimOpacity;
overlayObj.options.contentColor = this.matteColor;
overlayObj.options.videoControlsColor = this.videoControlsColor;
if (this.borderThickness > 0){
overlayObj.options.contentBorderWidth = this.borderThickness + "px";
overlayObj.options.contentBorderColor = this.borderColor;
}
if (this.matteThickness > 0){
overlayObj.options.contentPadding = this.matteThickness;
overlayObj.options.contentColor = this.matteColor;
}
if (this.additionalOptionsStr != null){
if (this.additionalOptionsStr.indexOf('&') != -1){
var additionalOptions = this.additionalOptionsStr.split('&');
} else {
var additionalOptions = [this.additionalOptionsStr];
}
for (var i=0; i < additionalOptions.length; i++){
var option = additionalOptions[i].split("=");
//alert("option name=" + option[0]);
//alert("option value=" + option[1]);
if (option[1] == "true"){
overlayObj.options[option[0]] = true;
} else if (option[1] == "false"){
overlayObj.options[option[0]] = false;
} else {
overlayObj.options[option[0]] = option[1];
}
}
}
if (this.filename != ''){
var ext = this.filename.substr(this.filename.lastIndexOf(".")+1,3).toLowerCase();
if (ext == "htm" || ext == "php"){
overlayObj.type = 'webpage';
}
} else {
overlayObj.type = 'webpage';
}
this.overlay = new lg_lib.Overlay(overlayObj);
this.overlay.openOverlay();
}
/**
*
*/
lg_lib.OverlayManager.prototype.closeOverlay = function(){
if (this.overlay != null){
this.overlay.closeOverlay();
}
}
lg_lib.OverlayManager.prototype.showSupportLoader = function(b){
//alert('showSupportLoad('+b+')');
var e;
if(b){
e = window.document.createElement('div');
e.setAttribute('id','nsJSLoader');
//e.setAttribute('style','position:absolute;margin:-20px 0 0 -20px;padding:0;z-index:450;width:40px;height:40px;top:50%;left:50%;display:block;');
window.document.body.appendChild(e);
var e2 = window.document.createElement('div');
e2.setAttribute('id','animation');
e.appendChild(e2);
var att = {data:this.baseURL+'swfs/loading.swf', width:"100%", height:"100%"};// will occupy what ever space set by content
var params = {wmode : "transparent", menu : false};//, align: "middle"
swfobject.createSWF(att, params, 'animation');
}else{
e = document.getElementById('nsJSLoader');
if(null != e){
swfobject.removeSWF('animation');
e.innerHTML = '';
e.parentNode.removeChild(e);
};
}
}
/**
* Load the next CSS or JavaScript library necessary for
* displaying the DIV overlay.
*/
lg_lib.OverlayManager.prototype.loadSupportFiles = function(){
var targetFile = this.supportFiles[this.totalSupportFilesLoaded];
Appcelerator.Core.remoteLoad(targetFile.tag, targetFile.type, targetFile.path, this.handleSupportFileLoaded.bind2(this));
}
/**
* Increment the total number of support files loaded after
* each one is loaded, and load the next one if there are more,
* or alternatively, display the overlay.
*/
lg_lib.OverlayManager.prototype.handleSupportFileLoaded = function(){
this.totalSupportFilesLoaded++;
if (this.areSupportFilesLoaded()){
// Delay to give Moo Tools time to initialize. Otherwise
// a vertical scrollbar will appear in Firefox.
setTimeout(this.openOverlayActual.bind2(this), 500);
} else {
this.loadSupportFiles();
}
}
/**
* Return true or false depending on whether or not all the
* support files have been loaded.
*/
lg_lib.OverlayManager.prototype.areSupportFilesLoaded = function(){
if (this.totalSupportFilesLoaded == this.supportFiles.length){
return true;
} else {
return false;
}
}
/**
* [DEPRECATED] Proxy function for opening the mod site in an HTML
* popup window. Keep this function in case there are old scripts
* or custom Flash components that call this method without using
* the lg_lib namespace.
*/
openRemote = function(){
lg_lib.openRemote();
}
/**
* Open the index.php script in an HTML popup window. Define a
* launchInPopup query string (GET) variable to let the server-side
* script know the index page is being rendered in a popup window.
*/
lg_lib.openRemote = function(){
var windowWidth = screen.width - 10;
var windowHeight = screen.height - 100;
var windowOptions = "toolbar=0,menubar=0,location=0,directories=0,status=1,scrollbars=0,resizable=1,copyhistory=0,width=" + windowWidth + ",height=" + windowHeight + ",top=0,left=0,screeny=0,screenx=0";
var windowName = "client";
remote = window.open("index.php?launchInPopup=1",windowName,windowOptions);
}
/**
* Resize the current browser window to fill the screen
* if the site is configured to do so.
*/
lg_lib.sizeToFitScreen = function(){
if (this.doResize){
if (!this.isSafari){
var winToMove = top.window;
} else {
var winToMove = self;
}
if (document.all || this.isSafari) {
var w = screen.availWidth;
var h = screen.availHeight;
// Account for the fact that IE on Mac does not include the dock
// in the availHeight property. Have to guess that it's approximately
// 80 pixels high and is visible.
if (this.isMac && !this.isSafari){
h -= 80;
}
winToMove.moveTo(0,0);
winToMove.resizeTo(w,h);
} else if (document.layers || document.getElementById) {
if (winToMove.outerHeight < screen.availHeight || winToMove.outerWidth < screen.availWidth){
winToMove.outerHeight = screen.availHeight;
winToMove.outerWidth = screen.availWidth;
}
winToMove.moveTo(0,0);
}
}
}
/**
* Hide the content-container div. This is done by
* dynamically creating a style declaration for the
* content-container div. Can't set the style.display
* property on DOM or body load because the HTML site
* will be visible briefly. This approach ensures the
* content is hidden on JS-enabled browsers and visible
* in non-JS-enabled browsers!
*/
lg_lib.hideContent = function(){
document.write('');
}
/**
* Show the content-container div.
*/
lg_lib.showContent = function(){
var e = document.getElementById("content-container");
if (e != undefined){
e.style.display = "block";
}
}
/**
* Set the site background color. This is done by
* dynamically creating a style declaration for the
* body tag. Can't set the color in the style sheet
* because the background needs to be white for all
* non-Flash content.
*
* @param type [String] - Indicates which screen
* to set background color for: main or splash.
*/
lg_lib.setBodyBGColor = function(type){
var bgColor = type == 'main' ? this.mainInfo.bgColor : this.splashInfo.bgColor;
document.getElementById("content-container").style.backgroundColor = bgColor;
}
/**
* Render out the Flash upgrade notice using JavaScript.
* This prevents the notice from being displayed in
* user-agents that don't execute JavaScript.
*/
lg_lib.showFlashUpgradeNotice = function(){
if (!this.isIPhone){
var e = document.getElementById("getFlash");
if (e != undefined){
var getFlashHTML = '
';
getFlashHTML += '
To view the fully enhanced version of this portfolio, you need to download and install the latest version of the Adobe Flash Player.
';
e.innerHTML = getFlashHTML;
}
}
}
/**
* Embed base.swf.
*/
lg_lib.launchMain = function(){
if (arguments.length == 0){
launchOnDomLoad = true;
} else {
launchOnDomLoad = arguments[0];
}
var isFlashOK = this.qsParams["useflash"] == undefined ? true : false;
if (isFlashOK && swfobject.hasFlashPlayerVersion(this.MIN_FLASH_VERSION)) {
// Create an anonymous function to be executed
// once the DOM loads.
var fn = function(){
/*
Display the Flash site if the site root is being loaded, i.e.,
no document URI, or index.php with or without a query string.
NB: May be able to just test for existence of a query string.
*/
if (document.location == lg_lib.BASE_URL || document.location == lg_lib.BASE_URL + "index.php" || lg_lib.qsParams["useflash"] || lg_lib.qsParams["launchInPopup"] || lg_lib.qsParams["loadDebugger"]){
/*
Check for the existence of the div into which main.swf is
to be embedded. If it's not there, that means the splash.swf
was loaded. Using the createSWF() method actually replaces
the div with the object/embed tag. So if the div isn't there,
create it now so the main.swf can be embedded to it.
*/
var flashDiv = document.getElementById(lg_lib.FLASH_DIV_ID);
if (flashDiv == null){
// First remove the splash SWF.
swfobject.removeSWF(lg_lib.FLASH_DIV_ID);
var contentContainerDiv = document.getElementById("content-container");
if (contentContainerDiv == null){
var div = document.createElement("div");
div.setAttribute("id", "content-container");
document.getElementsByTagName("body")[0].appendChild(div);
}
var div = document.createElement("div");
div.setAttribute("id", lg_lib.FLASH_DIV_ID);
document.getElementById("content-container").appendChild(div);
}
var attributes = {
data: lg_lib.mainInfo.swfURL,
width: "100%",
height: "100%",
align: ""
}
var params = {
flashvars: lg_lib.mainInfo.flashvars,
quality: "high",
bgcolor: lg_lib.mainInfo.bgColor,
scale: "noscale",
salign: "LT",
wmode: "transparent",
allowscriptaccess: "always"
}
swfobject.createSWF(attributes, params, lg_lib.FLASH_DIV_ID);
document.bgColor = lg_lib.mainInfo.bgColor; // Do this in case the splash, which
// might have a different background
// color, was loaded first.
lg_lib.setBodyBGColor('main');
lg_lib.showContent();
/*
This code is executed on subpages. We don't want the Flash
site to load with the URL pointed to a subdirectory of content.
To avoid that, change the URL to the web root to load the the
Flash site.
*/
} else {
document.location = lg_lib.BASE_URL;
}
}
} else {
var fn = function(){
// Show the Flash upgrade notice and the HTML
// content that was hidden during page load.
lg_lib.showFlashUpgradeNotice();
lg_lib.showContent();
}
}
if (launchOnDomLoad){
swfobject.addDomLoadEvent(fn);
} else {
fn();
}
}
/**
* Embed splash.swf.
*/
lg_lib.launchSplash = function (){
if (!this.qsParams["launchInPopup"]){
// Create an anonymous function to be executed once the DOM loads.
if (swfobject.hasFlashPlayerVersion(this.MIN_FLASH_VERSION)) {
var fn = function() {
/*
Display the Flash site if the site root is being loaded, i.e.,
no document URI, or index.php with or without a query string.
NB: May be able to just test for existence of a query string.
*/
if (document.location == lg_lib.BASE_URL || document.location == lg_lib.BASE_URL + "index.php"){
var attributes = {
data: lg_lib.splashInfo.swfURL,
width: "100%",
height: "100%",
align: ""
}
var params = {
flashvars: lg_lib.splashInfo.flashvars,
quality: "high",
bgcolor: lg_lib.splashInfo.bgColor,
scale: "noscale",
salign: lg_lib.splashInfo.salign,
allowscriptaccess: "always"
}
swfobject.createSWF(attributes, params, lg_lib.FLASH_DIV_ID);
lg_lib.setBodyBGColor('splash');
lg_lib.showContent();
/*
This code is executed on subpages. We don't want the Flash
site to load with the URL pointed to a subdirectory of content.
To avoid that, change the URL to the web root to load the the
Flash site.
*/
} else {
document.location = lg_lib.BASE_URL;
}
}
} else {
var fn = function(){
// Show the Flash upgrade notice and the HTML
// content that was hidden during page load.
lg_lib.showFlashUpgradeNotice();
lg_lib.showContent();
}
}
swfobject.addDomLoadEvent(fn);
} else {
this.launchMain();
}
}
lg_lib.main = function(){
this.CLIENT_ID = 176;
this.APP_DOMAIN = "http://lightgalleries.net";
this.APP_VERSION = "2.1.3";
this.BASE_URL = "http://www.jimroofcreative.net/"; // Add a slash because JS adds a slash to the
// end of document.location if it's a directory.
this.CLIENT_SERVER_NAME = "www.jimroofcreative.net";
this.MIN_FLASH_VERSION = "6.0.0.0";
this.FLASH_DIV_ID = "content";
this.doBodyOnLoad = false;
this.doResize = false;
this.hideContent();
this.getUserSpecs();
this.getQueryStringParams();
this.mainInfo = {};
this.mainInfo.swfURL = "http://lightgalleries.net/app/2.1.3/templates/version_2/base_2.swf?nocache=0.011627906976744";
this.mainInfo.flashvars = lg_lib.qsParams["loadDebugger"] == undefined ? "clientID=176&USE_LEAD_PHOTO=1&INTRO_ACTIVE=1&LEAD_PHOTO_SELECTED=1&BG_COLOR=0x525482&SITE_FONT=2&USE_LOAD_BAR_TEXT=1&USE_LOAD_BAR_LINES=1&domain=http://www.jimroofcreative.net&ROOT_MOD_URL=http://lightgalleries.net/app/2.1.3/templates/&ROOT_SMT_URL=http://lightgalleries.net/app/2.1.3/smt/&LOAD_ANIM_TYPE=2&customScreenFilename=" : "clientID=176&USE_LEAD_PHOTO=1&INTRO_ACTIVE=1&LEAD_PHOTO_SELECTED=1&BG_COLOR=0x525482&SITE_FONT=2&USE_LOAD_BAR_TEXT=1&USE_LOAD_BAR_LINES=1&domain=http://www.jimroofcreative.net&ROOT_MOD_URL=http://lightgalleries.net/app/2.1.3/templates/&ROOT_SMT_URL=http://lightgalleries.net/app/2.1.3/smt/&LOAD_ANIM_TYPE=2&customScreenFilename=" + '&loadDebugger=' + lg_lib.qsParams["loadDebugger"];
this.mainInfo.bgColor = "#525482";
this.splashInfo = {};
this.splashInfo.swfURL = "/content/swfs/splash.swf?nocache=0.0125";
this.splashInfo.flashvars = "splash_title=&splash_subtitle=&client_name=Jim Roof&splash_email=&text_color=0xFFFFFF&launchInPopup=0";
this.splashInfo.bgColor = "#000000";
this.splashInfo.salign = "LT";
this.addOnLoadEvent(this.handleBodyLoad);
this.sizeToFitScreen();
Appcelerator.Core.initialize(); // To support run-time load of style sheets
// and JavaScript libraries.
this.overlayManager = new this.OverlayManager(this.APP_DOMAIN, this.APP_VERSION, this.CLIENT_SERVER_NAME, .5, '#222222', 0, '#666666', 0, '#222222', '#CECECE');
this.launchMain();
self.focus();
}
lg_lib.main();