<!--
function popWin(sUrl, sWindowName, iWidth, iHeight)
{
	var oWin = window.open(sUrl, sWindowName, 'width=' + iWidth + ',height=' + iHeight + ',scrollbars=1,resizable=1,toolbar=0');
		oWin.focus();
}

function Trim(s)
{
    return s.replace(/(^\s+)|(\s+$)/g, "");
}

function IsRadioChecked(radioArray)
{
	if(typeof(radioArray.length) == 'undefined')
	{
		return radioArray.checked;
	}
	else
	{
		for(var iCnt = 0; iCnt < radioArray.length; iCnt++)
		{
			if(radioArray[iCnt].checked == true)
			{
				return true;
			}
		}
		
		return false;
	}
}

function CountSelectedOptions(optionsArray)
{
	var iSelected = 0;
		for(var iCnt = 0; iCnt < optionsArray.length; iCnt++)
		{
			if(optionsArray[iCnt].selected == true)
			{
				iSelected++
			}
		}
		
		return iSelected;
}

function ValidEmail(email)
{
	// alert('ValidEmail(\'' + email + '\')');
	
	if(email.length < 'a@b.cd'.length)
	{
		return false;
	}
	
	return RegExpTest(email, /.+\@.+\..+/g);
}

function ValidUrl(url)
{
	// alert('ValidUrl(\'' + url + '\')');
	
	if(url.length < 'http://*.**'.length)
	{
		return false;
	}
	
	return RegExpTest(url, /http:\/\/.+\..{2,}/);
}

function ValidLoginData(pwd)
{
	// alert('ValidLoginData(\'' + pwd + '\')');
	
	if(pwd.length < 6)
	{
		return false;
	}
	
	return !RegExpTest(pwd, /[^A-Za-z0-9_\-\.]/);
}

function RegExpTest(s, re)
{
	// alert('RegExpTest(\'' + s + '\', <re> = ' + re.test(s));
	return re.test(s);
}

function SelectCheckboxes(frm, checkboxName, checked)
{
	var checkboxArray = frm[checkboxName];

	if(typeof(checkboxArray) != 'undefined')
	{
		if(typeof(checkboxArray.length) == 'undefined')
		{
			checkboxArray.checked = checked;
		}
		else
		{
			for(var iCnt = 0; iCnt < checkboxArray.length; iCnt++)
			{
				checkboxArray[iCnt].checked = checked;
			}
		}
	}
}
// -->