// WBPassMasterVerify.action v1.5.3 - January, 2009
// Copyright © 1999 by Walter Blady
// All rights reserved
function WBPassMasterVerify(action) {
	if (PMVVersion() && action[5].length > 0) {
		PMaction = action;
		if (action[1] == 3) {
			PMVCookieObject = new PMVCookie(document, action[5], "0", action[6], action[7], action[8]);
			PMVCookieObject.removeCookie();
			var to = setTimeout("PMVLogOut()", 1000);
			return;
		}
		try {
			PMassID;
		}
		catch (errorCode) {
			var mess = "PassMasterVerify can not find the PMass.js file.\n";
			mess += "You must link the PMass.js file inside your site folder to this page."
			alert(mess);
			PMVCookieObject = new PMVCookie(document, action[5], "0", action[6], action[7], action[8]);
			PMVCookieObject.removeCookie();
			if (acton[1] > 0) PMVGoURL(action, action[2]);
			return;
		}
		var defaultUrl = eval("PMass_" + "0()");
		var goURL = defaultUrl;
		var cookieCrumbs = PMVGetCookie(action[5]);
		if (cookieCrumbs != "") {
			var cookieArray = cookieCrumbs.split("&");
			var id = cookieArray[0].substr(cookieArray[0].indexOf("=")+1, 99), pw = cookieArray[1];
			for (var i = 1; PMassID.toLowerCase() != "end"; i++) {
				var pmurl = eval("PMass_" + i + "()");
				if (PMassID.toLowerCase() != "end" && PMassPassw != "" && id == PMassID && pw == PMassPassw) {
					goURL = pmurl != "" ? pmurl : defaultUrl;
					if (goURL != "") {
						if (action[1] == 0) {
							PMVGoURL(action, goURL);
							return;
						}
						else if (action[1] == 1 && window.location.href.indexOf(goURL) > -1) {
							return;
						}
						else if (action[1] == 2 && PMassPageCode == action[3]) {
							return;
						}
					}
				}
			}
			PMVInvalidOut(action, goURL);
		}
		else {
			PMVInvalidOut(action, PMaction[2]);
		}
	}
	return;
}
function PMVLogOut() {
	PMVGoURL(PMaction, PMaction[2]);
	return;
}
function PMVGoURL(action, goURL) {
	var params;
	if (action[4].length < 1) {
		window.location.href = goURL;
	}
	else {
		if (action[4].toLowerCase().indexOf("blank") != -1) {
			var PMVNewWindow = window.open(goURL,"PMnewWindow", "toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,favorites=yes,resizable=yes");
		}
		else {
			params = eval(action[4] + ".window.location");
			params.href = goURL;
		}
	}
	return;
}
function PMVInvalidOut(action, goURL) {
	var outURL = goURL != "" ? goURL : action[2];
	if (action[1] == 1 || action[1] == 2 || action[1] == 3) {
		if (self.opener) {
			opener.location.replace(outURL);
			self.window.close();
		}
		else {
			window.location.replace(outURL);
		}
	}
	return;
}
new PMVCookie();
PMVCookie.prototype.removeCookie = PMVRemoveCookie;
function PMVCookie(document, name, hours, path, domain, secure) {
	this.$document = document;
	this.$name = name;
	if (hours) this.$expires = new Date(new Date().getTime() + hours*86400000);
	else this.$expires = null;
	if (path) this.$path = path; else this.$path = null;
	if (domain) this.$domain = domain; else this.$domain = null;
	if (secure) this.$secure = secure; else this.$secure = false;
	return;
}
function PMVGetCookie(cookieTarget) {
	var cookieCrumbs = unescape(document.cookie);
	var cookieArray = cookieCrumbs.split("; ");
	cookieCrumbs = "";
	for (var i = 0; i < cookieArray.length; i++) {
		if (cookieArray[i].indexOf(cookieTarget) != -1) {
			cookieCrumbs = cookieArray[i];
			break;
		}
	}
	return cookieCrumbs;
}
function PMVRemoveCookie() {
	var cookie = this.$name + "=";
	if (this.$path) cookie += "; path=" + this.$path;
	if (this.$domain) cookie += "; domain =" + this.$domain;
	cookie += "; expires=Thu, 01-Jan-1970 00:00:01 GMT";
	this.$document.cookie = cookie;
	return;
}
function PMVVersion() {
	return true;
}
//
// PassMaster.action v1.7.5 - July, 2008
// Copyright © 1999 by Walter Blady
// All rights reserved
var PMisIE4 = navigator.appVersion.indexOf("MSIE 4") >= 0;
var PMW3C = document.getElementById ? true : false;
var PMisNav4 = navigator.appName.indexOf("Netscape") >= 0 && parseInt(navigator.appVersion.charAt(0)) == 4;
function WBPassMaster(action) {
	if (PMVersion() && action[2].length > 0 && action[3].length > 0) {
		try {
			PMassID;
		}
		catch (errorCode) {
			var mess = "PassMaster can not find the PMass.js file.\n";
			mess += "You must link the PMass.js file inside your site folder to this page."
			alert(mess);
			return;
		}
		PMassID = "", PMassPassw = "";
		var myForm = window.document[action[1]];
		if (PMisNav4 && action[5] != "") {
			myForm = window.document[action[5]].document[action[1]]
			myForm.onsubmit = PMVDoFalse;
		}
		var defaultUrl = eval("PMass_" + "0()");
		for (var i = 1; PMassID.toLowerCase() != "end"; i++) {
			var pmurl = eval("PMass_" + i + "()");
			if (PMassID.toLowerCase() != "end" && PMassPassw != "" && myForm[action[2]].value == PMassID && myForm[action[3]].value == PMassPassw) {
				if (action[6] == 0 && action[7].length > 0) {
					var cookieCrumbs = PMassID + "&" + PMassPassw;
					PMCookieObject = new PMCookie(document, action[7], parseInt(action[8]), action[10], action[11], action[9]);
					PMCookieObject.storeCookie(cookieCrumbs);
				}
				myForm[action[3]].value = "";
				var goURL = pmurl != "" ? pmurl : defaultUrl;
				if (goURL != "") {
					var params;
					if (action[4] == "") {
						window.location.href = goURL;
					}
					else {
						if (action[4].toLowerCase().indexOf("blank") != -1) {
							var PMNewWindow = window.open(goURL,"PMnewWindow", "toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,favorites=yes,resizable=yes");
						}
						else {
							params = eval(action[4] + ".window.location");
							params.href = goURL;
						}
					}
				}
				return;
			}
		}
		myForm[action[3]].value = "";
		window.alert(PMWrongPassword());
	}
	return;
}
new PMCookie();
PMCookie.prototype.storeCookie = PMStoreCookie;
function PMCookie(document, name, hours, path, domain, secure) {
	this.$document = document;
	this.$name = name;
	if (hours) this.$expires = new Date(new Date().getTime() + hours*86400000);
	else this.$expires = null;
	if (path) this.$path = path; else this.$path = null;
	if (domain) this.$domain = domain; else this.$domain = null;
	if (secure) this.$secure = secure; else this.$secure = false;
	return;
}
function PMStoreCookie(value) {
	if (value == null) value = "";
	for (var prop in this) {
		if (prop.charAt(0) == "$" || (typeof this[prop]) == "function") {
			continue;
		}
		if (value != "") value += "&";
		value += prop + ":" + escape(this[prop]);
	}
	var cookie = this.$name + "=" + value;
	if (this.$expires) cookie += "; expires=" + this.$expires.toGMTString();
	if (this.$path) cookie += "; path=" + this.$path;
	if (this.$domain) cookie += "; domain=" + this.$domain;
	if (this.$secure) cookie += "; secure=" + secure;
	this.$document.cookie = cookie;
	return;
}
function PMVDoFalse() {
	return false;
}
function PMVersion() {
	return true;
}
//
