	function isEmpty(fname)
	{
		invalid = " ";
	
		flag = 1;
		for(ttt=0;ttt<fname.value.length;ttt++)
		{
			if(fname.value.charAt(ttt)!=invalid)
			{
				//alert('sdf');
				break;
			}
		}
		if(ttt==fname.value.length) flag = 0;
		if(flag==0) return true;
		if((fname.value=="") ||(fname.value==invalid))
			return true;
		else
			return false;
	}
	function CheckAll(frmNam)
	{
		var intCounter = 0 ;
		var tot=0;
		tot = eval("document."+frmNam+".elements."+"length");
		box = eval("document."+frmNam+".elements");
		tot = tot - 1;
		var intCounter = 0 ;
		for(intCounter=0;intCounter<=tot;intCounter++) 
		{
			if(box[intCounter].type=="checkbox")
			{
				box[intCounter].checked=true;
			} 
		} 
			
	}
	
	function goCan(loc)
	{
		window.location = loc;
	}
	
	function ClearAll(frmNam)
	{
		var intCounter = 0 ;
		var tot=0;
		tot = eval("document."+frmNam+".elements."+"length");
		box = eval("document."+frmNam+".elements");
		tot = tot - 1;
		var intCounter = 0 ;
		for(intCounter=0;intCounter<=tot;intCounter++) 
		{
			if(box[intCounter].type=="checkbox")
			{
				box[intCounter].checked=false;
			} 
		} 
			
	}
	/*function CheckAll(frmNam)
	{
		var intCounter = 0 ;
		var tot=0;
		tot = eval("document."+frmNam+".elements."+"length");
		box = eval("document."+frmNam+".elements");
		tot = tot - 1;
		var intCounter = 0 ;
		for(intCounter=0;intCounter<=tot;intCounter++) 
		{
			if(box[intCounter].type=="checkbox")
			{
				box[intCounter].checked=true;
			} 
		} 
			
	}
	
	function ClearAll(frmNam)
	{
		var intCounter = 0 ;
		var tot=0;
		tot = eval("document."+frmNam+".elements."+"length");
		box = eval("document."+frmNam+".elements");
		tot = tot - 1;
		var intCounter = 0 ;
		for(intCounter=0;intCounter<=tot;intCounter++) 
		{
			if(box[intCounter].type=="checkbox")
			{
				box[intCounter].checked=false;
			} 
		} 
			
	}*/
	
	function DeleteChecked(cnt,formname,page)
	{
		var flag = 0;
		fname = eval("document."+formname);
		//alert("JJ"); return;
		for(j=1;j<=cnt;j++)
		{
			box = eval("document."+formname+".unchk" + j);
			//alert(box.value);
			if(box.checked == true)
			{
				flag = 1;
				break;
			}
		}
		if(flag==0) //if any item not selected
		{
			if(cnt==0) alert("No record to delete");
			else alert("Please select record to delete");
		}
		else
		{
			var ids = "";
			var x = confirm("Are you sure you want to delete?");
			if(x) //to delete selected menu and its submenus
			{
				for(j=1;j<=cnt;j++)
				{
					box = eval("document."+formname+".unchk" + j);
					//alert(box.value);
					if(box.checked == true)
						ids = ids + box.value + ",";
				}
				ids = ids.substring(0,ids.length-1);
				fname.appid.value = ids;
				fname.action = page;
				fname.submit();
			}
			else
			{
				for(j=1;j<=cnt;j++)
				{
					box = eval("document."+formname+".unchk" + j);
					box.checked = false;
				}
			}
		}
	}
	
	
