function browseIt()
{
	this.ver = navigator.appVersion.toLowerCase();
	this.agent = navigator.userAgent.toLowerCase();
	this.dom = document.getElementById ? 1 : 0;
	this.opera = (navigator.userAgent.indexOf("opera")>-1 && document.getElementById) ? 1 : 0;
	this.opera7 = (this.opera && parseInt(navigator.appVersion) >= 7);
	this.ie = (this.ver.indexOf("msie") > -1 && this.dom && !this.opera) ? 1 : 0;
	this.macOS = this.agent.indexOf("mac") > -1;
	this.mac = (this.macOS && parseInt(this.ver) >= 7) ? 1 : 0;
	this.moz = (this.agent.indexOf("gecko")>-1)
	this.ns6 = (this.dom && this.agent.indexOf("netscape")>-1 && parseInt(this.ver) >= 5) ? 1 : 0;
	this.b = (this.ie || this.ns6 || this.opera7 || this.mac || this.moz || this.dom);
	return this;
}

//var px = window.opera ? "" : "px";
var b = new browseIt();

function trim(s, p)
{
	if (typeof s != 'string')
		return s;
	return s.replace(p ? p : /^\s*|\s*$/g, '');
}

function stripTags(str)
{
	return str.replace(/(<([^>]*)>)/g, '');
}

function checkAll(val, p)
{
	if (!p)
		p = document.body;

	var arr = p.getElementsByTagName('INPUT');
	for (var i = 0; i < arr.length; i++) {
		if (arr[i].type == 'checkbox')
			arr[i].checked = val;
	}
}

function checkDate(month, day, year)
{
	if (month < 1 || month > 12) return false;
	if (day < 1 || day > 31) return false;
	switch (month) {
	case 4:
	case 6:
	case 9:
	case 11:
		if (day > 30) return false;
		break;
	case 2:
		if (year % 4) {
			if (day > 28) return false;
		} else {
			if (day > 29) return false;
		}
		break;
	}

	return true;
}

function frPr()
{
	if (parent && parent != window)
		parent.location.href = window.location.href;
}

