function checkForm(form) {
	  var err = 0;
	  //Populate the array with all the page tags
	  var allPageTags=document.getElementById(form).getElementsByTagName("*");
	  //Cycle through the tags using a for loop
	  for (i=0; i < allPageTags.length; i++) {
	  var req = /required/i;
	    //Pick out the tags with our class name
	    if (allPageTags[i].className.search(req) != -1) {
	    //Manipulate this in whatever way you want
	    err = checkText(allPageTags[i], err);
	    }
	  }
	  if (err == 1 || err == null){
	    alert("Please fill in all required fields!")
	    return false;
	  }else{
	    	return true;
	  }
	}
	function checkText(entry, err){
	  var str = entry.value;
	  str = str.replace(/\s+/g,'');
	  if(str == ''){
	    if(err == 0){
	    err = 1;
	    }
	    entry.style.border="2px solid red";
	    return err;
	  }
	  return err;
	}

  function socialLink(site, link){
    $("#social").val($("#social").val() + site + ",");
    window.open(link);
  }