//~ pcBrowserInfo.js - browser detector object.
//~ COPYRIGHT 2003 PHILIP CHALMERS, ALL RIGHTS RESERVED.
//~ Web site www.benefit-from-it.co.uk
function pcBrowserInfo(sArrExt,sBadB){var oBI=pcBrowserInfo._o;if(oBI){this._arrExtURL=(sArrExt)?sArrExt:null;return oBI;this.badBrowserURL=(sBadB)?sBadB:null;da}this.modelType='';this.canCreateContextualFragment=false;this.canInnerHTML=false;this.canAppendChild=false;this.modelMajVsn=0;this.code='';this._badBrAlrtd=false;pcBrowserInfo._o=this;if(document.layers)this.modelType="ns4";else{if(document.all)this.modelType="msie";if(!document.all&&document.getElementsByTagName("*"))this.modelType="w3cdom";}var ua=navigator.userAgent;var i=ua.indexOf('WebTV');if(i>=0){this.code='WebTV';i+=6;}else{i=ua.indexOf('Opera');if(i>=0){this.code='OP';i=ua.indexOf(') ')+2;}else{i=ua.indexOf('MSIE');if(i>=0){this.code='MSIE';i+=5;}else{i=ua.indexOf('Mozilla/');if(i>=0){this.code='NS';i+=8;}if(ua.indexOf('Netscape')<0)this.code='other';}}}this.version=parseFloat(ua.substring(i,i+4));this.platform='Win';if(ua.indexOf('Mac')>=0)this.platform='Mac';if(ua.indexOf('OS/2')>=0)this.platform='OS/2';if(ua.indexOf('X11')>=0)this.platform='Unix';this.engine=(ua.indexOf('Gecko')>-1)?'gecko':'';this.canDynLoadScripts=(this.modelType=='w3cdom'||(this.modelType=='msie'&&(document.getElementById)));this.canSetCSS=(this.modelType=='msie'||this.modelType=='w3cdom');this.__msg='';this.__ap=Array.prototype;this.__noLd=false;if((this._arrExtURL)&&(!(this.__ap.concat)||!(this.__ap.copy)||!(this.__ap.pop)||!(this.__ap.push)||!(this.__ap.shift)||!(this.__ap.slice)||!(this.__ap.splice)||!(this.__ap.unshift))){if(!this.loadScript(this._arrExtURL)){this.__msg+='\n\nYour browser does not support the standard array methods push, pop, concat, slice, splice, shift and unshift.';this.__noLd=true;window.onerror=null;}}if(this.__noLd)this.__msg+='We check for these problems and try to load scripts to improve you browser\'s capabilities, but unfortunately your browser cannot load scripts dynamically.';if(this.__msg !='')this.showBadBrowserMsg(null,extnMsg);delete this.__noLd;delete this.__ap;delete this.__msg;}pcBrowserInfo.prototype.checkBodyFacilities=function(){this.canAppendChild=false;this.canInnerHTML=false;this.canCreateContextualFragment=false;this.innerHTMLtype='n';var db=document.body;if(typeof db !='undefined'){this.canAppendChild=(db.appendChild)?true:false;var ci=this.canInnerHTML=(typeof db.innerHTML=='string');var cc=this.canCreateContextualFragment=(typeof db.ownerDocument !='undefined'&&db.ownerDocument.createRange&&db.ownerDocument.createRange().createContextualFragment);this.innerHTMLtype=((ci)?'i':((cc)?'c':'n'));}else if(this.modelType=='ns4')this.innerHTMLtype='l';};pcBrowserInfo.prototype.loadScript=function(sURL,nomsg){if(this.canAppendChild){var dh=(this.modelType=='msie')?document.body:document.getElementsByTagName('head')[0];sc=document.createElement('script');sc.src=sURL;sc.type='text/javascript';dh.appendChild(sc);return true;}else{if(!nomsg){this.showBadBrowserMsg(null,'The page needs to load a script dynamically but your browser cannot do this.');window.onerror=null;}return false;}};pcBrowserInfo.prototype.showBadBrowserMsg=function(u,s){var bbu=(u)?u:this.badBrowserURL;if(bbu){if(document.images)location.replace(bbu);else location.href=bbu;}else if(!this._badBrAlrtd){alert('Sorry, your browser does not comply with standards published between 1996 and 1999, so it cannot display this page properly.\n\nYou will get more out of the web if you upgrade your browser or switch to a better one.'+((s)?'\n\n'+s:''));window.onerror=null;this._badBrAlrtd=true;}};pcBrowserInfo.prototype.createStylesheet=function(){switch(this.modelType){case 'msie':return document.createStyleSheet();case 'w3cdom':var ss=document.createElement('style');var ha=document.getElementsByTagName('head');var h=ha[ha.length-1];h.appendChild(ss);ss=document.styleSheets[document.styleSheets.length-1];return ss;default:this.showBadBrowserMsg(null,'Your browser cannot create CSS stylesheets dynamically.');}};pcBrowserInfo.prototype.setCSSrule=function(selsp,rtxt){var ss;var ds=document.styleSheets;if(ds.length==0)ss=this.createStylesheet();else{var ss=ds[ds.length-1];switch(this.modelType){case 'msie':ss.addRule(selsp,rtxt);break;case 'w3cdom':ss.insertRule(selsp+' {'+rtxt+'}',ss.length-1);break;default:this.showBadBrowserMsg(null,'Your browser cannot create CSS rules dynamically.');}}};pcBrowserInfo.prototype.setCSSclass=function(o,n){switch(this.modelType){case 'msie':case 'w3cdom':o.className=n;break;default:this.showBadBrowserMsg(null,'Your browser cannot change an object\'s CSS class dynamically.');}};pcBrowserInfo.prototype.getCSSclass=function(o){switch(this.modelType){case 'msie':case 'w3cdom':return o.className;break;default:this.showBadBrowserMsg(null,'Your browser cannot change an object\'s CSS class dynamically.');}};pcBrowserInfo._o=new pcBrowserInfo();if(window.onload)pcBrowserInfo._o._exWLdHndlr=window.onload;window.onload=function(){if(pcBrowserInfo._o._exWLdHndlr)pcBrowserInfo._o._exWLdHndlr();pcBrowserInfo._o.checkBodyFacilities();};
