function NewWin(name) {
	window.open(name,'blank','width=450,height=500,resizable=yes,scrollbars=yes,status=no,menubar=no')
}

function doOpenWindow(name, width, height) {
	newwindow = window.open(name,'blank','width='+width+',height='+height+',resizable=yes,scrollbars=yes,status=no,menubar=no')
	if (window.focus) { newwindow.focus(); }
}

function get_radio_value(field) {
	for (var i=0; i < field.length; i++) {
		if (field[i].checked) {
			return field[i].value;
		}
	}
	return false;
}

function pleaseWaitStart(){
	  waitObj =  
	    new YAHOO.widget.Panel("wait", {
	      width:       "240px",  
	      fixedcenter: true,  
	      close:       false,  
	      draggable:   false,  
	      modal:       true, 
	      visible:     false
	    }  
	  ); 
	  waitObj.render(document.body);
	  //waitObj.setHeader("Processing, please wait...");
	  var tempURL = location.href.split('://');	  
	  if (tempURL['0'] == 'https') {
		  waitObj.setBody('Processing... <img src="https://s3.amazonaws.com/imagesroot.rescuegroups.org/loadingcircle.gif" />');
	  } else {
		  waitObj.setBody('Processing... <img src="http://imagesroot.rescuegroups.org/loadingcircle.gif" />');
	  }		  
	  waitObj.render(); 
}

function pleaseWaitOn(){
	  waitObj.show();
}
function pleaseWaitOff(){
	  waitObj.hide();
}

function openNewWindow(url, width, height) {
	doOpenWindow(url, width, height);
}

function openLargeTA(elementID){
  var name = "/textarea?elementID="+elementID;
  var x = "400";
  var y = "800";
  doOpenWindow(name, x, y);
}
