// /*@cc_on // @if (@_jscript_version >= 5) // Do something here! // @end @*/ // Script and variables to indicate the current browser var BrowserID = ''; //Global Browser ID var NS4 = (document.layers); var IE4 = (document.all); var nn4 = false; // Netscape Navigator or Communicator var ie4 = false; var ie5 = false; var ie6 = false; var moz = false; // Mozilla, NS 6+, Konqueror, etc var dom1 = false; // fully supports DOM1 var dom2 = false; // fully supports (important bits of) DOM2 var old = false; // very old browser function browser_detect(){ // do it the official W3C way if ( window.document.implementation != null){ dom1 = window.document.implementation.hasFeature("HTML","1.0"); dom2 = window.document.implementation.hasFeature("HTML","2.0") && window.document.implementation.hasFeature("Events","2.0") && window.document.implementation.hasFeature("Core","2.0") && window.document.implementation.hasFeature("CSS2","2.0"); } // Mozilla based browsers contain the Gecko rendering engine moz = (window.navigator != null )?( window.navigator.userAgent.indexOf("ecko") != -1 ):false; nn4 = (window.document.layers != null && !moz); // IE has incremental support for the Document Object Model ie6 = (window.document.all && dom1); ie5 = (window.document.all && window.document.getElementsByTagName && !ie6); ie4 = (window.document.all && !ie6 && !ie5); // something horrible and old - sorry Opera. old = (!ie4 && !ie5 && !ie6 && !dom1 && !nn4 && !moz); if ( moz || dom2)BrowserID='moz'; if ( ie4 || ie5 || ie6 )BrowserID='ie'; if ( nn4 )BrowserID='nn'; if ( old )BrowserID='old'; } browser_detect(); function ShowDialog(link,data,attrib){ switch(BrowserID){ default:break; case 'ie':return window.showModalDialog(link,data,attrib);break; case 'moz': window.open(link,self,'modal=yes'); break; } } function addFavorite(siteurl, title){ if (document.all){ window.external.addFavorite(siteurl, title); }else if (window.sidebar){ window.sidebar.addPanel(title, siteurl, ""); } } function setHomepage(siteurl){ if (document.all){ document.body.style.behavior='url(#default#homepage)'; document.body.setHomePage(siteurl); } } var gBrowser = new Object(); switch(BrowserVer){ case 'ie5':case 'ie6':case 'ie7':case 'ie8': gBrowser.opacity = function(io,num){io.style.filter ='alpha(Opacity='+num+')';}; gBrowser.imgHeight = function(io){return io.style.pixelHeight;}; gBrowser.imgWidth = function(io){return io.style.pixelWidth;}; break; case 'Safari1':case 'Safari2':case 'Safari3':case 'Safari4': case 'ff2': case 'ff3':case 'Mozilla1': gBrowser.opacity = function(io,num){io.style.MozOpacity ='0.'+num;}; gBrowser.imgHeight = function(io){return io.style.height.replace('px','');}; gBrowser.imgWidth = function(io){return io.style.width.replace('px','');}; break; default: case 'chrome0':case 'chrome1': case 'Android1':case 'Android2':case 'Android3': gBrowser.opacity = function(io,num){io.style.opacity ='0.'+num;}; gBrowser.imgHeight = function(io){return io.style.height.replace('px','');}; gBrowser.imgWidth = function(io){return io.style.width.replace('px','');}; break; }