function TrimString (sInString){
	sInString = sInString.replace(/ /g,' ');
	return sInString.replace(/(^\s+)|(\s+$)/g, '');
}

function GetHeight() {
	return Screen.getDocumentHeight()+50;
}

function ShowHide(id){
if (id != '') {
	var itm = null;
	var pitm= null;
	if (document.getElementById) {
  		itm = document.getElementById(id);
	} else if (document.all) {
		itm = document.all[id];
	} else if (document.layers) {
		itm = document.layers[id];
	}
   	if (!itm) { /* do nothing */
	} else if (itm.style) {
   		if (itm.style.display == "none") {
			itm.style.display = "block";
		} else {
			itm.style.display = "none";
		}
    } else { itm.visibility = "show"; }
 }
}

function setCookie (name, value, expires, path, domain, secure) {
      document.cookie = name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

function getCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
}

function blockdiv (this_) {    myVar = getCookie("acc");
    if(myVar!='accept'){
		bi('termsblock').style.height = GetHeight()+'px';
		document.getElementById(this_).style.display = 'block';
	}

}
function nonediv (this_) {
	var time=new Date();
	time.setTime(time.getTime()+(1*24*60*60*1000));
	var expires = time.toGMTString();
	setCookie("acc", "accept", expires, "/");
	document.getElementById(this_).style.display = 'none';
}



function setnulltext(this_, mess, typ) {
	if (typ == 0) {
		if (this_.value == mess) {this_.value = ""};
	} else {
		if (this_.value == "") {this_.value = mess};
	}
}
function bi (el) {
	return document.getElementById(el);
}

