var reEmail			= /^.+\@.+\..+$/;
var reAlphanumeric	= /^\w+$/;

var daysInMonth		= new Array(13);
var todaysDate		= new Date();
var thisYear		= todaysDate.year;

daysInMonth[0]	= 0;
daysInMonth[1]	= 31;
daysInMonth[2]	= ((thisYear % 4 == 0) && ((!(thisYear % 100 == 0)) || (thisYear % 400 == 0))) ? 29 : 28;
daysInMonth[3]	= 31;
daysInMonth[4]	= 30;
daysInMonth[5]	= 31;
daysInMonth[6]	= 30;
daysInMonth[7]	= 31;
daysInMonth[8]	= 31;
daysInMonth[9]	= 30;
daysInMonth[10]	= 31;
daysInMonth[11]	= 30;
daysInMonth[12]	= 31;

function isBlank(s)
{
	return ((s == null) || (s == "null") || (s == "") || (s.length == 0));
}

function strlen( str )
{
	myStr = "";
	myStr += str;
	
	return myStr.length;
}

function isEmail(s)
{
	return reEmail.test(s);
}

function isAlphanumeric(s)
{
	return reAlphanumeric.test(s);
}

function openCenterWin( URL, sTitle, height, width, scrollbars, status, menu, resize )
{
	posLeft	= (window.screen.availWidth - width) / 2;
	posTop	= (window.screen.availHeight - height) / 2;
	
	sProperties = 'height=' + height + ',width=' + width + ',scrollbars=' + scrollbars +
				',status=' + status + ',resize=' + resize + ',top=' + posTop + ',left=' + posLeft;
	
	window.open(URL, sTitle, sProperties);
}

function getQueryString(variable){
  var query = window.top.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
  return false;
}

