function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ns6 = document.getElementById&&!document.all;
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
	if (this.ie5) this.v = 5
	this.min = (this.ns||this.ie)
}

is = new BrowserCheck()

if(is.ns) {	doc = 'document';
	sty = '';
	htm = '.document'}
else if (is.ie) {	doc = 'document.all';
		sty = '.style';
		htm = '';}

function GetCookie(name){
	var result = null;
	var myCookie = " "+document.cookie+";";
	var searchName = " "+name+"=";
	var startOfCookie = myCookie.indexOf(searchName);
	var endOfCookie;
	
	if(startOfCookie != -1){
		startOfCookie += searchName.length;
		endOfCookie = myCookie.indexOf(";",startOfCookie);
		result = unescape(myCookie.substring(startOfCookie,endOfCookie));
	}

	return result;
}

function GetParam(name){
	var result = null;
	var url=self.location.href;
	if(url.indexOf((name+'='),0) != -1){
		var si=url.indexOf((name+'='),0)+(name.length+1);
		var ei=url.indexOf('&',si);
		result = url.substring(si,(ei==-1)?url.length:ei);
	}
	return result;
}

function ValidateField(field,regexp,msg) {
	if(typeof(regexp) == "boolean"){
		if(! regexp){
			alert(msg);
			field.focus();
			return false;
		}
		return true;
	} else {
		if(field.value.search(regexp) == -1) {
			alert(msg);
			field.focus();
			return false;
		}
	}
	return true;
}
