function ConfirmDelete() 
{ 
if (confirm("Are you sure you want to delete this record?")==true) 
return true; 
else 
return false; 
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function OpenNewWindow(Page){
	var objWindow=window.open(Page,"awindow","toolbar=no,scrollbars=yes,top=100,left=100,width=560,height=340");
}

function OpenNewWindow1(Page){
	var objWindow=window.open(Page,"awindow","toolbar=no,scrollbars=yes,top=100,left=100,width=740,height=540");
}
function openViewWindow(pgName)
{
	var myPage = window.open(pgName, 'ViewItemForm', 'Scrollbars=yes,Toolbar=yes,resizable=no,left=230,top=150,width=460,height=560');
}
function setSubmit(x)
{
	alert(x);
	if (x==1)
	{
		toSubmit = 'btnLogin';
	}
	else if (x==2)
	{
		toSubmit = 'btnSubmit';
	}
	else
	{
		toSubmit = 'none';
	}
}
function goSubmit(){
	
	if (toSubmit == 'btnLogin')
	{
		window.document.all("btnLogin").click();
	}
	if (toSubmit == 'btnSubmit')
	{
		window.document.all("btnSubmit").click();
	}
}
function clickButton(e, buttonid)
{ 
			var bt = document.getElementById(buttonid); 
			if (typeof bt == 'object')
			{ 
						if(navigator.appName.indexOf("Netscape")>(-1)){ 
									if (e.keyCode == 13){ 
												bt.click(); 
												return false; 
									} 
						} 
						if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
									if (event.keyCode == 13){ 
												bt.click(); 
												return false; 
									} 
						} 
			} 
} 
function SetFocus(fieldID)
{
			var bt = document.getElementById(fieldID); 
			if (bt != null)
			{
				if (typeof bt == 'object')
				{
					bt.focus();
				}
			}
			return true;
}
function SetFocusViaTextBox(txtFocusID)
{
	var fieldTag = document.getElementById(txtFocusID);
	if (fieldTag != null)
	{
		if (typeof fieldTag == 'object')
		{
			SetFocus(fieldTag.value);	
		}
	}
}
function SetFocusBack(fieldTag)
{
	var fieldID = document.getElementById(fieldTag);
	if (fieldID != null)
	{
		var bt = document.getElementById(fieldID.value); 
		if (bt != null)
		{
			if (typeof bt == 'object')
			{
				bt.focus();
			}
		}
	}
}


		/* -- Checkbox List / Radio Button List on the button */
			function chkList_Max_OnBtn(csListID, inTotCount, inMaxSelected)
			{
				var inCtr;
				var inCheckMaxCtr = 0;
				if (inTotCount > 0)
				{
					for (inCtr=0; inCtr <= inTotCount - 1; inCtr++)
						{ 
							var csCreatedID = csListID + "_" + inCtr;
							if(window.document.getElementById(csCreatedID).checked==true)
							{
								inCheckMaxCtr	= inCheckMaxCtr + 1;
							}
						}
						if(inCheckMaxCtr < inMaxSelected) return false;
				} 
				return true;
			}
			

function LimittextCounterWithoutDestination(field,maxLimit)
	{
		var Srcfield = document.getElementById(field);
			if (Srcfield != null)
			{
				if (Srcfield.value.length + 1 > maxLimit) 
				{
					Srcfield.value = Srcfield.value.substring(0, maxLimit);
					return false; 
				}
				return true; 
			}
	}
	
	
