function popIt(url,centerTF,width,height){
if(centerTF){
  var myLeft = (screen.width-width)/2;
  var myTop = ((screen.height-height)/2)-15;
  myWindow = window.open(url,'_blank','toolbar=no,titlebar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, width='+width+', height='+height+', left='+myLeft+', top='+myTop+"'");
}else if(width && height){
  var myLeft = 0;
  var myTop = 0;
  myWindow = window.open(url,'_blank','toolbar=no,titlebar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, width='+width+', height='+height+', left='+myLeft+', top='+myTop+"'");
}else{
  myWindow = window.open(url,'_blank','toolbar=no,titlebar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, width='+width+', height='+height);
}

myWindow.focus();
}


function swapHeart(id){
      var Itm = document.getElementById(id);
      var nm = Itm.src;
      var len = nm.length;
      var toCheck = nm.slice(len-8,len);
      if(toCheck == "Over.png"){
        Itm.src = nm.slice(0,len-8)+".png";
      }else{
        Itm.src = nm.slice(0,len-4)+"Over.png";
      }
}

function swaplinkImg(id){
      var Itm = document.getElementById(id);
      var nm = Itm.src;
      var len = nm.length;
      var toCheck = nm.slice(len-8,len);
      if(toCheck == "over.png"){
        Itm.src = nm.slice(0,len-8)+".png";
      }else{
        Itm.src = nm.slice(0,len-4)+"over.png";
      }
}

function doEmail(){
	  xvar0 = get_El('emailAddMe');
	   var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	   if(xvar0.value.match(emailExp)){
		 updateEmail(xvar0.value);
	   }else{
         xvar0.value = "An error occurred...";
       }
}	
	 
function get_El(El){return document.getElementById(El);}
     
function updateEmail(EmAdd){
         var request1 = false;
        try {
        request1 = new XMLHttpRequest();
        }
        catch (trymicrosoft) {
          try {
            request1 = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (othermicrosoft) {
          try {
            request1 = new ActiveXObject("Microsoft.XMLHTTP");
          }
        catch (failed) {
            request1 = false;
        }  
        }
        }

     var url = "emailAdd.php?emadd=" + EmAdd;
     request1.open("GET", url, true);
     request1.onreadystatechange = function changeit(){
       if (request1.readyState == 4) {
         if (request1.status == 200) {
           get_El('emailAddMe').value = "";
           get_El('emailAddMe').value = request1.responseText;
           get_El('emailAddMe').style.display = "block";
         }
       }
     }
     request1.send(null);
}
