function NewWindow(mypage, myname, w, h) {

	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,resizable'
	win = window.open(mypage, myname, winprops);
	win.opener=self;
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}


function popper(url, name, ww,  wh) {
	  popupWin = window.open(url, name, 'width='+ww+',height='+wh+',scrollbars,top=150,left=150');
	}
	
	

function gohere($xx){
    location.href=$xx;
  }

function pophere($xx,$rel){
    location.rel=$rel;
    location.href=$xx;
  }

function trim(str, chars) {
		return ltrim(rtrim(str, chars), chars);
	}
	 
function ltrim(str, chars) {
		chars = chars || "\\s";
		return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
	}
	 
function rtrim(str, chars) {
		chars = chars || "\\s";
		return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
	}  

function GetSelectedRadioItem($r) {
	$radio=document.getElementsByName($r);
	len = $radio.length;
	for (i = 0; i <len; i++) {
		if ($radio[i].checked==true) {
	      return $radio[i].value;
	      break;
		}
	  }
    return '';
}
