function popup(url,width,height,scrollbars)	{
	if (arguments.length < 2) {width  = 400;}
	if (arguments.length < 3) {height = 600;}
	if (arguments.length < 4) {scrollbars = 'no';}
	window.open(url,"","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=" + scrollbars + ",resizable=yes,width=" + width + ",height=" + height)
}
function displayWindow(url, width, height) {
       var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=yes,status=yes' );
	Win.focus();
}
/*function act(action) {
	willDelete = confirm("Stop! Are you sure you want to " + action + "?");
	if (willDelete) {return true;} else {return false;}
}*/

function act(action) {
	return confirm("Stop! Are you sure you want to delete this " + action + "?");
}
function pmt(action) {
	return confirm(action);
}
function popHelp(url,width,height,scrollbars) {
	if (arguments.length < 2) {width  = 800;}
	if (arguments.length < 3) {height = 550;}
	if (arguments.length < 4) {scrollbars = 'Yes';}
	window.open(url,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + scrollbars + ",resizable=yes,width=" + width + ",height=" + height)
}
function help(txt) {
	document.getElementById("help_text").innerHTML = txt;
}
function loginPls() {
	alert("Please, login to continue");
}
function CFWinCleanup(winName) {
    ColdFusion.Window.destroy(winName,true);
 }
function left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function radioValue(radioGroup) {
	var rbgroup_value = "";
	for (i=0;i< radioGroup.length;i++) 
	{ 
	      if ( radioGroup[i].checked) 
	      { 
	             rbgroup_value = radioGroup[i].value; 
	      } 
	}
	return rbgroup_value;
}
function right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}
// Browser Detection Javascript
// copyright 1 February 2003, by Stephen Chapman, Felgall Pty Ltd

// You have permission to copy and use this javascript provided that
// the content of the script is not changed in any way.

function whichBrs() {
	var agt=navigator.userAgent.toLowerCase();
	alert(agt);
	if (agt.indexOf("opera") != -1) return 'Opera';
	if (agt.indexOf("staroffice") != -1) return 'Star Office';
	if (agt.indexOf("webtv") != -1) return 'WebTV';
	if (agt.indexOf("beonex") != -1) return 'Beonex';
	if (agt.indexOf("chimera") != -1) return 'Chimera';
	if (agt.indexOf("netpositive") != -1) return 'NetPositive';
	if (agt.indexOf("phoenix") != -1) return 'Phoenix';
	if (agt.indexOf("firefox") != -1) return 'Firefox';
	if (agt.indexOf("safari") != -1) return 'Safari';
	if (agt.indexOf("skipstone") != -1) return 'SkipStone';
	if (agt.indexOf("msie") != -1) return 'Internet Explorer';
	if (agt.indexOf("netscape") != -1) return 'Netscape';
	if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
	if (agt.indexOf('\/') != -1) {
	if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
		return navigator.userAgent.substr(0,agt.indexOf('\/'));}
	else return 'Netscape';} else if (agt.indexOf(' ') != -1)
		return navigator.userAgent.substr(0,agt.indexOf(' '));
	else return navigator.userAgent;
}
function URLEncode (clearString) {
	  var output = '';
	  var x = 0;
	  clearString = clearString.toString();
	  var regex = /(^[a-zA-Z0-9_.]*)/;
	  while (x < clearString.length) {
	    var match = regex.exec(clearString.substr(x));
	    if (match != null && match.length > 1 && match[1] != '') {
	    	output += match[1];
	      x += match[1].length;
	    } else {
	      if (clearString[x] == ' ')
	        output += '+';
	      else {
	        var charCode = clearString.charCodeAt(x);
	        var hexVal = charCode.toString(16);
	        output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
	      }
	      x++;
	    }
	  }
	  return output;
	}
function getSelectedCheckbox(buttonGroup) {
	   // Go through all the check boxes. return an array of all the ones
	   // that are selected (their position numbers). if no boxes were checked,
	   // returned array will be empty (length will be zero)
	   var retArr = new Array();
	   var lastElement = 0;
	   if (buttonGroup[0]) { // if the button group is an array (one check box is not an array)
	      for (var i=0; i<buttonGroup.length; i++) {
	         if (buttonGroup[i].checked) {
	            retArr.length = lastElement;
	            retArr[lastElement] = i;
	            lastElement++;
	         }
	      }
	   } else { // There is only one check box (it's not an array)
	      if (buttonGroup.checked) { // if the one check box is checked
	         retArr.length = lastElement;
	         retArr[lastElement] = 0; // return zero as the only array value
	      }
	   }
	   return retArr;
	} // Ends the "getSelectedCheckbox" function
	
	function getSelectedCheckboxValue(buttonGroup) {
	   // return an array of values selected in the check box group. if no boxes
	   // were checked, returned array will be empty (length will be zero)
	   var retArr = 0; // set up empty array for the return values
	   var selectedItems = getSelectedCheckbox(buttonGroup);
	   if (selectedItems.length != 0) { // if there was something selected
	      retArr.length = selectedItems.length;
	      for (var i=0; i<selectedItems.length; i++) {
	         if (buttonGroup[selectedItems[i]]) { // Make sure it's an array
	            retArr = retArr + parseFloat(buttonGroup[selectedItems[i]].value);
	         } else { // It's not an array (there's just one check box and it's selected)
	            retArr = retArr + parseFloat(buttonGroup.value);// return that value
	         }
	      }
	   }
	   return retArr;
	}
	function checkAll(field,checkflag) {
		if (field.length) {
			for (i = 0; i < field.length; i++) {field[i].checked = checkflag.checked;}
		} else {
			field.checked = checkflag.checked;
		}
	}
	function fwdMe(action) {
		var url_str = "?biz=" + action;
		document.location.href=url_str;
	}
	function showDiv(id,dispid){
	      if (document.getElementById && document.createTextNode)
		    {
		         var div=document.getElementById(id);
				 var dispLoc = document.getElementById(dispid);
				   if(div.style.display=='' || div.style.display=='none')
		            {
		                div.style.display='inline'; 
						dispLoc.innerHTML = "<img src='/Common/images/menu/arrv_black.gif' border='0' alt='' align='absmiddle' style='cursor: pointer;'>";
		            }else {
		                div.style.display='none'; 
						dispLoc.innerHTML = "<img src='/Common/images/menu/arrow_sub6.gif' border='0' alt='' align='absmiddle' style='cursor: pointer;'>";
		            }       
		    }
		}
