﻿if (!window.MakoLab) MakoLab=new Object(); MakoLab.__namespace=true;
if (!window.MakoLab.Modules) MakoLab.Modules=new Object(); MakoLab.Modules.__namespace=true;
if (!window.MakoLab.Modules.Arcus) MakoLab.Modules.Arcus=new Object(); MakoLab.Modules.Arcus.__namespace=true;
if (!window.MakoLab.Modules.Arcus.Lead) MakoLab.Modules.Arcus.Lead=new Object();

MakoLab.Modules.Arcus.Lead.OnCompanyNameChanged=function(evt,TINValidator,TINRegexValidator)
{
	if (!evt) evt=window.event;
	var Source=(evt.srcElement?evt.srcElement:evt.target);
	if ((TINValidator!=undefined)&&(TINValidator!=null))
	{
		if (typeof (TINValidator)=="string")
			TINValidator=document.getElementById(TINValidator);
		if ((TINValidator!=undefined)&&(TINValidator!=null))
			ValidatorEnable(TINValidator,(Source.value!=""?true:false));
	}
	if ((TINRegexValidator!=undefined)&&(TINRegexValidator!=null))
	{
		if (typeof (TINRegexValidator)=="string")
			TINRegexValidator=document.getElementById(TINRegexValidator);
		if ((TINRegexValidator!=undefined)&&(TINRegexValidator!=null))
			ValidatorEnable(TINRegexValidator,(Source.value!=""?true:false));
	}
}

MakoLab.Modules.Arcus.Lead.OnDeliveryDataCheckedChanged=function(evt)
{
	if (!evt) evt=window.event;
	var Source=(evt.srcElement?evt.srcElement:evt.target);
	var Row=Source.parentNode;
	while ((Row.nodeName.toLowerCase()!="tr")&&(Row.parentNode!=null))
		Row=Row.parentNode;
	for (var Index=Row.rowIndex+1; Index<Row.rowIndex+7; Index++)
	{
		Row.parentNode.rows[Index].style.display=(Source.checked==false?"":"none");
		var Validator=Row.parentNode.rows[Index].getElementsByTagName("span");
		if (Validator.length>0)
			ValidatorEnable(Validator[0],!Source.checked);
	}
}

if ((window.Sys!=undefined)&&(window.Sys.Application!=undefined))
	Sys.Application.notifyScriptLoaded();
