function checkemail(f_name){
	var str =$("input[name="+f_name+"]").val();
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str)){
		return true;
	}
	else{
		alert("Please input a valid email address!")
		return false;
	}
}

function validate_fields_input(f_name,msg){
	if(!$("input[name="+f_name+"]").val()){
		alert(msg+" is required field");
		return false;
	}
	else{
		return true;
	}
		
}
function validate_fields_select(f_name,msg){
	if(!$("select[name="+f_name+"]").val()){
		alert(msg+" is required field");
		return false;
	}
	else{
		return true;
	}
		
}
function validateZIP(fld)  {
	 var field=$("input[name="+fld+"]").val();
	var valid = "0123456789-";
	var hyphencount = 0;

	if (field.length!=5 && field.length!=10) {
	alert("Please enter your 5 digit or 5 digit+4 zip code.");
		return false;
	}
	for (var i=0; i < field.length; i++) {
		temp = "" + field.substring(i, i+1);
		if (temp == "-") hyphencount++;
		if (valid.indexOf(temp) == "-1") {
			alert("Invalid characters in your zip code.  Please try again.");
			return false;
		}
		if ((hyphencount > 1) || ((field.length==10) && ""+field.charAt(5)!="-")) {
			alert("The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'.   Please try again.");
			return false;
		}
	}
	return true;
}  

function validate_phone(fld) {
	var strng= $("input[name="+fld+"]").val();
	var stripped = strng.replace(/[\(\)\.\-\ ]/g,'');
	//strip out acceptable non-numeric characters
	if (isNaN(parseInt(stripped))) {
	   alert( "The phone number contains illegal characters.");
	   return false;
	}
	if (!(stripped.length == 10)) {
		alert("The phone number is the wrong length. Make sure you included an area code.\n");
		return false;
	}
    
return true;
}
function ajaxFunction(url,place)
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  //var rad = document.getElementById("radio");
  
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
      document.getElementById(place).innerHTML = xmlHttp.responseText;
      }
    }
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }
function openWin(url) {
	var w_left = Math.ceil(screen.width/2-300);
	var openWin = window.open(url,"VoteWin","left="+w_left+",top=30,scrollbars=no,menubar=no,height=450,width=600,resizable=yes,toolbar=no,location=no,status=no"); 
	openWin.focus();
}
<!-- BEGIN Panel InfoJavaScriptPanel -->
function show(divID) {
	document.getElementById('div'+divID).style.visibility = "visible"; 
} 
function hide(divID) { 
	document.getElementById('div'+divID).style.visibility = "hidden";
}

