function formCheck(){
	if (document.editProg1.Program_Name.value== "") {
		alert("Please select a Program to continue");
		document.editProg1.Program_Name.focus();
		return;
	}else if(document.editProg1.pw.value== "") {
		alert("Please enter your password");
		document.editProg1.pw.focus();
		return;
	}
	document.editProg1.submit();
}

function formCheck2(){
	count = 0;
	for (var i = 0; i < document.addTag.Common_Name.length; i++) {      
		if (document.addTag.Common_Name.options[i].selected == true) 
		{         
			count++;	
		}   

	}
	if(count > 12){
		alert("You can select upto 12 species. Please change your selections");
		document.addTag.Common_Name.focus();
		return;
	}
	count = 0;
	for (var i = 0; i < document.addTag.tag_color.length; i++) {      
		if (document.addTag.tag_color.options[i].selected == true) 
		{         
			count++;	
		}   

	}
	if(count > 4){
		alert("You can select upto 4 tag colors. Please change your selections");
		document.addTag.tag_color.focus();
		return;
	}
	
	count = 0;
	for (var i = 0; i < document.addTag.tag_color_hist.length; i++) {      
		if (document.addTag.tag_color_hist.options[i].selected == true) 
		{         
			count++;	
		}   

	}
	if(count > 4){
		alert("You can select upto 4 historically used tag colors. Please change your selections");
		document.addTag.tag_color_hist.focus();
		return;
	}

	count = 0;
	for (var i = 0; i < document.addTag.Tag_Code.length; i++) {      
		if (document.addTag.Tag_Code.options[i].selected == true) 
		{         
			count++;	
		}   

	}
	if(count > 3){
		alert("You can select upto 3 Tag Types . Please change your selections");
		document.addTag.Tag_Code.focus();
		return;
	}else if(count == 0){
		alert("You have to select atleast 1 Tag Type . Please make a selection");
		document.addTag.Tag_Code.focus();
		return;
	}
		count = 0;
	for (var i = 0; i < document.addTag.Attach_Code.length; i++) {      
		if (document.addTag.Attach_Code.options[i].selected == true) 
		{         
			count++;	
		}   

	}
	if(count > 3){
		alert("You can select upto 3 tag locations. Please change your selections");
		document.addTag.Attach_Code.focus();
		return;
	}
	if(document.addTag.Common_Name.value == ""){
		alert("Please specify the species that are tagged");
		document.addTag.Common_Name.focus();
		return;
	}else if(document.addTag.First_ST.value == ""){
		alert("Please specify First state");
		document.addTag.First_ST.focus();
		return;
	}else if(document.addTag.Last_ST.value == ""){
		alert("Please specify Last state");
		document.addTag.Last_ST.focus();
		return;
	
	}else if(document.addTag.Who_ID.value == ""){
		alert("Please specify who is allowed to tag");
		document.addTag.Who_ID.focus();
		return;
	}else if(document.addTag.pw.value == ""){
		alert("Please enter your password");
		document.addTag.pw.focus();
		return;
	}else if(document.addTag.comments.value.length > 150){
		alert("No. of characters permitted in the Comments field is limited to 150. Please edit your comments");
		document.addTag.comments.focus();
		return;
	}
	document.addTag.submit();
	
}

function check4SpChar(fieldName){
		doNotSubmit = 0;
		val=0;
		val2=0;
		
			
			val = fieldName.value.indexOf("\"");
			val2 = fieldName.value.indexOf("'");
			if(val != -1 || val2 != -1){
				
			
				doNotSubmit = 1;
				
			}
			

			if(doNotSubmit == 1){
					
					fieldName.focus();
					alert("The value you entered contains invalid characters. Invalid characters are  \" and '.");
					
			}
			
		
		return;
	}
