// Checks a string to see if it is blank (length = 0 or only contains whitespace)
function is_blank(str) {
	var len = str.length;
	var i = 0;
	
	if (len == 0) { return true; }
	
	// check if only has blank spaces in string
	while (i < len) {
		if (str.charAt(i) != ' ') { return false; } 
		i++;
	}	
	return true;
}

// check if string resolves to a non-zero positive integer
function is_nonzero_integer(my_str) {
	if (my_str == "0") { 
		return false;
	}
	
	var objRegExp = /^[0-9]+$/;
    return objRegExp.test(my_str);
}

function open_window(url) {

      agent = navigator.userAgent;
      windowName = "_blank";

      params  = "";
      params += "toolbar=0,";
      params += "location=0,";
      params += "directories=0,";
      params += "status=0,";
      params += "menubar=0,";
      params += "scrollbars=1,";
      params += "resizable=1,";
      
      params += "width=400,";
      params += "height=300";

      win = window.open(url, windowName , params);

      if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) {
          win = window.open(url, windowName , params);
      }

      if (!win.opener) {
          win.opener = window;
      }
};
