
bbcjs.css=new Object();bbcjs.css.prototype=new bbcjs.Module("css",1,"$Revision: 1.9 $","$Date: 2005/06/03 14:20:31 $");bbcjs.css.targets={win:1,mac:2,linux:4,ie:8,nav:16,opera:32,ie5up:64,nav6up:128,ie6up:256,safari:512,gecko:1024}
bbcjs.css.detect={};bbcjs.css.detect.init=function()
{this.agt=navigator.userAgent.toLowerCase();this.is_major=parseInt(navigator.appVersion);this.is_minor=parseFloat(navigator.appVersion);this.is_win=((this.agt.indexOf("win")!=-1)||(this.agt.indexOf("16bit")!=-1));this.is_mac=(this.agt.indexOf("mac")!=-1);this.is_linux=(this.agt.indexOf("inux")!=-1);this.is_nav=((this.agt.indexOf('mozilla')!=-1)&&(this.agt.indexOf('spoofer')==-1)&&(this.agt.indexOf('compatible')==-1)&&(this.agt.indexOf('opera')==-1)&&(this.agt.indexOf('webtv')==-1)&&(this.agt.indexOf('hotjava')==-1));this.is_nav2=(this.is_nav&&(this.is_major==2));this.is_nav3=(this.is_nav&&(this.is_major==3));this.is_nav4=(this.is_nav&&(this.is_major==4));this.is_nav4up=(this.is_nav&&(this.is_major>=4));this.is_navOnly=(this.is_nav&&((this.agt.indexOf(";nav")!=-1)||(this.agt.indexOf("; nav")!=-1)));this.is_nav6=(this.is_nav&&(this.is_major==5));this.is_nav6up=(this.is_nav&&(this.is_major>=5));this.is_safari=((this.agt.indexOf("safari")!=-1));this.is_gecko=(this.agt.indexOf('gecko')!=-1);this.is_ie=((this.agt.indexOf("msie")!=-1)&&(this.agt.indexOf("opera")==-1));this.is_ie3=(this.is_ie&&(this.is_major<4));this.is_ie4=(this.is_ie&&(this.is_major==4)&&(this.agt.indexOf("msie 4")!=-1));this.is_ie4up=(this.is_ie&&(this.is_major>=4));this.is_ie5=(this.is_ie&&(this.is_major==4)&&(this.agt.indexOf("msie 5.0")!=-1));this.is_ie5_5=(this.is_ie&&(this.is_major==4)&&(this.agt.indexOf("msie 5.5")!=-1));this.is_ie5up=(this.is_ie&&!this.is_ie3&&!this.is_ie4);this.is_ie5_5up=(this.is_ie&&!this.is_ie3&&!this.is_ie4&&!this.is_ie5);this.is_ie6=(this.is_ie&&(this.is_major==4)&&(this.agt.indexOf("msie 6.")!=-1));this.is_ie6up=(this.is_ie&&!this.is_ie3&&!this.is_ie4&&!this.is_ie5&&!this.is_ie5_5);this.is_opera=(this.agt.indexOf("opera")!=-1);this.is_opera2=(this.agt.indexOf("opera 2")!=-1||this.agt.indexOf("opera/2")!=-1);this.is_opera3=(this.agt.indexOf("opera 3")!=-1||this.agt.indexOf("opera/3")!=-1);this.is_opera4=(this.agt.indexOf("opera 4")!=-1||this.agt.indexOf("opera/4")!=-1);this.is_opera5=(this.agt.indexOf("opera 5")!=-1||this.agt.indexOf("opera/5")!=-1);this.is_opera5up=(this.is_opera&&!this.is_opera2&&!this.is_opera3&&!this.is_opera4);}
bbcjs.css.detect.init();bbcjs.trace('<b><font color="green">jst_css.js</font> was included.</b>',2);bbcjs.css.Swap=function(url,profiles)
{bbcjs.trace('new bbcjs.css.Swap()');this.url=url||'';this.profiles=profiles||[];};bbcjs.css.swap=new bbcjs.css.Swap();bbcjs.css.Swap.prototype.load=function()
{bbcjs.trace('bbcjs.css.swap.load()',3);if(this.url)
{this.write(this.url);if(this.profiles)
{var profile=this._parseProfiles(this.profiles);if(profile.length>0)
{var s='';for(var i=0;i<profile.length;i++)
{s+='.'+profile[i];}
var profileFile=this.url.replace(/\.css/,s+'.css');this.write(profileFile);return true;}}
return true;}
return false;};bbcjs.css.Swap.prototype._parseProfiles=function(profiles)
{bbcjs.trace('bbcjs.css.swap._parseProfiles('+profiles+')',4);var profile=[];var isMatch=true;for(var a=0;a<profiles.length;a++)
{var operand=parseInt(profiles[a]).toString(2);bbcjs.trace('Profile '+profiles[a]+' ('+operand+')',6);var i=operand.length;var j=1;while(i>0)
{if(operand.charAt(i-1)==1)
{for(var t in bbcjs.css.targets)
{var isBit=(bbcjs.css.targets[t].toString(2).length==j);bbcjs.trace('Target '+t+' ('+bbcjs.css.targets[t].toString(2)+') = '+isBit,6);if(bbcjs.css.targets[t].toString(2).length==j)
{isMatch=isMatch&&eval("bbcjs.css.detect.is_"+t);profile[profile.length]=t;break;}}}
i--;j++;}
bbcjs.trace('Profile '+profiles[a]+' ('+profile+') = '+isMatch,4);if(!isMatch)
{profile=[];isMatch=true;}
else
{break;}}
return profile;};bbcjs.css.Swap.prototype.write=function(href)
{bbcjs.trace('bbcjs.css.swap.write("'+href+'")',3);var le='<link rel="stylesheet" type="text/css" href="'+href+'">';document.write(le);};