// JavaScript Document
// JavaScript Document
function checkEditgroups(form){
                 theform=document.frmgrp;
				  if (theform.groupname.value==""){ 
                     alert("Group Name is required")
                     theform.groupname.focus()
                     return false;
                }
				if ((!theform.choose[0].checked) && (!theform.choose[1].checked)){
						alert("Either Zipcode or Country is required!")
						return false;
				}
					if(theform.choose[0].checked){
							if (theform.zipcode.value==""){
							 alert("Zipcode is required!")
							 theform.zipcode.focus()
							 return false;
						}
						
						if (isNaN(theform.zipcode.value)){ 
							 alert("Zipcode must be number!")
							 theform.zipcode.focus()
							 return false;
						}			
						if ((theform.zipcode.value).length<5){ 
							 alert("Zipcode must be five digit number!")
							 theform.zipcode.focus()
							 return false;
						}
				}
				if(theform.choose[1].checked){
							if (theform.country.value==""){
							 alert("Country is required!")
							 theform.country.focus()
							 return false;
						}
							if (!isNaN(theform.country.value)){ 
							 alert("Country should not be number!")
							 theform.country.focus()
							 return false;
						}	
				}	
					 if (theform.city.value==""){ 
                     alert("City is required!")
                     theform.groupcategory.focus()
                     return false;
                }
                     if (theform.groupcategory.value==""){ 
                     alert(" Choose Groups Category!")
                     theform.groupcategory.focus()
                     return false;
                }
                     if (theform.message_box.value==""){ 
                     alert("Group detail is required!")
                     theform.message_box.focus()
                     return false;
                }
				 
}
