/*
RedirectOldBrowsers()
written by Matt Pressnall 12/09/2004
modified by MP 4/20/2005
What does it do?
This function uses three js files called PopoffWindow, GetBrowserOSVersion, and CanSetCookies to check whether the browser is netscape or ie (or if it is just a mac using ie), whether it is under version 5, whether we have not done a redirect for this browser in the last 10 years. If all of that is true, it then a pop off gives the user some upgrade info.
How do I use it?
(place the JS files somewhere on the page and put the function call RedirectOldBrowsers anywhere underneath the JS file call)
<script src="/js/standardFunctionality/PopoffWindow.js"></script>
<script src="/js/standardFunctionality/GetBrowserOSVersion.js"></script>
<script src="/js/standardFunctionality/CanSetCookies.js"></script>
<script src="/js/standardFunctionality/STSpecific/RedirectOldBrowsers.js"></script>
<script>RedirectOldBrowsers();</script>
*/
function RedirectOldBrowsers(){
GetBrowserOSVersion();
var meetsRequirementForRedirect;
//it's IE or Netscape
if((browser == "Netscape") || (browser == "Microsoft Internet Explorer")){
// and the browser is less than version 5
if(version < 5){
meetsRequirementForRedirect = 1;
}
}
// mac users using IE should get the warning
if(os == "mac"){
if(browser == "Microsoft Internet Explorer"){
meetsRequirementForRedirect = 1;
}
}
if(meetsRequirementForRedirect){
var haveAlreadyRedirected = Get_Cookie("HaveAlreadyRedirected");
// haven't done a redirect during this session
if(! haveAlreadyRedirected){
// set a permanent cookie for 10 years
var daysToKeepCookie = 3650;
var today = new Date();
today.setTime( today.getTime() );
var expires = daysToKeepCookie * 1000 * 60 * 60 * 24;
var expires_date = new Date( today.getTime() + (expires) );
Set_Cookie("HaveAlreadyRedirected","true",expires_date);
// and pop off this window
// ie 4 doesn't suppor the focus tag
if((browser == "Microsoft Internet Explorer") && (version == 4)){
newWindow = window.open('http://seattletimes.nwsource.com/services/browsers2.html','BrowserRec',"width=514,height=270,location=no,resizable=no,scrollbars=no,toolbar=no");
} else {
PopoffWindow('BrowserRec',514,270,'http://seattletimes.nwsource.com/services/browsers2.html','no','no');
}
}
}
}