﻿window.onload = function() {
    if (FlashDetect.installed && FlashDetect.major >= 9) {   
        document.getElementById('cssfile').href = "/css/fscss.css";
    }
}
function gamePopUp(strUrl, strWidth, strHeight) {
   window.open(strUrl,'catalyst_game','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + strWidth + ',height=' + strHeight);
}
function chatPopUp(strUrl, strWidth, strHeight) {
   window.open(strUrl,'catalyst_chat','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + strWidth + ',height=' + strHeight);
}
function new_window(strUrl) {
	window.open(strUrl, "_blank");	
}
function GetInnerSize () {
    var x,y;
    if (self.innerHeight) // all except Explorer
    {
	    x = self.innerWidth;
	    y = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight)
	    // Explorer 6 Strict Mode
    {
	    x = document.documentElement.clientWidth;
	    y = document.documentElement.clientHeight;
    }
    else if (document.body) // other Explorers
    {
	    x = document.body.clientWidth;
	    y = document.body.clientHeight;
    }
    return [x,y];
}
function whichBrowser() {
	return BrowserDetect.OS;	
}
function ResizeToInner (w, h, x, y) {
    // make sure we have a final x/y value
    // pick one or the other windows value, not both
    if (x==undefined) x = window.screenLeft || window.screenX;
    if (y==undefined) y = window.screenTop || window.screenY;
    // for now, move the window to the top left
    // then resize to the maximum viewable dimension possible
    window.moveTo(0,0);
    window.resizeTo(screen.availWidth,screen.availHeight);
    // now that we have set the browser to it's biggest possible size
    // get the inner dimensions.  the offset is the difference.
    var inner = GetInnerSize();
    var ox = screen.availWidth-inner[0];
    var oy = screen.availHeight-inner[1];
    // now that we have an offset value, size the browser
    // and position it
    if (BrowserDetect.OS == 'Mac')
    {
        //It's a mac!
        if (BrowserDetect.browser == 'Firefox') {
             //It's firefox!
            window.resizeTo(w+ox, (h+oy)-22);
            window.moveTo(x,y);
        } else if (BrowserDetect.browser == 'Safari') {
            //It's safari!
            window.resizeTo(w+ox, (h+oy)+2);
            window.moveTo(x,y-22);
        } else {
            window.resizeTo(w+ox, h+oy);
            window.moveTo(x,y);
        }
    } else {
        //It's windows!
        window.resizeTo(w+ox, h+oy);
        window.moveTo(x,y);
    }
}
//http://www.featureblend.com/license.txt
var FlashDetect=new function(){var self=this;self.installed=false;self.raw="";self.major=-1;self.minor=-1;self.revision=-1;self.revisionStr="";var activeXDetectRules=[{"name":"ShockwaveFlash.ShockwaveFlash.7","version":function(obj){return getActiveXVersion(obj);}},{"name":"ShockwaveFlash.ShockwaveFlash.6","version":function(obj){var version="6,0,21";try{obj.AllowScriptAccess="always";version=getActiveXVersion(obj);}catch(err){}
return version;}},{"name":"ShockwaveFlash.ShockwaveFlash","version":function(obj){return getActiveXVersion(obj);}}];var getActiveXVersion=function(activeXObj){var version=-1;try{version=activeXObj.GetVariable("$version");}catch(err){}
return version;};var getActiveXObject=function(name){var obj=-1;try{obj=new ActiveXObject(name);}catch(err){}
return obj;};var parseActiveXVersion=function(str){var versionArray=str.split(",");return{"raw":str,"major":parseInt(versionArray[0].split(" ")[1],10),"minor":parseInt(versionArray[1],10),"revision":parseInt(versionArray[2],10),"revisionStr":versionArray[2]};};var parseStandardVersion=function(str){var descParts=str.split(/ +/);var majorMinor=descParts[2].split(/\./);var revisionStr=descParts[3];return{"raw":str,"major":parseInt(majorMinor[0],10),"minor":parseInt(majorMinor[1],10),"revisionStr":revisionStr,"revision":parseRevisionStrToInt(revisionStr)};};var parseRevisionStrToInt=function(str){return parseInt(str.replace(/[a-zA-Z]/g,""),10)||self.revision;};self.majorAtLeast=function(version){return self.major>=version;};self.FlashDetect=function(){if(navigator.plugins&&navigator.plugins.length>0){var type='application/x-shockwave-flash';var mimeTypes=navigator.mimeTypes;if(mimeTypes&&mimeTypes[type]&&mimeTypes[type].enabledPlugin&&mimeTypes[type].enabledPlugin.description){var version=mimeTypes[type].enabledPlugin.description;var versionObj=parseStandardVersion(version);self.raw=versionObj.raw;self.major=versionObj.major;self.minor=versionObj.minor;self.revisionStr=versionObj.revisionStr;self.revision=versionObj.revision;self.installed=true;}}else if(navigator.appVersion.indexOf("Mac")==-1&&window.execScript){var version=-1;for(var i=0;i<activeXDetectRules.length&&version==-1;i++){var obj=getActiveXObject(activeXDetectRules[i].name);if(typeof obj=="object"){self.installed=true;version=activeXDetectRules[i].version(obj);if(version!=-1){var versionObj=parseActiveXVersion(version);self.raw=versionObj.raw;self.major=versionObj.major;self.minor=versionObj.minor;self.revision=versionObj.revision;self.revisionStr=versionObj.revisionStr;}}}}}();};FlashDetect.release="1.0.3";
