
window.onerror=null;

function browserInformation() {
    this.ie = (navigator.appName.indexOf('Micr') != -1);
    this.ns = (navigator.appName.indexOf('Nets') != -1);
    this.mac = (navigator.userAgent.indexOf('Mac') != -1) || (navigator.userAgent.indexOf('mac') != -1);
    this.windows = (navigator.userAgent.indexOf('Win') != -1) || (navigator.userAgent.indexOf('win') != -1);
    this.level4 = (navigator.appVersion.charAt(0) >=  4)
}

function Language() {
	var index1 = location.pathname.indexOf("Francais");
	this.language="";
	if (index1 == -1) this.language="English";
	if (index1 != -1) this.language="French";
}

theBrowser = new browserInformation();
theLanguage = new Language();

// for the stylesheet
if (theLanguage.language == "French") {
	if (theBrowser.windows) {
		if (theBrowser.ie) {
			document.writeln("<LINK Rel='stylesheet' Type='text/css' HREF='../StyleSheets/sPearWay_winIE.css'>");
		} else {
			document.writeln("<LINK Rel='stylesheet' Type='text/css' HREF='../StyleSheets/sPearWay_winNS.css'>");
		}
	} else {
		if (theBrowser.ie) {
			document.writeln("<LINK Rel='stylesheet' Type='text/css' HREF='../StyleSheets/sPearWay_macIE.css'>");
		} else {
			document.writeln("<LINK Rel='stylesheet' Type='text/css' HREF='../StyleSheets/sPearWay_macNS.css'>");
		}
	}
} else {
	if (theBrowser.windows) {
		if (theBrowser.ie) {
			document.writeln("<LINK Rel='stylesheet' Type='text/css' HREF='StyleSheets/sPearWay_winIE.css'>");
		} else {
			document.writeln("<LINK Rel='stylesheet' Type='text/css' HREF='StyleSheets/sPearWay_winNS.css'>");
		}
	} else {
		if (theBrowser.ie) {
			document.writeln("<LINK Rel='stylesheet' Type='text/css' HREF='StyleSheets/sPearWay_macIE.css'>");
		} else {
			document.writeln("<LINK Rel='stylesheet' Type='text/css' HREF='StyleSheets/sPearWay_macNS.css'>");
		}
	}
}


// Test browser if it supports the Navigator layer property 
// MISE supports only the document.all property.
if (theBrowser.ns) {        
    //Assign the starting width of window to a variable.          
    var beginWidth = innerWidth;
    //Assign the starting height of window to a variable.
    var beginHeight = innerHeight; 
}        

function reloadWindow() {
    //Test for any resize of browser window.
    if (innerWidth != beginWidth || innerHeight != beginHeight) 
    //Reload the browser window when there is a resize.
    location.reload();
}