/*******************************************************************************************************/
/*                                                                                                     */
/* The email subscription block verification... not a jquery but thrown in here for making life easier */
/*                                                                                                     */
/*******************************************************************************************************/

function verifyRequired10182() {
  var icpForm10182 = document.getElementById('icpsignup10182');
  if (document.location.protocol === "https:")	icpForm10182.action = "https://app.icontact.com/icp/signup.php";
  if (icpForm10182["fields_email"].value == "") {
    icpForm10182["fields_email"].focus();
    alert("The Email field is required.");
    return false;
  }
  if (icpForm10182["fields_fname"].value == "") {
    icpForm10182["fields_fname"].focus();
    alert("The First Name field is required.");
    return false;
  }
  if (icpForm10182["fields_lname"].value == "") {
    icpForm10182["fields_lname"].focus();
    alert("The Last Name field is required.");
    return false;
  }
  return true;
}

/*******************************************************************************************************/
/*                                                                                                     */
/* The email to a friend function... not a jquery but thrown in here for making life easier            */
/*                                                                                                     */
/*******************************************************************************************************/

function emailPage() {
  var docTitle = "%22" + document.title + "%22";
  var docUrl = document.URL + "%3Femail";
  var docDescr = getDescription ();
  var docBody1 = "I thought that the following document found on the website of Great 100 Nurses of Northeast Florida would be of interest to you%2E%0A%0A      Title%3A%20";
  var docBody2 = "%0ADescription%3A%20%0A";
  var docBody3 = "%0A   Location%3A%20";
  var docBody4 = "%0A%0AThe Great 100 Nurses of Northeast Florida is an organization dedicated to the recognition of nursing excellence%2C scholarships for students and professional development and, resources for the nursing professional%2E Their website is located at%3A http%3A%2F%2Fwww%2Egreat100nurses%2Eorg%2E";
  var docSubj = "A page of interest from the Great 100 Nurses of Northeast Florida website"
  var mailtoS = "mailto:?" + "subject=" + docSubj + "&Body=" + docBody1 + docTitle + docBody3 + docUrl + docBody2 + docDescr + docBody4;
  return mailtoS;
}
function getDescription () {
  var metaElements = document.all ?
    document.all.tags('Meta') :
    document.getElementsByTagName ?
    document.getElementsByTagName ('Meta') : new Array();
  var metaDescription = new Array();
  var i = 0;
  for (var m = 0; m < metaElements.length; m++)
    if (metaElements[m].name == 'Description')
      metaDescription[i++] = metaElements[m].content;
  if (metaDescription == '')
    metaDescription = "%3CNo Description Available from the Website%3E";
  return metaDescription;
}

/*******************************************************************************************************/
/*                                                                                                     */
/* If Javascript is active, this inserts the email to a friend button                                  */
/*                                                                                                     */
/*******************************************************************************************************/

$(document).ready(function(){
	$("#mrightcol").prepend('<div id="email"><a href="' + emailPage() + '" class="semail">Email to a Friend</a></div>');
});