<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

var xmlhttp=false;
var pageResponse=null;
var rootdomain="http://"+window.location.hostname;
var displayName;
var response;
var bustcachevar=1; //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects="";
var bustcacheparameter="";

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

var zipcodegood=true;
var displaynamegood=true;
var birthdategood=true;
var jobdategood=true;
var webaddressgood=true;
var otherfieldsgood=true;
var securitygood=true;
var emailgood=true;
var messagegood=true;
var passwordgood=true;
var otherJobFieldsgood=true
var invalidentry = "Complete Required Item";
var invalidsecurity = "Invalid Security Code";
var invalidemail = "Invalid Email Address";
var invalidpassword = "Invalid Password";
var errormessage = "Please Fix Error Indicated Above";
var errorcount = 0;

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

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 ajaxpage(url, containerid)
{
   var page_request = new GetXmlHttpObject();

   page_request.onreadystatechange=function()
   {
      loadpage(page_request, containerid)
   }

   if (bustcachevar) //if bust caching of external page
   {
      bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
   }

   page_request.open('GET', url+bustcacheparameter, true)
   page_request.send(null)
}

<!-- ############################################################################### -->

function loadpage(page_request, containerid)
{
   if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
   {
      document.getElementById(containerid).innerHTML=page_request.responseText
   }
}

<!-- ############################################################################### -->

function ajaxcombo(selectobjID, loadarea)
{
   var selectobj=document.getElementById? document.getElementById(selectobjID) : ""

   if (selectobj!="" && selectobj.options[selectobj.selectedIndex].value!="")
   {
      ajaxpage(rootdomain+"/"+selectobj.options[selectobj.selectedIndex].value, loadarea)
   }
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function displayLoginArea(showType)
{
   if (showType == 1)
   {
      $("#loginArea").css("display","block");
   }
   else
   {
      $("#loginArea").css("display","none");
   }

}

<!-- #################### -->

function Login()
{
   $.ajax({
      type: "GET",
      url: rootdomain+"/Login/LoginScreen.php",
      success: function(msg){
      	$("#loginArea").html(msg);
      }
    });

   displayLoginArea(1);



}

<!-- #################### -->

function LoginFooter()
{
     window.scrollTo(0,230);
     Login();
}

<!-- #################### -->

function NewMember()
{
   $.ajax({
      type: "GET",
      url: rootdomain+"/Login/NewUser.php",
      success: function(msg){
      	$("#loginArea").html(msg);
      }
    });
   displayLoginArea(1);
}

<!-- #################### -->

function NewPassword()
{
   $.ajax({
      type: "GET",
      url: rootdomain+"/Login/GetPassword.php",
      success: function(msg){
      	$("#loginArea").html(msg);
      }
    });
   displayLoginArea(1);
}

<!-- #################### -->

function Logout()
{
   var theURL = "/Login/Logout.php";
   var logresponse = getReturnInfo(theURL);

   window.location = 'http://www.myglamourpics.com';
}

<!-- #################### -->

function HomePage()
{
   window.location = 'http://www.myglamourpics.com';
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function setTopPageArrows(pageNum, totalpages)
{
	 var setPageLink;
	 var top_page_left;
	 var top_page_right;

	 if (pageNum == 0)
	 {
      setPageLink = "<a href=\'javascript:;\' class=\'opacityit3\'><img src=\'http://www.myglamourpics.com/images/HelpImages2/ArrowLeft.jpg\' width=\'13\' height=\'13\' /></a>";
	 }
	 else
	 {
	 	top_page_left = pageNum - 1;
      setPageLink = "<a href=\'javascript:setTopViewedPage("+top_page_left+","+totalpages+")\' class=\'opacityit2\'><img src=\'http://www.myglamourpics.com/images/HelpImages2/ArrowLeft.jpg\' width=\'13\' height=\'13\' /></a>";
	 }

   document.getElementById('topNavImageLeft').innerHTML= setPageLink;

	 if (pageNum == totalpages)
	 {
      setPageLink = "<a href=\'javascript:;\' class=\'opacityit3\'><img src=\'http://www.myglamourpics.com/images/HelpImages2/ArrowRight.jpg\' width=\'13\' height=\'13\' /></a>";
	 }
	 else
	 {
	 	top_page_right = pageNum + 1;
      setPageLink = "<a href=\'javascript:setTopViewedPage("+top_page_right+","+totalpages+")\' class=\'opacityit2\'><img src=\'http://www.myglamourpics.com/images/HelpImages2/ArrowRight.jpg\' width=\'13\' height=\'13\' /></a>";
	 }

   document.getElementById('topNavImageRight').innerHTML= setPageLink;
   document.getElementById('topNavMoreArea').innerHTML= "More";

}

<!-- ############################################################################### -->

function setTopViewedPage(pageNum, totalpages)
{
   setTopPageArrows(pageNum, totalpages);
   ajaxpage(rootdomain+'/MyGlamourFiles/TopViewedImagesNew.php?setNum='+pageNum, 'topImageViewedArea');
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function refreshRecentAdd()
{
   ajaxpage(rootdomain+'/MyGlamourFiles/ShowRecentAddPhotosNew.php', 'recentAddedImages');
}

<!-- ############################################################################### -->

function refreshModelSpotlight()
{
   ajaxpage(rootdomain+'/MyGlamourFiles/ModelSpotlightNew.php', 'modelSpotLightArea');
}

<!-- ############################################################################### -->

function getModelProfileBrief()
{
   ajaxpage(rootdomain+'/MyGlamourFiles/ModelProfileBrief.php', 'profileBriefsWrap');
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function addShoutComment(userID,inserttype)
{
	var app =  document.getElementById("addshout");
	var comments = app.comments.value;
   var theURL;
   var ShoutCommentResponse;

	 if (comments == "")
	 {
      ViewAddShoutBox(userID, 0, 0)
      return;
	 }

   theURL = "/MyShoutFiles/AddShoutComment.php?userID="+userID+"&comments="+comments+"&inserttype="+inserttype;
   ShoutCommentResponse = getReturnInfo(theURL);

   if (ShoutCommentResponse == "Good") {ViewAddShoutBox(userID, 0, 0);}
}

<!-- #################### -->

function ViewAddShoutBox(userID,shoutType, setNum)
{
   var setMoreLink;

   if (shoutType == 0)
   {
	 	  setMoreLink = "[<a href=\'javascript:ViewAddShoutBox(%27"+userID+"%27,1,0)\'>Add Shout</a>]";
      document.getElementById('shoutText').innerHTML= setMoreLink;
      ajaxpage(rootdomain+'/MyShoutFiles/ShoutCommentsNew.php?userID='+userID+'&shoutType='+shoutType+'&setNum='+setNum, 'shoutOutArea');
   }
   else
   {
      document.getElementById('shoutText').innerHTML= "";
      ajaxpage(rootdomain+'/MyShoutFiles/ShoutCommentsNew.php?userID='+userID+'&shoutType='+shoutType+'&setNum='+setNum, 'shoutOutArea');
   }
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

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 viewImages(userType)
{
  if (userType == 3){window.scrollTo(0,1035);}else{window.scrollTo(0,705);}
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function getReplyForm(wallID,userID,loggedIN,discard)
{
    var theURL;
    var CheckOpenWallResponse;
    var wall_Open;
    var wall_Open_ID;

    theURL = "/MyWallFiles/WallOpenCheck.php";
    CheckOpenWallResponse = getReturnInfo(theURL);

    wall_Open    = CheckOpenWallResponse.substring(0,1);
    wall_Open_ID = CheckOpenWallResponse.substring(1);

    if (wall_Open == 1)
    {
     	discardWallReplyForm(wall_Open_ID);
    }

    document.getElementById('singleHomeWallWrapSmallReply'+wallID).style.display = "none";
    document.getElementById('singleHomeWallWrapLargeReply'+wallID).style.display = "block";

    ajaxpage(rootdomain+'/MyWallFiles/ReplyCommentFormNew.php?wallID='+wallID+'&userID='+userID+'&loggedIN='+loggedIN+'&discard='+discard, 'singleHomeWallLargeReply'+wallID);
}

<!-- ############################################################################### -->

function discardWallReplyForm(wallID)
{
    document.getElementById('singleHomeWallWrapSmallReply'+wallID).style.display = "block";
    document.getElementById('singleHomeWallWrapLargeReply'+wallID).style.display = "none";
}

<!-- ############################################################################### -->

function discardWallReplyOpen(wall_Open_ID)
{
    document.getElementById('singleHomeWallWrapSmallReply'+wall_Open_ID).style.display = "block";
    document.getElementById('singleHomeWallWrapLargeReply'+wall_Open_ID).style.display = "none";
}

<!-- ############################################################################### -->

function addWallReplyComment(wallID,userID,loggedIN,discard)
{
	 var app =  document.getElementById(wallID);
	 var wall_comments_reply = app.wall_comments_reply.value;
   var theURL;
   var addWallReplyResponse;
 	 var theWallFormID = "wallFormReply"+wallID;

	 app.wall_comments_reply.value = "";

	 if (wall_comments_reply == "")
	 {
     	discardWallReplyForm(wallID);
      return;
	 }

   wall_comments_reply = escape(wall_comments_reply);
    
   theURL = "/MyWallFiles/AddWallReplyComments.php?wallID="+wallID+"&userID="+userID+"&wall_comments_reply="+wall_comments_reply;
   addWallReplyResponse = getReturnInfo(theURL);

   if (addWallReplyResponse == "Good")
   {
      ajaxpage(rootdomain+'/MyWallFiles/ShowHomeWallUpdate.php?wallID='+wallID+'&userID='+userID+'&loggedIN='+loggedIN, 'wallSection'+wallID);
   }
}

<!-- ############################################################################### -->

function showAllComments(wallID,userID,loggedIN,setLimit)
{
	  if (setLimit == 0) setLimit="";
    ajaxpage(rootdomain+'/MyWallFiles/ShowHomeWallUpdate.php?wallID='+wallID+'&userID='+userID+'&loggedIN='+loggedIN+'&setLimit='+setLimit, 'wallSection'+wallID);
}

<!-- ############################################################################### -->

function showMyAllComments(wallID,userID,sessionUserID,loggedIN,setLimit)
{
	  if (setLimit == 0) setLimit="";
    ajaxpage(rootdomain+'/MyWallFiles/ShowMyWallUpdate.php?wallID='+wallID+'&userID='+userID+'&sessionUserID='+sessionUserID+'&loggedIN='+loggedIN+'&setLimit='+setLimit, 'wallSection'+wallID);
}

<!-- ############################################################################### -->

function showHideMyWallForms()
{
    document.getElementById('myWallPostFormLarge').style.display = "block";
    document.getElementById('myWallPostFormSmall').style.display = "none";
}

<!-- ############################################################################### -->

function discardMyWallForm()
{
 	  var app =  document.getElementById("LargeWallForm");
	  app.wall_comments.value = "";

    document.getElementById('myWallPostFormLarge').style.display = "none";
    document.getElementById('myWallPostFormSmall').style.display = "block";
}

<!-- ############################################################################### -->

function setEmptyWall(wallValue)
{
	  if (document.getElementById(wallValue).value == "Enter your thoughts....") { document.getElementById(wallValue).value="";}
}

<!-- ############################################################################### -->

function addWallComment(userID,sessionUserID,loggedIN)
{
	 var app =  document.getElementById("LargeWallForm");
	 var wall_comments = app.wall_comments.value;
   var theURL;
   var addWallResponse;

	 app.wall_comments.value = "";

	 if (wall_comments == "")
	 {
   	  discardMyWallForm();
      return;
	 }

   wall_comments = escape(wall_comments);

   theURL = "/MyWallFiles/AddWallCommentsNew.php?wall_comments="+wall_comments;
   addWallResponse = getReturnInfo(theURL);

   if (addWallResponse == "Good")
   {
      showWall(userID,sessionUserID,loggedIN);
      discardMyWallForm();
   }
}

<!-- ############################################################################### -->

function showWall(userID,sessionUserID,loggedIN)
{
   ajaxpage(rootdomain+'/MyWallFiles/ShowMyWallNew.php?userID='+userID+'&sessionUserID='+sessionUserID+'&loggedIN='+loggedIN, 'theWallComments');
}

<!-- ############################################################################### -->

function addTagComment(userID,sessionUserID,loggedIN)
{
	 var app =  document.getElementById("LargeWallForm");
	 var wall_comments = app.wall_comments.value;
   var theURL;
   var addWallResponse;

	 app.wall_comments.value = "";

	 if (wall_comments == "")
	 {
   	  discardMyWallForm();
      return;
	 }

   theURL = "/MyWallFiles/AddWallTagComments.php?userID="+userID+"&wall_comments="+wall_comments;
   addWallResponse = getReturnInfo(theURL);

   if (addWallResponse == "Good")
   {
      showWall(userID,sessionUserID,loggedIN);
      discardMyWallForm();
   }
}

<!-- ############################################################################### -->

function deleteWall(wallID,userID,loggedIN,actionType)
{
	 var theWallFormID = "removeWallItem"+wallID;
   var theURL;
   var deleteWallResponse;

	 switch(actionType)
	 {
	    case 1: document.getElementById(theWallFormID).style.display = "block"; break;
	    case 2:
              theURL = "/MyWallFiles/DeleteWallComments.php?wallID="+wallID;
              deleteWallResponse = getReturnInfo(theURL);

              if (deleteWallResponse == "Good")
              {
                 showWall(userID,userID,loggedIN);
              }

	    break;
	    case 3: document.getElementById(theWallFormID).style.display = "none"; break;
	 }
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function addToFriends(friendID, mtype)
{
   var theURL = "/MyAccountFiles/MyAccountFriends.php?friendID="+friendID+"&action=1";
   var friendsresponse = getReturnInfo(theURL);
   var messagearea;

   if (mtype == 1) {messagearea = 'friendFavoriteErrorArea';}else{messagearea = 'bioInfoErrorArea';}
     document.getElementById(messagearea).style.display = "block";
   if (friendsresponse  > 0)
   {
      if (mtype == 1) {document.getElementById('friendsLink').innerHTML = "[Add To Your Friends]";}
      errorMessage = "Friend Request Has Been Sent";
      document.getElementById(messagearea).innerHTML = errorMessage;
   }
   else
   {
       if (friendsresponse == -1)
      {
      	 errorMessage = "You Cannot Add Your Profile";
         document.getElementById(messagearea).innerHTML = errorMessage;
      }
      else
      {
         if (friendsresponse == -2)
         {
         	 errorMessage = "Profile Exists In Your Friends";
           document.getElementById(messagearea).innerHTML = errorMessage;
         }
         else
         {
      	    errorMessage = "A Friend Request Already Made";
            document.getElementById(messagearea).innerHTML = errorMessage;
         }
      }
   }
}

<!-- ############################################################################### -->

function friendsActionRequests(actionType)
{
   var theForm = document.getElementById("friendslist");
   var theFormElm;
   var friendID = new Array();
   var actionresponse;
   var cnt = 0;
   var theURL;
   var actionT;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
         if (theFormElm.checked == true)
         {
            friendID[cnt] = theFormElm.value;
            cnt++;
         }
      }
   }

   switch(actionType)
   {
      case 0: actionT = 0; break;
      case 1: actionT = 1; break;
      case 2: actionT = 2; break;
      case 3: document.getElementById('removeWallItemVerify').style.display = "block";
              document.getElementById('messageButtonsWrap2').style.display = "none"; break;
      case 4: document.getElementById('removeWallItemVerify').style.display = "none";
              checkAllFriends(2); break;
   }

   if (actionType < 3)
   {
      theURL = "/MyAccountFiles/MyAccountFriendsActions.php?friendID="+friendID+"&action="+actionT;
      actionresponse = getReturnInfo(theURL);
   }

   if (actionresponse == "Good")
   {
      window.location.reload();
   }
}

<!-- ############################################################################### -->

function inviteFriends(actionType)
{
	 var app;
	 var friends;
	 var emailaddressesHold  = new Array();
	 var emailaddresses      = new Array();
	 var elength;
   var theURL;
   var esend;
   var cnt = 0;

   if (actionType == 1)
   {
    	 app =  document.getElementById("inviteFriend");
	     friends = app.invitefriends.value;

   	   if (friends == "")
       {
           window.location = 'http://www.myglamourpics.com/Friends.php';
           return;
       }

       emailaddressesHold = friends.split(",");
       elength = emailaddressesHold.length;
       if (elength > 10){elength = 10;}

       for (i=0; i<elength; i++)
       {
     	    emailaddressesHold[i] = emailaddressesHold[i].replace(/ /gi,"");
          if (checkemail(emailaddressesHold[i])== true)
          {
             emailaddresses[cnt] = emailaddressesHold[i];
             cnt++;
          }
       }

       theURL = "/MyAccountFiles/MyAccountInviteSend.php?emailaddress="+emailaddresses;
       esend = getReturnInfo(theURL);

       if (esend == "Good")
       {
         window.location = 'http://www.myglamourpics.com/Friends.php';
       }
   }
   else
   {
      window.location = 'http://www.myglamourpics.com/Friends.php';
   }
}

<!-- ############################################################################### -->

function setEmptyFriends(friendsValue)
{
	  if (document.getElementById(friendsValue).value == "Enter Email Addresses Seperated By Commas")
	     { document.getElementById(friendsValue).value="";}
}

<!-- ############################################################################### -->

function setFriendsDeleteLink()
{
   var theForm = document.getElementById("friendslist");
   var theFormElm;
   var isChecked = false;
   var deleteLink;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
         if (theFormElm.checked == true)
         {
            isChecked = true;
         }
      }
   }

   if (isChecked == true)
   {
      document.getElementById('messageButtonsWrap2').style.display = "block";
   }
   else
   {
      document.getElementById('messageButtonsWrap2').style.display = "none";
   }

   document.getElementById('removeWallItemVerify').style.display = "none"

}

<!-- ############################################################################### -->

function checkAllFriends(checkAction)
{
   var theForm = document.getElementById("friendslist");
   var theFormElm;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
      	 if (checkAction == 1)
      	 {
             theFormElm.checked=true;
         }
         else
      	 {
             theFormElm.checked=false;
         }

      }
   }
   setFriendsDeleteLink();
}

<!-- ############################################################################### -->

function setNextPage(file_name,page_area,page_type,pageNum)
{
   if (page_type == 1)
   {
      ajaxpage(rootdomain+'/'+file_name+'?rowNav='+pageNum, page_area);
   }
   else
   {
      ajaxpage(rootdomain+'/'+file_name+'&rowNav='+pageNum, page_area);
   }
}

<!-- ############################################################################### -->

function friendsSort(userID,sortType)
{
   var theForm = document.getElementById("sortDirection");
   var theFormElm;
   var sortDiretion

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "radio" )
      {
         if (theFormElm.checked){sortDiretion = theFormElm.value;}
      }
   }

   ajaxpage(rootdomain+'/MyFriendsFiles/FriendsList.php?userID='+userID+'&sortType='+sortType+'&sortDiretion='+sortDiretion, 'showFriendsArea');

}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function addToFavorites(imagelink)
{
   var theURL = "/MyAccountFiles/MyAccountFavorites.php?imagelink="+imagelink+"&action=1";
   var favoriteresponse = getReturnInfo(theURL);
   var errorMessage;

   if (favoriteresponse > 0)
   {
      document.getElementById('favoritesLink').innerHTML = "[Add To Your Favorites("+favoriteresponse+")]";
      document.getElementById('friendFavoriteErrorArea').innerHTML = "Image Added To Your Favorites";
   }
   else
   {
      if (favoriteresponse == -1)
      {
      	 errorMessage = "You Cannot Add Your Images";
         document.getElementById('friendFavoriteErrorArea').innerHTML = errorMessage;
      }
      else
      {
      	 errorMessage = "Image Exists In Your Favorites";
         document.getElementById('friendFavoriteErrorArea').innerHTML = errorMessage;
      }
   }

}

<!-- ############################################################################### -->

function deleteFromFavorites()
{
   var theForm = document.getElementById("favoritelist");
   var theFormElm;
   var imagelink = new Array();
   var favoriteresponse;
   var cnt = 0;
   var theURL;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
         if (theFormElm.checked == true)
         {
            imagelink[cnt] = theFormElm.value;
            cnt++;
         }
      }
   }

   theURL = "/MyAccountFiles/MyAccountFavorites.php?imagelink="+imagelink+"&action=2";
   favoriteresponse = getReturnInfo(theURL);

   if (favoriteresponse == "Good")
   {
      window.location.reload();
   }
}
<!-- ############################################################################### -->

function setFavoritesDeleteLink()
{
   var theForm = document.getElementById("favoritelist");
   var theFormElm;
   var isChecked = false;
   var deleteLink;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
         if (theFormElm.checked == true)
         {
            isChecked = true;
         }
      }
   }

   if (isChecked == true)
   {
      document.getElementById('messageButtonsWrap2').style.display = "block";
   }
   else
   {
      document.getElementById('messageButtonsWrap2').style.display = "none";
   }

}

<!-- ############################################################################### -->

function checkAllFavorites(checkAction)
{
   var theForm = document.getElementById("favoritelist");
   var theFormElm;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
      	 if (checkAction == 1)
      	 {
             theFormElm.checked=true;
         }
         else
      	 {
             theFormElm.checked=false;
         }

      }
   }
   setFavoritesDeleteLink();
}


<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function setimagelink(imagelink)
{
	    ajaxpage(rootdomain+'/MyPortfolioPages/PhotoPage.php?imagelink='+imagelink, 'theImageAreaWrap');
}

<!-- ############################################################################### -->

function getNextImage(imagelink,direction)
{
   var theURL = "/MyGlamourFiles/GetNextImageLinkNew.php?imagelink="+imagelink+'&direction='+direction;
   var nextImageLink = getReturnInfo(theURL);

	 setimagelink(nextImageLink);
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function RateItem(varItemId, varRating, varRatingType)
{
   var varOrigClassName = document.getElementById(varItemId).className;

   xmlhttp=GetXmlHttpObject();
	 if (xmlhttp==null) {alert ("Browser does not support HTTP Request"); return; }

      xmlhttp.open('get', rootdomain+'/MyGlamourFiles/RatingItem.php?item='+varItemId+'&rating='+varRating+'&ratingType='+varRatingType+'&classes='+varOrigClassName, false);
      xmlhttp.onreadystatechange = function (){
   	     if (xmlhttp.readyState == 4)
         {
            if (xmlhttp.status == 200)
            {
               ReloadRating(xmlhttp);
               ajaxpage(rootdomain+'/MyGlamourFiles/PhotoRatingCount.php?vlink='+varItemId+'&ratingType='+varRatingType, 'ratingsCount');
            }
            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;
  var liObj;

  returnData = ReadNameValuePairs(requestObj.responseText.replace(newlines, ""));

  document.getElementById(returnData['item']).className = returnData['classes'];
  liObj = document.getElementById(returnData['item']).getElementsByTagName('a');

  for (var i = 0; i < liObj.length; i++)
  {
    liObj[i].onclick = function(){};
  }
}

<!-- ############################################### -->

function RatingError()
{
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function addComment(imagelink,sessionUserID)
{
	 var app =  document.getElementById("AddComments");
	 var comments = app.image_comments.value;
   var theURL;
   var commentResponse;

	 app.image_comments.value = "";

	 if (comments == "")
	 {
      discardCommentsForms();
      return;
	 }

   theURL = "/MyCommentsFiles/AddCommentNew.php?imagelink="+imagelink+"&comments="+comments;
   commentResponse = getReturnInfo(theURL);

   if (commentResponse == "Good")
   {
      discardCommentsForms();
	    showImageComments(imagelink,sessionUserID);
   }
}

<!-- ############################################################################### -->

function showImageComments(imagelink,sessionUserID)
{
	    ajaxpage(rootdomain+'/MyCommentsFiles/ImageCommentsNew.php?imagelink='+imagelink+'&sessionUserID='+sessionUserID, 'allCommentsWrap');
}

<!-- ############################################################################### -->

function deleteComment(comment_ID,imagelink,sessionUserID)
{
   var theURL = "/MyCommentsFiles/DeleteComment.php?imagelink="+imagelink+"&comment_ID="+comment_ID;
   var deleteCommentResponse = getReturnInfo(theURL);

   if (deleteCommentResponse == "Good") {showImageComments(imagelink,sessionUserID);}
}

<!-- ############################################################################### -->

function showHideCommentsForms()
{
   document.getElementById('commentsFormLarge').style.display = "block";
   document.getElementById('commentsFormSmall').style.display = "none";
}

<!-- ############################################################################### -->

function discardCommentsForms()
{
	 var app =  document.getElementById("AddComments");
	 app.image_comments.value = "";

   document.getElementById('commentsFormLarge').style.display = "none";
   document.getElementById('commentsFormSmall').style.display = "block";
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function sendReportImage(imagelink)
{
	 var app =  document.getElementById('ReportComments');
	 var remove_reason = app.remove_reason.value;
	 var removevalues;
	 var theURL;
	 var reportImage;

	 app.remove_reason.value = "";

	 if (remove_reason == "")
	 {
      discardReportForms();
      return;
	 }

   removevalues =  "?imagelink="+imagelink+"&remove_reason="+remove_reason;
   theURL  = "/MyGlamourFiles/ReportImageNew.php"+removevalues;

   reportImage = getReturnInfo(theURL);
   discardReportForms();
}

<!-- ############################################################################### -->

function reportImage(imagelink)
{
   showHideReportForms();
}

<!-- ############################################################################### -->

function showHideReportForms()
{
    document.getElementById('reportFormWrap').style.display = "block";
    document.getElementById('commentsFormWrap').style.display = "none";
    document.getElementById('allCommentsWrap').style.display = "none";
}

<!-- ############################################################################### -->

function discardReportForms()
{
    document.getElementById('reportFormWrap').style.display = "none";
    document.getElementById('commentsFormWrap').style.display = "block";
    document.getElementById('allCommentsWrap').style.display = "block";
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

var goodSubmit;
function confirmSubmitSearch()
{
  var app =  document.getElementById("mySearch");
  var zipExist;
  var zipcodehold = app.zipcode;
  var zipcode;

  if ((zipcodehold.value != "") && (zipcodehold.value != "enter zip code"))
  {
     zipcodegood = checkZipCode(zipcodehold);
     zipcode     = zipcodehold.value
  }
  else
  {
     zipcode = 0;
  }

  if ((zipcodegood))
	{
     var searchvalues;
     var profiletype = app.type.value;
     var imagetype   = app.imagetype.value;
     var state       = app.state.value;
     var miles       = app.miles.value;
     var sort        = app.sort.value;
     var sex         = app.sex.value;
     var race        = app.race.value;
     var age_start   = app.age_start.value;
     var age_end     = app.age_end.value;
     var zodiac      = app.zodiac.value;

     var displayname;
     var theURL;
     var profileTypeName;

     if ((app.displayname.value != "") && (app.displayname.value != "enter display name"))
     {
        displayname = app.displayname.value;
     }
     else
     {
        displayname = "none";
     }

     theURL = "/MyGlamourFiles/GetProfileTypeNew.php?type="+profiletype+"&image="+imagetype;
     profileTypeName = getReturnInfo(theURL);

     searchvalues =  "type="+profiletype+"&imagetype="+imagetype+"&state="+state+"&zipcode="+zipcode+"&miles="+miles+"&sort="+sort;
     searchvalues =   searchvalues+"&displayname="+displayname+"&sex="+sex+"&race="+race+"&age_start="+age_start+"&age_end="+age_end+"&zodiac="+zodiac;

     ajaxpage(rootdomain+'/MySearchFiles/MySearchGalleryNew.php?'+searchvalues, 'theSearchAreaWrap');
     document.getElementById('theSearchAreaText').innerHTML= profileTypeName;

		 goodSubmit=false;
	}
	else
	{
		 goodSubmit=false;
	}

  return goodSubmit;
}

<!-- ############################################################################### -->

function clearSearch(messageArea)
{
	 zipcodegood=true;
   clearErrorMessage(messageArea);
//   document.getElementById('zmessage').innerHTML = "(Us Only)";
   document.getElementById(messageArea).style.color="black";
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

var invalidemail = "Invalid Email Address";

function checkemail(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);
}

<!-- ############################################################################### -->

function checkemailcontact(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;
      clearErrorMessage('emailm');
   }
   else
   {
      emailgood=false;
      submitErrorMessage('emailm',invalidemail);
   }

   return (emailgood);
}

<!-- ############################################################################### -->

function checkDisplayName(displayname)
{
	 var dname = displayname.value;
   var theURL = "/MyAccountFiles/MyAccountCheckDisplayName.php?displayname="+dname;
   var displayexist = getReturnInfo(theURL);
   var filter = /\s+/g;
   var invalidname;

   if (displayexist == 1)
   {
      displaynamegood = false;
      invalidname = "Display Name Taken";
      submitErrorMessage('displaynamem',invalidname);
   }
   else
   {
      if (filter.test(dname))
      {
         displaynamegood = false;
         invalidname = "Spaces Are Not Allowed";
         submitErrorMessage('displaynamem',invalidname);
      }
      else
      {
         displaynamegood = true;
         clearErrorMessage('displaynamem');
      }
   }

   return (displaynamegood);
}

<!-- ############################################################################### -->

function validateZipCode(zipcode)
{
   var theURL = "/MyAccountFiles/MyAccountCheckZip.php?zipcode="+zipcode;
   var zipresponse = getReturnInfo(theURL);

   return(zipresponse);
}

<!-- ############################################# -->

function checkZipCode(zipcode)
{
   var filter = /^\d{5}?$/;
   var invalidzipcode;
   var zipExist;

   if (filter.test(zipcode.value))
   {
   	  zipExist = validateZipCode(zipcode.value);

      if (zipExist == 1)
      {
         zipcodegood=true;
         clearErrorMessage('zmessage');
      }
      else
      {
         invalidzipcode = "Zip Code Does Not Exist";
         submitErrorMessage('zmessage',invalidzipcode);
         zipcodegood=false;
      }
   }
   else
   {
      invalidzipcode = "Invalid Zip Code";
      submitErrorMessage('zmessage',invalidzipcode);
      zipcodegood=false;
   }
//alert(zipcodegood);
   return (zipcodegood);
}

<!-- ############################################################################### -->

function checkLinkName(linkname,linkaddress,linkset)
{
   var invalidname;
   var linkerror;

   if (linkset == 1){linkerror = "linkname1m";}else{linkerror = "linkname2m";}

   if ((linkname.value == "") && (linkaddress.value != ""))
   {
      invalidname = "Missing Web Name";
      submitErrorMessage(linkerror,invalidname);
      webaddressgood=false;
      return (webaddressgood);
   }
   else
   {
      webaddressgood=true;
      clearErrorMessage(linkerror);
      return (webaddressgood);
   }

}

function checkURL(linkname,linkaddress,linkset)
{
   var filter = /^http:\/\/www\.[a-z]+\.(com)|(org)|(edu)|(net)$/;
   var invalidwebsite;
   var linkerror;
   var fullinkaddress = "http://";

   if (linkset == 1){linkerror = "linkaddress1m";}else{linkerror = "linkaddress2m";}

   if ((linkname.value != "") && (linkaddress.value == ""))
   {
      invalidwebsite = "Missing Web Address";
      submitErrorMessage(linkerror,invalidwebsite);
      webaddressgood=false;
      return (webaddressgood);
   }
   else
   {
      if ((linkname.value == "") && (linkaddress.value == ""))
      {
         webaddressgood=true;
         clearErrorMessage(linkerror);
         return (webaddressgood);
      }
      else
      {
      	 fullinkaddress = fullinkaddress+linkaddress.value;
         if ((!filter.test(fullinkaddress)) && (linkaddress.value != ""))
         {
            invalidwebsite = "Invalid Web Address";
            submitErrorMessage(linkerror,invalidwebsite);
            webaddressgood=false;
            return (webaddressgood);
         }
         else
         {
            if ((filter.test(fullinkaddress)) && (linkaddress.value != ""))
            {
               webaddressgood=true;
               clearErrorMessage(linkerror);
               return (webaddressgood);
            }
         }
      }
   }
}

<!-- ############################################################################### -->

function checkBirthDate(birthdate)
{
   var filter = /^(\d{1,2})(\/)(\d{1,2})\2(\d{4})$/;
   var invalidBirthDate;
   var app =  document.getElementById("myAccount");

   if (!filter.test(birthdate.value))
   {
      invalidBirthDate = "Invalid Date Format";
      submitErrorMessage('dmessage',invalidBirthDate);
      birthdategood=false;
      return (birthdategood);
   }

   var bdate = birthdate.value;
   var matchArray = bdate.split("/");
   var month = parseInt(matchArray[0],10);
   var day = parseInt(matchArray[1],10);
   var year = parseInt(matchArray[2],10);

   if (month < 1 || month > 12)
   {
      invalidBirthDate = "Invalid Month Range";
      submitErrorMessage('dmessage',invalidBirthDate);
      birthdategood=false;
      return (birthdategood);
   }

   if (day < 1 || day > 31)
   {
      invalidBirthDate = "Invalid Day Range";
      submitErrorMessage('dmessage',invalidBirthDate);
      birthdategood=false;
      return (birthdategood);
   }

   if ((month==4 || month==6 || month==9 || month==11) && day==31)
   {
      invalidBirthDate = "Invalid Day For Month";
      submitErrorMessage('dmessage',invalidBirthDate);
      birthdategood=false;
      return (birthdategood);
   }

   if (month == 2)
   {
      var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));

      if (day>29 || (day==29 && !isleap))
      {
         invalidBirthDate = "Invalid Day For Month";
         submitErrorMessage('dmessage',invalidBirthDate);
         birthdategood=false;
         return (birthdategood);
      }
   }

   var d = new Date();
   var curr_date = d.getDate();
   var curr_month = d.getMonth()+1;
   var curr_year = d.getFullYear();
   var lessyear;
   var age;

   if (curr_month < month)
   {
   	  lessyear = 1;
   }
   else
   {
   	   if ((curr_month == month) && (curr_date < day))
   	   {
      	  lessyear = 1;
   	   }
   	   else
   	   {
      	  lessyear = 0;
  	   }
   }

   age = curr_year - year - lessyear;

   if (age <18)
   {
      invalidBirthDate = "Invalid Age, Must Be 18";
      submitErrorMessage('dmessage',invalidBirthDate);
      birthdategood=false;
      return (birthdategood);
   }

//   app.dayofbirth.value = month.toString() + "/" + day.toString() + "/" + year.toString();
   birthdategood=true;
   clearErrorMessage('dmessage');
   return (birthdategood);
}

<!-- ############################################################################### -->

function checkOtherFields()
{
   var app =  document.getElementById("myAccount");

   otherfieldsgood=true;

   if (app.displayname.type != "hidden") {
   if (app.displayname.value =="")  {otherfieldsgood=false; submitErrorMessage('displaynamem',invalidentry);}  else {checkDisplayName(app.displayname);}}
   if (app.name.value =="")         {otherfieldsgood=false; submitErrorMessage('namem',invalidentry);}         else {clearErrorMessage('namem');}
   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.sex.value =="")          {otherfieldsgood=false; submitErrorMessage('sexm',invalidentry);}          else {clearErrorMessage('sexm');}
   if (app.race.value =="")         {otherfieldsgood=false; submitErrorMessage('racem',invalidentry);}         else {clearErrorMessage('racem');}
   if (app.dayofbirth.value =="")   {otherfieldsgood=false; submitErrorMessage('dmessage',invalidentry);}      else {checkBirthDate(app.dayofbirth);}
   if (app.type.value =="")         {otherfieldsgood=false; submitErrorMessage('typem',invalidentry);}         else {clearErrorMessage('typem');}
   if (app.security_code.value ==""){otherfieldsgood=false; submitErrorMessage('securitym',invalidentry);}     else {checkSecurity(app.security_code);}
   checkLinkName(app.linkname1,app.linkaddress1,1);
   checkLinkName(app.linkname2,app.linkaddress2,2);
   checkURL(app.linkname1,app.linkaddress1,1);
   checkURL(app.linkname2,app.linkaddress2,2);

}

<!-- ############################################################################### -->

function clearErrorMessage(messageArea)
{
	document.getElementById(messageArea).innerHTML= "";

  if ((zipcodegood) && (birthdategood) && (webaddressgood) && (otherfieldsgood) && (emailgood) && (securitygood) && (displaynamegood))
  {
  	  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 checkSecurity(s_code)
{
	    var security_code = s_code.value;
  	  var theURL = "/phpClasses/MyGlamour_Security.php?security_code="+security_code;
      var security = getReturnInfo(theURL);

      if (security == 1)
      {
         securitygood=true;
         clearErrorMessage('securitym');
      }
      else
      {
         submitErrorMessage('securitym',invalidsecurity);
         securitygood=false;
      }

      return(securitygood);
}

<!-- ############################################################################### -->

var goodSubmit;
function confirmSubmitAccount()
{
	checkOtherFields();

  if ((zipcodegood) && (birthdategood) && (webaddressgood) && (otherfieldsgood) && (securitygood) && (displaynamegood))
	{
	   goodSubmit=true;
	}
	else
	{
		 goodSubmit=false;
	}
  return goodSubmit;
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ########################  Change Password Functions  ########################## -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function checkPassword(newPassword,newPasswordConfirm,errorlocation)
{
	 var filter = /^[a-zA-Z0-9]+$/;
	 var newPasswordHold;

   if (errorlocation == "newpasswordm"){newPasswordHold = newPassword.value;}else{newPasswordHold = newPasswordConfirm.value;}

   if (newPasswordHold == "")
   {
      invalidpassword = "Please Enter Password";
      submitErrorMessage(errorlocation,invalidpassword);
      passwordgood=false;
   }
   else
   {
      if (newPasswordHold.length < 6)
      {
         invalidpassword = "Password Too Short";
         submitErrorMessage(errorlocation,invalidpassword);
         passwordgood=false;
      }
      else
      {
         if (!filter.test(newPasswordHold))
         {
            invalidpassword = "Not Alphanumeric";
            submitErrorMessage(errorlocation,invalidpassword);
            passwordgood=false;
         }
         else
         {
            if (errorlocation == "newpasswordm")
            {
               passwordgood=true;
               clearErrorMessage(errorlocation);
            }
            else
            {
            	 if (newPassword.value != newPasswordConfirm.value)
            	 {
                  invalidpassword = "Passwords Do Not Match";
                  submitErrorMessage(errorlocation,invalidpassword);
                  passwordgood=false;
            	 }
            	 else
            	 {
                  passwordgood=true;
                  clearErrorMessage(errorlocation);
            	 }
            }

         }
      }
   }

   return (passwordgood);
}

<!-- ############################################################################### -->

function checkOtherPasswordFields()
{
   var app =  document.getElementById("myPassword");

   otherfieldsgood=true;

   if (app.newpassword.value =="")         {otherfieldsgood=false; submitErrorMessage('newpasswordm',invalidentry);}       else {checkPassword(app.newpassword,app.newpasswordconfirm,'newpasswordm');}
   if (app.newpasswordconfirm.value =="")  {otherfieldsgood=false; submitErrorMessage('newpasswordconfirmm',invalidentry);}else {checkPassword(app.newpassword,app.newpasswordconfirm,'newpasswordconfirmm');}
   if (app.security_code.value =="")       {otherfieldsgood=false; submitErrorMessage('securitym',invalidentry);}          else {checkSecurity(app.security_code);}
}

<!-- ############################################################################### -->

function confirmSubmitPassword()
{
   checkOtherPasswordFields();

   if ((passwordgood)	&& (otherfieldsgood) && (securitygood))
	 {
	   goodSubmit=true;
	 }
	 else
	 {
		 goodSubmit=false;
	 }

   return goodSubmit;

}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function showHideMessageForm()
{
   var theURL  = "/MyMessageFiles/MessageCount.php";
	 var countresponse;

	 countresponse = getReturnInfo(theURL);

   if (countresponse == 1)
   {
      document.getElementById('sendMessageFormLarge').style.display = "block";
   }
   else
   {
      document.getElementById('bioInfoErrorArea').innerHTML= "Daily Message Limit Reached";
   }
}

<!-- ############################################################################### -->

function discardMessageForm()
{
   var app =  document.getElementById('addmessage');
	 app.message.value = "";
	 app.subject.value = "";

   document.getElementById('sendMessageFormLarge').style.display = "none";
}

<!-- ############################################################################### -->

function addMessage(userID)
{
	 var app =  document.getElementById('addmessage');
	 var message = app.message.value;
	 var subject = app.subject.value;
	 var messagevalues;
	 var messageResponse;
	 var theURL;

	 app.message.value = "";
	 app.subject.value = "";

	 if (message == "")
	 {
      discardMessageForm();
      return;
	 }

   theURL  = "/MyMessageFiles/AddMessageNew.php?userID="+userID+"&message="+escape(message)+"&subject="+subject;
	 messageResponse = getReturnInfo(theURL);

   if (messageResponse == "Good")
   {
      document.getElementById('bioInfoErrorArea').innerHTML= "Message Sent!!!";
      discardMessageForm();
   }
}

<!-- ############################################################################### -->

function addReplyMessage()
{
	 var app =  document.getElementById('addmessage');
	 var message   = app.message.value;
	 var messageID = app.messageID.value;
	 var senderID  = app.senderID.value;
	 var subject   = app.subject.value;

	 var messageReplyResponse;
	 var theURL;
	 var  messagevalues;

	 if (message == "")
	 {
      discardReplyMessageForm();
      return;
	 }

   messagevalues =  "?messageID="+messageID+"&senderID="+senderID+"&message="+escape(message)+"&subject="+subject;
	 theURL = "/MyMessageFiles/AddReply.php"+messagevalues;

	 messageReplyResponse = getReturnInfo(theURL);

   messagevalues =  "?messageID="+messageID+"&senderID="+senderID;

   if (messageReplyResponse == "Good")
   {
      ajaxpage(rootdomain+'/MyMessageFiles/MessageReadNew.php'+messagevalues, 'theMessagesAreaRead');
      discardReplyMessageForm();
   }

}

<!-- ############################################################################### -->

function showHideReplyMessageForms()
{
    document.getElementById('sendMessageFormLarge').style.display = "block";
    document.getElementById('sendMessageFormSmall').style.display = "none";
}

<!-- ############################################################################### -->

function discardReplyMessageForm()
{

   var app =  document.getElementById('addmessage');
	 app.message.value = "";

   document.getElementById('sendMessageFormLarge').style.display = "none";
   document.getElementById('sendMessageFormSmall').style.display = "block";
}

<!-- ############################################################################### -->

function returnToMessageInbox(actionType)
{
   window.location = 'http://www.myglamourpics.com/Messages.php?action='+actionType;
}

<!-- ############################################################################### -->

function readMessageActionProcess(messageID, actionType)
{
	 var actionReplyResponse;
	 var theURL;
	 var actionvalues;

   actionvalues =  "?messageID="+messageID+"&actionType="+actionType;
	 theURL = "/MyMessageFiles/MessageAction.php"+actionvalues;

	 actionReplyResponse = getReturnInfo(theURL);

   return actionReplyResponse;
}

<!-- ############################################################################### -->

function readMessageAction(messageID, actionType)
{
	 var actionReplyResponse;

	 actionReplyResponse = readMessageActionProcess(messageID, actionType);

   if (actionReplyResponse == "Good")
   {
      window.location = 'http://www.myglamourpics.com/Messages.php';
   }
}

<!-- ############################################################################### -->

function readMessageMultiAction(actionType)
{
   var theForm = document.getElementById("viewmessage");
   var theFormElm;
   var messageID = new Array();
   var cnt = 0;
	 var actionReplyResponse;
	 var theURL;
	 var actionvalues;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
         if (theFormElm.checked == true)
         {
            messageID[cnt] = theFormElm.value;
            cnt++;
         }
      }
   }

   actionvalues =  "?messageID="+messageID+"&actionType="+actionType;
	 theURL = "/MyMessageFiles/MessageAction.php"+actionvalues;

	 actionReplyResponse = getReturnInfo(theURL);

   if (actionReplyResponse == "Good")
   {
      window.location.reload();
   }

}

<!-- ############################################################################### -->

function deleteSingleMessageProcess(messageID)
{
   var theURL;
   var deleteresponse;

   theURL = "/MyMessageFiles/DeleteSingleMessage.php?messageID="+messageID;
   deleteresponse = getReturnInfo(theURL);

   return deleteresponse;
}

<!-- ############################################################################### -->

function deleteSingleMessage(messageID)
{
   var deleteresponse;

   deleteresponse = deleteSingleMessageProcess(messageID);

   if (deleteresponse == "Good")
   {
      window.location.reload();
   }
}

<!-- ############################################################################### -->

function deleteMessage()
{
   var theForm = document.getElementById("viewmessage");
   var theFormElm;
   var messageID;
   var deleteresponse;
   var messageID = new Array();
   var theURL;
   var cnt = 0;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
         if (theFormElm.checked == true)
         {
            messageID[cnt] = theFormElm.value;
            cnt++;
         }
      }
   }

   theURL = "/MyMessageFiles/DeleteMessages.php?messageID="+messageID;
   deleteresponse = getReturnInfo(theURL);

   if (deleteresponse == "Good")
   {
      window.location.reload();
   }
}

<!-- ############################################################################### -->

function setDeleteLink()
{
   var theForm = document.getElementById("viewmessage");
   var theFormElm;
   var isChecked = false;
   var deleteLink;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
         if (theFormElm.checked == true)
         {
            isChecked = true;
         }
      }
   }

   if (isChecked == true)
   {
      document.getElementById('messageButtonsWrap2').style.display = "block";
   }
   else
   {
      document.getElementById('messageButtonsWrap2').style.display = "none";
   }

}

<!-- ############################################################################### -->

function checkAll(checkAction)
{
   var theForm = document.getElementById("viewmessage");
   var theFormElm;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
      	 if (checkAction == 1)
      	 {
             theFormElm.checked=true;
         }
         else
      	 {
             theFormElm.checked=false;
         }

      }
   }
   setDeleteLink();
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function setEmpty(value)
{
    document.getElementById(value).value="";
}

<!-- ############################################################################### -->

function checkEnter(numValue,event)
{
	 var fieldValue;
	 var fieldMaxLength;
   var filter = /^[0-9]{5,6}?$/;
   var charCode;
   var holdValue;
	 var theURL;

	 holdValue = numValue;
	 fieldValue = document.getElementById(numValue).value;
	 fieldMaxLength = 4;

   if (fieldValue.length > fieldMaxLength)
   {
         if (numValue.which)
         {
            numValue = numValue;
            charCode = numValue.which;
         }
         else
         {
            numValue = event;
            charCode = numValue.keyCode ;
         }

         if(charCode == 13)
         {
            if (filter.test(fieldValue))
            {
               theURL = "/MyGlamourFiles/CheckForUserID.php?userID="+fieldValue;
               if (getReturnInfo(theURL))
               {
                  window.location = 'http://www.myglamourpics.com/Profile.php?userID='+fieldValue;
                  document.getElementById(holdValue).value="- enter mgp# here -";
               }
               else
               {
         	       alert("Profile Id Number Does Not Exist.  Try Again!!!");
                 document.getElementById(holdValue).value="";
               }

               return false;
            }
            else
            {
      	       alert("InValid Characters In Profile Id Number.  Try Again!!!");
               document.getElementById(holdValue).value="";
               return false;
            }
         }
         else
         {
            return true;
         }
   }
}

var perrormessage = "Please Select A Picture Type";
var perrormessage2 = "Please Select Image Before Pressing Button";
function pclearErrorMessage(messageArea)
{
	document.getElementById(messageArea).innerHTML= "";
}

function psubmitErrorMessage(messageArea,message)
{
     document.getElementById(messageArea).innerHTML= message;
     document.getElementById(messageArea).style.color="red";
}

<!-- ############################################### -->

function checkValidFile(validfile)
{
	 var validfileName = validfile;
   var theURL = "/MyGlamourFiles/CheckForValidImage.php?filename="+validfileName;
   var validresponse;

   validresponse = getReturnInfo(theURL);
   alert(validresponse);
}

<!-- ############################################### -->

var goodSubmit;
function confirmSubmit(imageCnt)
{
   var app =  document.getElementById("imageUpload");

   goodSubmit=true;
   if (imageCnt == 3)
   {
      if ((app.new_image1.value =="") && (app.new_image2.value =="") && (app.new_image3.value =="")){goodSubmit=false; psubmitErrorMessage('emessagetemp',perrormessage2);} else {pclearErrorMessage('emessagetemp');}
      if ((app.new_image1.value !="") && (app.imageType1.value =="")){goodSubmit=false; psubmitErrorMessage('emessage1',perrormessage);} else {pclearErrorMessage('emessage1');}
      if ((app.new_image2.value !="") && (app.imageType2.value =="")){goodSubmit=false; psubmitErrorMessage('emessage2',perrormessage);} else {pclearErrorMessage('emessage2');}
      if ((app.new_image3.value !="") && (app.imageType3.value =="")){goodSubmit=false; psubmitErrorMessage('emessage3',perrormessage);} else {pclearErrorMessage('emessage3');}
   }
   else
   {
      if (imageCnt == 2)
      {
         if ((app.new_image1.value =="") && (app.new_image2.value =="")){goodSubmit=false; psubmitErrorMessage('emessagetemp',perrormessage2);} else {pclearErrorMessage('emessagetemp');}
         if ((app.new_image1.value !="") && (app.imageType1.value =="")){goodSubmit=false; psubmitErrorMessage('emessage1',perrormessage);} else {pclearErrorMessage('emessage1');}
         if ((app.new_image2.value !="") && (app.imageType2.value =="")){goodSubmit=false; psubmitErrorMessage('emessage2',perrormessage);} else {pclearErrorMessage('emessage2');}
      }
      else
      {
         if (app.new_image1.value ==""){goodSubmit=false; psubmitErrorMessage('emessagetemp',perrormessage2);} else {pclearErrorMessage('emessagetemp');}
         if ((app.new_image1.value !="") && (app.imageType1.value =="")){goodSubmit=false; psubmitErrorMessage('emessage1',perrormessage);} else {pclearErrorMessage('emessage1');}
      }
   }

   return goodSubmit;
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function editImages(editType,imagelink)
{

   ajaxpage(rootdomain+'/MyImageFiles/MyImageEdit.php?edittype='+editType+'&imagelink='+imagelink, 'editPhotoConfirm');
   $("#editPhotoConfirm").css("display","block");
/*   $.ajax({
     type: "GET",
     url: rootdomain+"/MyImageFiles/MyImageEdit.php",
     data: "edittype="+editType+"&imagelink="+imagelink,
     success: function(msg){ alert(msg);
       $("#editPhotoConfirm").html(msg);
     }
   });*/
   window.scrollTo(0,100);
}

<!-- ############################################################################### -->

function confirmImages(editType,imagelink)
{
   var app =  document.getElementById("confirmImage");
   var imagetype;

   if (editType == 2) {imagetype = app.imageType.value;} else {imagetype = "";}

     $.ajax({
        type: "GET",
        url: rootdomain+"/MyImageFiles/MyImageConfirm.php",
        data: "edittype="+editType+"&imagelink="+imagelink+"&imagetype="+imagetype,
        success: function(){
       	     window.location.reload();
        }
      });

}

<!-- ############################################################################### -->

function confirmCancel()
{
   $("#editPhotoConfirm").css("display","none");
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ########################## Model Stats Functions    ########################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function checkOtherStatFields()
{
   var app =  document.getElementById("myStats");

   otherStatFieldsgood=true;

   if (app.height.value =="")      {otherStatFieldsgood=false; submitErrorMessage('heightm',invalidentry);}    else {clearErrorMessage('heightm');}
   if (app.weight.value =="")      {otherStatFieldsgood=false; submitErrorMessage('weightm',invalidentry);}    else {checkWeight(app.weight);}
   if (app.chest.value =="")       {otherStatFieldsgood=false; submitErrorMessage('chestm',invalidentry);}     else {clearErrorMessage('chestm');}
   if (app.cupsize.value =="")     {otherStatFieldsgood=false; submitErrorMessage('cupsizem',invalidentry);}   else {clearErrorMessage('cupsizem');}
   if (app.waist.value =="")       {otherStatFieldsgood=false; submitErrorMessage('waistm',invalidentry);}     else {clearErrorMessage('waistm');}
   if (app.hips.value =="")        {otherStatFieldsgood=false; submitErrorMessage('hipsm',invalidentry);}      else {clearErrorMessage('hipsm');}
   if (app.haircolor.value =="")   {otherStatFieldsgood=false; submitErrorMessage('haircolorm',invalidentry);} else {clearErrorMessage('haircolorm');}
   if (app.hairstyle.value =="")   {otherStatFieldsgood=false; submitErrorMessage('hairstylem',invalidentry);} else {clearErrorMessage('hairstylem');}
   if (app.eyecolor.value =="")    {otherStatFieldsgood=false; submitErrorMessage('eyecolorm',invalidentry);}  else {clearErrorMessage('eyecolorm');}
   if (app.shoesize.value =="")    {otherStatFieldsgood=false; submitErrorMessage('shoesizem',invalidentry);}  else {clearErrorMessage('shoesizem');}
   if (app.experience.value =="")  {otherStatFieldsgood=false; submitErrorMessage('experiencem',invalidentry);}else {clearErrorMessage('experiencem');}
}

<!-- ############################################################################### -->

var weightgood;
var otherStatFieldsgood=true;
var invalidentry = "Complete Required Item";
var invalidweight = "Invalid Weight";

function checkWeight(weight)
{
   var filter = /^[0-9]{2,3}?$/;

   if (filter.test(weight.value))
   {
      weightgood=true;
      clearErrorMessage('weightm');
   }
   else
   {
      submitErrorMessage('weightm',invalidweight);
      weightgood=false;
   }
    return (weightgood);
}

<!-- ############################################################################### -->

function checkAllStats(theAction)
{
   var theForm = document.getElementById("myStats");
   var theFormElm;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
         if (theAction == 1)
         {
            theFormElm.checked=true;
         }
         else
         {
         	  theFormElm.checked=false;
         }
      }
   }
}

<!-- ############################################################################### -->

function confirmSubmitStats()
{
	checkOtherStatFields();

  if ((weightgood)	&& (otherStatFieldsgood)) {goodSubmit=true;}else{goodSubmit=false;}
  return goodSubmit;
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function editAccountInfo(userid)
{
   $("#theWallArea").css("display","none");
   $("#editFormArea").css("display","block");
   $("#theWallText").html("Editing Account Information....");
	 ajaxpage(rootdomain+'/MyAccountFiles/MyAccountEdit.php?userID='+userid, 'editFormArea');
}

<!-- ############################################################################### -->

function editAccountBio(userid)
{
   $("#theWallArea").css("display","none");
   $("#editFormArea").css("display","block");
   $("#theWallText").html("Editing Biography Information....");
	 ajaxpage(rootdomain+'/MyAccountFiles/MyAccountBio.php?userID='+userid, 'editFormArea');
}

<!-- ############################################################################### -->

function editAccountStats(userid)
{
   $("#theWallArea").css("display","none");
   $("#editFormArea").css("display","block");
   $("#theWallText").html("Editing Statistics Information....");
 	 ajaxpage(rootdomain+'/MyAccountFiles/MyAccountStats.php?userID='+userid, 'editFormArea');

}

<!-- ############################################################################### -->

function editAccountPasswd(userid)
{
   $("#theWallArea").css("display","none");
   $("#editFormArea").css("display","block");
   $("#theWallText").html("Editing Password Information....");
	 ajaxpage(rootdomain+'/MyAccountFiles/MyAccountPasswd.php?userID='+userid, 'editFormArea');
}

<!-- ############################################################################### -->

function cancelProfile(userid)
{
   $("#theWallArea").css("display","none");
   $("#editFormArea").css("display","block");
   $("#theWallText").html("Cancelling Account....");
 	 ajaxpage(rootdomain+'/MyAccountFiles/MyAccountCancel.php?userID='+userid, 'editFormArea');
}

<!-- ############################################################################### -->

function deleteProfileEntirely()
{
   var theURL = "/MyAccountFiles/MyAccountDeleteProfile.php";
   var deleteProfileResponse;
   var r=confirm("Confirm Cancellation Of Profile");

   if (r == true)
   {
      deleteProfileResponse = getReturnInfo(theURL);
      if (deleteProfileResponse == "Good") {window.location = 'http://www.myglamourpics.com';}
   }
   else
   {
     return;
   }
}

<!-- ############################################################################### -->

function cancelEdit(userID)
{
   $("#theWallArea").css("display","block");
   $("#editFormArea").css("display","none");
   $("#theWallText").html("Your Wall....");
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ######################  Contact And Report Bugs Fucntions  #################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function clearContactReport(app)
{
     app.message.value = "";
     app.subject.value = "";
     app.email.value = "";
     app.security_code.value = "";
     messagegood=true; clearErrorMessage('messagem');
     emailgood=true; clearErrorMessage('emailm');
     securitygood=true; clearErrorMessage('securitym');
}

<!-- ############################################################################### -->

function contactAndReport(actionType,actionTaken)
{
	 var message;
	 var subject;
	 var messagevalues;
	 var email;
	 var security;
	 var formType;
	 var captchaResponse;
	 var app;

//   app = document.getElementById("contactus");
//   clearContactReport(app);

   if (actionType == 1)
   {
      $("#contactUsBlock").css("display","block");

      if (actionTaken == 0)
      {
         document.getElementById('contactReportColor').style.color="black";
//         $("#contactUsBlock").css("color","#000000");
         $("#contactReport").html("Contact Reason:");
         $("#B1").val("Send Contact");
         $("#B1").css("color","black");
         $("#B2").css("color","black");
         $("#formType").val(0);
      }
      else
      {
         $("#contactUsBlock").css("color","red");
         $("#contactReport").html("The Bug:");
         $("#B1").val("Report Bug");
         $("#B1").css("color","red");
         $("#B2").css("color","red");
         $("#formType").val(1);
      }
   }
   else
   {
      app = document.getElementById("contactus");

  	  if (actionType == 2)
  	  {
	       message  = escape(app.message.value);
	       subject  = app.subject.value;
	       email    = app.email.value;
	       security = app.security_code.value;
	       formType = app.formType.value;

         if (security =="")  {securitygood=false; submitErrorMessage('securitym',invalidentry);} else {checkSecurity(app.security_code);}
         if (email =="")     {emailgood=false; submitErrorMessage('emailm',invalidentry);}       else {checkemailcontact(email);}
         if (message =="")   {messagegood=false; submitErrorMessage('messagem',invalidentry);}   else {messagegood=true; clearErrorMessage('messagem');}

	       if ((emailgood) && (securitygood) && (messagegood))
	       {
            messagevalues =  "?message="+message+"&subject="+subject+"&email="+email+"&action="+formType;
   	        app.message.value = "";
	          app.subject.value = "";
	          app.email.value = "";
	          app.security_code.value = "";
alert(messagevalues);
            $.ajax({
                type: "GET",
                url: rootdomain+"/MyContactUsSend.php",
                data: messagevalues,
                success: function(msg){
       	           alert(msg);
                }
            });

            window.location.reload();
         }
  	  }
  	  else
  	  {
         clearContactReport(app);
         $("#contactUsBlock").css("display","none");
  	  }
   }
}

<!-- ############################################################################### -->

function ComingSoon()
{
   alert("Coming Soon");
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ######################                                     #################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function showJobsForm()
{
   $("#jobPostFormLarge").css("display","block");
}

<!-- ############################################################################### -->

function discardJobsForm()
{
   $("#jobPostFormLarge").css("display","none");

   clearErrorMessage('titlem');
   clearErrorMessage('datem');
   clearErrorMessage('typem');
   clearErrorMessage('ratem');
   clearErrorMessage('durationm');
   clearErrorMessage('zmessage');
   clearErrorMessage('descriptionm');
}

<!-- ############################################################################### -->

function checkOtherJobFields()
{
   var app =  document.getElementById("myJobs");

   otherJobFieldsgood=true;

   if (app.title.value =="")       {otherJobFieldsgood=false; submitErrorMessage('titlem',invalidentry);}       else {clearErrorMessage('titlem');}
   if (app.date.value =="")        {otherJobFieldsgood=false; submitErrorMessage('datem',invalidentry);}        else {checkJobDate(app.date);}
   if (app.type.value =="")        {otherJobFieldsgood=false; submitErrorMessage('typem',invalidentry);}        else {clearErrorMessage('typem');}
   if (app.rate.value =="")        {otherJobFieldsgood=false; submitErrorMessage('ratem',invalidentry);}        else {clearErrorMessage('ratem');}
   if (app.duration.value =="")    {otherJobFieldsgood=false; submitErrorMessage('durationm',invalidentry);}    else {clearErrorMessage('durationm');}
   if (app.zipcode.value =="")     {otherJobFieldsgood=false; submitErrorMessage('zmessage',invalidentry);}     else {checkZipCode(app.zipcode);}
   if (app.description.value =="") {otherJobFieldsgood=false; submitErrorMessage('descriptionm',invalidentry);} else {clearErrorMessage('descriptionm');}
}

<!-- ############################################################################### -->

function checkJobDate(jobdate)
{
   var filter = /^(\d{1,2})(\/)(\d{1,2})\2(\d{4})$/;
   var invalidJobDate;
   var app =  document.getElementById("myJobs");

   if (!filter.test(jobdate.value))
   {
      invalidJobDate = "Invalid Date Format";
      submitErrorMessage('datem',invalidJobDate);
      jobdategood=false;
      return (jobdategood);
   }

   var bdate = jobdate.value;
   var matchArray = bdate.split("/");
   var month = parseInt(matchArray[0],10);
   var day = parseInt(matchArray[1],10);
   var year = parseInt(matchArray[2],10);

   if (month < 1 || month > 12)
   {
      invalidJobDate = "Invalid Month Range";
      submitErrorMessage('datem',invalidJobDate);
      jobdategood=false;
      return (jobdategood);
   }

   if (day < 1 || day > 31)
   {
      invalidJobDate = "Invalid Day Range";
      submitErrorMessage('datem',invalidJobDate);
      jobdategood=false;
      return (jobdategood);
   }

   if ((month==4 || month==6 || month==9 || month==11) && day==31)
   {
      invalidJobDate = "Invalid Day For Month";
      submitErrorMessage('datem',invalidJobDate);
      jobdategood=false;
      return (jobdategood);
   }

   if (month == 2)
   {
      var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));

      if (day>29 || (day==29 && !isleap))
      {
         invalidJobDate = "Invalid Day For Month";
         submitErrorMessage('datem',invalidJobDate);
         jobdategood=false;
         return (jobdategood);
      }
   }

   var d = new Date();
   var curr_date = d.getDate();
   var curr_month = d.getMonth()+1;
   var curr_year = d.getFullYear();
   if (curr_month < 10) { curr_month = "0"+curr_month; }
   var today = curr_month+"/"+curr_date+"/"+curr_year;

   if (jobdate.value <= today)
   {
      invalidJobDate = "Invalid Date, Must Be Future Date";
      submitErrorMessage('datem',invalidJobDate);
      jobdategood=false;
      return (jobdategood);
   }

   jobdategood=true;
   clearErrorMessage('datem');
   return (jobdategood);
}

<!-- ############################################################################### -->

function confirmSubmitJobs()
{
	checkOtherJobFields();

  if ((jobdategood)	&& (otherJobFieldsgood) && (zipcodegood))
  {
     goodSubmit=true;
  }
  else
  {
  	 goodSubmit=false;
  }

  return goodSubmit;

}

<!-- ############################################################################### -->

function jobListSort(sortBy, orderBy)
{

     $.ajax({
        type: "GET",
        url: rootdomain+"/MyJobFiles/JobListings.php",
        data: "sort_order="+sortBy+"&order_by="+orderBy,
        success: function(msg){
       	  $("#jobListingArea").html(msg);
        }
      });

     $.ajax({
        type: "GET",
        url: rootdomain+"/MyJobFiles/JobListingsHeaders.php",
        data: "sort_order="+sortBy+"&order_by="+orderBy,
        success: function(msg){
       	  $("#jobColumnsHeaderWrap").html(msg);
        }
      });

}

<!-- ############################################################################### -->

function checkZipCode2(zipcode)
{
   var filter = /^\d{5}?$/;
   var invalidzipcode;
   var zipExist;

   if (filter.test(zipcode.value))
   {
   	  zipExist = validateZipCode(zipcode.value);

      if (zipExist == 1)
      {
         zipcodegood=true;
         clearErrorMessage('zmessage2');
      }
      else
      {
         invalidzipcode = "Zip Code Does Not Exist";
         submitErrorMessage('zmessage2',invalidzipcode);
         zipcodegood=false;
      }
   }
   else
   {
      invalidzipcode = "Invalid Zip Code";
      submitErrorMessage('zmessage2',invalidzipcode);
      zipcodegood=false;
   }

   return (zipcodegood);
}

<!-- ############################################################################### -->

function  confirmJobSubmitSearch()
{
  var app =  document.getElementById("myJobSearch");
  var zipExist;
  var zipcodehold = app.zipcode;
  var zipcode;

  if ((zipcodehold.value != "") && (zipcodehold.value != "enter zip code"))
  {
     zipcodegood = checkZipCode2(zipcodehold);
     zipcode     = zipcodehold.value
  }
  else
  {
     zipcode = 0;
  }

  if ((zipcodegood))
	{
     var searchvalues;
     var jobtype     = app.type.value;
     var rate        = app.rate.value;
     var duration    = app.duration.value;
     var miles       = app.miles.value;
     var sort        = app.sort.value;
     var state       = app.state.value;
     var sortBy      = app.sort_order.value;
     var orderBy     = app.order_by.value;

     searchvalues =  "type="+jobtype+"&rate="+rate+"&state="+state+"&zipcode="+zipcode+"&miles="+miles+"&sort="+sort+"&duration="+duration+"&sort_order="+sortBy+"&order_by="+orderBy;
     $("#postJobsWrap").css("display","block");
     $("#jobColumnsHeaderWrap").css("display","block");
     $("#theJobsText").html("The Lastest Jobs....");
   
     $.ajax({
        type: "GET",
        url: rootdomain+"/MyJobFiles/JobListingsSearch.php",
        data: searchvalues,
        success: function(msg){
       	  $("#jobListingArea").html(msg);
        }
      });

     $.ajax({
        type: "GET",
        url: rootdomain+"/MyJobFiles/JobListingsHeaders.php",
        data: "sort_order="+sortBy+"&order_by="+orderBy,
        success: function(msg){
       	  $("#jobColumnsHeaderWrap").html(msg);
        }
      });

		 goodSubmit=false;
	}
	else
	{
		 goodSubmit=false;
	}

  return goodSubmit;
}

<!-- ############################################################################### -->

function showSingleJob(jobID)
{
   ajaxpage(rootdomain+'/MyJobFiles/JobDetails.php?jobID='+jobID, 'jobListingArea');

   $("#postJobsWrap").css("display","none");
   $("#jobColumnsHeaderWrap").css("display","none");
   $("#theJobsText").html("Viewing Job Details....");
}

<!-- ############################################################################### -->

function addJobReply(posterID)
{

	 var app =  document.getElementById('addmessage');
	 var message = app.message.value;
	 var subject = app.subject.value;
	 var messagevalues;

	 if (message == ""){return;}

   $.ajax({
      type: "GET",
      url: rootdomain+"/MyMessageFiles/AddMessageNew.php",
      data: "userID="+posterID+"&message="+escape(message)+"&subject="+subject,
      success: function(){
         window.location = 'http://www.myglamourpics.com/Jobs.php';
      }
    });
}

<!-- ############################################################################### -->

function resetJobReplyForm()
{
	 var app =  document.getElementById('addmessage');
	 app.message.value = "";
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function getZodiacText(zodiacCode)
{
   $.ajax({
      type: "GET",
      url: rootdomain+"/MyGlamourFiles/DailyHoroScopeText.php",
      data: "zodiacCode=" + zodiacCode,
      success: function(msg){
      	$("#zodiacArea").html(msg);
      }
    });

   $("#zodiacMore").css("display","block");
}

<!-- ############################################################################### -->

function showZodiacs()
{
   $.ajax({
      type: "GET",
      url: rootdomain+"/MyGlamourFiles/DailyHoroScope.php",
      success: function(msg){
      	$("#zodiacArea").html(msg);
      }
    });

   $("#zodiacMore").css("display","none");


}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function getGenreList(videoSearchT,videoAction)
{
	 var videoSearchType = videoSearchT.value;
	 var boxType;
	 
	 if (videoAction == 1)
	 {
	    boxType = "#genre";
   }
   else
	 {
	    boxType = "#artists";
   }
   
	 if (videoSearchType != "")
	 {
        $.ajax({
           type: "GET",
           url: rootdomain+"/MyVideoFiles/VideoSearchFormHelp.php",
           data: "videoSearchType=" + videoSearchType + "&videoAction=" + videoAction,
           success: function(msg){
      	      $(boxType).html(msg);
           }
      });
   }
}

<!-- ############################################################################### -->

function confirmVideoSubmitSearch()
{
  var app =  document.getElementById("myVideoSearch");
  var artistname = app.artists.value;

  $.ajax({
     type: "GET",
     url: rootdomain+"/MyVideoFiles/ShowAllVideos.php",
     data: "name=" + artistname,
     success: function(msg){
       $("#videoListWrap").html(msg);
     	 $("#vArtist").html(artistname);
     	 $("#artistHead").css("display","block");
     }
  });

  goodSubmit=false;

  return goodSubmit;

}
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function addToVideoFavorites(videolink)
{
   var favoriteresponse;
   var errorMessage;

  $.ajax({
     type: "GET",
     url: rootdomain+"/MyAccountFiles/MyAccountVideoFavorites.php",
     data: "videolink="+videolink+"&action=1",
     success: function(msg){
       favoriteresponse = msg;

       if (favoriteresponse > 0)
       {
          $("#favoritesLink").html("[Add To Your Favorites("+favoriteresponse+")]");
          $("#friendFavoriteErrorArea").html("Video Added To Your Favorites");
       }
       else
       {
    	    errorMessage = "Video Exists In Your Favorites";
          $("#friendFavoriteErrorArea").html(errorMessage);
       }
     }
  });


}

<!-- ############################################################################### -->

function deleteFromVideoFavorites()
{
   var theForm = document.getElementById("favoritelist");
   var theFormElm;
   var videolink = new Array();
   var cnt = 0;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
         if (theFormElm.checked == true)
         {
            imagelink[cnt] = theFormElm.value;
            cnt++;
         }
      }
   }

  $.ajax({
     type: "GET",
     url: rootdomain+"/MyAccountFiles/MyAccountVideoFavorites.php",
     data: "videolink="+videolink+"&action=2",
     success: function(){
        window.location.reload();
     }
  });
}
<!-- ############################################################################### -->

function setVideoFavoritesDeleteLink()
{
   var theForm = document.getElementById("favoritelist");
   var theFormElm;
   var isChecked = false;
   var deleteLink;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
         if (theFormElm.checked == true)
         {
            isChecked = true;
         }
      }
   }

   if (isChecked == true)
   {
 	    $("#'messageButtonsWrap2").css("display","block");
   }
   else
   {
 	    $("#'messageButtonsWrap2").css("display","none");
   }

}

<!-- ############################################################################### -->

function checkAllVideoFavorites(checkAction)
{
   var theForm = document.getElementById("favoritelist");
   var theFormElm;

   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
      	 if (checkAction == 1)
      	 {
             theFormElm.checked=true;
         }
         else
      	 {
             theFormElm.checked=false;
         }

      }
   }
   setVideoFavoritesDeleteLink();
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->
<!-- ############################################################################### -->

function addVideoComment(videolink,sessionUserID)
{
	 var app =  document.getElementById("AddComments");
	 var comments = app.video_comments.value;

	 app.video_comments.value = "";

	 if (comments == "")
	 {
      discardVideoCommentsForms();
      return;
	 }

  $.ajax({
     type: "GET",
     url: rootdomain+"/MyCommentsFiles/AddVideoCommentNew.php",
     data: "videolink="+videolink+"&comments="+comments,
     success: function(){
      discardVideoCommentsForms();
	    showVideoComments(videolink,sessionUserID);
     }
  });
}

<!-- ############################################################################### -->

function showVideoComments(videolink,sessionUserID)
{
  $.ajax({
     type: "GET",
     url: rootdomain+"/MyCommentsFiles/VideoCommentsNew.php",
     data: "videolink="+videolink+"&sessionUserID="+sessionUserID,
     success: function(msg){
       $("#allCommentsWrap").html(msg);
     }
  });
}

<!-- ############################################################################### -->

function deleteVideoComment(comment_ID,videolink,sessionUserID)
{
  $.ajax({
     type: "GET",
     url: rootdomain+"/MyCommentsFiles/DeleteVideoComment.php",
     data: "videolink="+videolink+"&comment_ID="+comment_ID,
     success: function(msg){
         showVideoComments(videolink,sessionUserID)     
     }
  });

}

<!-- ############################################################################### -->

function showHideVideoCommentsForms()
{
 	 $("#commentsFormLarge").css("display","block");
 	 $("#commentsFormSmall").css("display","none");
}

<!-- ############################################################################### -->

function discardVideoCommentsForms()
{
	 var app =  document.getElementById("AddComments");
	 app.video_comments.value = "";

 	 $("#commentsFormLarge").css("display","none");
 	 $("#commentsFormSmall").css("display","block");

}

<!-- ############################################################################### -->

function setVideoWallArrows(recordStart,pageNum,totalpages)
{
	 var setPageLink;
	 var shout_page_left;
	 var shout_page_right;

	 if (pageNum == 0)
	 {
      setPageLink = "<a href=\'javascript:;\' class=\'opacityit3\'><img src=\'http://www.myglamourpics.com/images/HelpImages2/BigArrowLeft.jpg\' width=\'15\' height=\'65\' /></a>";
	 }
	 else
	 {
	 	  shout_page_left = pageNum - 1;
      setPageLink = "<a href=\'javascript:setVideoWall("+recordStart+","+shout_page_left+","+totalpages+")\' class=\'opacityit2\'><img src=\'http://www.myglamourpics.com/images/HelpImages2/BigArrowLeft.jpg\' width=\'15\' height=\'65\' /></a>";
	 }

   $("#theWallNavImageLeft").html(setPageLink);

	 if (pageNum == totalpages)
	 {
      setPageLink = "<a href=\'javascript:;\' class=\'opacityit3\'><img src=\'http://www.myglamourpics.com/images/HelpImages2/BigArrowRight.jpg\' width=\'15\' height=\'65\' /></a>";
	 }
	 else
	 {
	 	  shout_page_right = pageNum + 1;
      setPageLink = "<a href=\'javascript:setVideoWall("+recordStart+","+shout_page_right+","+totalpages+")\' class=\'opacityit2\'><img src=\'http://www.myglamourpics.com/images/HelpImages2/BigArrowRight.jpg\' width=\'15\' height=\'65\' /></a>";
	 }

   $("#theWallNavImageRight").html(setPageLink);

}

<!-- ############################################################################### -->

function setVideoWall(recordStart, pageNum, totalpages)
{
   setVideoWallArrows(recordStart, pageNum, totalpages);
   
  $.ajax({
     type: "GET",
     url: rootdomain+"/MyVideoFiles/ShowHomeWallVideosHelp.php",
     data: "recordStart="+recordStart+"&setNum="+pageNum,
     success: function(msg){
       $("#theWallVideo").html(msg);
     }
  });
}
