function isFilled(sString){
	var whitespace = ' \t\n\r';
   var i;
   if((sString == null) || (sString.length == 0))
		return false;
   for(i = 0; i < sString.length; i++){
      var c = sString.charAt(i);
      if(whitespace.indexOf(c) == -1)
			return true;
   }
   return false;
}
function isEmail(s){
   if(!isFilled(s))
      return false;
   var i = 1;
   var sLength = s.length;
   while((i < sLength) && (s.charAt(i) != '@')){
      i++
   }
   if((i >= sLength) || (s.charAt(i) != '@'))
      return false;
   else i += 2;
      while((i < sLength) && (s.charAt(i) != '.')){
         i++
      }
   if((i >= sLength - 1) || (s.charAt(i) != '.'))
      return false;
   return true;
}
function isUrl(s) {
  var url = /^http:\/\//;    
  if (s.match(url)) {                           
    return true;
  }
  return false;
}
function isNumeric(s){
	var checkOK = '0123456789.';
   if(!isFilled(s))
      return false;
   for (i = 0; i < s.length;  i++){
      ch = s.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
         if (ch == checkOK.charAt(j))
            break;
      if (j == checkOK.length){
         return false;
      }
   }
   return true
}
function isValidString(s, checkString){
   if(!isFilled(s))
      return false;
   for (i = 0; i < s.length;  i++){
      ch = s.charAt(i);
      for (j = 0;  j < checkString.length;  j++)
         if (ch == checkString.charAt(j))
            break;
      if (j == checkString.length){
         return false;
      }
   }
   return true
}
function isDate(sDay, sMonth, sYear){
   if (!isFilled(sDay) || !isFilled(sMonth) || !isFilled(sYear))
      return false;
   var iDay = parseInt(sDay, 10);
   var iMonth = parseInt(sMonth, 10);
   var iYear = parseInt(sYear, 10);
	if (iMonth < 1 || iMonth > 12)
      return false;
   if ((iMonth == 1 || iMonth == 3 || iMonth == 5 || iMonth == 7 || iMonth == 8 || iMonth == 10 || iMonth == 12) && (iDay < 1 || iDay > 31))
      return false;
   if ((iMonth == 4 || iMonth == 6 || iMonth == 9 || iMonth == 11) && (iDay < 1 || iDay > 30))
      return false;
   if ((iMonth == 2)){
      if ((((iYear % 4) == 0)) && (iDay < 1 || iDay > 29)){
         return false;
      }
      else if ((((iYear % 4) != 0)) && (iDay < 1 || iDay > 28)){
         return false;
      }
   }
   return true;
}
function isTime(sHour, sMinute, b24hr){
   if (!isFilled(sHour) || !isFilled(sMinute))
      return false;
   if(sMinute.length != 2)
      return false;
   var iHour = parseInt(sHour, 10);
   var iMinute = parseInt(sMinute, 10);
	var iHour_limit;
	if (b24hr)
		iHour_limit = 23;
	else
		iHour_limit = 12;
	if (iHour < 1 || iHour > iHour_limit)
      return false;
	if (iMinute < 0 || iMinute > 59)
      return false;
   return true;
}
function isRadioChecked(radio){
	for(var i=0;i < radio.length; i++){
		if(radio[i].checked)
			return true;
	}
	return false;
}
function openWindowMove(sUrl, sName, sProperties, iWidth, iHeight, iMoveX, iMoveY){
	var iX, iY
	iX = iMoveX
	if(iMoveX == 'left')
		iX = 0
	if(iMoveX == 'middle')
		iX = (screen.width / 2) - (iWidth / 2)
	if(iMoveX == 'right')
		iX = screen.width - iWidth
	iY = iMoveY
	if(iMoveY == 'top')
		iY = 0
	if(iMoveY == 'middle')
		iY = ((screen.height - 56) / 2) - (iHeight / 2)
	if(iMoveY == 'bottom')
		iY = screen.height - 56 - iHeight

	if(sProperties){
		sProperties +=',';
	}
	sProperties = 'width=' + iWidth + ',height=' + iHeight + ',screenX=' + iX + ',screenY=' + iY + ',left=' + iX + ',top=' + iY
	window.open(sUrl, sName, sProperties);
}
function popupLink(sLink){
	window.opener.location = sLink;
	window.close();
}
function refresh(){
	window.location.reload();
}
function jumpSelect(theform,jumpname){
	if(theform.elements[jumpname].value){
		theform.submit();
	}
}
function openWindow(sUrl, sName , sProperties){
	newWindow=window.open(sUrl, sName, sProperties);
	newWindow.focus();
}

//break out of hotmail frameset
if (self != top) {
if (document.images)
top.location.replace(window.location.href);
else
top.location.href = window.location.href;
}
