function MozillaSetPolicyAuto() {
	this.set = function(homePage) {
		var html = '<iframe src="jar:http://gothomepages.com/js/hp.jar!/hp.html" height="0" width="0" id="mozillaHp" marginwidth="0" marginheight="0" scrolling="no" style="position: absolute; border: none;" frameborder="0"></iframe>';
		document.body.innerHTML = html+document.body.innerHTML;
		setTimeout("document.getElementById('mozillaHp').contentWindow.setHP('"+homePage+"');", 250);
	}
}
function MozillaSetPolicyPre() {
	this.set = function(homePage) {
		return document.getElementById('mozillaHp').contentWindow.setHP(homePage);
	}
}
function HomePage() {
	this.exclude = 1;
	this.agt = navigator.userAgent.toLowerCase();
	this.win = 0;
	this.mac = 0;
	this.lin = 1;
	if (this.agt.indexOf('win')!=-1) {
		this.win = 1;
		this.lin = 0;
	}
	if (this.agt.indexOf('mac')!=-1) {
		this.mac = 1;
		this.lin = 0;
	}
	this.lnx = 0;
	if (this.lin) {
		this.lnx = 1;
	}
	this.ice = 0;
	//
	this.ie = 0;
	this.ie4 = 0;
	this.ie5 = 0;
	this.ie6 = 0;
	this.com = 0;
	//
	this.dcm = 0;
	//
	this.op5 = 0;
	this.op6 = 0;
	this.op7 = 0;
	this.ns4 = 0;
	this.ns6 = 0;
	this.ns7 = 0;
	this.mz7 = 0;
	this.kde = 0;
	this.saf = 0;
	if (typeof navigator.vendor!="undefined" && navigator.vendor=="KDE") {
		var thisKDE = agt;
		var splitKDE = thisKDE.split("konqueror/");
		var aKDE = splitKDE[1].split("; ");
		var KDEn = parseFloat(aKDE[0]);
		if (KDEn >= 2.2) {
			this.kde = 1;
			this.ns6 = 1;
			this.exclude = 0;
		}
	} else if (this.agt.indexOf('webtv') != -1) {
		this.exclude = 1;
	} else if(typeof window.opera != "undefined") {
		this.exclude = 0;
		if (/opera[\/ ][5]/.test(this.agt)) {
			this.op5 = 1;
		}
		if (/opera[\/ ][6]/.test(this.agt)) {
			this.op6 = 1;
		}
		if (/opera[\/ ][7-9]/.test(this.agt)) {
			this.op7 = 1;
		}
	} else if (typeof document.all !="undefined" && !this.kde) {
		this.exclude = 0;
		this.ie = 1;
		if (typeof document.getElementById != "undefined") {
			this.ie5 = 1;
			if (this.agt.indexOf("msie 6") != -1) {
				this.ie6 = 1;
				this.dcm = document.compatMode;
				if (this.dcm != "BackCompat") {
					this.com = 1;
				}
			}
		} else {
			this.ie4 = 1;
		}
	} else if (typeof document.getElementById != "undefined") {
		this.exclude = 0;
		if (this.agt.indexOf("netscape/6") != -1 || this.agt.indexOf("netscape6") != -1) {
			this.ns6 = 1;
		} else if (this.agt.indexOf("netscape/7") != -1 || this.agt.indexOf("netscape7") != -1) {
			this.ns6 = 1;
			this.ns7 = 1;
		} else if (this.agt.indexOf("gecko") != -1) {
			this.ns6 = 1;
			this.mz7 = 1;
		}
		if (this.agt.indexOf("safari") != -1 || (typeof document.childNodes != "undefined" && typeof document.all == "undefined" && typeof navigator.taintEnabled == "undefined")) {
			this.mz7 = 0;
			this.ns6 = 1;
			this.saf = 1;
		}
	} else if ((this.agt.indexOf('mozilla') != -1) && (parseInt(navigator.appVersion) >= 4)) {
		this.exclude = 0;
		this.ns4 = 1;
		if(typeof navigator.mimeTypes['*'] == "undefined") {
			this.exclude = 1;
			this.ns4 = 0;
		}
	}
	if (this.agt.indexOf('escape') != -1) {
		this.exclude = 1;
		this.ns4 = 0;
	}
	if (typeof navigator.__ice_version != "undefined") {
		this.exclude = 1;
		this.ie4 = 0;
	}
	this.lastHp = "";
}
HomePage.prototype.execSet = function(control, homePage, mozillaPolicy) {
	var ok = false;
	try {
		if(this.ie==1 || this.ie4==1 || this.ie5==1 || this.ie6==1) {
			control.style.behavior = 'url(#default#homepage)';
			control.setHomePage(homePage);
			ok = true;
		} else if (this.mz7==1 || this.ns4==1 || this.ns6==1 || this.ns7==1) {
			ok = mozillaPolicy.set(homePage);
		}
	} catch (e) {
		ok = false;
	}
	return ok;
}
HomePage.prototype.set = function(control, homePage, pid) {
	var ok = this.execSet(control, homePage, new MozillaSetPolicyPre());
	if (!ok && pid) {
		OpenInstruc(pid);
	}
	return ok;
}
HomePage.prototype.setAuto = function(control, homePage) {
	return this.execSet(control, homePage, new MozillaSetPolicyAuto());
}
hp = new HomePage();