
var value = "unCheck";
	
function checkAndUncheckAll(fieldName){
  

	if(value == "unCheck"){
   	  for(var i=0; i<fieldName.length; i++){
		fieldName[i].checked = true;
	  }
	  value = "check";
	
	}else if(value == "check"){
   	  for(var i=0; i<fieldName.length; i++){
		fieldName[i].checked = false;
          }
	  value="unCheck";

	}
	
	 el = document.getElementById("select");
	if (el.style["display"] == 'block')
	   el.style["display"] = 'none';
	else
		el.style["display"] = 'block';
	 ell = document.getElementById("unSelect");
	if (ell.style["display"] == 'block')
	   ell.style["display"] = 'none';
	else
	   ell.style["display"] = 'block';
	
 }




function showSelected(){

	document.searchSel.submit();
}

function clearForm(frmName){

	if(frmName == "alphaSrch"){
		document.alphaSrch.clear();
	
	}else if(frmName == "enrolleeSrch"){
		document.enrolleeSrch.clear();
		
	}
	return false;
}

function formSubmit(frmName, value){

	if(frmName == "rpSearchForm"){
		if(document.rpSearchForm.txn.value == "ntfSubmission")
			document.rpSearchForm.action = "pebDetailRP.do?param=processRP";
		else	
			document.rpSearchForm.action = "pebDetailRP.do?param=processRP";
		document.rpSearchForm.submit();
		
	}
	else if(frmName == "alphaSrch"){
		document.alphaSrch.submit();

	}else if(frmName == "enrolleeSrch"){
		document.enrolleeSrch.submit();
	
	}else if(frmName == "enrolleeDup"){
		if(value == "CLAIMSTATUS"){
			document.enrolleeDup.action="pebEnrolleeDup.do?param=processDuplicates";
			document.enrolleeDup.submit();
		
		}else if(value == "notification_status"){
	
			document.enrolleeDup.action="pebEnrolleeDup.do?param=processDuplicates";
			document.enrolleeDup.submit();
		
		}else if(value =="CLAIMRESEARCH"){
			document.enrolleeDup.action="pebEnrolleeDup.do?param=processDuplicates";
			document.enrolleeDup.submit();
		
		}else{
			document.enrolleeDup.action="pebEnrolleeDup.do?param=processDuplicates";
			document.enrolleeDup.submit();
		}
	
	}else if(frmName == "alphaDup"){
	
	
		if(value == "CLAIMSTATUS"){
			document.alphaDup.action ="pebAlphaDup.do?param=processDuplicates&txn=CLAIMSTATUS";
			document.alphaDup.submit();
		
		}else if(value == "notification_status"){
	
			document.alphaDup.action ="pebAlphaDup.do?param=processDuplicates&txn=notification_status";
			document.alphaDup.submit();
		
		}else if(value =="CLAIMRESEARCH"){
			document.alphaDup.action ="pebAlphaDup.do?param=processDuplicates&txn=CLAIMRESEARCH";
			document.alphaDup.submit();
		
		}else{
			document.alphaDup.action = "pebAlphaDup.do?param=processDuplicates";
			document.alphaDup.submit();	
		}	
	

	
	}else if(frmName == "enrolleeSummary"){
		var actionValue = "";
		
		if(value == 'button'){
			actionValue = "pebDetailSummary.do?param=processDetail";
			if(document.enrolleeSummary.txn.value=="ntfSubmission"){
				actionValue= actionValue+"&txn=ntfSubmission";
			}
			
			document.enrolleeSummary.action = actionValue;
			document.enrolleeSummary.submit();
		}else{
		
			actionValue = "pebDetail.do?param=processDetail";
			if(document.enrolleeSummary.txn.value=="ntfSubmission"){
				actionValue= actionValue+"&txn=ntfSubmission";
			}
			document.enrolleeSummary.memberId.value=value;
			document.enrolleeSummary.action=actionValue;
			document.enrolleeSummary.submit();
		}
	
	}else if(frmName == "detailForm"){
	
		document.detailForm.buttonName.value = value;
		document.detailForm.submit();
	}
	else if(frmName == "rpSearchForm"){
	
		document.rpSearchForm.submit();
	}else if(frmName == "rpDetail"){
	
		document.rpDetail.submit();
	}else if(frmName == "nextDetail"){
	
		document.nextDetail.submit();
	
	}
	
	
}
	
	function formSelect(frmName, page){
	
		if(frmName == "pageSelect"){
			document.pageSelect.page.value = page;
			document.pageSelect.submit();
		}
	}

	function sortBy(col) 
 	{
 		var lastSortCol = document.enrolleeSummary.PRIM_KEY.value;
 		var lastSortOrder =document.enrolleeSummary.ASC_SORT.value;
 		
 		 
 				
 		if (col == lastSortCol && lastSortOrder == "true") 
 		{
 			document.enrolleeSummary.ASC_SORT.value = "false";
 		} 
 		else 
 		{
 		    document.enrolleeSummary.PRIM_KEY.value=col;
 			document.enrolleeSummary.ASC_SORT.value = "true";
 		}
 		
 		document.enrolleeSummary.action="pebSort.do?param=processSort";
 		document.enrolleeSummary.submit();

 	}
 
 
 


        function NewWindow(mypage, myname, w, h, scroll) {
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
		win =window.open(mypage, myname, winprops)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}
		
	function submitForm() {
	
	   var myPage = document.IbaagPrime.PAGE.options[document.IbaagPrime.PAGE.selectedIndex].value;
		
	    if (myPage == "0"){	
	    
	        return false;
	        
	     }else {
	     
		var myURL = "benefitsDetail.do?PAGE="+myPage;		   	
	        NewWindow(myURL ,'primeibaag','740','650','yes','yes');
	    }	                 
	 }
	 
	 function NewWindow(mypage, myname, w, h, scroll) {
		 var winl = (screen.width - w) / 2;
		 var wint = (screen.height - h) / 2;
		 winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
		 window.open(mypage, myname, winprops)
	 }
	 
	 function getNewWindow(myURL, myPage, myH, myT) {
	        
	     NewWindow(myURL ,myPage, myH, myT,'yes','yes');
	                  
	 }
	 
	 
	 function submitOnEnter(pressed_key, frm) 
	 { 
	 	  
	 	if(pressed_key==13) 
	 	  frm.submit(); 
	 	 
	} 




	function selectPEBSearch(form){
		form.action = "pebPostLogin.do?param=processInPostLogin";
		form.submit();
	}
 
 	
 	
