function dateLookup(e, q)
{
	document.open('../PickList/DateLookUp.aspx?e='+ e +'&q='+q, 'DatePicker','scrollbars=no,height=170,width=200,left='+(screen.width/2-100)+',top='+ (screen.height/2 - 85));
	return;
}

function defaultFocus(ctl)
{
	try
	{
		
		if (ctl != null && ctl.length > 0) //If control is passed then set focus to that control
		{
			setTimeout("document.forms[0].elements['"+ctl+"'].focus();",50);
		}
		else //If control is not passed then set focus to the first element of the form
		{
			for (var i=0; i < window.document.forms[0].elements.length; i++)
			{
				var ctl = window.document.forms[0].elements[i];
				if (ctl.type == 'text' && ctl.disabled == false && ctl.style.visibility != 'hidden')
				{
					ctl.focus();
					break;
				}
			}
		}
	}
	catch(e)
	{
		window.status = 'Focus message: ' + e.message;
	}
}

function n_a(e)
{
	window.status = 'Access Restricted';
}

function popopup(c, h, t, co) //Pet Owner New
{
	rc=window.open('../Customer/CreateCustomer.aspx?Title=Edit Pet Owner&id=' + c +'&mode=edit&CustomerType=Pet Owner&PetOwnerMode=popup&OwnerReport='+co+'&Arg2=&f1=' + h + '&f2=' + t + '&Arg1=','PickCustomer','Height=500,Width=550, scrollbars=yes,left='+((screen.width -370) / 2)+',top='+ (screen.height - 375) / 2);
}
function petpopup(e, h, t) //Pet New
{			
	rc = window.open('../Customer/ManagePet.aspx?Title="Edit Pet"&PetCode=' + e + '&mode=popup&f1=' + h + '&f2=' + t + '&Arg1=','PickCustomer','Height=500,Width=550, scrollbars=yes,left='+((screen.width -370) / 2)+',top='+ (screen.height - 375) / 2+'');
}

function RetToP(uID) //Lookup
{
	try
	{
		if (window.opener != undefined)
		{
			var frm=document.forms(0);
			var doc=window.opener.document;
			doc.getElementById(frm.hdn1.value).value=uID;
			doc.getElementById(frm.hdn2.value).value=uID;
			window.opener.__doPostBack(frm.hdn1.value,'');
			self.close();
			doc.focus();
		}
		else
		{
			self.close();
		}
	}
	catch(e)
	{
		self.close();
	}
}

function cl_d(ifd) //Disabling the button on click
{		
	ifd.disabled=true;	
	ifd.value='Processing...';
}

function cl_ds(ifd) //Disabling the button on click and submit
{		
	ifd.disabled=true;	
	ifd.value='Processing...';	
	__doPostBack(ifd.name,'');
	
}

function def_act(ctl)
{
	if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById(ctl).click();return false;}} else {return true};
}

//Page Navigation Check
function pnc(PageName, Status)
{	
	if(Status == 'False')
	{	
		document.forms(0).hdnStatus.value = PageName;		
		newwindow=window.open("PaymentAlert.aspx", "PaymentAlert",'Height=250,Width=630,left='+((screen.width - 670) / 2)+',top='+ (screen.height - 275) / 2);
		if (window.focus) 
		{
			newwindow.focus();
		}		
	}			
}



