function checkall(objForm){
	
	len = objForm.elements.length;
	var i=0;
	for( i=0 ; i<len ; i++) {
		if (objForm.elements[i].type=='checkbox') {
			objForm.elements[i].checked=objForm.check_all.checked;
			
		}
	}
}

function CheckColorAll(objForm){
	
	len = objForm.elements.length;
	var i=0;
	for( i=0 ; i<len ; i++) {
		if (objForm.elements[i].type=='checkbox') {
			objForm.elements[i].checked=objForm.check_all.checked;
			var box = "bg_ar"+i+"_box";
			var id = "bg_ar"+i;
			//changecolorall ('bg_ar'+i+'_box', 'bg_ar'+i);
			if (document.getElementById(box).checked == true) {
				document.getElementById(box).checked = false;
			}
			else {
				document.getElementById(box).checked = true;
			}
			changecolorall ('bg_ar'+i+'_box', 'bg_ar'+i);
			
			
		}
	}
}
function changecolorall (box, id) {
		//alert (document.getElementById(box));
		if (document.getElementById(box).checked == true) {
			var col = "#E1E1FF"; 
		
		}
		else  {
			var col = "";
		}
		document.getElementById(id).style.backgroundColor= col;	
	
}

function changecolor (box, id) {
		
			//alert (document.getElementById(box).checked);
			if (document.getElementById(box).checked == true) {
				var col = "#E1E1FF"; 
				
			}
			else  {
				var col = "";
			}
			document.getElementById(id).style.backgroundColor= col;
		
	
	}

function confirm_submit(objForm) {
	return true;
}

function openwin1(file,Iwidth,Iheight) {
      var newWin1=window.open(file,'nWin2','x=0,y=0,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes, copyhistory=no,width='+Iwidth+',height='+Iheight+',screenX=0,screenY=0,left=20,top=20');
}

function deleteConfirmFromUser(name) {		
	//alert("aaaaaa");
	if(validcheck(name)==true) {
		if(confirm("Are you sure you want to delete the record?")) {
			return true;  
		} else  {
			return false;  
		}
	}
	else if(validcheck(name)==false) {
		alert("Select at least one check box.");		
		return false;
	}
}

function activateConfirmFromUser(name)
{		
	////////alert("aaaaaa");
	if(validcheck(name)==true)
	{
		if(confirm("Are you sure you want to activate the record?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}
	}
	else if(validcheck(name)==false)
	{
		alert("Select at least one check box.");		
		return false;
	}
}

function deactivateConfirmFromUser(name)
{		
	////////alert("aaaaaa");
	if(validcheck(name)==true)
	{
		if(confirm("Are you sure you want to deactivate the record?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}
	}
	else if(validcheck(name)==false)
	{
		alert("Select at least one check box.");		
		return false;
	}
}

