var xmlhttp=false;
var pageResponse=null;
var rootdomain="http://"+window.location.hostname;
var displayName;
var response;

<!-- ############################################################################### -->

function openPictureWindow_Video(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01
	var imageWidth2 = 700;
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><head>');
	newWindow.document.write('<meta http-equiv="imagetoolbar" content="no">');
	newWindow.document.write('<title>'+alt+'</title>');
	newWindow.document.write('<script language="JavaScript">');
	newWindow.document.write('var message="Function Disabled!";');
	newWindow.document.write('function clickIE() {if (document.all) {alert(message);return false;}}');
	newWindow.document.write('function clickNS(e) {if ');
	newWindow.document.write('(document.layers||(document.getElementById&&!document.all)) {');
	newWindow.document.write('if (e.which==2||e.which==3) {alert(message);return false;}}}');
	newWindow.document.write('if (document.layers) ');
	newWindow.document.write('{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}');
	newWindow.document.write('else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}');
	newWindow.document.write('document.oncontextmenu=new Function("return false")');
	newWindow.document.write('</script>');
	newWindow.document.write('</head>');
	newWindow.document.write('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">');
	newWindow.document.write('<embed src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+'>');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

<!-- ############################################################################### -->

function GetXmlHttpObject()
{
   //Try to set up an IE XMLHTTP Request Object
   try {xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}
   catch (error)
   {
      try {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
      catch (error) {xmlhttp = false;}
   }

   //Try to set up Mozilla and Safari XMLHTTP Request Object
   if (!xmlhttp && typeof XMLHttpRequest!='undefined')
   {
      try {xmlhttp = new XMLHttpRequest();}
      catch (error) {xmlhttp=false;}
   }

   //Try to set up IceBrowser XMLHTTP Request Object
   if (!xmlhttp && window.createRequest)
   {
      try {xmlhttp = window.createRequest();}
      catch (error) {xmlhttp=false;}
   }

   return xmlhttp;
}

<!-- ############################################################################### -->

function getReturnInfo(theURL)
{
      xmlhttp=GetXmlHttpObject();
      if (xmlhttp==null) {alert ("Browser does not support HTTP Request"); return; }
      xmlhttp.open('GET', rootdomain+theURL, false);
      xmlhttp.send(null);

      return xmlhttp.responseText;
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function showVideo(videolink)
{
	ajaxpage(rootdomain+'/SexyVideoFiles/VideoPage.php?vlink='+videolink+'&aplay=1', 'youTubeVideoArea');
  ajaxpage(rootdomain+'/SexyVideoFiles/TotalCount.php', 'videoBannerHeaderTextRight');
//  document.getElementById('emailSent').innerHTML= "";
//  window.location = 'http://www.sexyvisions.net?vlink='+videolink;
//  checkCommentsOpen(videolink);
}

<!-- ############################################################################### -->

function setVideoLink(videolink)
{

   window.scrollTo(0,290);
 showVideo(videolink); 
/*	  ajaxpage(rootdomain+'/Advertisement/AdBanner.php', 'youTubeVideoArea');
   	setTimeout(function () {}, 3000);


   document.getElementById('youTubeVideoArea').style.display = "none";
   document.getElementById('youTubeVideoAreaEtology').style.display = "block";

   setTimeout(function () {
       document.getElementById('youTubeVideoAreaEtology').style.display = "none";
       document.getElementById('youTubeVideoArea').style.display = "block";
  	    showVideo(videolink);

 	}, 3000);
   var rand = Math.floor(Math.random()*3)+1;

   if (rand == 12)
   {
   	  ajaxpage(rootdomain+'/Advertisement/AdBanner.php', 'youTubeVideoArea');
//      document.getElementById('youTubeVideoArea').style.display = "none";
//      document.getElementById('youTubeVideoAreaEtology').style.display = "block";
   }
   else
   {
      showVideo(videolink);
   }*/
}

<!-- ############################################################################### -->

function setAllRelated(race, ethnicity, pageNum)
{
   var setAll = false;

   setEthnicityHeader(race, ethnicity, setAll);
   ajaxpage(rootdomain+'/SexyVideoFiles/AllRelatedVideoPage.php?rtype='+race+'&rowNav='+pageNum, 'relatedVideoArea');
}

<!-- #################### -->

function setEthnicityHeader(race, ethnicity, setAll)
{
   var setMoreLink;

	 document.getElementById('ethnicityHeaderText').innerHTML= ethnicity;

	 if (setAll)
	 {
	 	  setMoreLink = "<a href=\'javascript:setAllRelated("+race+",%27"+ethnicity+"%27,0)\'>[View All]</a>";
    	document.getElementById('ethnicityHeaderText2').innerHTML= setMoreLink;
	 }
	 else
	 {
	    document.getElementById('ethnicityHeaderText2').innerHTML= "";
	 }
}

<!-- #################### -->

function setMoreEthnicity(race, ethnicity, numRows)
{
	 var setAll;

   if (numRows < 33)
   {
      setAll = false;
   }
   else
   {
      setAll = true;
   }

   setEthnicityHeader(race, ethnicity, setAll);
   ajaxpage(rootdomain+'/SexyVideoFiles/RelatedVideoPage.php?rtype='+race, 'relatedVideoArea');
}

<!-- ############################################################################### -->

function setAllCategory(category, catHead, pageNum)
{
   var setAll = false;

   setEthnicityHeader(category, catHead, setAll);
   ajaxpage(rootdomain+'/SexyVideoFiles/AllRelatedCategoryVideoPage.php?ctype='+category+'&rowNav='+pageNum, 'relatedVideoArea');
}

<!-- #################### -->

function setCategoryHeader(category, catHead, setAll)
{
   var setMoreLink;

	 document.getElementById('ethnicityHeaderText').innerHTML= catHead;

	 if (setAll)
	 {
	 	  setMoreLink = "<a href=\'javascript:setAllCategory("+category+",%27"+catHead+"%27,0)\'>[View All]</a>";
    	document.getElementById('ethnicityHeaderText2').innerHTML= setMoreLink;
	 }
	 else
	 {
	    document.getElementById('ethnicityHeaderText2').innerHTML= "";
	 }
}

<!-- #################### -->

function setCategory(category, catHead, numRows)
{
	 var setAll;

   if (numRows < 33)
   {
      setAll = false;
   }
   else
   {
      setAll = true;
   }

   setCategoryHeader(category, catHead, setAll);
   ajaxpage(rootdomain+'/SexyVideoFiles/RelatedCategoryVideoPage.php?ctype='+category, 'relatedVideoArea');
}

<!-- ############################################################################### -->

function setTopOneHundred(hundredType, pageNum)
{
	 window.scrollTo(0,800);

   if (hundredType == 100)
   {
      document.getElementById('ethnicityHeaderText').innerHTML= "Top One Hundred Videos Viewed";
   }
   else
   {
      document.getElementById('ethnicityHeaderText').innerHTML= "Our Top One Hundred Rated Videos";
   }

   document.getElementById('ethnicityHeaderText2').innerHTML= "";
            ajaxpage(rootdomain+'/SexyVideoFiles/TopOneHundredVideoPage.php?ctype='+hundredType+'&rowNav='+pageNum, 'relatedVideoArea');

}

<!-- ############################################################################### -->

function refreshTopRated()
{
   ajaxpage(rootdomain+'/SexyVideoFiles/ShowFeaturedVideos.php', 'featureVideoList');
}


<!-- ############################################################################### -->

function refreshRecentAdd()
{
   ajaxpage(rootdomain+'/SexyVideoFiles/ShowRecentAddVideos.php', 'recentVideoAddAreaList');
}

<!-- ############################################################################### -->

function refreshSexyPhotos()
{
   ajaxpage(rootdomain+'/SexyVideoFiles/ShowSexyPhotos.php', 'sexyPhotosAreaList');
}

<!-- ############################################################################### -->

function showTopForty(numShow)
{
   if (numShow == 1)
   {
      document.getElementById('topVideoListShowMore').innerHTML= "<a href=\'javascript:showTopForty(2)\'>[See Next 24]</a>";
      ajaxpage(rootdomain+'/SexyVideoFiles/ShowTopVideos.php?start=0', 'topVideoList');
   }
   else
   {
      document.getElementById('topVideoListShowMore').innerHTML= "<a href=\'javascript:showTopForty(1)\'>[See First 24]</a>";
      ajaxpage(rootdomain+'/SexyVideoFiles/ShowTopVideos.php?start=24', 'topVideoList');
   }
}

<!-- ############################################################################### -->

function setAllFavorites(pageNum)
{
   document.getElementById('ethnicityHeaderText2').innerHTML= "";
   ajaxpage(rootdomain+'/SexyVideoFiles/AllFavoriteVideos.php?&rowNav='+pageNum, 'relatedVideoArea');
}

<!-- #################### -->

function Favorites(videolink, favType)
{
	 var showAll;
   var setMoreLink;

   xmlhttp=GetXmlHttpObject();
	 if (xmlhttp==null) {alert ("Browser does not support HTTP Request"); return; }

   if (favType < 3)
   {
      xmlhttp.open('get', rootdomain+'/SexyVideoFiles/FavoriteVideos.php?vlink='+videolink+'&action='+favType, false);
      xmlhttp.send(null);
   }
   else
   {
      document.getElementById('ethnicityHeaderText').innerHTML= "Your Favorites";

      xmlhttp.open('get', rootdomain+'/SexyVideoFiles/FavoriteVideos.php?vlink='+videolink+'&action=4', false);
      xmlhttp.onreadystatechange = function (){
   	     if (xmlhttp.readyState == 4)
         {
            if (xmlhttp.status == 200)
            {
               showAll = xmlhttp.responseText;

               if (showAll < 33)
               {
         	         document.getElementById('ethnicityHeaderText2').innerHTML= "";
	             }
               else
               {
	 	              setMoreLink = "<a href=\'javascript:setAllFavorites(0)\'>[View All]</a>";
    	            document.getElementById('ethnicityHeaderText2').innerHTML= setMoreLink;
               }

               ajaxpage(rootdomain+'/SexyVideoFiles/FavoriteVideos.php?vlink='+videolink+'&action=3', 'relatedVideoArea');
            }
         }
    	};

   xmlhttp.send(null);

   }
}

<!-- ############################################################################### -->

function addComment(videolink)
{
	 var app =  document.getElementById("addcomment");
	 var comments = app.comments.value;

	 if (comments == "")
	 {
      ViewAddComment(videolink, 0)
      return;
	 }

   xmlhttp=GetXmlHttpObject();
	 if (xmlhttp==null) {alert ("Browser does not support HTTP Request"); return; }

   xmlhttp.open('get', rootdomain+'/Comments/AddComment.php?vlink='+videolink+'&comments='+comments, false);
   xmlhttp.onreadystatechange = function (){
	    if (xmlhttp.readyState == 4)
      {
         if (xmlhttp.status == 200)
         {
            ViewAddComment(videolink, 0);
         }
      }
   };

   xmlhttp.send(null);
}

<!-- #################### -->

function checkCommentsOpen(videolink)
{
   xmlhttp=GetXmlHttpObject();
	 if (xmlhttp==null) {alert ("Browser does not support HTTP Request"); return; }

      xmlhttp.open('get', rootdomain+'/Comments/CheckCommentsOpen.php', false);
      xmlhttp.onreadystatechange = function (){
   	     if (xmlhttp.readyState == 4)
         {
            if (xmlhttp.status == 200)
            {
               comOpen = xmlhttp.responseText;

               if (comOpen == 1)
               {
         	         ViewAddComment(videolink, 0)
	             }
            }
         }
    	};

   xmlhttp.send(null);
}

<!-- #################### -->

function ViewAddComment(videolink, comType)
{
   var setMoreLink;

   document.getElementById('ethnicityHeaderText').innerHTML= "Video Comments";

   if (comType == 0)
   {
	 	  setMoreLink = "<a href=\'javascript:ViewAddComment(%27"+videolink+"%27,1)\'>[Add Comment]</a>";
      document.getElementById('ethnicityHeaderText2').innerHTML= setMoreLink;
      ajaxpage(rootdomain+'/Comments/VideoComments.php?vlink='+videolink+'&cbox='+comType, 'relatedVideoArea');
   }
   else
   {
      document.getElementById('ethnicityHeaderText2').innerHTML= "";
      ajaxpage(rootdomain+'/Comments/VideoComments.php?vlink='+videolink+'&cbox='+comType, 'relatedVideoArea');
   }
}

<!-- ############################################################################### -->

function RateItem(varItemId, varRating)
{
   var varOrigClassName = document.getElementById(varItemId).className;

   xmlhttp=GetXmlHttpObject();
	 if (xmlhttp==null) {alert ("Browser does not support HTTP Request"); return; }

      xmlhttp.open('get', rootdomain+'/SexyVideoFiles/RatingItem.php?item='+varItemId+'&rating='+varRating+'&classes='+varOrigClassName, false);
      xmlhttp.onreadystatechange = function (){
   	     if (xmlhttp.readyState == 4)
         {
            if (xmlhttp.status == 200)
            {
               ajaxpage(rootdomain+'/SexyVideoFiles/VideoRatingCount.php?vlink='+varItemId, 'ratingsCount');
               ReloadRating(xmlhttp);
            }
            else
          	{
               RatingError();
          	}
         }
    	};

   xmlhttp.send(null);
}

<!-- #################### -->

function ReadNameValuePairs(nameValuePair)
{
  var trimspaces = /(\s)+/;
  var returnData = new Array();
  var pairs      = nameValuePair.split('&');

  for (var i = 0; i < pairs.length; i++)
  {
    var pair = pairs[i].split('=');
    returnData[pair[0].replace(trimspaces, "")] = pair[1];
  }

  return returnData;
}

<!-- #################### -->

function ReloadRating(requestObj)
{
  var newlines   = /(\r\n|\r|\n)/;
  var returnData = ReadNameValuePairs(requestObj.responseText.replace(newlines, ""));

  document.getElementById(returnData['item']).className = returnData['classes'];
  var liObj = document.getElementById(returnData['item']).getElementsByTagName('a');

  for (var i = 0; i < liObj.length; i++)
  {
    liObj[i].onclick = function(){};
  }
}

<!-- #################### -->

function RatingError()
{
}

<!-- ############################################################################### -->

function Login(loginType)
{
   if (loginType == 1)
   {
       document.getElementById('videoBannerHeaderTextLeft').innerHTML= "Please Login....";
       ajaxpage(rootdomain+'/Login/LoginScreen.php', 'youTubeVideoArea');
   }
   else
   {
      if (loginType == 2)
      {
         document.getElementById('videoBannerHeaderTextLeft').innerHTML= "Retrieve Password....";
         ajaxpage(rootdomain+'/Login/GetPassword.php', 'youTubeVideoArea');
      }
      else
      {
         document.getElementById('videoBannerHeaderTextLeft').innerHTML= "Thanks For Registering....";
         ajaxpage(rootdomain+'/Login/NewUser.php', 'youTubeVideoArea');
      }
   }
}

<!-- #################### -->

function Logout()
{
	 var setMoreLink;

   ajaxpage(rootdomain+'/Login/Logout.php', 'youTubeVideoArea');
   document.getElementById('videoBannerHeaderTextLeft').innerHTML= "Logging Out...";
   document.getElementById('logoutEditText').innerHTML="";

	 setTimeout(function ()
	            {
            	   setMoreLink = "<a href=\'javascript:Login(1)\'>Login</a> [<a href=\'javascript:Login(3)\'>Register</a>]";
                 document.getElementById('videoBannerHeaderTextLeft').innerHTML= setMoreLink;
	 	          }, 5000);
}

<!-- ############################################################################### -->

function textCounter(field, countfield, maxlimit)
{
   if (field.value.length > maxlimit)
   {
      field.value = field.value.substring(0, maxlimit);
   }
   else
   {
      countfield.value = maxlimit - field.value.length;
   }
}

<!-- ############################################################################### -->

function checkemail(eemail,vemail){

   var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

   eemail.value = eemail.value.toLowerCase();
   vemail.value = vemail.value.toLowerCase();

   if (filter.test(eemail.value))
   {
      emailgood=true;
      clearErrorMessage('emessage');

      if (vemail.value != "")
      {
      	  verifyemail(eemail,vemail);
      }
   }
   else
   {
      submitErrorMessage('emessage',invalidemail);
      emailgood=false;
   }
    return (emailgood);
}

<!-- ############################################################################### -->

function verifyemail(eemail,vemail)
{
   var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

   eemail.value = eemail.value.toLowerCase();
   vemail.value = vemail.value.toLowerCase();

   if (filter.test(vemail.value))
   {
	    if (eemail.value == vemail.value)
	    {
         verifygood=true;
         clearErrorMessage('vmessage');
	    }
	    else
	  	{
         submitErrorMessage('vmessage',invalidverify);
         verifygood=false;
	    }
	 }
	 else
	 {
      submitErrorMessage('vmessage',invalidemail);
      emailgood=false;
	 }
   return (verifygood);
}

<!-- ############################################################################### -->

var xmlhttp=false;
var pageResponse=null;

function checkSecurity(s_code)
{
	    var security_code = s_code.value;

      xmlhttp=GetXmlHttpObject();
      if (xmlhttp==null) {alert ("Browser does not support HTTP Request"); return; }
      xmlhttp.open('get', rootdomain+'/phpClasses/ApexV_Security.php?security_code='+security_code, false);

      xmlhttp.onreadystatechange = function (){
   	     if (xmlhttp.readyState == 4)
         {
            if (xmlhttp.status == 200)
            {
               security = xmlhttp.responseText;

               if (security == 1)
               {
                  securitygood=true;
                  clearErrorMessage('securitym');
               }
               else
               {
                  submitErrorMessage('securitym',invalidsecurity);
                  securitygood=false;
               }
            }
         }
    	};
      xmlhttp.send(null);

      return(securitygood);
}

<!-- ############################################################################### -->

function checkContactOtherFields()
{
   var app =  document.getElementById("modelApp");

   otherfieldsgood=true;

   if (app.firstname.value =="")   {otherfieldsgood=false; submitErrorMessage('firstnamem',invalidentry);} else {clearErrorMessage('firstnamem');}
   if (app.lastname.value =="")    {otherfieldsgood=false; submitErrorMessage('lastnamem',invalidentry);}  else {clearErrorMessage('lastnamem');}
   if (app.email.value =="")       {otherfieldsgood=false; submitErrorMessage('emessage',invalidentry);}   else {checkemail(app.email,app.emailverify);}
   if (app.emailverify.value =="") {otherfieldsgood=false; submitErrorMessage('vmessage',invalidentry);}   else {verifyemail(app.email,app.emailverify);}
   if (app.phone.value =="")       {otherfieldsgood=false; submitErrorMessage('pmessage',invalidentry);}   else {checkPhone(app.phone);}
   if (app.address.value =="")     {otherfieldsgood=false; submitErrorMessage('addressm',invalidentry);}   else {clearErrorMessage('addressm');}
   if (app.city.value =="")        {otherfieldsgood=false; submitErrorMessage('citym',invalidentry);}      else {clearErrorMessage('citym');}
   if (app.state.value =="")       {otherfieldsgood=false; submitErrorMessage('statem',invalidentry);}     else {clearErrorMessage('statem');}
   if (app.zipcode.value =="")     {otherfieldsgood=false; submitErrorMessage('zmessage',invalidentry);}   else {checkZipCode(app.zipcode);}
   if (app.country.value =="")     {otherfieldsgood=false; submitErrorMessage('countrym',invalidentry);}   else {clearErrorMessage('countrym');}
   if (app.source.value =="")      {otherfieldsgood=false; submitErrorMessage('sourcem',invalidentry);}    else {clearErrorMessage('sourcem');}
   if (app.contact.value =="")     {otherfieldsgood=false; submitErrorMessage('contactm',invalidentry);}   else {clearErrorMessage('contactm');}
   if (app.security_code.value ==""){otherfieldsgood=false; submitErrorMessage('securitym',invalidentry);}   else {checkSecurity(app.security_code);}

}

<!-- ############################################################################### -->

var goodSubmit;
function confirmContactSubmit()
{
	//idform = document.modelapp;

	checkContactOtherFields();

  if ((emailgood) && (verifygood) && (phonegood) && (zipcodegood) && (otherfieldsgood) && (securitygood))
	{
	   goodSubmit=true;
     //idform.submit();
	}
	else
	{
		 goodSubmit=false;
	}
  return goodSubmit;
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->

var racelinkgood=true;
var linkgood=true;
var invalidelink = "Invalid YouTube Link";
var invalidentry = "Complete Required Item";
var errormessage = "Please Fix Error Indicated Above";

<!-- ############################################################################### -->
<!-- ############################################################################### -->

function checkboxlimit()
{
   var addvid =  document.getElementById("videoUpload");
   var limit = 4;

	 for (var i=0; i<addvid.elements.length; i++)
	 {
	    addvid.elements[i].onclick=function()
		  {
		     var checkedcount=0;

		     for (var i=0; i<addvid.elements.length; i++)
		     {
			      checkedcount+=(addvid.elements[i].checked)? 1 : 0;
			   }

  	     if (checkedcount>limit)
		     {
			      this.checked=false
			   }
		  }
   }
}

<!-- ############################################################################### -->

function checkRaceLink()
{
   var app =  document.getElementById("videoUpload");

   racelinkgood=true;

   if (app.race.value =="")      {racelinkgood=false; submitErrorMessage('raceerror',invalidentry);} else {clearErrorMessage('raceerror');}
   if (app.videolink.value =="") {racelinkgood=false; submitErrorMessage('linkerror',invalidentry);} else {clearErrorMessage('linkerror');}

}

<!-- ############################################################################### -->

function checkvideolink(videolink)
{
   var linkvalue = videolink.value.substr(29,2);

   linkgood=true;

   if (linkvalue !="v=")
   {
      linkgood=false;
      submitErrorMessage('linkerror',invalidelink);
   }
   else
   {
      clearErrorMessage('linkerror');
   }

}

<!-- ############################################################################### -->

function clearErrorMessage(messageArea)
{
	document.getElementById(messageArea).innerHTML= "";

  if ((racelinkgood) && (linkgood))
  {
  	  document.getElementById('erroralert').innerHTML= "";
  }
}

<!-- ############################################################################### -->

function submitErrorMessage(messageArea,message)
{
     document.getElementById(messageArea).innerHTML= message;
     document.getElementById(messageArea).style.color="red";

     document.getElementById('erroralert').innerHTML= errormessage;
     document.getElementById('erroralert').style.color="red";
}

<!-- ############################################################################### -->

function confirmSubmit()
{
	//idform = document.modelapp;

	checkRaceLink();

  if ((racelinkgood) && (linkgood))
	{
	   goodSubmit=true;
     //idform.submit();
	}
	else
	{
		 goodSubmit=false;
	}
  return goodSubmit;
}

<!-- ############################################################################### -->

function setEmptyFriends(friendsValue)
{
	  if (document.getElementById(friendsValue).value == "Enter Email Addresses Seperated By Commas")
	     { document.getElementById(friendsValue).value="";}
}

<!-- ############################################################################### -->

function sendEmail(videolink)
{
	 var app;
	 var friends;
	 var emailaddresses;
	 var elength;
   var theURL;
   var esend;

	 if (videolink == "")
	 {
     document.getElementById('emailSent').innerHTML= "Please Select A Video First To Email!!!";
	 }
	 else
	 {
      app =  document.getElementById("emailFriend");
	    friends = app.emailfriends.value;

    	if ((friends == "") || (friends == "Enter Email Addresses Seperated By Commas"))
	    {
         document.getElementById('emailSent').innerHTML= "Please enter an email address.  Try again!!!";
	    }
      else
    	{
	       emailaddresses = friends.split(",");
	       elength =emailaddresses.length;
	       if (elength > 4){elength = 4;}

	       for (i=0; i<elength; i++)
	       {
	          if (checkemailSend(emailaddresses[i])== true)
	          {
               theURL = "/EmailVideoSend.php?emailaddress="+emailaddresses[i]+"&videolink="+videolink;
               esend = getReturnInfo(theURL);
               document.getElementById('emailSent').innerHTML= "Thanks For Emailing This Video To Your Friend(s)!!!";
//             document.getElementById('emailSent').innerHTML= esend;
	          }
	       }

      }
   }

    document.getElementById('emailfriends').value= "Enter Email Addresses Seperated By Commas";
  	setTimeout(function () { document.getElementById('emailSent').innerHTML= ""; }, 5000);
}

<!-- ############################################################################### -->

var invalidemailSend = "Invalid Email Address";

function checkemailSend(eemail)
{
   var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

   eemail = eemail.toLowerCase();

   if (filter.test(eemail))
   {
      emailgood=true;
   }
   else
   {
      emailgood=false;
   }
    return (emailgood);
}
