﻿function trim(val)
{
	// return if string is empty
	if (null == val || val.length < 1) return val;

	var value = val;
	var len = value.length;
	if (len == undefined) return;

	while (value.charAt(value.length - 1) == " ") { value = value.substring(0, value.length - 1); }
	while (value.substring(0, 1) == " ") { value = value.substring(1, value.length); }

	return value;
}//end of trim


function openWindow() 
{
	var leftPoint = (top.screen.width - 800) / 2;
	var topPoint = (top.screen.height - 600) / 2;
	window.open('Rules.html', '' , 'left='+leftPoint+', top='+topPoint+',width=450, height=600, scrollbars=yes');
} //end of openWindow



function B2C_ValidateCheckBox(sender, args)
{
	if (!document.getElementById(chkReadAgreed))
	{
		args.IsValid = false;
		return;
	}
	
	args.IsValid = document.getElementById(chkReadAgreed).checked;
} //end of B2C_ValidateCheckBox
