RFX_Base = 'http://scholastic.richfx.com/catalog_scholastic/TeenCitizen6-8/'
PassBack = escape('undefined')
/* Function: DeclareCatalogObject
* Description: returns html code to embed the catalog
*/
function DeclareCatalogObject()
{
debugFunc('DeclareCatalogObject', arguments);
var buff="";
//get the event handlers, and the metrics code.
buff += declareScriptTag('version.txt'); //Sets the VERSION variable
buff += declareScriptTag('custom/flashevents.js') + declareScriptTag('script/LoggingManager.js');
//declare the product iframe
buff += '
';
//Load style sheet. IE forces us to do it here and not in every view seperatly. It ignores style
//tags that are doc.written after document is loaded
buff += '';
//buff += '';
buff += EmbedCatalog();
//if debug variable is set via the querystring show a textbox showing the debug info
if (oSettings.debug)
{
buff += '
'
}
buff += "";
//adding 'showobjectdec=true', shows the declaration of the object in plain text.
if (_rfxGetUrlParam("RFX_showobjectdec"))
return ""
else
return buff
}
/* Function: GetUserVars
* Description: populates the user specific information.
*
*/
function GetUserVars()
{
debugFunc('GetUserVars', arguments);
oSettings.ViewID = GetViewId();
oSettings.sResolution=_rfxGetSubCookie('perm', 'res', oSettings.sResolution);
oSettings.iCurrentPage=_rfxGetSubCookie('temp', "page", oSettings.iCurrentPage);
if (oSettings.searchEnabled)
oSettings.searches=_rfxGetSubCookie('perm', "searches", oSettings.searches);
if (oSettings.iflagsEnabled)
oSettings.iflags=_rfxGetSubCookie('perm', 'iflags', oSettings.iflags);
if (oSettings.zoomMode == "arrowzoom") //Arrow zoom mode.
oSettings.arrow_help=_rfxGetSubCookie('temp', 'arrow_help', oSettings.arrow_help);
if (oSettings.zoomMode == "magnify") //Magnify mode.
oSettings.mag_help=_rfxGetSubCookie('temp', 'mag_help', oSettings.mag_help);
}
/* Function: _rfxGetUrlParams
* Description: checks for parameters in the url that should override any cookie values.
*/
function _rfxGetUrlParams()
{
debugFunc('_rfxGetUrlParams', arguments);
oSettings.base=unescape(_rfxGetUrlParam("RFX_Base",oSettings.base));
oSettings.clientBase=unescape(_rfxGetUrlParam("RFX_URLBase",oSettings.clientBase));
oSettings.debug=_rfxGetUrlParam("RFX_Debug",oSettings.debug);
oSettings.showSearchBorders=_rfxGetUrlParam("RFX_SSB",oSettings.showSearchBorders);
oSettings.func_debug=_rfxGetUrlParam("RFX_Show_Internals",oSettings.func_debug);
oSettings.QAProjectID=_rfxGetUrlParam("RFX_QAProjectID",oSettings.QAProjectID);
oSettings.ViewID=_rfxGetUrlParam("RFX_ViewID",oSettings.ViewID);
oSettings.sResolution=_rfxGetUrlParam("RFX_Res", oSettings.sResolution);
oSettings.iCurrentPage=_rfxGetUrlParam("RFX_Page",oSettings.iCurrentPage);
oSettings.bDontCache=_rfxGetUrlParam("RFX_dontcache",oSettings.dontCache);
oSettings.sViewMode=_rfxGetUrlParam("RFX_View",oSettings.sViewMode);
oSettings.sSearchTerm=unescape(_rfxGetUrlParam("RFX_SearchTerm",oSettings.sSearchTerm));
oSettings.iSearchOffset=_rfxGetUrlParam("RFX_SearchOffset",oSettings.iSearchOffset);
oSettings.bDisableLogging= _rfxGetUrlParam("RFX_disablelogging", oSettings.bDisableLogging);
oSettings.bDebugLogging= _rfxGetUrlParam("RFX_DebugLogging", oSettings.bDebugLogging);
oSettings.sOmnitureABTestName = _rfxGetUrlParam("RFX_ABTest", "");
oSettings.sOmnitureABSecondTestName = "";
oSettings.sOmnitureCampaignName = _rfxGetUrlParam("RFX_Campaign", "");
oSettings.sSpecialVersionName = _rfxGetUrlParam("RFX_SpecialVersionName", "");
//for product page preview
oSettings.BorderClickGID = _rfxGetUrlParam("RFX_BorderClickGID", oSettings.BorderClickGID);
}
/* Function: checkBaseForCache
* Description: checks if we need to make the base come from earthcache, our cache provider.
* if so changes the base
*/
function checkBaseForCache()
{
debugFunc('checkBaseForCache', arguments);
if (oSettings.bDontCache == "true")
return false;
//if location is a domain, and its not "testny" then use cache
if (oSettings.base.match(/\/\/([^\/]*)/))
{
hostname = RegExp.$1
//Earthcache
//if (hostname.match(/.*\.\D{2,4}$/) && hostname.indexOf("testny") < 0 && hostname.indexOf("edgesuite") < 0)
// oSettings.base=oSettings.base.replace("richfx.com","richfx.com.edgesuite.net")
//Akamai
if (hostname.match(/.*\.\D{2,4}$/) && hostname.indexOf("testny") < 0 && hostname.indexOf("edgesuite") < 0)
oSettings.base=oSettings.base.replace("richfx.com","richfx.com.edgesuite.net")
}
}
/* Function: _rfxMain
* Description: entry point of the Catalog.
*/
function _rfxMain()
{
debugFunc('_rfxMain', arguments);
//populate template settings
PopulateMagicVariables(oSettings);
//start user specific code, only if cookies is supported.
if (CookiesEnabled())
GetUserVars()
//overrided user settings with url params
_rfxGetUrlParams();
if (!oSettings.base) oSettings.base = location.href.substr(0,location.href.lastIndexOf('/'));
//add a slash to the end of base url if there isnt one already.
oSettings.base+=(oSettings.base.charAt(oSettings.base.length-1)!='/')?"/":"";
oSettings.productbase=oSettings.base;
//check if we should add caching.
checkBaseForCache()
//Initialize Catalog Settings depending on user settings.
setResolution(oSettings.sResolution)
oSettings.bCookiesEnabled = CookiesEnabled();
oSettings.version = (shouldShowHTML())?"HTML":"FLASH " + oSettings.flash_version;
oSettings.viewType = oSettings.isLowRes() ? "Small View" : "Large View";
//check to see if html version is requested or required
if (shouldShowHTML())
document.write(declareScriptTag('script/html_catalog.js'));
else
document.write(declareScriptTag('script/flash_catalog.js'));
}
/*
* Function: CatalogCodeLoaded()
* Description: call back after appropriate javascript code for the catalog has been loaded
*/
function CatalogCodeLoaded()
{
debugFunc('CatalogCodeLoaded', arguments);
//These are flash/HTML specific already
InitializeCatalog();
document.write(DeclareCatalogObject());
}
/* Function: detectFlash
* Description: returns true if flash 6 is detected.
*/
function detectFlash()
{
debugFunc('detectFlash', arguments);
//dont bother detecting if already detect.
if (oSettings.flash_version)
return oSettings.flash_version > 5;
var plugin;
var flash_version=0;
document.write("\nfunction jCreateObject(progID)\nOn Error Resume Next\nset jCreateObject=CreateObject(progID)\nend function\n");
for (i=5;i<=7;i++)
{
plugin = false
if (document.layers || navigator.userAgent.toLowerCase().indexOf("gecko") >= 0 || navigator.userAgent.toLowerCase().indexOf('mac') >= 0) { //netscape check
plugin = ((navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : false);
plugin = (plugin && plugin.description && parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= i) ? true : false;
} else {
plugin=typeof(jCreateObject("ShockwaveFlash.ShockwaveFlash." + i)) == "object";
}
if (plugin) flash_version = i;
}
oSettings.flash_version=flash_version;
return (flash_version > 5)
}
/*
* Function: shouldShowHTML()
* Description: returns true if we should show html version.
*/
function shouldShowHTML()
{
debugFunc('shouldShowHTML', arguments);
return oSettings.htmlEnabled && (_rfxGetUrlParam("RFX_ver") == "html" || !detectFlash() || !oSettings.flashEnabled || (navigator.userAgent.toLowerCase().indexOf('mac') >= 0 && oSettings.flash_version <= 5))
}
/* Function: setResolution
* Description: populates a setting with the sizes of a certain resolution.
*/
function setResolution(index)
{
debugFunc('setResolution', arguments);
var Arr = new Array()
for (attrib in oSettings.Resolutions)
{
eval("oSettings." + attrib + "=oSettings.Resolutions[attrib][index];")
}
return Arr;
}
/* Function: CatalogVars
* Description: contains all catalog settings
*/
function CatalogVars()
{
debugFunc('CatalogVars', arguments);
this.bInitializing=true;
this.sCatalogMode;
this.embedWidth;
this.embedHeight;
this.smallPictureWidth;
this.smallPictureHeight;
this.PRODX;this.PRODY;this.PRODWIDTH;this.PRODHEIGHT;
this.HIGHRES;
this.LOWBAND;
this.read_only=false;
this.base=(typeof(RFX_Base)=="string")?RFX_Base:"";
this.clientBase=location.href
this.clientBase=this.clientBase.replace(/\#$/, "");
this.clientBase=this.clientBase.replace(location.search,"") + "?";
this.showSearchBorders="false";
this.bShowModeMenu;
this.bShowHelp;
this.bShowTOC;
this.bShowPane;
this.showProdPopupAnim = 1;
this.sResolution;
this.ViewID;
this.searches="";
this.sLastSearchTerm = "";
this.mag_help=0;
this.arrow_help=0;
this.ViewID
this.iflags="";
this.debug;
this.bCookiesEnabled;
this.viewType;
this.version;
this.ab1="";
this.ab2="";
this.campain = "";
this.bDisableLogging = false;
this.iCurrentPage = 0;
this.sViewMode = 'spread';
this.ua = navigator.userAgent.toLowerCase();
this.mac = this.ua.indexOf('mac') > -1
this.ie = this.ua.indexOf('msie') > -1
this.gecko = this.ua.indexOf('gecko') > -1
this.safari = this.ua.indexOf('safari') > -1
this.isLowRes = function() {return oSettings.sResolution=='low';}
this.isHighRes = function() {return oSettings.sResolution=='high';}
}
/* Function: product_details_close
* Description: closes the product window in response to the close click event in the flash
*/
function product_details_close()
{
var obj = document.getElementById('product_frame')
if (obj.style.display!="none")
{
obj.style.visibility='hidden';
obj.style.display = "none"
obj.src=oSettings.base+"blank.html";
}
}
/////////////////////////////////////////////////////////////////////////////////////////
/* Function: GetViewId
* Description: returns the view (user) id, if none
* creates one and sets it in a persistent cookie
*/
function GetViewId()
{
debugFunc('GetViewId', arguments);
id = _rfxGetSubCookie('perm', 'viewid')
if (!id)
{
id = GenerateNewId();
_rfxSetSubCookie('perm', 'viewid', id);
}
return id
}
/* Function: GenerateNewId
* Description: Creates a random character string used for unique ids.
*/
function GenerateNewId()
{
debugFunc('GenerateNewId', arguments);
charList = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
//TODO: Add random number to shift the random iterator to.
uID = ""
for (i=0;i<32;i++)
uID+=charList.charAt(Math.random()*charList.length)
return uID;
}
/* Function: declareScriptTag
* Description: returns script tag with the scriptFile supplied.
*/
function declareScriptTag(scriptFile)
{
debugFunc('declareScriptTag', arguments);
return ""+(oSettings.safari ? "" : "")+"\n";
}
/* Function: ParseUrlEncodedString
* Description: parses a url encoded string and returns value if found
*/
function ParseUrlEncodedString(str,param)
{
//debugFunc('ParseUrlEncodedString', arguments);
if (!str)
return null;
re = new RegExp("(^|[?&])" + param + "=([^&=]*)(&|$)?","i")
//re = new RegExp(param + "=([^&=]*)(&|$)?","i")
if (str.match(re))
return RegExp.$2
return null;
}
/* Function: ReplaceUrlEncodedString
* Description: returns adds or replaces a query string param in a formatted string
*/
function ReplaceUrlEncodedString(queryStr, param)
{
debugFunc('ReplaceUrlEncodedString', arguments);
if (queryStr)
{
rep = /\&$/;
param=param.replace(rep, "");
var sPar = param.split("=")[0];
var sVal = param.split("=")[1];
re = new RegExp("(^|[?&])" + sPar + "=([^&=]*)(&|$)?","i")
if (queryStr.match(re))
{
if (sVal=="")
queryStr = queryStr.replace(re,RegExp.$1); //delete
else
queryStr = queryStr.replace(re,RegExp.$1+param+"&");
return queryStr;
}
if (sVal=="")
return queryStr;
queryStr=queryStr.replace(rep, "");
return queryStr+"&"+param;
}
return param;
}
/* Function: _rfxGetUrlParam
* Description: returns value of url param if found, or sDefValue if not
*/
function _rfxGetUrlParam(param, sDefValue)
{
debugFunc('_rfxGetUrlParam', arguments);
queryStr = location.search
if (!queryStr) return sDefValue; // if query string is empty return
sRet=ParseUrlEncodedString(queryStr,param);
return (sRet==null ? sDefValue : sRet);
}
/* Function: _rfxSetUrlParam
* Description: returns adds or replaces a query string param in a query string
*/
function _rfxSetUrlParam(queryStr, param)
{
debugFunc('_rfxSetUrlParam', arguments);
return ReplaceUrlEncodedString(queryStr, param);
}
/* Function: GetUrlParamState
* Description: returns the basic state of the catalog as a URL param string
*/
function GetUrlParamState()
{
debugFunc('GetUrlParamState', arguments);
var sParams=location.search;
sParams=sParams.replace(/^\?/, "");
sParams=sParams.replace(/\#$/, "");
sParams=_rfxSetUrlParam(sParams,"RFX_Ver=" + oSettings.sCatalogMode);
sParams=_rfxSetUrlParam(sParams,"RFX_Res=" + oSettings.sResolution);
sParams=_rfxSetUrlParam(sParams,"RFX_Base=" + escape(oSettings.base));
sParams=_rfxSetUrlParam(sParams,"RFX_ViewID=" + oSettings.ViewID );
return sParams;
}
/* Function: StripUrlParamState
* Description: returns the URL string stripped of all rfx_ params that control state
*/
function StripUrlParamState(sURL)
{
debugFunc('StripUrlParamState', arguments);
sURL=_rfxSetUrlParam(sURL,"RFX_Ver=");
sURL=_rfxSetUrlParam(sURL,"RFX_Res=");
sURL=_rfxSetUrlParam(sURL,"RFX_Page=");
sURL=_rfxSetUrlParam(sURL,"RFX_Base=");
sURL=_rfxSetUrlParam(sURL,"RFX_ViewID=");
sURL=_rfxSetUrlParam(sURL,"RFX_Debug=");
return sURL;
}
/////////////////////////////////////////////////////////////////////////////////////////
/* Function: CookiesEnabled
* Description: returns true if Cookies is enabled.
*/
function CookiesEnabled()
{
debugFunc('CookiesEnabled', arguments);
_rfxSetSubCookie('temp', 'enabled', 'true')
return _rfxGetSubCookie('temp', 'enabled') == 'true';
}
/* Function: _rfxGetCookie
* Description: returns value of cookie specified in sName,
* null if not found.
*/
function _rfxGetCookie(sName)
{
debugFunc('_rfxGetCookie', arguments);
// cookies are separated by semicolons
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++)
{
// a name/value pair (a crumb) is separated by an equal sign
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0])
return unescape(aCrumb[1]);
}
// a cookie with the requested name does not exist
return null;
}
/* Function: _rfxGetSubCookie
* Description: returns value of a sub cookie of sCookieName specified by sSubCookieName
* null if not found.
*/
function _rfxGetSubCookie(sCookieName, sSubCookieName, sDefValue)
{
debugFunc('_rfxGetSubCookie', arguments);
var sCrumb = _rfxGetCookie(oSettings.CatalogID+"_"+sCookieName);
var sVal=ParseUrlEncodedString(sCrumb, sSubCookieName);
return (sVal!=null ? unescape(sVal) : sDefValue);
}
function _rfxSetSubCookie(sCookieName, sSubCookieName, sSubCookieValue )
{
debugFunc('_rfxSetSubCookie', arguments);
var sCrumb = _rfxGetCookie(oSettings.CatalogID+"_"+sCookieName);
sCrumb = ReplaceUrlEncodedString(sCrumb,sSubCookieName+'='+sSubCookieValue);
var expires="";
if (sCookieName!='temp')
expires="expires=Mon, 31 Dec 2010 23:59:59 UTC;";
document.cookie=oSettings.CatalogID+"_"+sCookieName+"="+escape(sCrumb)+";"+expires;
}
/////////////////////////////////////////////////////////////////////////////////////////
function debugShowCookies()
{
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++)
{
var aCrumb = aCookie[i].split("=");
if (aCrumb[0]==oSettings.CatalogID+'_perm' || aCrumb[0]==oSettings.CatalogID+'_temp')
{
_dfs(i+". "+aCrumb[0]+" sub cookies:");
var sCrumb = unescape(aCrumb[1]);
if (sCrumb!=null)
{
var aSubCookie=new Array;
aSubCookie = sCrumb.split("&");
for (var j=0; j < aSubCookie.length; j++)
{
if (aSubCookie[j]!="" || j != aSubCookie.length-1) //dont display last if null (trailing &)
_dfs("------"+j+". "+unescape(aSubCookie[j]));
}
}
}
else _dfs(i+". "+aCookie[i]);
}
}
function debugDelCookies()
{
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++)
{
document.cookie=aCookie[i]+";expires=Mon, 31 Dec 1979 23:59:59 UTC;";
}
}
function ClearServerCache()
{
_dfs("Clearing Server Cache");
var scriptdiv = document.createElement('iframe');
scriptdiv.src = oSettings.base + "asp/common.asp?rfx_action=clear_cache";
scriptdiv.id = 'debug_clear';
document.body.appendChild(scriptdiv)
scriptdiv = document.getElementById('debug_clear');
if(scriptdiv)
document.body.removeChild(scriptdiv);
_dfs("Done.");
}
function OpenDebugWindow(sInfo)
{
if (typeof(debugWnd) == "undefined" || !debugWnd || debugWnd.closed)
{
debugWnd = window.open("","debugContent","width=800,height=600,scrollbars,top=0,left=0")
var oDiv = debugWnd.document.createElement("div")
oDiv.id="content"
with (oDiv.style)
{
fontFamily="verdana";
fontSize='8pt';
top=0;
left=0;
}
debugWnd.document.body.appendChild(oDiv);
}
debugWnd.document.getElementById("content").innerHTML=sInfo;
try { debugWnd.focus(); } catch(e) { }
}
function DebugEval()
{
try
{
var sTerm=document.getElementById('eval_field').value;
eval(sTerm);
}
catch(e) { }
}
function FlushDebug()
{
try
{
var buff = document.getElementById("fswindow").value;
var aStuff = (oSettings.mac && oSettings.ie) ? buff.split('\r') : buff.split('\n')
var sInfo = aStuff.join(" ");
OpenDebugWindow(sInfo);
document.getElementById("fswindow").value="";
}
catch(e) { }
}
function DumpDebugWindow(sInfo)
{
while(sInfo.charAt(0) != "=")
sInfo = unescape(sInfo)
sInfo = sInfo.substr(1)
OpenDebugWindow(sInfo);
}
function ShowStateWindow(stateStr)
{
//open the window if its not already there
while(stateStr.charAt(0) != "=")
stateStr = unescape(stateStr)
stateStr = stateStr.substr(1)
if (typeof(debugWnd) == "undefined" || !debugWnd || debugWnd.closed)
{
debugWnd = window.open("","debug","width=500,height=450,scrollbars,top=0,left=0")
var oDiv = debugWnd.document.createElement("div")
oDiv.id="content"
with (oDiv.style)
{
fontFamily="verdana";
fontSize='8pt';
color="333333";
backgroundColor="d3d3d3";
top=0;
left=0;
}
debugWnd.document.body.appendChild(oDiv);
}
try
{
var str="";
//Dump gCS
var content = stateStr.split('\n');
if (content.length>0)
{
str += "Current State:
"
for (i in content)
{
if (content[i] == "") continue;
var attrs = content[i].split(':\t')
str+= "
" + attrs[0] + "
" + attrs[1] + "
"
}
str+="
"
}
//Dump Settings
str+= " oSettings:
"
for (i in oSettings)
{
str+= "
" + i + "
" + oSettings[i] + "
"
}
str+="
"
debugWnd.document.getElementById("content").innerHTML+=str + " ";
}
catch(e) { }
}
/////////////////////////////////////////////////////////////////////////////////////////
/* Function: geturl_FSCommand
* Description: Flash event handler for Mozilla based browsers
* For Mozilla based browsers we send the event via a getUrl javascript:geturl_FSCommand
* to facilitate the problem of talking to the browser in netscape&mac.
*/
function geturl_FSCommand(command, args) {
main_DoFSCommand(command, args)
}
/* Function: main_FSCommand
* Description: Flash event handler for IExplorer
*/
if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0) {
document.write(' \n');
document.write('on error resume next \n');
document.write('Sub rfxmain_FSCommand(ByVal command, ByVal args)\n');
document.write(' call main_DoFSCommand(command, args)\n');
document.write('end sub\n');
document.write(' \n');
}
function baseSwitchCallStack(checkBox)
{
if (oSettings.mac && oSettings.gecko)
checkBox.checked = !checkBox.checked
oSettings.func_debug = checkBox.checked;
}
function debugFunc(funcName,args,stype)
{
if (oSettings && oSettings.func_debug == 1)
{
var sArgs=" ";
for (var i=0; i0)
{
fsw.value=sDebugBackLog;
sDebugBackLog="";
}
fsw.value+="\n"+args
if (!(oSettings.mac && oSettings.ie))
fsw.scrollTop=fsw.scrollHeight;
}
else
sDebugBackLog+="\n"+args;
}
catch (e) {}
}
return
}
if (oSettings.debug && command != "ShowStateWindow" && command != "DumpDebugWindow")
{
fsw.value+="\nFunction: " + func;
if (!(oSettings.mac && oSettings.ie))
fsw.scrollTop=fsw.scrollHeight;
}
try
{
eval(func);
}
catch(e)
{
if (oSettings.debug)
if (document.all)
fsw.value+="\nCall Failed! -- " + e.description;
else
fsw.value+="\nCall Failed! -- " + e.message;
}
}
/////////////////////////////////////////////////////////////////////////////////////////
var bflashEventsLoaded=false;
var bCatalogObjectReady=false;
var bLoggingLoaded=false;
/* Function: CallCatalogReady
* Description: checks is everything has loaded and calls CatalogReady()
*/
function CallCatalogReady()
{
debugFunc('CallCatalogReady', arguments);
if (bCatalogObjectReady && bflashEventsLoaded && bLoggingLoaded)
{
CatalogReady();
oSettings.bInitializing=false;
if (sDebugBackLog.length>0) _dfs(""); //flush whatever we accumulated if any
_rfxLoggingManager.logCatalog();
}
}
function LoggingLoaded()
{
debugFunc('LoggingLoaded', arguments);
bLoggingLoaded=true;
CallCatalogReady();
}
/* Function: CatalogObjectReady
* Description: called when the object has done writing to the document
*/
function CatalogObjectReady()
{
debugFunc('CatalogObjectReady', arguments);
bCatalogObjectReady=true;
CallCatalogReady();
}
/* Function: flashEventsLoaded
* Description: called after the flashevents.js is loaded.
*/
function flashEventsLoaded()
{
debugFunc('flashEventsLoaded', arguments);
bflashEventsLoaded=true;
CallCatalogReady();
}
/* Function: MagicVarsLoaded
* Description: called after the magic vars are loaded.
*/
function MagicVarsLoaded()
{
debugFunc('MagicVarsLoaded', arguments);
_rfxMain();
}
function check_unsupported()
{
var has_flash = detectFlash();
var ua = navigator.userAgent.toLowerCase();
var msie = ua.indexOf('msie') >= 0
var version;
if (msie) version = parseFloat(ua.substr(ua.indexOf("msie")+5))
var osX = (ua.indexOf('mac') >= 0) && ((ua.indexOf('os x') >=0) || msie && version >= 5.2)
// not_supported should be true if the following:
// NO Flash and OSX/SAFARI
// NO Flash and OSX/MSIE
// NO Flash and AOL
var not_supported = !has_flash && (ua.indexOf(' aol ') >= 0 || (osX && (msie || ua.indexOf('safari') >=0)))
return not_supported;
}
//objects holding settings
var oSettings = new CatalogVars();
//get magic variables function, call _rfxGetUrlParams to get base param
//magic.js then calls magic loaded, which eventually starts the catalog.
_rfxGetUrlParams();
if (check_unsupported())
location.href = oSettings.base + "error/error.html";
else
{
checkBaseForCache();
document.write(declareScriptTag('script/magic.js'));
}