function OnChangePercentage(p1,OLDp2,OLDp3)
{
	var p2 = document.getElementById('ECB_txtHCEmpCommP').value;
	var p3 = document.getElementById('ECB_txtHCAutoshipP').value;
	var p = 0;
	
	if(!isNumberString(p2))
		p2 = 0;
	if(!isNumberString(p3))
		p3 = 0;
		
	p = parseFloat(p2) + parseFloat(p3);
	
	if((p1>0) && (p>p1))
	{
		alert('Total Suggested Percentage must not exceed to ' + p1 + ' percent.');
		return false;
	}
	else
	{
		if((OLDp2!=p2) || (OLDp3!=p3))
		{
			if(window.showModalDialog("../../Protected/Popups/Confirmation.aspx?p=1","","dialogHeight: 250px; dialogWidth: 400px; center: Yes; help: No; resizable: Yes; status: No;") == "1")
				return true;
			else
				return false;
		}
		else
			return true;
	}
}
function isNumberString (InString)  
{
	if(InString.length==0) return (false);
	var RefString="1234567890.";
	for (Count=0; Count < InString.length; Count++)  {
		TempChar= InString.substring (Count, Count+1);
		if (RefString.indexOf (TempChar, 0)==-1)  
		return (false);
	}
	return (true);
}
function ArticlePopup(the_url,win_name,the_width,the_height,the_left,the_top,bars)
{
	var the_window = null;
	var final_width = (the_width == 0)? (screen.width - 20) : the_width;
	var final_height = (the_height == 0)? (screen.height - 150) : the_height;
	var settings = 'width=' + final_width + ',height=' + final_height + ',scrollbars=yes,menubar=' + bars + ',toolbar=' + bars + ',left=' + the_left + ',top=' + the_top + ',resizable';
	the_window = window.open(the_url,win_name,settings);
}
function Popups(the_url,win_name,the_width,the_height,the_left,the_top,bars)
{
	var the_window = null;
	var final_width = (the_width == 0)? (screen.width - 20) : the_width;
	var final_height = (the_height == 0)? (screen.height - 150) : the_height;
	var settings = 'width=' + final_width + ',height=' + final_height + ',scrollbars=no,menubar=' + bars + ',toolbar=' + bars + ',left=' + the_left + ',top=' + the_top;
	the_window = window.open(the_url,win_name,settings);
}
function AgreementOK()
{
	alert('Your Personal Trainer Agreement Form has been submitted!');
	document.location.href="default.aspx";
}
function Send(a)
{
	document.getElementById('a').value = a;
	document.forms[0].submit();
}
function iprint(ptarget) 
{ 
	ptarget.focus(); 
	ptarget.print(); 
} 
