  var http_request = false;
   function makePOSTRequest(url, parameters) {
      http_request = false;
	  
	  if (window.XMLHttpRequest) { // Mozilla, Safari,...
		 http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      
	  document.cookie ="retryurl="+url+"; path=/";
	  var extrasrate = url.indexOf("extras.php?rate");
	  var sendafriendyes = url.indexOf("sendafriend.php");
	  var pmsend = url.indexOf("pm.php");
	  var addtofav = url.indexOf("addtofaves.php");
	  var disabmess = url.indexOf("disablemessage.php");
	  var delfav = url.indexOf("delfavorites.php");
	  var extrascomment = url.indexOf("extras.php?comment");
	  var mapstuff = url.indexOf("updatelatlong.php?");
	  
	  
	  if (mapstuff != -1) { 
	  //document.getElementById('myspan').innerHTML = "<img src='/images/wait.gif'>";
	  }
	  else if (extrasrate != -1) { 
	  document.getElementById('whichspan').value = "yes";
	  } else if (sendafriendyes != -1 || addtofav != -1 || disabmess != -1 || pmsend != -1) { 
	  document.getElementById('sendafriendspan').value = "yes";
	  } else if (delfav != -1) { 
	  document.getElementById('sendafriendspan').value = "del";
	  
	  } else if (extrascomment != -1) { 
	  document.getElementById('commentspan').value = "yes";
	  } else if (document.getElementById('commentspan')) { 
	  if (document.getElementById('commentspan').value == "page") {
	  //do nothing, dont show the loading2gif
	  } else {
	  document.getElementById('searching').style.visibility = "hidden";
	  if (document.getElementById('googs')) {
	  document.getElementById('googs').style.visibility = "hidden";
	  }
	  document.getElementById('myspanw').innerHTML = "<p><img src='/images/loading2.gif'></p>";
	  }
	  } else if (document.getElementById('myspan0')) {
	  document.getElementById('searching').style.visibility = "hidden";
	   if (document.getElementById('googs')) {
	  document.getElementById('googs').style.visibility = "hidden";
	  }
	  document.getElementById('myspanw').innerHTML = "<p><img src='/images/loading2.gif'></p>";
	  } else {
	  document.getElementById('myspan').innerHTML = "<p><img src='/images/wait.gif'></p>";
	  }

	  http_request.onreadystatechange = alertContents;
      http_request.open('GET', url, true);
      http_request.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2005 00:00:00 GMT");
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      //http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   
   }

   function alertContents() {
  
      if (http_request.readyState == 4) {
		 if (http_request.status == 200) {
            //alert(http_request.responseText);
			
			document.cookie ="loadretry=0; path=/";
            var result = http_request.responseText;
			
			if (!document.getElementById('myspan')) {
			if (document.getElementById('myspan0') && document.getElementById('searchplatego').value == "") {
		document.getElementById('myspan0').innerHTML = result;	
		document.getElementById('myspan0').style.display = "none";
		document.getElementById('myspan0').style.opacity = 0;
        document.getElementById('myspan0').style.MozOpacity = 0;
        document.getElementById('myspan0').style.KhtmlOpacity = 0;
        document.getElementById('myspan0').style.filter = "alpha(Opacity="+0+");";
		document.getElementById('myspanw').innerHTML = "";
		startFade('myspan0');
	document.getElementById('myspan0').style.display = "block";		
			
	document.getElementById('searchplatego').value = "yes";	
			
			} else if (document.getElementById('whichspan').value == "yes") {
			var puthere = document.getElementById('thecorrectspan').value;
		 //document.getElementById(puthere).style.display = "none";		
	     document.getElementById(puthere).style.opacity = 0;
         document.getElementById(puthere).style.MozOpacity = 0;
         document.getElementById(puthere).style.KhtmlOpacity = 0;
         document.getElementById(puthere).style.filter = "alpha(Opacity="+0+")";
	     document.getElementById(puthere).innerHTML = result;
		 
		 	
		 startFade(puthere); 
			
			
			document.getElementById('whichspan').value = "";
			
			
			
			} else if (document.getElementById('sendafriendspan').value == "del") {
			var allfaves = result.indexOf("All Favorites removed");
			
			if (allfaves != -1) {
			document.getElementById('favemessage').innerHTML = "<div id='favemessage'><p>You currently have no favorites.</p><p>Browse through our <a class=\"alwayson\" href=\"http://iplateu.com/index.php?love_hate\">love &amp; hate</a> and use the Actions link to add favorites.</p></div>";
			document.getElementById('searching').style.visibility = "hidden";
			} else {
			
			var purpose = document.getElementById('thecorrectsendafriendspan').value.substr(1,4);
            
			if(purpose == "love") {
			
			if (document.getElementById('lovecount').value > 1 && document.getElementById('lovecount').value < 6) {
			document.getElementById('lovecount').value = document.getElementById('lovecount').value -1;
			document.getElementById(document.getElementById('thecorrectsendafriendspan').value).style.display = "none";			
			document.getElementById('totalfave').innerHTML = document.getElementById('totalfave').innerHTML - 1;
			var dontdoit = 0;
			} else if (document.getElementById('lovecount').value > 1 && document.getElementById('lovecount').value > 5)  {
			document.getElementById('totalfave').innerHTML = document.getElementById('totalfave').innerHTML - 1;
			var dontdoit = 1;
			LoadFaves('0','newest');
			} else {
			document.getElementById('lovecount').value = 0;
			document.getElementById('totalfave').innerHTML = document.getElementById('totalfave').innerHTML - 1;
			document.getElementById(document.getElementById('thecorrectsendafriendspan').value).innerHTML = "<p>Tell me where is the love...</p>";
			}
			}
			
			if(purpose == "hate") {
			if (document.getElementById('hatecount').value > 1 && document.getElementById('hatecount').value < 6) {
			document.getElementById('hatecount').value = document.getElementById('hatecount').value -1;
			document.getElementById(document.getElementById('thecorrectsendafriendspan').value).style.display = "none";
			document.getElementById('totalfave').innerHTML = document.getElementById('totalfave').innerHTML - 1;
			var dontdoit = 0;
			} else if (document.getElementById('hatecount').value > 1 && document.getElementById('hatecount').value > 5)  {
			document.getElementById('totalfave').innerHTML = document.getElementById('totalfave').innerHTML - 1; 
			
			var dontdoit = 1;
			LoadFaves('0','newest');
			} else {
			document.getElementById('totalfave').innerHTML = document.getElementById('totalfave').innerHTML - 1;
			document.getElementById(document.getElementById('thecorrectsendafriendspan').value).innerHTML = "<p>Enjoy the silence...</p>";
			document.getElementById('hatecount').value = 0;
			}	        
			}
			
			if (dontdoit != 1) {
			if (document.getElementById('hatecount').value == 0 && document.getElementById('lovecount').value == 0) {
			document.getElementById('favemessage').innerHTML = "<div id='favemessage'><p>You currently have no favorites.</p><p>Please browse through our <a class=\"alwayson\" href=\"http://iplateu.com/index.php?love_hate\">love &amp; hate</a> and use the Actions link to add favorites.</p></div>";
	        }
			}
			if (document.getElementById('totalfave').innerHTML == 1) {
			document.getElementById('plural').innerHTML = "message";
			}
			
			}
			
			} else if (document.getElementById('sendafriendspan').value == "yes") {
			var puthere3 = document.getElementById('thecorrectsendafriendspan').value;
		 document.getElementById(puthere3).style.display = "none";		
	     document.getElementById(puthere3).style.opacity = 0;
         document.getElementById(puthere3).style.MozOpacity = 0;
         document.getElementById(puthere3).style.KhtmlOpacity = 0;
         document.getElementById(puthere3).style.filter = "alpha(Opacity="+0+")";
	     document.getElementById(puthere3).innerHTML = result;
		 document.getElementById(puthere3).style.width = "100%";
		 	
		 startFade(puthere3);
		 document.getElementById(puthere3).style.display = "block"; 	
			
		 document.getElementById('sendafriendspan').value = "";
		 setTimeout("document.getElementById('"+puthere3+"').style.display = 'none'", 3000); 
		  			
			} else if (document.getElementById('commentspan').value == "page") {
			var puthere2 = document.getElementById('whichcommentspan').value;
		document.getElementById(puthere2).innerHTML = result;
		document.getElementById(puthere2).style.display = "none";
	    document.getElementById(puthere2).style.opacity = 0;
        document.getElementById(puthere2).style.MozOpacity = 0;
        document.getElementById(puthere2).style.KhtmlOpacity = 0;
        document.getElementById(puthere2).style.filter = "alpha(Opacity="+0+");";
			
			
	    startFade(puthere2);
       document.getElementById(puthere2).style.display = "block";
	   
			
			
			document.getElementById('commentspan').value = "";
			
			
			} else if (document.getElementById('commentspan').value == "yes") {
			var puthere2 = document.getElementById('whichcommentspan').value;
			var result2 = result.replace(/\\\'/g, "\'");
			result2 = result2.replace(/\\\"/g, "\"");
			result2 = result2.replace(/\\\\/g, "\\");
			
		document.getElementById(puthere2).innerHTML = result2;
		document.getElementById(puthere2).style.display = "none";
	    document.getElementById('no'+puthere2).style.opacity = 0;
        document.getElementById('no'+puthere2).style.MozOpacity = 0;
        document.getElementById('no'+puthere2).style.KhtmlOpacity = 0;
        document.getElementById('no'+puthere2).style.filter = "alpha(Opacity="+0+");";
			
			
	    startFade('no'+puthere2);
    document.getElementById('no'+puthere2).style.display = "block";
	document.getElementById(puthere2).style.display = "block";
			
			
			document.getElementById('commentspan').value = "";
			
			
			var howmany = document.getElementById('numcomments').value * 1;	
			howmany = howmany + 1;
			document.getElementById('js'+puthere2).innerHTML = "<a class=\"alwayson\" href=\"javascript:HideComments2(\'"+puthere2+"\',\'"+howmany+"\');\">Comments("+howmany+")</a>";
			} } else {
			document.getElementById('myspan').innerHTML = result;
			}
			var already = result.indexOf("ALREADYYYY");
			var congrats = result.indexOf("Congratulations!");
			var thanks = result.indexOf("Thanks,");
			var nokay = result.indexOf("Incorrect code.");
			var pchange = result.indexOf("pchangeddddddddddd");
			var lredirect = result.indexOf("Success. Logging in...");
			var cellredirect = result.indexOf("Cell phone# updated successfully");
			var emredirect = result.indexOf("Email address updated successfully");
			var mostlove = result.indexOf("Most");

			var jtagg = result.indexOf("Success! Found");
			var jtagg2 = result.indexOf("Sorry, no plate calls found for that tag");
			
			var prefstuff = result.indexOf("Preferences updated");
			var prefstuff2 = result.indexOf("cuckoo");
			
			var didenable = result.indexOf("Message playback Enabled");
			var diddisable = result.indexOf("Message playback Disabled");
			
			var mapanswer = result.indexOf("Map updated!");
			
			if (mapanswer != -1) {
			GUnload();
			parent.document.getElementById('googlebox').style.display='none';
			top.document.getElementById('lovemp3didit').value = '';
			top.document.getElementById('hatemp3didit').value = '';
			DoMP3Stuff2();
			var end = result.indexOf('*');
			var puthere = result.substring(28,end);
			
		 puthere = 'sendafriend'+puthere;
		 var puthere2 = '*'+puthere;
		 top.document.getElementById(puthere).style.display = "none";		
	     top.document.getElementById(puthere).style.opacity = 0;
         top.document.getElementById(puthere).style.MozOpacity = 0;
         top.document.getElementById(puthere).style.KhtmlOpacity = 0;
         top.document.getElementById(puthere).style.filter = "alpha(Opacity="+0+")";
	     top.document.getElementById(puthere).innerHTML = "Map Updated!<br /><br /><br />";
		 top.document.getElementById(puthere).style.width = "100%";
		 	
		 startFade(puthere2);
		 top.document.getElementById(puthere).style.display = "block"; 	
			
		 setTimeout("top.document.getElementById('"+puthere+"').style.display = 'none'", 3000);
			}
			
			if (didenable != -1) {
			var inhere = document.getElementById('whichonestatus').value;
			var newclassname = document.getElementById("disable"+inhere).className.substr(1,11);
			var purpose = inhere.substr(0,4); 
			if (purpose == "love") {
			newclassname = "l"+newclassname;
			} else {
			newclassname = "h"+newclassname;
			}
			document.getElementById("disable"+inhere).className = newclassname;						
			document.getElementById("3"+inhere).style.display = "none";
			document.getElementById("2"+inhere).style.display = "inline";
			document.getElementById(inhere).style.display = "none";
			document.getElementById(inhere).innerHTML = "&nbsp;";
			document.getElementById("disable2"+inhere).className = "messages";
			document.getElementById("disable3"+inhere).className = "messages";
			document.getElementById("disable4"+inhere).className = purpose;
			document.getElementById("dis"+inhere).innerHTML = "<a alt='Only you will be able to hear it' title='Only you will be able to hear it' class=\"alwayson\" href=\"javascript:DisableMessage('"+inhere+"')\">Disable Playback</a>";
			document.getElementById('status'+inhere).value = 0;
			}
			
			if (diddisable != -1) {
			var inhere = document.getElementById('whichonestatus').value;
			var newclassname = document.getElementById("disable"+inhere).className.substr(1,11);
			newclassname = "d"+newclassname;
			document.getElementById("disable"+inhere).className = newclassname;
			document.getElementById(inhere).style.display = "none";
			document.getElementById(inhere).innerHTML = "&nbsp;";
			document.getElementById("2"+inhere).style.display = "none";
			document.getElementById("3"+inhere).style.display = "inline";
			document.getElementById("disable2"+inhere).className = "messages1";
			document.getElementById("disable3"+inhere).className = "messages1";
			document.getElementById("disable4"+inhere).className = "messages1";
			document.getElementById("dis"+inhere).innerHTML = "<a alt='Let everyone listen in' title='Let everyone listen in' class=\"alwayson\" href=\"javascript:DisableMessage('"+inhere+"')\">Enable Playback</a>";
			document.getElementById('status'+inhere).value = 1;
			}
			
			if (prefstuff != -1 || prefstuff2 != -1) {
			EnablePrefs();
			}
			
			if (jtagg != -1 || jtagg2 != -1 && document.getElementById('thetag').style.display == "none") {
			document.getElementById('thetag').style.display = "block";
            document.getElementById('jtag').style.display = "none";
			document.getElementById('tagclick').value = "";
			}
			if (already != -1) {
			alert("You have already rated this clip");
			}
			if (pchange != -1) {
			var passvalue = MD5(document.form2.changepass2.value);
			document.cookie ="remembermep="+passvalue+"; expires=Thu, 5 Jul 2080 20:47:11 UTC; path=/";
			}
			if (congrats != -1) {
			setTimeout("document.location = 'http://www.iplateu.com/index.php?how_it_works'",4000);
			}
		    if (mostlove != -1) {
			document.getElementById('mostlovehate').innerHTML = "<a href='javascript:MostLovedHated();DisableMost();'>most love and hate</a>";
			}		
			if (cellredirect != -1) {
			setTimeout("document.location = 'https://iplateu.com/log_me_in.php'",4000);
			}
			if (emredirect != -1) {
			setTimeout("document.location = 'https://iplateu.com/log_me_in.php'",4000);
			}
			if (lredirect != -1) {
			if (document.loginform.rememberme.value == "yes") {
			var usernamevalue = document.loginform.username.value;
			var passvalue = MD5(document.loginform.password.value);
			document.cookie ="rememberme="+usernamevalue+"; expires=Thu, 5 Jul 2080 20:47:11 UTC; path=/";
            document.cookie ="remembermep="+passvalue+"; expires=Thu, 5 Jul 2080 20:47:11 UTC; path=/";
			}
			setTimeout("document.location = location.href",3000);
			}
			if (thanks != -1 || nokay != -1) {
			Disable5();
			document.myform2.theauthcode.focus();
			}
			plate = result.indexOf("Authentication successful!");
			if (plate != -1) {
			setTimeout("document.location = location.href",3500);
			}
			
			 					            
            } else { 
	     	 var loadretryvalue = GetCookie('loadretry')*1;
			loadretryvalue = loadretryvalue+1;
	        document.cookie ="loadretry="+loadretryvalue+1+"; path=/";
            if (loadretryvalue < 9) {		   
			var theurl = GetCookie('retryurl');
			var question = theurl.indexOf('?');
			var poststr = theurl.substring(question+1,theurl.length);
			//alert("Retry #"+loadretryvalue);
            setTimeout("makePOSTRequest('"+theurl+"','"+poststr+"')",1000);
			} else { 
			document.cookie ="loadretry=0; path=/";
			document.cookie ="retryurl=; path=/";
			alert('Oops! It didn\'t go through. Please check your internet connection and try again.');
			location.reload();
			}
         }
      }
   }
   
  function GetCookie(name)
{
	var cookies = document.cookie;
	if (cookies.indexOf(name) != -1)
	{
		var startpos = cookies.indexOf(name)+name.length+1;
		var endpos = cookies.indexOf(";",startpos)-1;
		if (endpos == -2) endpos = cookies.length;
		return cookies.substring(startpos,endpos);
	}
	else
	{
		return false; // the cookie couldn't be found! it was never set before, or it expired.
	}
}
   
     function get(obj) {
      var poststr = "activatecell=" + encodeURI( document.getElementById("activatecell").value );
      makePOSTRequest(location.href+"&activatecell="+document.getElementById("activatecell").value, poststr);
   }

function DisableMe() { 
frm=document.forms['myform'];
document.getElementById('cellstuff').style.color = "#ccc";
document.getElementById('errorcell').style.color = "#ccc";
frm.button.disabled=true;
frm.wrong.disabled=true;
}

function Disable3() { 
frm=document.forms['form1'] 
if(frm.changecell.value.length < 10) { 
frm.change.disabled=true;
} 
else {frm.change.disabled=false} 
}

function Disable4() { 
frm=document.forms['myform3']
if(frm.plate1.value.length > 1 && frm.state1.value !="" || frm.plate2.value.length > 1 && frm.state2.value !="")  { 
frm.button.disabled=false;
} 
else {frm.button.disabled=true} 
}

function Disable4b() { 
frm=document.forms['myform3'] 
frm.button.disabled=true;
document.getElementById('platestuff').style.color = "#ccc";
document.getElementById('later1').innerHTML = "skip this part ";
frm.plate1.disabled=true;
frm.plate2.disabled=true;
frm.state1.disabled=true;
frm.state2.disabled=true;
}

function Disable4c() { 
frm=document.forms['myform0']
if(frm.plate.value.length < 1 || frm.state.value =="")  { 
frm.button.disabled=true;
} 
else {frm.button.disabled=false} 
}

function Disable5() { 
frm=document.forms['myform2']
if(frm.theauthcode.value.length == 5)  { 
frm.button.disabled=false;
} 
else {frm.button.disabled=true} 
} 

   function get2(obj) { 
      var poststr = "theauthcode=" + document.getElementById("theauthcode").value;
      makePOSTRequest(location.href+"&theauthcode="+document.getElementById("theauthcode").value, poststr);
   }
   
   function get3(obj) { 
      var poststr = "plate1="+document.getElementById("plate1").value+"&state1=" + encodeURI( document.getElementById("state1").value )+"&plate2=" +document.getElementById("plate2").value+"&state2=" + encodeURI( document.getElementById("state2").value );
	  makePOSTRequest(location.href+"&plate1="+document.getElementById("plate1").value+"&state1="+document.getElementById("state1").value+"&plate2="+document.getElementById("plate2").value+"&state2="+document.getElementById("state2").value, poststr);
   }
   
   function get4(obj) { 
      var poststr = "verify="+document.getElementById("verify").value+"&cell=" + document.getElementById("cell").value;
	  makePOSTRequest(location.href+"?&verify="+document.getElementById("verify").value+"&cell="+document.getElementById("cell").value, poststr);
   }
  
  function get5(obj) { 
      var poststr = "username="+document.getElementById("username").value+"&password=" + document.getElementById("password").value+"&rememberme=" + document.getElementById("rememberme").value;
	  makePOSTRequest(location.href+"?&username="+document.getElementById("username").value+"&password="+document.getElementById("password").value+"&rememberme="+document.getElementById("rememberme").value, poststr);
   }
   
   function get6(obj) { 
      var poststr = "changepass1="+document.getElementById("changepass1").value+"&changepass2=" + document.getElementById("changepass2").value;
	  makePOSTRequest("https://"+window.location.host+"/proc_change.php?changepass1="+document.getElementById("changepass1").value+"&changepass2="+document.getElementById("changepass2").value, poststr);
   }
   
   function get7(obj) { 
      frm=document.forms['form3'];
	  if (frm.button.disabled == false) {
	  var poststr = "changecell="+document.getElementById("changecell").value;
	  makePOSTRequest("https://"+window.location.host+"/proc_change.php?changecell="+document.getElementById("changecell").value, poststr);
   }
   }
   
   function get8(obj) { 
      var poststr = "changeemail1="+document.getElementById("changeemail1").value+"&changeemail2=" + document.getElementById("changeemail2").value;
	  makePOSTRequest("https://"+window.location.host+"/proc_change.php?changeemail1="+document.getElementById("changeemail1").value+"&changeemail2="+document.getElementById("changeemail2").value, poststr);
   }
   
   function UpdatePrefs(what) { 
      var value;
	  if (document.getElementById(what).value == "") {
	  value = 1;
	  document.getElementById(what).value = "checked";
	  } else {
	  document.getElementById(what).value = "";
	  value = 0;
	  }
	  DisablePrefs();
	  var poststr = "what="+what+"&value="+value;
	  makePOSTRequest("https://"+window.location.host+"/proc_change.php?what="+what+"&value="+value, poststr);
   }
   
   function get9(obj) { 
      var poststr = "changeplate1="+document.getElementById("changeplate1").value+"&changestate1=" + encodeURI( document.getElementById("changestate1").value )+"&changeplate2=" +document.getElementById("changeplate2").value+"&changestate2=" + encodeURI( document.getElementById("changestate2").value );
	  makePOSTRequest("https://"+window.location.host+"/proc_change.php?changeplate1="+document.getElementById("changeplate1").value+"&changestate1="+document.getElementById("changestate1").value+"&changeplate2="+document.getElementById("changeplate2").value+"&changestate2="+document.getElementById("changestate2").value, poststr);
   }
   
   function get10(obj) { 
      var poststr = "users="+document.getElementById("users").value;
	  makePOSTRequest("https://"+window.location.host+"/proc_change.php?users="+document.getElementById("users").value, poststr);
   }
   
   function get11(obj) {
	 
	  if (document.getElementById("button").disabled == false) {
	  var plate = document.getElementById('plate').value.toUpperCase();
	  var state = document.getElementById('state').value;
	  //document.getElementById('searching').innerHTML = "";
	  //document.getElementById('searching').style.visibility = "hidden";
	  
	  //document.getElementById('searchplatego').value = "";
	  //frm=document.forms['myform0'];
      frm.button.focus();
	  frm.button.disabled=true;
	  //document.getElementById('hatemp3didit').value = "";
	  //document.getElementById('lovemp3didit').value = "";
	  //var poststr = "state="+document.getElementById("state").value+"&plate="+document.getElementById("plate").value;
	  //var poststr = encodeURI(poststr);
	  //makePOSTRequest("http://"+window.location.host+"/searchplates.php?state="+document.getElementById("state").value+"&plate="+encodeURI(document.getElementById("plate").value), poststr);
      Search_Plate(state+' '+plate);
	  }
	  }
	  
   
   function get12(id,purpose,value) { 
     if (document.getElementById('membername').value == "") {
	  alert("Please login to rate this clip ");
	  return false;
	  } 
	 var poststr = "rate="+value+"&purpose="+purpose+"&id="+id;
	 msgQuestion = "Rate this message "+value+"/5 ?";
	 userResponse = confirm(msgQuestion);
	  if (userResponse == 1) {
       document.getElementById('whichspan').value = "";
	    document.getElementById('thecorrectspan').value = purpose+id;
	 		
	   makePOSTRequest("http://"+window.location.host+"/extras.php?rate="+value+"&purpose="+purpose+"&id="+id, poststr);
	  } else {
		return;
		}
   }
   
   function getcomments(page,purpose,id) { 
	 document.getElementById('hatemp3didit').value = "yes";
	  document.getElementById('lovemp3didit').value = "yes";
	 document.getElementById('whichcommentspan').value = "nocomments"+purpose+id;
	 document.getElementById('commentspan').value = "page";
	 var poststr = "purpose="+purpose+"&id="+id+"&page="+page;
	 makePOSTRequest("http://"+window.location.host+"/getcomments.php?purpose="+purpose+"&id="+id+"&page="+page, poststr);
   }
   
    
   function PostComment(whichone,numcomments) { 
	 if (document.getElementById('membername').value == "") {
	  alert("Please login to PM");
	  } else if (document.getElementById(whichone+'text').value.length > 1000){
	  thelength = document.getElementById(whichone+'text').value.length;
	  thisamount = thelength - 1000;
	  alert("Your message exceeds the 1000 char limit ("+thelength+" chars.) Please reduce by "+thisamount+" chars.");
	  } else {
	 var purpose = whichone.substr(11,4);
     var id = whichone.substr(15);
	 document.getElementById('whichcommentspan').value = "comments"+purpose+id;
	 document.getElementById('commentspan').value = "";
	 document.getElementById('numcomments').value = numcomments;
	 var strippedcomments = htmlStrip(whichone+'text');
	 //no garbage posts 
     if (document.getElementById(whichone+'text').value.match(/(.)\1{11,}/)) {
	 alert("No garbage posts please (eg. excessive characters !!!!!!!!!!!).");
	 } else { 
	 document.getElementById(whichone+'button').disabled = true;
	 document.getElementById(whichone+'text').disabled = true;
	 var poststr = "comment="+document.getElementById(whichone+'text').value+"&purpose="+purpose+"&id="+id;
	 poststr = encodeURI(poststr);
	 makePOSTRequest("http://"+window.location.host+"/extras.php?comment="+escape(document.getElementById(whichone+'text').value)+"&purpose="+purpose+"&id="+id, poststr);
   }
   }
   }
   
   function gopm(whichone) { 
	 if (document.getElementById('membername').value == "") {
	  alert("Please login to PM");
	  } else if (document.getElementById(whichone+'text').value.length > 1000){
	  thelength = document.getElementById(whichone+'text').value.length;
	  thisamount = thelength - 1000;
	  alert("Your message exceeds the 1000 char limit ("+thelength+" chars.) Please reduce by "+thisamount+" chars.");
	  } else {
  
     document.getElementById('thecorrectsendafriendspan').value = whichone;
 
	 var purpose = whichone.substr(11,4);
     var id = whichone.substr(15);
	 document.getElementById(whichone+'button').disabled = true;
	 var poststr = "purpose="+purpose+"&id="+id+"&message="+document.getElementById(whichone+'text').value;
	 poststr = encodeURI(poststr);
	 makePOSTRequest("http://"+window.location.host+"/pm.php?purpose="+purpose+"&id="+id+"&message="+escape(document.getElementById(whichone+'text').value), poststr);
   }
   }
   
   function gopm2(whichone,who) { 
	 if (document.getElementById('membername').value == "") {
	  alert("Please login to PM");
	  } else if (document.getElementById(whichone+'text').value.length > 1000){
	  thelength = document.getElementById(whichone+'text').value.length;
	  thisamount = thelength - 1000;
	  alert("Your message exceeds the 1000 char limit ("+thelength+" chars.) Please reduce by "+thisamount+" chars.");
	  } else {
     document.getElementById('thecorrectsendafriendspan').value = whichone;
	 document.getElementById(whichone+'button').disabled = true;
	 var poststr = "who="+who+"&message="+document.getElementById(whichone+'text').value;
	 poststr = encodeURI(poststr);
	 makePOSTRequest("http://"+window.location.host+"/pm.php?who="+who+"&message="+escape(document.getElementById(whichone+'text').value), poststr);
   }
   }
   
   function tagsearch() {
   if (document.getElementById('wassubmitted').value == "") {
   get13(document.getElementById('keyword').value);
   }
   }
   
   function get13(tag,page,sortby) {
   if (page == null) {
   page = 0;
    }    
	  document.getElementById('searching').innerHTML = "";
	  document.getElementById('searching').innerHTML = "<img src='/images/blank.gif' width='475' height='1' /><br />Sort by: <a href=\"javascript:get13('"+tag+"','0','newest');\">Newest</a> - <a href=\"javascript:get13('"+tag+"','0','oldest');\">Oldest</a><br /><br /><br />";
	  document.getElementById('wassubmitted').value = "yes";
	  document.getElementById('thetag').style.display = "none";
      document.getElementById('jtag').style.display = "block";
	  document.getElementById('searchplatego').value = "";
      document.getElementById('search').style.display = "none";
      document.getElementById('search').innerHTML = "";
      document.getElementById('hatemp3didit').value = "";
	  document.getElementById('lovemp3didit').value = "";
      document.getElementById('mostloved').innerHTML = "<span style='display:none;filter:alpha(opacity=0);width:100%;' name='myspan0' id='myspan0'></span><span name='myspanw' id='myspanw'></span>";
	  var poststr = "tag="+tag+"&page="+page+"&sortby="+sortby;
	  makePOSTRequest("http://"+window.location.host+"/tags.php?tag="+encodeURI(tag)+"&page="+page+"&sortby="+sortby, poststr);
      }
   
   
      function delfavorites(whichone) {
	  if (whichone == "all") {
	  msgQuestion = "Remove ALL plate calls from favorites?";
	  } else {
	  msgQuestion = "Remove this plate call from favorites?";
	  }
	  userResponse = confirm(msgQuestion);
	  if (userResponse == 1) {
       document.getElementById('thecorrectsendafriendspan').value = 'd'+whichone;
	   var poststr = "removethis="+whichone;	
	   makePOSTRequest("http://"+window.location.host+"/delfavorites.php?removethis="+whichone, poststr);
	  } else {
		return;
		}
	   }
      
   function gosendafriend(whichone) {
	  
	  if (document.getElementById(whichone+'button').disabled == false) {
	  document.getElementById('thecorrectsendafriendspan').value = whichone; 
      document.getElementById(whichone+'button').disabled = true;
	  var poststr = "emailto="+document.getElementById(whichone+"text").value+"&membername="+document.getElementById("membername").value+"&messageid="+whichone;
	  makePOSTRequest("http://"+window.location.host+"/sendafriend.php?emailto="+document.getElementById(whichone+"text").value+"&membername="+document.getElementById("membername").value+"&messageid="+whichone, poststr);
   }
   }
   
   function htmlStrip(whattext){
   var re= /<\S[^><]*>/g;
   document.getElementById(whattext).value=document.getElementById(whattext).value.replace(re, "");
   }

   
   function WrongNumber() {
   document.getElementById('myspan').innerHTML = "<p>Enter your correct cell phone number.</p> <form name='form1' method='post' action='"+location.href+"'> <p><input name='changecell' type='text' id='changecell' size='10' maxlength='10' onkeyup='Disable3();'>  &nbsp; <input name='change' type='submit' value='Change Number'></p></form>";   
   Disable3();
   }
   
   function doitLater() {
   document.location = 'http://www.iplateu.com/index.php?how_it_works';
   }
   
   function Disable() { 
   frm=document.forms['register'] 
   if(frm.username.value.length < 4 || frm.password2.value.length < 6 || frm.password.value.length < 6 || frm.email.value.length < 6) { 
   frm.Continue.disabled=true
   } 
   else {frm.Continue.disabled=false} 
   }
   
   function Disabletagsearchb() { 
  document.getElementById('button2').disabled = true;
   } 
   
   
   function Disabletagsearch() { 
   if(document.getElementById('keyword').value.length < 3 ) { 
document.getElementById('button2').disabled=true
} 
else {document.getElementById('button2').disabled=false} 
}


   function DisablePrefs() {
   document.getElementById('cp').disabled = true;
   document.getElementById('pm').disabled = true;
   document.getElementById('emailpc').disabled = true;
   document.getElementById('emailcomment').disabled = true;
   document.getElementById('emailplated').disabled = true;
   document.getElementById('emailreply').disabled = true;
   }
   
   function EnablePrefs() {
   document.getElementById('cp').disabled = false;
   document.getElementById('pm').disabled = false;
   document.getElementById('emailpc').disabled = false;
   document.getElementById('emailplated').disabled = false;
   document.getElementById('emailcomment').disabled = false;
   document.getElementById('emailreply').disabled = false;
   }
   
function Disable2() { 
frm=document.forms['register2'] 
if(frm.zip.value.length < 5 || frm.month.value.length < 2 || frm.day.value.length < 2 || frm.year.value.length < 4 || frm.cell.value.length < 10 || frm.verify.value.length < 5) { 
frm.Signup.disabled=true
} 
else {frm.Signup.disabled=false} 
}  

function LostPassword() {
var subspace = '99px';
if (navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf("Opera") < 0) {
subspace = '101px';
}
document.getElementById('login').style.display = "none";
document.getElementById('login').innerHTML = "<p>Enter your cell phone# and we\'ll email you your login info.</p><form name='loginform2' id='loginform2' action='javascript:get4(document.getElementById('loginform2'));'><p>Cell Phone#: <input name='cell' type='text' class='styleblack' id='cell' size='10' maxlength='10' onkeyup='Disable6();'/></p><p style='margin-left: 100px'> <img src='/iv/randomImage3.php' name='code'/></p><p style='margin-left: 29px'>Verify Code: <input name='verify' type='text' class='styleblack' id='verify' size='5' maxlength='5' onkeyup='Disable6();' /></p><p style='margin-left: "+subspace+"'><span style=\"background-color:#fff;\"><input name='button' type='button' id='button' value='Submit' onclick='javascript:get4(this.parentNode);Disablesend();'/></span></form></p>";
reloadImage();
Disable6();
document.getElementById('login').style.opacity = 0;
document.getElementById('login').style.MozOpacity = 0;
document.getElementById('login').style.KhtmlOpacity = 0;
document.getElementById('login').style.filter = "alpha(Opacity="+0+");";
startFade('login');
document.getElementById('login').style.display = "block";	

}

function LostPassword2() {
frm.cell.disabled=false;
frm.verify.disabled=false;
frm.cell.value="";
frm.verify.value="";
document.getElementById('login').style.color = "";
document.getElementById('myspan').innerHTML = "";
reloadImage();
Disable6();
}

function Disable6() { 
frm=document.forms['loginform2']
if(frm.verify.value.length < 5 || frm.cell.value.length < 10) { 
frm.button.disabled=true;
} 
else {frm.button.disabled=false} 
} 

function Disablesend() { 
frm=document.forms['loginform2'];
frm.button.disabled=true;
frm.cell.disabled=true;
frm.verify.disabled=true;
document.getElementById('login').style.color = "#ccc";
}

function Disablelogin() { 
frm=document.forms['loginform'];
frm.button.disabled=true;
frm.username.disabled=true;
frm.password.disabled=true;
frm.remember.disabled=true;
document.getElementById('clickhere').innerHTML = "click here";
document.getElementById('login').style.color = "#ccc";
}

function relogin() { 
frm=document.forms['loginform'];
frm.button.disabled=true;
frm.remember.disabled=false;
frm.username.disabled=false;
frm.password.disabled=false;
frm.password.value= "";
document.getElementById('clickhere').innerHTML = "<a href='javascript:LostPassword();'>click here</a>";
document.getElementById('login').style.color = "";
document.getElementById('myspan').innerHTML = "";
}

function focusme() {
frm=document.forms['loginform'] 
frm.username.focus();
}

function Disable7() { 
frm=document.forms['loginform'] 
if(frm.username.value.length < 4 || frm.password.value.length < 6) { 
frm.button.disabled=true
} 
else {frm.button.disabled=false} 
}

function reloadImage() {
    var now = new Date();
    if (document.images) {
        document.images.code.src = '/iv/randomImage3.php?' + now.getTime();
    }
}

function Disable8() { 
frm=document.forms['form2'] 
if(frm.changepass1.value.length < 6 || frm.changepass2.value.length < 6) { 
frm.button.disabled=true
} 
else {frm.button.disabled=false} 
}

function Disable9() { 
frm=document.forms['form1'] 
if(frm.changeemail1.value.length < 6 || frm.changeemail2.value.length < 6 || frm.changeemail1.value != frm.changeemail2.value ) { 
frm.button.disabled=true
} 
else {frm.button.disabled=false} 
}

function Disable10() { 
frm=document.forms['form3'] 
if(frm.changecell.value.length < 10) { 
frm.button.disabled=true
} 
else {frm.button.disabled=false} 
}

function Disable11() { 
frm=document.forms['form4']
if(frm.changeplate1.value.length > 1 && frm.changestate1.value !="" || frm.changeplate2.value.length > 1 && frm.changestate2.value !="" || frm.changestate2.value =='ZZ' || frm.changestate1.value =='ZZ')  { 
frm.button.disabled=false;
} 
else {frm.button.disabled=true} 
if(frm.changestate1.value =='ZZ') {
frm.changeplate1.value ='REMOVE';
frm.changeplate1.disabled = true;
}
if(frm.changestate2.value =='ZZ') {
frm.changeplate2.value ='REMOVE';
frm.changeplate2.disabled = true;
}


}

function Disable12() { 
frm=document.forms['contact']; 
if(frm.subject.value.length < 1 || frm.message.value =="" || frm.verify.value.length < 5 || frm.email.value.length < 6 || frm.email2.value.length < 6)  { 
frm.button.disabled=true;
} 
else {frm.button.disabled=false} 
}

function Disable13() { 
frm=document.forms['blocked'] 
frm.button.disabled=false;
}

function DisableContact() { 
frm=document.forms['contact'];
frm.button.disabled=true;
frm.submit();
}

function DisablePass() { 
frm=document.forms['form2'];
frm.button.disabled=true;
}

function DisableCell() { 
frm=document.forms['form3'] 
frm.button.disabled=true;
}

function DisableEmail() { 
frm=document.forms['form1'];
frm.button.disabled=true;
}

function DisablePlate() { 
frm=document.forms['form4'];
frm.button.disabled=true;
}

function DisableBlock() { 
frm=document.forms['blocked'];
frm.button.disabled=true;
}

function DisableMost() {
document.getElementById('mostlovehate').innerHTML = "<a href='#'>most love and hate</a>";
}


function LoadFaves(page,sortby) {
  document.getElementById('searching').innerHTML = "";
  document.getElementById('searchplatego').value = "";
  document.getElementById('mostloved').innerHTML = "";
  document.getElementById('hatemp3didit').value = "";
  document.getElementById('lovemp3didit').value = "";
  document.getElementById('searching').innerHTML = "<img src='/images/blank.gif' width='475' height='1' /><br />Sort by: <a href=\"javascript:LoadFaves('0','newest');\">Newest</a> - <a href=\"javascript:LoadFaves('0','oldest');\">Oldest</a> - <a href=\"javascript:LoadFaves('0','wickedest');\">Wickedest</a> - <a href=\"javascript:LoadFaves('0','lamest');\">Lamest</a> -  <a href=\"javascript:LoadFaves('0','mostcommented');\">Most Commented</a> - <a href=\"javascript:LoadFaves('0','mostrated');\">Most Rated</a><br /><br /><br />"; 
  if (page == null) {
  page = "";
  }
  var poststr = "page="+page+"&sortby="+sortby;
  document.getElementById('search').innerHTML = "<span style='display:none;filter:alpha(opacity=0);width:100%;' name='myspan0' id='myspan0'></span><span name='myspanw' id='myspanw'></span>";
  
  makePOSTRequest("http://"+window.location.host+"/loadfaves.php?page="+page+"&sortby="+sortby, poststr);
  }


function ChangePass() {
   if (document.getElementById('pass').style.display == "none") {
   document.getElementById('pass').style.width = "100%";
   document.getElementById('pass').style.opacity = 0;
      document.getElementById('pass').style.MozOpacity = 0;
      document.getElementById('pass').style.KhtmlOpacity = 0;
      document.getElementById('pass').style.filter = "alpha(Opacity="+0+");";
   startFade('pass');
   document.getElementById('pass').style.display = "block";
   document.getElementById('spanstuff').innerHTML = "<span name='myspan' id='myspan'></span>";
   document.form2.button.disabled=true;
   } else {
   document.getElementById('pass').style.display = "none";
   document.getElementById('spanstuff').innerHTML = "";
   }
   document.getElementById('emails').style.display = "none";
   document.getElementById('cellnum').style.display = "none";
   document.getElementById('lps').style.display = "none";
   document.getElementById('bc').style.display = "none";
   document.getElementById('cp').style.display = "none";
   if (document.getElementById('spanstuff1')) {
   document.getElementById('spanstuff1').innerHTML = "";
   }
   if (document.getElementById('spanstuff2')) {
   document.getElementById('spanstuff2').innerHTML = "";
   }
   if (document.getElementById('spanstuff3')) {
   document.getElementById('spanstuff3').innerHTML = "";
   }
   if (document.getElementById('spanstuff4')) {
   document.getElementById('spanstuff4').innerHTML = "";
   }
   if (document.getElementById('spanstuff6')) {
   document.getElementById('spanstuff6').innerHTML = "";
   }
   }
   
   function ChangeEmail() {
   if (document.getElementById('emails').style.display == "none") {
      document.getElementById('emails').style.width = "100%";
	  document.getElementById('emails').style.opacity = 0;
      document.getElementById('emails').style.MozOpacity = 0;
      document.getElementById('emails').style.KhtmlOpacity = 0;
      document.getElementById('emails').style.filter = "alpha(Opacity="+0+");";
   startFade('emails');
   document.getElementById('emails').style.display = "block";
   document.getElementById('spanstuff1').innerHTML = "<span name='myspan' id='myspan'></span>";
   } else {
   document.getElementById('emails').style.display = "none";
   document.getElementById('spanstuff1').innerHTML = "";
   }
   Disable9();
   document.getElementById('pass').style.display = "none";
   document.getElementById('cellnum').style.display = "none";
   document.getElementById('lps').style.display = "none";
   document.getElementById('bc').style.display = "none";
   document.getElementById('cp').style.display = "none";
   if (document.getElementById('spanstuff')) {
   document.getElementById('spanstuff').innerHTML = "";
   }
   if (document.getElementById('spanstuff2')) {
   document.getElementById('spanstuff2').innerHTML = "";
   }
   if (document.getElementById('spanstuff3')) {
   document.getElementById('spanstuff3').innerHTML = "";
   }
   if (document.getElementById('spanstuff4')) {
   document.getElementById('spanstuff4').innerHTML = "";
   }
   if (document.getElementById('spanstuff6')) {
   document.getElementById('spanstuff6').innerHTML = "";
   }
   }
   
   function ChangePrefs() {
   if (document.getElementById('cp').style.display == "none") {
      document.getElementById('cp').style.width = "100%";
	  document.getElementById('cp').style.opacity = 0;
      document.getElementById('cp').style.MozOpacity = 0;
      document.getElementById('cp').style.KhtmlOpacity = 0;
      document.getElementById('cp').style.filter = "alpha(Opacity="+0+");";
   startFade('cp');
   document.getElementById('cp').style.display = "block";
   document.getElementById('spanstuff6').innerHTML = "<span name='myspan' id='myspan'></span>";
   } else {
   document.getElementById('cp').style.display = "none";
   document.getElementById('spanstuff6').innerHTML = "";
   }
   document.getElementById('pass').style.display = "none";
   document.getElementById('emails').style.display = "none";
   document.getElementById('cellnum').style.display = "none";
   document.getElementById('lps').style.display = "none";
   document.getElementById('bc').style.display = "none";
   
   if (document.getElementById('spanstuff')) {
   document.getElementById('spanstuff').innerHTML = "";
   }
   if (document.getElementById('spanstuff1')) {
   document.getElementById('spanstuff1').innerHTML = "";
   }
   if (document.getElementById('spanstuff2')) {
   document.getElementById('spanstuff2').innerHTML = "";
   }
   if (document.getElementById('spanstuff3')) {
   document.getElementById('spanstuff3').innerHTML = "";
   }
   if (document.getElementById('spanstuff4')) {
   document.getElementById('spanstuff4').innerHTML = "";
   }
   }
   
   function ChangeCell() {
   if (document.getElementById('cellnum').style.display == "none") {
   document.getElementById('cellnum').style.width = "100%";
   document.getElementById('cellnum').style.opacity = 0;
      document.getElementById('cellnum').style.MozOpacity = 0;
      document.getElementById('cellnum').style.KhtmlOpacity = 0;
      document.getElementById('cellnum').style.filter = "alpha(Opacity="+0+");";
   startFade('cellnum');
   document.getElementById('cellnum').style.display = "block";
   document.getElementById('spanstuff2').innerHTML = "<span name='myspan' id='myspan'></span>";
   } else {
   document.getElementById('cellnum').style.display = "none";
   document.getElementById('spanstuff2').innerHTML = "";
   }
   Disable10();
   document.getElementById('pass').style.display = "none";
   document.getElementById('emails').style.display = "none";
   document.getElementById('lps').style.display = "none";
   document.getElementById('bc').style.display = "none";
   document.getElementById('cp').style.display = "none";
   if (document.getElementById('spanstuff1')) {
   document.getElementById('spanstuff1').innerHTML = "";
   }
   if (document.getElementById('spanstuff')) {
   document.getElementById('spanstuff').innerHTML = "";
   }
   if (document.getElementById('spanstuff3')) {
   document.getElementById('spanstuff3').innerHTML = "";
   }
   if (document.getElementById('spanstuff4')) {
   document.getElementById('spanstuff4').innerHTML = "";
   }
   if (document.getElementById('spanstuff6')) {
   document.getElementById('spanstuff6').innerHTML = "";
   }
   }
   
   function ChangePlates() {
   if (document.getElementById('lps').style.display == "none") {
   document.form4.button.disabled=true;
   document.getElementById('lps').style.width = "100%";
   document.getElementById('lps').style.opacity = 0;
      document.getElementById('lps').style.MozOpacity = 0;
      document.getElementById('lps').style.KhtmlOpacity = 0;
      document.getElementById('lps').style.filter = "alpha(Opacity="+0+");";
   startFade('lps');
   document.getElementById('lps').style.display = "block";
   document.getElementById('spanstuff3').innerHTML = "<span name='myspan' id='myspan'></span>";
   } else {
   document.getElementById('lps').style.display = "none";
   document.getElementById('spanstuff3').innerHTML = "";
   }
   document.getElementById('pass').style.display = "none";
   document.getElementById('emails').style.display = "none";
   document.getElementById('cellnum').style.display = "none";
   document.getElementById('bc').style.display = "none";   
   document.getElementById('cp').style.display = "none";
   if (document.getElementById('spanstuff1')) {
   document.getElementById('spanstuff1').innerHTML = "";
   }
   if (document.getElementById('spanstuff2')) {
   document.getElementById('spanstuff2').innerHTML = "";
   }
   if (document.getElementById('spanstuff')) {
   document.getElementById('spanstuff').innerHTML = "";
   }
   if (document.getElementById('spanstuff4')) {
   document.getElementById('spanstuff4').innerHTML = "";
   } 
   if (document.getElementById('spanstuff6')) {
   document.getElementById('spanstuff6').innerHTML = "";
   }
   }
   
   function ChangeBlocked() {
   if (document.getElementById('bc').style.display == "none") {
   document.blocked.button.disabled=true;
   document.getElementById('bc').style.width = "100%";
   document.getElementById('bc').style.opacity = 0;
      document.getElementById('bc').style.MozOpacity = 0;
      document.getElementById('bc').style.KhtmlOpacity = 0;
      document.getElementById('bc').style.filter = "alpha(Opacity="+0+");";
   startFade('bc');
   document.getElementById('users').style.overflow = "auto";
   document.getElementById('bc').style.display = "block";
   document.getElementById('spanstuff4').innerHTML = "<span name='myspan' id='myspan'></span>";
   } else {
   document.getElementById('bc').style.display = "none";
   document.getElementById('spanstuff4').innerHTML = "";
   }
   document.getElementById('lps').style.display = "none";
   document.getElementById('pass').style.display = "none";
   document.getElementById('emails').style.display = "none";
   document.getElementById('cellnum').style.display = "none";
   document.getElementById('cp').style.display = "none";
   if (document.getElementById('spanstuff')) {
   document.getElementById('spanstuff').innerHTML = "";
   }
   if (document.getElementById('spanstuff1')) {
   document.getElementById('spanstuff1').innerHTML = "";
   }
   if (document.getElementById('spanstuff2')) {
   document.getElementById('spanstuff2').innerHTML = "";
   }
   if (document.getElementById('spanstuff3')) {
   document.getElementById('spanstuff3').innerHTML = "";
   }
   if (document.getElementById('spanstuff6')) {
   document.getElementById('spanstuff6').innerHTML = "";
   }
   }
   
   
   function Browse(state,page,sortby) {
	if (page == null) {
    page = 0;
    }
	document.getElementById('searching').innerHTML = "";
	document.getElementById('searching').style.visibility = "hidden";
	document.getElementById('searching').innerHTML = "<img src='/images/blank.gif' width='475' height='1' /><br />Sort by: <a href=\"javascript:Browse('"+state+"','0','newest');\">Newest</a> - <a href=\"javascript:Browse('"+state+"','0','oldest');\">Oldest</a> - <a href=\"javascript:Browse('"+state+"','0','wickedest');\">Wickedest</a> - <a href=\"javascript:Browse('"+state+"','0','lamest');\">Lamest</a> -  <a href=\"javascript:Browse('"+state+"','0','mostcommented');\">Most Commented</a> - <a href=\"javascript:Browse('"+state+"','0','mostrated');\">Most Rated</a><br /><br /><br />";
	document.getElementById('hatemp3didit').value = "";
	 document.getElementById('lovemp3didit').value = "";
	document.getElementById('searchplatego').value = "";
  document.getElementById('mostloved').innerHTML = ""; 
	  clearsearchfirst();
	  var poststr = "state="+state+"&page="+page+"&browse=true&sortby="+sortby;
	  makePOSTRequest("http://"+window.location.host+"/searchplates.php?state="+state+"&page="+page+"&browse=true&sortby="+sortby, poststr);
      }
	   
    
  function SearchPlates() {
  document.getElementById('searching').innerHTML = "";
  document.getElementById('searchplatego').value = "";
  document.getElementById('mostloved').innerHTML = "";
  document.getElementById('search').style.display = "none";
	    document.getElementById('search').style.width = "100%";
		document.getElementById('search').style.opacity = 0;
        document.getElementById('search').style.MozOpacity = 0;
        document.getElementById('search').style.KhtmlOpacity = 0;
        document.getElementById('search').style.filter = "alpha(Opacity="+0+");";  
  
  document.getElementById('search').innerHTML = "<div class=\"sbox\"><br /><form name='myform0' id='myform0' action=\"javascript:clearsearchfirst();get11(document.getElementById('myform0'));\"><p>State: <Select id='state' name='state' onChange='Disable4c();'><OPTION value='' selected>Select State</OPTION><OPTION value=AL>Alabama</OPTION><OPTION value=AK>Alaska</OPTION><OPTION value=AZ>Arizona</OPTION><OPTION value=AR>Arkansas</OPTION><OPTION value=CA>California</OPTION><OPTION value=CO>Colorado</OPTION><OPTION value=CT>Connecticut</OPTION><OPTION value=DE>Delaware</OPTION><OPTION value=FL>Florida</OPTION><OPTION value=GA>Georgia</OPTION><OPTION value=HI>Hawaii</OPTION><OPTION value=ID>Idaho</OPTION><OPTION value=IL>Illinois</OPTION><OPTION value=IN>Indiana</OPTION><OPTION value=IA>Iowa</OPTION><OPTION value=KS>Kansas</OPTION><OPTION value=KY>Kentucky</OPTION><OPTION value=LA>Louisiana</OPTION><OPTION value=ME>Maine</OPTION><OPTION value=MD>Maryland</OPTION><OPTION value=MA>Massachusetts</OPTION><OPTION value=MI>Michigan</OPTION><OPTION value=MN>Minnesota</OPTION><OPTION value=MS>Mississippi</OPTION><OPTION value=MO>Missouri</OPTION><OPTION value=MT>Montana</OPTION><OPTION value=NE>Nebraska</OPTION><OPTION value=NV>Nevada</OPTION><OPTION value=NH>New Hampshire</OPTION><OPTION value=NJ>New Jersey</OPTION><OPTION value=NM>New Mexico</OPTION><OPTION value=NY>New York</OPTION><OPTION value=NC>North Carolina</OPTION><OPTION value=ND>North Dakota</OPTION><OPTION value=OH>Ohio</OPTION><OPTION value=OK>Oklahoma</OPTION><OPTION value=OR>Oregon</OPTION><OPTION value=PA>Pennsylvania</OPTION><OPTION value=RI>Rhode Island</OPTION><OPTION value=SC>South Carolina</OPTION><OPTION value=SD>South Dakota</OPTION><OPTION value=TN>Tennessee</OPTION><OPTION value=TX>Texas</OPTION><OPTION value=UT>Utah</OPTION><OPTION value=VT>Vermont</OPTION><OPTION value=VA>Virginia</OPTION><OPTION value=WA>Washington</OPTION><OPTION value=DC>Washington D.C.</OPTION><OPTION value=WV>West Virginia</OPTION><OPTION value=WI>Wisconsin</OPTION><OPTION value=WY>Wyoming</OPTION></SELECT> &nbsp; Plate #: <input name='plate' id='plate' type='text' size='10' maxlength='15' onkeyup='Disable4c();'> <input type='button' name='button' id='button' value='Search Plate' onclick='clearsearchfirst();javascript:get11(this.parentNode);'/></form></p><p>Browse by state:<br /> <a class=\"alwayson4\" href=\"javascript:Browse('AL');\">AL</a> <a class=\"alwayson4\" href=\"javascript:Browse('AK');\">AK</a> <a class=\"alwayson4\" href=\"javascript:Browse('AZ');\">AZ</a> <a class=\"alwayson4\" href=\"javascript:Browse('AR');\">AR</a> <a class=\"alwayson4\" href=\"javascript:Browse('CA');\">CA</a> <a class=\"alwayson4\" href=\"javascript:Browse('CO');\">CO</a> <a class=\"alwayson4\" href=\"javascript:Browse('CT');\">CT</a> <a class=\"alwayson4\" href=\"javascript:Browse('DE');\">DE</a> <a class=\"alwayson4\" href=\"javascript:Browse('DC');\">DC</a> <a class=\"alwayson4\" href=\"javascript:Browse('FL');\">FL</a> <a class=\"alwayson4\" href=\"javascript:Browse('GA');\">GA</a> <a class=\"alwayson4\" href=\"javascript:Browse('HI');\">HI</a> <a class=\"alwayson4\" href=\"javascript:Browse('ID');\">ID</a> <a class=\"alwayson4\" href=\"javascript:Browse('IL');\">IL</a> <a class=\"alwayson4\" href=\"javascript:Browse('IN');\">IN</a> <a class=\"alwayson4\" href=\"javascript:Browse('IA');\">IA</a> <a class=\"alwayson4\" href=\"javascript:Browse('KS');\">KS</a> <a class=\"alwayson4\" href=\"javascript:Browse('KY');\">KY</a> <a class=\"alwayson4\" href=\"javascript:Browse('LA');\">LA</a> <a class=\"alwayson4\" href=\"javascript:Browse('ME');\">ME</a> <a class=\"alwayson4\" href=\"javascript:Browse('MD');\">MD</a> <a class=\"alwayson4\" href=\"javascript:Browse('MA');\">MA</a> <a class=\"alwayson4\" href=\"javascript:Browse('MI');\">MI</a> <a class=\"alwayson4\" href=\"javascript:Browse('MN');\">MN</a> <a class=\"alwayson4\" href=\"javascript:Browse('MS');\">MS</a> <a class=\"alwayson4\" href=\"javascript:Browse('MO');\">MO</a> <a class=\"alwayson4\" href=\"javascript:Browse('MT');\">MT</a> <a class=\"alwayson4\" href=\"javascript:Browse('NE');\">NE</a> <a class=\"alwayson4\" href=\"javascript:Browse('NV');\">NV</a> <a class=\"alwayson4\" href=\"javascript:Browse('NH');\">NH</a> <a class=\"alwayson4\" href=\"javascript:Browse('NJ');\">NJ</a> <a class=\"alwayson4\" href=\"javascript:Browse('NM');\">NM</a> <a class=\"alwayson4\" href=\"javascript:Browse('NY');\">NY</a> <a class=\"alwayson4\" href=\"javascript:Browse('NC');\">NC</a> <a class=\"alwayson4\" href=\"javascript:Browse('ND');\">ND</a> <a class=\"alwayson4\" href=\"javascript:Browse('OH');\">OH</a> <a class=\"alwayson4\" href=\"javascript:Browse('OK');\">OK</a> <a class=\"alwayson4\" href=\"javascript:Browse('OR');\">OR</a> <a class=\"alwayson4\" href=\"javascript:Browse('PA');\">PA</a> <a class=\"alwayson4\" href=\"javascript:Browse('RI');\">RI</a> <a class=\"alwayson4\" href=\"javascript:Browse('SC');\">SC</a> <a class=\"alwayson4\" href=\"javascript:Browse('SD');\">SD</a> <a class=\"alwayson4\" href=\"javascript:Browse('TN');\">TN</a> <a class=\"alwayson4\" href=\"javascript:Browse('TX');\">TX</a> <a class=\"alwayson4\" href=\"javascript:Browse('UT');\">UT</a> <a class=\"alwayson4\" href=\"javascript:Browse('VT');\">VT</a> <a class=\"alwayson4\" href=\"javascript:Browse('VA');\">VA</a> <a class=\"alwayson4\" href=\"javascript:Browse('WA');\">WA</a> <a class=\"alwayson4\" href=\"javascript:Browse('WV');\">WV</a> <a class=\"alwayson4\" href=\"javascript:Browse('WI');\">WI</a> <a class=\"alwayson4\" href=\"javascript:Browse('WY');\">WY</a></div></p><span style='display:none;filter:alpha(opacity=0);width:100%;' name='myspan0' id='myspan0'></span><span name='myspanw' id='myspanw'></span>";
  Disable4c();
  startFade('search');
  document.getElementById('search').style.display = "block";
  document.getElementById('mostlovehate').innerHTML = "<a href='javascript:MostLovedHated();DisableMost();'>most love and hate</a>";
  }
  
  function getlovehate(page,sortby) {
  document.getElementById('searchplatego').value = "";
  document.getElementById('mostloved').innerHTML = "";
  document.getElementById('hatemp3didit').value = "";
  document.getElementById('lovemp3didit').value = "";
  document.getElementById('searching').innerHTML = "<img src='/images/blank.gif' width='475' height='1' /><br />Sort by: <a href=\"javascript:getlovehate('0','newest');\">Newest</a> - <a href=\"javascript:getlovehate('0','oldest');\">Oldest</a> - <a href=\"javascript:getlovehate('0','wickedest');\">Wickedest</a> - <a href=\"javascript:getlovehate('0','lamest');\">Lamest</a> -  <a href=\"javascript:getlovehate('0','mostcommented');\">Most Commented</a> - <a href=\"javascript:getlovehate('0','mostrated');\">Most Rated</a><br /><br /><br />"; 
  if (page == null) {
  page = 0;
  }
  var poststr = "page="+page+"&sortby="+sortby;
  document.getElementById('search').style.display = "block";
  document.getElementById('search').innerHTML = "<span style='display:none;filter:alpha(opacity=0);width:100%;' name='myspan0' id='myspan0'></span><span name='myspanw' id='myspanw'></span>";
  document.getElementById('mostlovehate').innerHTML = "<a href='javascript:MostLovedHated();DisableMost();'>most love and hate</a>";
  makePOSTRequest("http://"+window.location.host+"/lovehate.php?page="+page+"&sortby="+sortby, poststr);
  }

  function LoadMyPlateCalls(page,sortby) {
  document.getElementById('searchplatego').value = "";
  document.getElementById('mostloved').innerHTML = "";
  document.getElementById('hatemp3didit').value = "";
  document.getElementById('lovemp3didit').value = "";
  document.getElementById('searching').innerHTML = "<img src='/images/blank.gif' width='475' height='1' /><br />Sort by: <a href=\"javascript:LoadMyPlateCalls('0','newest');\">Newest</a> - <a href=\"javascript:LoadMyPlateCalls('0','oldest');\">Oldest</a> - <a href=\"javascript:LoadMyPlateCalls('0','wickedest');\">Wickedest</a> - <a href=\"javascript:LoadMyPlateCalls('0','lamest');\">Lamest</a> -  <a href=\"javascript:LoadMyPlateCalls('0','mostcommented');\">Most Commented</a> - <a href=\"javascript:LoadMyPlateCalls('0','mostrated');\">Most Rated</a><br /><br /><br />"; 
  if (page == null) {
  page = 0;
  }
  var poststr = "page="+page+"&sortby="+sortby;
  document.getElementById('search').style.display = "block";
  document.getElementById('search').innerHTML = "<span style='display:none;filter:alpha(opacity=0);width:100%;' name='myspan0' id='myspan0'></span><span name='myspanw' id='myspanw'></span>";
  makePOSTRequest("http://"+window.location.host+"/load_plate_calls.php?page="+page+"&sortby="+sortby, poststr);
  }  
    
  function clearsearchfirst() {
  document.getElementById('myspan0').style.display = "none";
	    document.getElementById('myspan0').style.width = "100%";
		document.getElementById('myspan0').style.opacity = 0;
        document.getElementById('myspan0').style.MozOpacity = 0;
        document.getElementById('myspan0').style.KhtmlOpacity = 0;
        document.getElementById('myspan0').style.filter = "alpha(Opacity="+0+");";
  document.getElementById('myspanw').innerHTML = "";
  document.getElementById('myspan0').innerHTML = "";
  }
  
  
  function Search_Plate(plate,page,sortby) {
  if (page == null) {
  page = 0;
  }
  document.getElementById('searching').innerHTML = "";
  document.getElementById('hatemp3didit').value = "";
  document.getElementById('lovemp3didit').value = "";
  document.getElementById('searchplatego').value = "";
  document.getElementById('myspanw').innerHTML = "";
  document.getElementById('myspan0').innerHTML = "";
  document.getElementById('mostloved').innerHTML = "";
  document.getElementById('mostloved').innerHTML = "<span style='display:none;filter:alpha(opacity=0);width:100%;' name='myspan0' id='myspan0'></span><span name='myspanw' id='myspanw'></span>";
  var poststr = "searchplatelink="+plate+"&page="+page+"&sortby="+sortby;
  makePOSTRequest("http://"+window.location.host+"/searchplates.php?searchplatelink="+plate+"&page="+page+"&sortby="+sortby, poststr);
  }
  
  function LoveHate() {
  document.getElementById('mostloved').innerHTML = "";
  document.getElementById('search').innerHTML = "";
  //document.getElementById('left1').style.display = "block";
  //document.getElementById('right1').style.display = "block";
  document.getElementById('mostlovehate').innerHTML = "<a href='javascript:MostLovedHated();DisableMost();'>most love and hate</a>";
  location.reload();
 }
 
 function MostLovedHated(page) {
  if (page == null) {
  page = 0;
  }
  document.getElementById('searching').innerHTML = "";
  document.getElementById('searchplatego').value = "";
  document.getElementById('search').style.display = "none";
  document.getElementById('search').innerHTML = "";
  document.getElementById('mostloved').innerHTML = "<span style='display:none;filter:alpha(opacity=0);width:100%;' name='myspan0' id='myspan0'></span><span name='myspanw' id='myspanw'></span>";
  var poststr = "mostlovedandhated=go&page="+page;
  makePOSTRequest("http://"+window.location.host+"/searchplates.php?mostlovedandhated=go&page="+page, poststr);
 }
 
 function RateAvail(wheretogo) {
 if (document.getElementById(wheretogo).value == "") {
 document.getElementById(wheretogo).value = "yes";
 }
 }
 
 function StarMeBaby2(vavg,wheretogo) {
 
 
 if (vavg < 1) {
 document.getElementById(wheretogo+'star1').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star2').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star3').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star4').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star5').src = "/images/starblank.gif"; 
 }
 if (vavg < 1.5 && vavg > 0) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star3').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star4').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star5').src = "/images/starblank.gif"; 
 }
 if (vavg > 1.4 && vavg < 2) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/starhalf.gif";
 document.getElementById(wheretogo+'star3').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star4').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star5').src = "/images/starblank.gif"; 
 }
 if (vavg > 1.9 && vavg < 2.4) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/star.gif";
 document.getElementById(wheretogo+'star3').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star4').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star5').src = "/images/starblank.gif"; 
 }
 if (vavg > 2.4 && vavg < 3) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/star.gif";
 document.getElementById(wheretogo+'star3').src = "/images/starhalf.gif";
 document.getElementById(wheretogo+'star4').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star5').src = "/images/starblank.gif"; 
 }
 if (vavg > 2.9 && vavg < 3.4) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/star.gif";
 document.getElementById(wheretogo+'star3').src = "/images/star.gif";
 document.getElementById(wheretogo+'star4').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star5').src = "/images/starblank.gif"; 
 }
 if (vavg > 3.4 && vavg < 4) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/star.gif";
 document.getElementById(wheretogo+'star3').src = "/images/star.gif";
 document.getElementById(wheretogo+'star4').src = "/images/starhalf.gif";
 document.getElementById(wheretogo+'star5').src = "/images/starblank.gif"; 
 }
 if (vavg > 3.9 && vavg < 4.4) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/star.gif";
 document.getElementById(wheretogo+'star3').src = "/images/star.gif";
 document.getElementById(wheretogo+'star4').src = "/images/star.gif";
 document.getElementById(wheretogo+'star5').src = "/images/starblank.gif"; 
 }
 if (vavg > 4.4 && vavg < 5) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/star.gif";
 document.getElementById(wheretogo+'star3').src = "/images/star.gif";
 document.getElementById(wheretogo+'star4').src = "/images/star.gif";
 document.getElementById(wheretogo+'star5').src = "/images/starhalf.gif"; 
 }
 if (vavg > 4.8) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/star.gif";
 document.getElementById(wheretogo+'star3').src = "/images/star.gif";
 document.getElementById(wheretogo+'star4').src = "/images/star.gif";
 document.getElementById(wheretogo+'star5').src = "/images/star.gif"; 
 }
 }
 
 function StarMeBaby(rating,wheretogo) {
 

 if (rating == 1) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star3').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star4').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star5').src = "/images/starblank.gif";
 }
 if (rating == 2) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/star.gif";
 document.getElementById(wheretogo+'star3').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star4').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star5').src = "/images/starblank.gif";
 }
 if (rating == 3) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/star.gif";
 document.getElementById(wheretogo+'star3').src = "/images/star.gif";
 document.getElementById(wheretogo+'star4').src = "/images/starblank.gif";
 document.getElementById(wheretogo+'star5').src = "/images/starblank.gif";
 }
 if (rating == 4) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/star.gif";
 document.getElementById(wheretogo+'star3').src = "/images/star.gif";
 document.getElementById(wheretogo+'star4').src = "/images/star.gif";
 document.getElementById(wheretogo+'star5').src = "/images/starblank.gif";
 }
 if (rating == 5) {
 document.getElementById(wheretogo+'star1').src = "/images/star.gif";
 document.getElementById(wheretogo+'star2').src = "/images/star.gif";
 document.getElementById(wheretogo+'star3').src = "/images/star.gif";
 document.getElementById(wheretogo+'star4').src = "/images/star.gif";
 document.getElementById(wheretogo+'star5').src = "/images/star.gif";
 
 }
 }
  
  function ShowComments(whichone,howmany) {
  if (howmany == "0") {
  document.getElementById('no'+whichone).innerHTML = "<div class = \"thecomment\">No comments. <a class=\"alwayson\" href=\"javascript:AddComment(\'add"+whichone+"\',\'"+howmany+"\');\">Be the first</a> !</div>";
  }
  document.getElementById('js'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:HideComments(\'"+whichone+"\',\'"+howmany+"\');\">Comments("+howmany+")</a>";
  
  document.getElementById(whichone).style.display = "none";
  document.getElementById('add'+whichone).style.display = "none";
  
  
  startFade('no'+whichone);
  document.getElementById(whichone).style.display = "block";
  }
  


  function browserFix() {
  var browserfix = "";
  if(navigator.userAgent.indexOf("Firefox")!=-1){
  browserfix = "top:-10px";
  }
  if (navigator.appVersion.indexOf("MSIE")!=-1){
  browserfix = "top:5px";
  }
  return browserfix;
  } 
  
  function loadmap(whichone,latlong) {
  
  var mid = latlong.indexOf(',');
  var lat = latlong.substring(0,mid);
  var longs = latlong.substring(mid+1,latlong.length);
  lat = lat.replace(/\./,'');
  longs = longs.replace(/\./,'');
  lat = lat.substring(0,8);
  longs = longs.substring(0,10);
  lat = lat * 1;
  longs = longs * 1;
  longs = (4294967296+longs);
 
  var map = "style=\"background-image:url(http://www.google.com/mapdata?Point=b&Point.latitude_e6="+lat+"&Point.longitude_e6="+longs+"&Point.iconid=77&Point=e&latitude_e6="+lat+"&longitude_e6="+longs+"&zm=38400&w=85&h=75&cc=US&min_priority=1); background-repeat:no-repeat;background-position: 120px 5px;\"";
  
  return map;
  }
  
  
  function preloadmap(latlong) {
  
  var mid = latlong.indexOf(',');
  var lat = latlong.substring(0,mid);
  var longs = latlong.substring(mid+1,latlong.length);
  lat = lat.replace(/\./,'');
  longs = longs.replace(/\./,'');
  lat = lat.substring(0,8);
  longs = longs.substring(0,10);
  lat = lat * 1;
  longs = longs * 1;
  longs = (4294967296+longs);
 
  var premap = "http://www.google.com/mapdata?Point=b&Point.latitude_e6="+lat+"&Point.longitude_e6="+longs+"&Point.iconid=77&Point=e&latitude_e6="+lat+"&longitude_e6="+longs+"&zm=38400&w=85&h=75&cc=US&min_priority=1";
  
  return premap;
  }
  
  function UpdateLatLong(whichone) {
  var latlong = document.getElementById('latlong').value;
  document.getElementById('buttonsave').disabled = true;
  
  var whichclass = "thecomment";
  var map = loadmap(whichone,latlong);  
  var browserfix = browserFix();  
  var purpose = "Love";
  
  var purpose2 = "style=\"background-image:url(/images/pink_thumb.png); background-repeat:no-repeat;background-position: 120px 5px;\"";      
  
  if(whichone.indexOf('hate') != -1) {
  
  purpose = "Hate";
  var purpose2 = "style=\"background-image:url(/images/green_thumb.png); background-repeat:no-repeat;background-position: 120px 5px;\"";
  }
  
  if (parent.document.getElementById('status'+whichone).value == 0) {
  dowhat = "Disable";
  who = "Only you will be able to hear it";
  } else {
  dowhat = "Enable";
  who = "Let everyone listen in";
  }
  
  var mid = latlong.indexOf(',');
  var lat = latlong.substring(0,mid);
  var longs = latlong.substring(mid+1,latlong.length);
  lat = lat.replace(/\./,'');
  longs = longs.replace(/\./,'');
  lat = lat.substring(0,8);
  longs = longs.substring(0,10);
  lat = lat * 1;
  longs = longs * 1;
  longs = (4294967296+longs);
  parent.document.getElementById('theactions'+whichone).innerHTML = "<div class=\""+whichclass+"\" "+map+"><div id=\"map"+whichone+"\" "+purpose2+" >Here you can...<div style=\"position:relative;display:inline;\"><div style=\"position:absolute;display:inline;"+browserfix+"\"><span style=\"margin-left:29px;text-decoration:none;cursor:hand;cursor:pointer;\" id ='maplarge"+whichone+"'><img onclick=\"LargeMap('"+whichone+"','"+latlong+"');\" alt='View large map' title='View large map' border='0' src='/images/blank.gif' width='85' height='75' /></span></div></div><br /><br /><a alt='Share some "+purpose+"!' title='Share some "+purpose+"!' class=\"alwayson\" href=\"javascript:sendafriend('sendafriend"+whichone+"');\">Send a Friend</a><br /><a alt='Save this to your favorites for easy access' title='Save this to your favorites for easy access' class=\"alwayson\" href=\"javascript:addtofavorites('"+whichone+"')\">Add to Faves</a><br /><span id='dis"+whichone+"'><a alt='"+who+"' title='"+who+"' class=\"alwayson\" href=\"javascript:DisableMessage('"+whichone+"')\">"+dowhat+" Playback</a></span><br /><span id ='mapster"+whichone+"'><a alt='Pinpoint the location of where this happened' title='Pinpoint the location of where this happened' class=\"alwayson\" href=\"javascript:GeoCode('"+whichone+"','"+latlong+"')\">Modify Map</a></span><br /><br /></div></div>";
  
  parent.document.getElementById('js2'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:HideMyActions(\'"+whichone+"\',\'"+latlong+"\');\">Actions</a>";
  var poststr = "whichone="+whichone+"&latlong="+latlong;
  makePOSTRequest("http://"+window.location.host+"/updatelatlong.php?whichone="+whichone+"&latlong="+latlong, poststr);
  }

 function LargeMap(whichone,latlong) {
  document.getElementById('lovemp3didit').value = "";
  document.getElementById('hatemp3didit').value = "";
  document.cookie ="geowindow=2; path=/";
  DoMP3FlashFix();
  var purpose = "love";      
  var color1 = "#e24177";
  if(whichone.indexOf('hate') != -1) {
  purpose = "hate";
  color1 = "#88ab43";
  }
  var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://iplateu.com/largemap.php?latlong="+latlong+"&whichone="+whichone+"", "Where it happened...", "width=794px,height=548px,resize=1,scrolling=0,center=1");
  document.getElementById('drag-handle').style.backgroundImage = "";
  document.getElementById('drag-handle').style.backgroundColor = color1;
  
  document.onclick=check;
    
  function check(e){ 
  var geocookievalue = GetCookie('geowindow')*1;
  var target = (top.e && top.e.target) || (top.event && top.event.srcElement);
  
  geocookievalue = geocookievalue - 1;
  document.cookie ="geowindow="+geocookievalue*1+"; path=/";
  
  if (geocookievalue*1 < 1) {
  
   document.onclick="";
   document.cookie ="geowindow=; expires=Thu, 5 Jul 2000 20:47:11 UTC; path=/";
   document.getElementById('lovemp3didit').value = "";
   document.getElementById('hatemp3didit').value = "";
   DoMP3Stuff2();
   dhtmlwindow.minimize(googlewin.getElementsByTagName("img")[0], googlewin);
  }
  
  }
  
    googlewin.onclose=function(){ //Run custom code when window is being closed (return false to cancel action):
    //return //window.confirm("Close without saving?")
}

  
  }
  
  function LargeMap2(whichone,latlong,citystate) {
  document.getElementById('lovemp3didit').value = "";
  document.getElementById('hatemp3didit').value = "";
  document.cookie ="geowindow=2; path=/";
  DoMP3FlashFix();
  var city = citystate.substring(0,citystate.length-4);
  var purpose = "love";
  var something = "Feeling the Love in " +city;      
  var color1 = "#e24177";
  if(whichone.indexOf('hate') != -1) {
  purpose = "hate";
  color1 = "#88ab43";
  something = "What ain't right in " +city;
  }
  var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://iplateu.com/largemap2.php?latlong="+latlong+"&whichone="+whichone+"&citystate="+citystate+"", ""+something+"...", "width=794px,height=548px,resize=1,scrolling=0,center=1");
  document.getElementById('drag-handle').style.backgroundImage = "";
  document.getElementById('drag-handle').style.backgroundColor = color1;
  
  document.onclick=check2;
    
  function check2(e){ 
  var geocookievalue = GetCookie('geowindow')*1;
  var target = (top.e && top.e.target) || (top.event && top.event.srcElement);
  
  geocookievalue = geocookievalue - 1;
  document.cookie ="geowindow="+geocookievalue*1+"; path=/";
  
  if (geocookievalue*1 < 1) {
  
   document.onclick="";
   document.cookie ="geowindow=; expires=Thu, 5 Jul 2000 20:47:11 UTC; path=/";
   document.getElementById('lovemp3didit').value = "";
   document.getElementById('hatemp3didit').value = "";
   DoMP3Stuff2();
   dhtmlwindow.minimize(googlewin.getElementsByTagName("img")[0], googlewin);
  }
  
  }
  
    googlewin.onclose=function(){ //Run custom code when window is being closed (return false to cancel action):
    //return //window.confirm("Close without saving?")
}

  
  }
  
  
  function LargeMap3(whichone,plate) {
  document.getElementById('lovemp3didit').value = "";
  document.getElementById('hatemp3didit').value = "";
  document.cookie ="geowindow=2; path=/";
  DoMP3FlashFix();
  var purpose = "love";
  var something = "All of my Love";      
  var color1 = "#e24177";
  if(whichone.indexOf('hate') != -1) {
  purpose = "hate";
  color1 = "#88ab43";
  something = "All of my Hate";
  }
  if(plate!=null){
  something = "Where I plated "+plate+"";
  }
  if(whichone.indexOf('both') != -1) {
  purpose = "both";
  color1 = "#ffffff";
  something = "All my Love & Hate";
  plate = "";
  }
  var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://iplateu.com/largemap3.php?purpose="+purpose+"&plate="+plate+"", ""+something+"...", "width=794px,height=548px,resize=1,scrolling=0,center=1");
  document.getElementById('drag-handle').style.backgroundImage = "";
  document.getElementById('drag-handle').style.backgroundColor = color1;
  if(purpose == "both") {
  document.getElementById('drag-handle').style.backgroundImage = "url(/images/mashup.gif)";
  document.getElementById('drag-handle').style.backgroundRepeat = "repeat-x";
  }
  
  document.onclick=check3;
    
  function check3(e){ 
  var geocookievalue = GetCookie('geowindow')*1;
  var target = (top.e && top.e.target) || (top.event && top.event.srcElement);
  
  geocookievalue = geocookievalue - 1;
  document.cookie ="geowindow="+geocookievalue*1+"; path=/";
  
  if (geocookievalue*1 < 1) {
  
   document.onclick="";
   document.cookie ="geowindow=; expires=Thu, 5 Jul 2000 20:47:11 UTC; path=/";
   document.getElementById('lovemp3didit').value = "";
   document.getElementById('hatemp3didit').value = "";
   DoMP3Stuff2();
   dhtmlwindow.minimize(googlewin.getElementsByTagName("img")[0], googlewin);
  }
  
  }
  
    googlewin.onclose=function(){ //Run custom code when window is being closed (return false to cancel action):
    //return //window.confirm("Close without saving?")
}

  
  }

 function GeoCode(whichone,latlong) {
  document.getElementById('lovemp3didit').value = "";
  document.getElementById('hatemp3didit').value = "";
  //document.cookie ="geowindow=1; path=/";
  DoMP3FlashFix();       
  var color1 = "#e24177";
  if(whichone.indexOf('hate') != -1) {
  color1 = "#88ab43";
  }
  var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://iplateu.com/geocode.php?latlong="+latlong+"&whichone="+whichone+"", "Drag the pointer to set location", "width=794px,height=548px,resize=1,scrolling=1,center=1");
  document.getElementById('drag-handle').style.backgroundColor = color1;  
  document.onclick=check;
    
  function check(e){ 
  var geocookievalue = GetCookie('geowindow')*1;
  var target = (top.e && top.e.target) || (top.event && top.event.srcElement);
  
  geocookievalue = geocookievalue - 1;
  document.cookie ="geowindow="+geocookievalue*1+"; path=/";
  
  if (geocookievalue*1 < 1) {
  
   document.onclick="";
   document.cookie ="geowindow=; expires=Thu, 5 Jul 2000 20:47:11 UTC; path=/";
   document.getElementById('lovemp3didit').value = "";
   document.getElementById('hatemp3didit').value = "";
   DoMP3Stuff2();
   dhtmlwindow.minimize(googlewin.getElementsByTagName("img")[0], googlewin);
  }
  
  }
  
    googlewin.onclose=function(){ //Run custom code when window is being closed (return false to cancel action):
    //return //window.confirm("Close without saving?")
}

  
  }
	
  function ShowActions(whichone,latlong) {
  if(latlong != "") {
  var whichclass = "thecomment";
  var map = loadmap(whichone,latlong);
  var browserfix = browserFix();  
  var purpose = "style=\"background-image:url(/images/pink_thumb.png); background-repeat:no-repeat;background-position: 120px 5px;\"";
  } else {
  var whichclass = "thecommentM";
  var map ="";
  var browserfix="";
  var purpose = "";
  }
  document.getElementById('theactions'+whichone).innerHTML = "<div class=\""+whichclass+"\" "+map+"><div id=\"map"+whichone+"\" "+purpose+" >Here you can...<div style=\"position:relative;display:inline;\"><div style=\"position:absolute;display:inline;"+browserfix+"\"><span id='clickable"+whichone+"' style=\"margin-left:29px;text-decoration:none;cursor:hand;cursor:pointer;\"><img onclick=\"LargeMap('"+whichone+"','"+latlong+"');\" alt='View large map' title='View large map' border='0' src='/images/blank.gif' width='85' height='75' /></span></div></div><br /><br /><a alt='Share some Love!' title='Share some Love!' class=\"alwayson\" href=\"javascript:sendafriend('sendafriend"+whichone+"');\">Send a Friend</a><br /><a alt='Save this to your favorites for easy access' title='Save this to your favorites for easy access' class=\"alwayson\" href=\"javascript:addtofavorites('"+whichone+"')\">Add to Faves</a><br /><a alt='Send the plater a private message' title='Send the plater a private message' class=\"alwayson\" href=\"javascript:PM('sendafriend"+whichone+"')\">PM the Plater</a><br /><br /></div></div>";
  document.getElementById('js2'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:HideActions(\'"+whichone+"\',\'"+latlong+"\');\">Actions</a>";
  if(latlong == "") {
  document.getElementById('clickable'+whichone).innerHTML = "";
  }
  startFade('theactions'+whichone);
  if (document.getElementById('sendafriend'+whichone)) {
  document.getElementById('sendafriend'+whichone).style.display = "none";
  }
  document.getElementById('theactions'+whichone).style.display = "block";
  document.getElementById('actions'+whichone).style.display = "block";
  }
  
  function HideActions(whichone,latlong) {
  document.getElementById('js2'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:ShowActions(\'"+whichone+"\',\'"+latlong+"\');\">Actions</a>";
  document.getElementById('theactions'+whichone).style.display = "none";
  document.getElementById('actions'+whichone).style.display = "none";
  document.getElementById('sendafriend'+whichone).style.display = "none";
  }
  
  function ShowActions2(whichone,latlong) {
  if(latlong != "") {
  var whichclass = "thecomment";
  var map = loadmap(whichone,latlong);
  var browserfix = browserFix();
  var purpose = "style=\"background-image:url(/images/green_thumb.png); background-repeat:no-repeat;background-position: 120px 5px;\"";  
  } else {
  var whichclass = "thecommentM";
  var map ="";
  var browserfix="";
  var purpose = "";
  }
  document.getElementById('theactions'+whichone).innerHTML = "<div class=\""+whichclass+"\" "+map+"><div id=\"map"+whichone+"\" "+purpose+" >Here you can...<div style=\"position:relative;display:inline;\"><div style=\"position:absolute;display:inline;"+browserfix+"\"><span id='clickable"+whichone+"' style=\"margin-left:29px;text-decoration:none;cursor:hand;cursor:pointer;\"><img onclick=\"LargeMap('"+whichone+"','"+latlong+"');\" alt='View large map' title='View large map' border='0' src='/images/blank.gif' width='85' height='75' /></span></div></div><br /><br /><a alt='Share some Hate!' title='Share some Hate!' class=\"alwayson\" href=\"javascript:sendafriend('sendafriend"+whichone+"');\">Send a Friend</a><br /><a alt='Save this to your favorites for easy access' title='Save this to your favorites for easy access' class=\"alwayson\" href=\"javascript:addtofavorites('"+whichone+"')\">Add to Faves</a><br /><br />&nbsp;</div></div>";
  document.getElementById('js2'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:HideActions2(\'"+whichone+"\',\'"+latlong+"\');\">Actions</a>";
  if(latlong == "") {
  document.getElementById('clickable'+whichone).innerHTML = "";
  }
  startFade('theactions'+whichone);
  if (document.getElementById('sendafriend'+whichone)) {
  document.getElementById('sendafriend'+whichone).style.display = "none";
  }
  document.getElementById('theactions'+whichone).style.display = "block";
  document.getElementById('actions'+whichone).style.display = "block";
  }
  
  function HideActions2(whichone,latlong) {
  document.getElementById('js2'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:ShowActions2(\'"+whichone+"\',\'"+latlong+"\');\">Actions</a>";
  document.getElementById('theactions'+whichone).style.display = "none";
  document.getElementById('actions'+whichone).style.display = "none";
  document.getElementById('sendafriend'+whichone).style.display = "none";
  }
  
  function ShowMyActions(whichone,latlong) {
  if(latlong != "") {
  var whichclass = "thecomment";
  var map = loadmap(whichone,latlong);  
  var browserfix = browserFix();  
  var purpose = "Love";
  var purpose2 = "style=\"background-image:url(/images/pink_thumb.png); background-repeat:no-repeat;background-position: 120px 5px;\"";      
  if(whichone.indexOf('hate') != -1) {
  purpose = "Hate";
  var purpose2 = "style=\"background-image:url(/images/green_thumb.png); background-repeat:no-repeat;background-position: 120px 5px;\"";
  }
  } else {
  var whichclass = "thecommentM";
  var map ="";
  var browserfix="";
  var purpose2 = "";
  }
  if (document.getElementById('status'+whichone).value == 0) {
  dowhat = "Disable";
  who = "Only you will be able to hear it";
  } else {
  dowhat = "Enable";
  who = "Let everyone listen in";
  }
  
  document.getElementById('theactions'+whichone).innerHTML = "<div class=\""+whichclass+"\" "+map+"><div id=\"map"+whichone+"\" "+purpose2+" >Here you can...<div style=\"position:relative;display:inline;\"><div style=\"position:absolute;display:inline;"+browserfix+"\"><span id='clickable"+whichone+"' style=\"margin-left:29px;text-decoration:none;cursor:hand;cursor:pointer;\" id ='maplarge"+whichone+"'><img onclick=\"LargeMap('"+whichone+"','"+latlong+"');\" alt='View large map' title='View large map' border='0' src='/images/blank.gif' width='85' height='75' /></span></div></div><br /><br /><a alt='Share some "+purpose+"!' title='Share some "+purpose+"!' class=\"alwayson\" href=\"javascript:sendafriend('sendafriend"+whichone+"');\">Send a Friend</a><br /><a alt='Save this to your favorites for easy access' title='Save this to your favorites for easy access' class=\"alwayson\" href=\"javascript:addtofavorites('"+whichone+"')\">Add to Faves</a><br /><span id='dis"+whichone+"'><a alt='"+who+"' title='"+who+"' class=\"alwayson\" href=\"javascript:DisableMessage('"+whichone+"')\">"+dowhat+" Playback</a></span><br /><span id ='mapster"+whichone+"'><a alt='Pinpoint the location of where this happened' title='Pinpoint the location of where this happened' class=\"alwayson\" href=\"javascript:GeoCode('"+whichone+"','"+latlong+"')\">Modify Map</a></span><br /><br /></div></div>";
  document.getElementById('js2'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:HideMyActions(\'"+whichone+"\',\'"+latlong+"\');\">Actions</a>";
  if(latlong == "") {
  document.getElementById('clickable'+whichone).innerHTML = "";
  }
  startFade('theactions'+whichone);
  if (document.getElementById('sendafriend'+whichone)) {
  document.getElementById('sendafriend'+whichone).style.display = "none";
  }
  document.getElementById('theactions'+whichone).style.display = "block";
  document.getElementById('actions'+whichone).style.display = "block";
  }
  
  function HideMyActions(whichone,latlong) {
  document.getElementById('js2'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:ShowMyActions(\'"+whichone+"\',\'"+latlong+"\');\">Actions</a>";
  document.getElementById('theactions'+whichone).style.display = "none";
  document.getElementById('actions'+whichone).style.display = "none";
  document.getElementById('sendafriend'+whichone).style.display = "none";
  }
  
  function ShowActionsFave(whichone,latlong) {
  if(latlong != "") {
  var whichclass = "thecomment";
  var map = loadmap(whichone,latlong);
  var browserfix = browserFix();
  var purpose = "style=\"background-image:url(/images/pink_thumb.png); background-repeat:no-repeat;background-position: 120px 5px;\"";  
  } else {
  var whichclass = "thecommentM";
  var map ="";
  var browserfix="";
  var purpose = "";
  }
  document.getElementById('theactions'+whichone).innerHTML = "<div class=\""+whichclass+"\" "+map+"><div id=\"map"+whichone+"\" "+purpose+" >Here you can...<div style=\"position:relative;display:inline;\"><div style=\"position:absolute;display:inline;"+browserfix+"\"><span id='clickable"+whichone+"' style=\"margin-left:29px;text-decoration:none;cursor:hand;cursor:pointer;\"><img onclick=\"LargeMap('"+whichone+"','"+latlong+"');\" alt='View large map' title='View large map' border='0' src='/images/blank.gif' width='85' height='75' /></span></div></div><br /><br /><a alt='Share some Love!' title='Share some Love!' class=\"alwayson\" href=\"javascript:sendafriend('sendafriend"+whichone+"');\">Send a Friend</a><br /><a alt='Send the plater a private message' title='Send the plater a private message' class=\"alwayson\" href=\"javascript:PM('sendafriend"+whichone+"')\">PM the Plater</a><br /><a alt=\"I don\'t want this no more\" title=\"I don\'t want this no more\" class=\"alwayson\" href=\"javascript:delfavorites('"+whichone+"','"+document.getElementById('lovecount').value+"','"+document.getElementById('hatecount').value+"')\">Remove Fave</a><br /><br /></div></div>";
  document.getElementById('js2'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:HideActionsFave(\'"+whichone+"\',\'"+latlong+"\');\">Actions</a>";
  if (document.getElementById('sendafriend'+whichone)) {
  document.getElementById('sendafriend'+whichone).style.display = "none";
  }
  if(latlong == "") {
  document.getElementById('clickable'+whichone).innerHTML = "";
  }
  startFade('theactions'+whichone);
  document.getElementById('actions'+whichone).style.display = "block";
  }
  
  function HideActionsFave(whichone,latlong) {
  document.getElementById('js2'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:ShowActionsFave(\'"+whichone+"\',\'"+latlong+"\');\">Actions</a>";
  document.getElementById('actions'+whichone).style.display = "none";
  document.getElementById('sendafriend'+whichone).style.display = "none";
  
  }
  
  function ShowActions2Fave(whichone,latlong) {
  if(latlong != "") {
  var whichclass = "thecomment";
  var map = loadmap(whichone,latlong);
  var browserfix = browserFix();  
  var purpose = "style=\"background-image:url(/images/green_thumb.png); background-repeat:no-repeat;background-position: 120px 5px;\"";
  } else {
  var whichclass = "thecommentM";
  var map ="";
  var browserfix="";
  var purpose = "";
  }
  document.getElementById('theactions'+whichone).innerHTML = "<div class=\""+whichclass+"\" "+map+"><div "+purpose+" >Here you can...<div style=\"position:relative;display:inline;\"><div style=\"position:absolute;display:inline;"+browserfix+"\"><span id='clickable"+whichone+"' style=\"margin-left:29px;text-decoration:none;cursor:hand;cursor:pointer;\"><img onclick=\"LargeMap('"+whichone+"','"+latlong+"');\" alt='View large map' title='View large map' border='0' src='/images/blank.gif' width='85' height='75' /></span></div></div><br /><br /><a alt='Share some Hate!' title='Share some Hate!' class=\"alwayson\" href=\"javascript:sendafriend('sendafriend"+whichone+"');\">Send a Friend</a><br /><a alt=\"I don\'t want this no more\" title=\"I don\'t want this no more\" class=\"alwayson\" href=\"javascript:delfavorites('"+whichone+"','"+document.getElementById('lovecount').value+"','"+document.getElementById('hatecount').value+"')\">Remove Fave</a><br /><br />&nbsp;</div></div>";
  document.getElementById('js2'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:HideActions2Fave(\'"+whichone+"\',\'"+latlong+"\');\">Actions</a>";
  if(latlong == "") {
  document.getElementById('clickable'+whichone).innerHTML = "";
  }
  startFade('theactions'+whichone);
  document.getElementById('actions'+whichone).style.display = "block";
  }
  
  function HideActions2Fave(whichone,latlong) {
  document.getElementById('js2'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:ShowActions2Fave(\'"+whichone+"\',\'"+latlong+"\');\">Actions</a>";
  document.getElementById('actions'+whichone).style.display = "none";
  document.getElementById('sendafriend'+whichone).style.display = "none";
  }
  
  function ShowComments2(whichone,howmany) {
  document.getElementById('js'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:HideComments2(\'"+whichone+"\',\'"+howmany+"\');\">Comments("+howmany+")</a>";
  startFade('no'+whichone);
  document.getElementById(whichone).style.display = "block";
  }
  
  function HideComments(whichone,howmany) {
  document.getElementById('js'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:ShowComments(\'"+whichone+"\',\'"+howmany+"\');\">Comments("+howmany+")</a>";
  document.getElementById(whichone).style.display = "none";
  document.getElementById('add'+whichone).style.display = "none";
  }
  
  function HideComments2(whichone,howmany) {
  document.getElementById('js'+whichone).innerHTML = "<a class=\"alwayson\" href=\"javascript:ShowComments2(\'"+whichone+"\',\'"+howmany+"\');\">Comments("+howmany+")</a>";
  document.getElementById(whichone).style.display = "none";
  document.getElementById('add'+whichone).style.display = "none";
  }
  
  function addtofavorites(whichone) {
  if (document.getElementById('membername').value == "") {
	  alert("Please login to add to favorites ");
	  } else {
  document.getElementById('thecorrectsendafriendspan').value = "sendafriend"+whichone;
  document.getElementById('sendafriend'+whichone).style.display = "none";
  var poststr = "myfave="+whichone;
  makePOSTRequest("http://"+window.location.host+"/addtofaves.php?myfave="+whichone, poststr);
  }
  }
  
  function DisableMessage(whichone) {
  if (document.getElementById('membername').value == "") {
	  alert("Please login to disable messages");
	  } else {
  document.getElementById('whichonestatus').value = whichone;
  document.getElementById('thecorrectsendafriendspan').value = "sendafriend"+whichone;
  document.getElementById('sendafriend'+whichone).style.display = "none";
  var poststr = "disable="+whichone;
  makePOSTRequest("http://"+window.location.host+"/disablemessage.php?disable="+whichone, poststr);
  }
  }
  
  function AddComment(whichone,numcomments) {
  if (document.getElementById('membername').value == "") {
	  alert("Please login to comment ");
	  } else {
   
   var whichone2 = whichone.substring(11,whichone.length);
   document.getElementById('sendafriend'+whichone2).style.display = "none";
   //document.getElementById('actions'+whichone2).style.display = "none";
   
   document.getElementById(whichone).style.opacity = 0;
      document.getElementById(whichone).style.MozOpacity = 0;
      document.getElementById(whichone).style.KhtmlOpacity = 0;
      document.getElementById(whichone).style.filter = "alpha(Opacity="+0+")";
   document.getElementById(whichone).style.display = "none";
     
   document.getElementById(whichone).innerHTML = "<form name=\""+whichone+"form\" id=\""+whichone+"form\" method=\"post\" action=\"\">Your comments:<br /><br /><textarea name=\""+whichone+"text\" id=\""+whichone+"text\" onkeyup=\"DisableComment(\'"+whichone+"\');\" class=\"comments\" cols=\"10\" rows=\"3\"></textarea><br /><br /><span style=\"background-color:#fff;\"><input class='commentbutton' type='button' name=\""+whichone+"button\" id=\""+whichone+"button\" value='Submit' onclick=\"PostComment(\'"+whichone+"\',\'"+numcomments+"\');\"/></span></form><br /><br />";
   document.getElementById(whichone+"text").style.width = "100%";
   document.getElementById(whichone).style.width = "100%";
   document.getElementById(whichone+"text").style.overflow = "auto";
   document.getElementById(whichone+'button').disabled = true;
   
   startFade(whichone);
   document.getElementById(whichone).style.display = "block";
   
    
   document.getElementById(whichone+'text').focus();
   document.getElementById(whichone+'text').focus();
   
   
    }
  }
  
  function sendafriend(whichone) {
  if (document.getElementById('membername').value == "") {
	  alert("Please login to Send a Friend");
	  } else {
   var whichone3 = whichone.substring(11,whichone.length);
      
   
   var whichone2 = whichone.substring(11,whichone.length);
   whichone2 = "addcomments"+whichone2;
   if (document.getElementById(whichone2)) {
   document.getElementById(whichone2).style.display = "none";
   }
   document.getElementById(whichone).style.display = "none";
   document.getElementById(whichone).innerHTML = "<div id='"+whichone+"friend' class=\"sendafriend2\"><form action=\"javascript:gosendafriend(\'"+whichone+"\');\" name=\""+whichone+"form\" id=\""+whichone+"form\">Your friend's email:<br /><input type='text' class=\"textspace\" size='30' maxlength='60' name=\""+whichone+"text\" id=\""+whichone+"text\" onkeyup=\"DisableSend(\'"+whichone+"\');\"><br /><span style=\"margin-left:20px;background-color:#fff;\"><input class='commentbutton' type='button' name=\""+whichone+"button\" id=\""+whichone+"button\" value='Send' onclick=\"gosendafriend(\'"+whichone+"\');\"/></span></form><br /><br /></div>";
  
  document.getElementById(whichone+"friend").style.opacity = 0;
      document.getElementById(whichone+"friend").style.MozOpacity = 0;
      document.getElementById(whichone+"friend").style.KhtmlOpacity = 0;
      document.getElementById(whichone+"friend").style.filter = "alpha(Opacity="+0+")";
   document.getElementById(whichone+"friend").style.display = "none";
   //document.getElementById(whichone).style.width = "100%";
   document.getElementById(whichone+"friend").style.width = "100%";
  document.getElementById(whichone+"text").style.width = "214px";
   document.getElementById(whichone+'button').disabled = true;
   
   startFade(whichone+"friend");
   document.getElementById(whichone+"friend").style.display = "block";
   document.getElementById(whichone).style.display = "block";
   
   //var yposnew = findPosY(document.getElementById('footer'));
   //var yposold = document.getElementById('posyoldmap'+whichone3).value; 
   //var diff = yposnew - yposold;
   //document.getElementById('map'+whichone3).style.top = diff+'px';
   
   document.getElementById(whichone+'text').focus();
   document.getElementById(whichone+'text').focus();
   
   
    }
  }
  
  function PM(whichone) {
  if (document.getElementById('membername').value == "") {
	  alert("Please login to send PM's");
	  } else {
   
   var whichone3 = whichone.substring(11,whichone.length);
   var whichone2 = whichone.substring(11,whichone.length);
   document.getElementById('addcomments'+whichone2).style.display = "none";
   
   document.getElementById(whichone).style.opacity = 0;
      document.getElementById(whichone).style.MozOpacity = 0;
      document.getElementById(whichone).style.KhtmlOpacity = 0;
      document.getElementById(whichone).style.filter = "alpha(Opacity="+0+")";
   document.getElementById(whichone).style.display = "none";
     
   document.getElementById(whichone).innerHTML = "<form action=\"javascript:gopm(\'"+whichone+"\');\" name=\""+whichone+"form\" id=\""+whichone+"form\">Private message the plater:<br /><br /><textarea class=\"comments\" cols=\"10\" rows=\"3\" name=\""+whichone+"text\" id=\""+whichone+"text\" onkeyup=\"DisableComment(\'"+whichone+"\');\"></textarea><br /><br /><span style=\"margin-left:20px;background-color:#fff;\"><input class='commentbutton' type='button' name=\""+whichone+"button\" id=\""+whichone+"button\" value='Send' onclick=\"gopm(\'"+whichone+"\');\"/></span></form><br /><br />";
  
   document.getElementById(whichone+"text").style.width = "100%";
   document.getElementById(whichone).style.width = "100%";
   document.getElementById(whichone+"text").style.overflow = "auto";
  
   document.getElementById(whichone+'button').disabled = true;
   
   startFade(whichone);
   document.getElementById(whichone).style.display = "block";
   
   //var yposnew = findPosY(document.getElementById('footer'));
   //var yposold = document.getElementById('posyoldmap'+whichone3).value; 
   //var diff = yposnew - yposold;
   //document.getElementById('map'+whichone3).style.top = diff+'px';
   document.getElementById(whichone+'text').focus();
   document.getElementById(whichone+'text').focus();
   
   
    }
  }

function PM2(whichone,who) {
  if (document.getElementById('membername').value == "") {
	  alert("Please login to send PM's");
	  } else {
   
   var whichone2 = whichone.substring(11,whichone.length);
   if (document.getElementById(whichone)) {
   document.getElementById(whichone).style.display = "none";
   }
   
   whichone = "addcomments" +whichone2;
   
   document.getElementById(whichone).style.opacity = 0;
      document.getElementById(whichone).style.MozOpacity = 0;
      document.getElementById(whichone).style.KhtmlOpacity = 0;
      document.getElementById(whichone).style.filter = "alpha(Opacity="+0+")";
   document.getElementById(whichone).style.display = "none";
     
   document.getElementById(whichone).innerHTML = "<form action=\"javascript:gopm2(\'"+whichone+"\',\'"+who+"\');\" name=\""+whichone+"form\" id=\""+whichone+"form\">Private message "+who+":<br /><br /><textarea class=\"comments\" cols=\"10\" rows=\"3\" name=\""+whichone+"text\" id=\""+whichone+"text\" onkeyup=\"DisableComment(\'"+whichone+"\');\"></textarea><br /><br /><span style=\"margin-left:20px;background-color:#fff;\"><input class='commentbutton' type='button' name=\""+whichone+"button\" id=\""+whichone+"button\" value='Send' onclick=\"gopm2(\'"+whichone+"\',\'"+who+"\');\"/></span></form><br /><br />";
  
   document.getElementById(whichone+"text").style.width = "100%";
   document.getElementById(whichone).style.width = "100%";
   document.getElementById(whichone+"text").style.overflow = "auto";
  
   document.getElementById(whichone+'button').disabled = true;
   
   startFade(whichone);
   document.getElementById(whichone).style.display = "block";
   
   
   document.getElementById(whichone+'text').focus();
   document.getElementById(whichone+'text').focus();
   
    }
  }

  
  function DisableSend(whichone) {
  email = document.getElementById(whichone+'text').value;
  email = email.replace(/\s+/g,'');
  var at = email.indexOf("@");
  var dot = email.indexOf(".");
  if (document.getElementById(whichone+'text').value == "" || email.length < 6 || at == -1 || dot == -1 || email.charAt(0) == "@" || email.charAt(email.length) == "." || email.charAt(email.length-1) == "." || email.charAt(email.length-2) == ".") {
  document.getElementById(whichone+'button').disabled = true;
  } else {
  document.getElementById(whichone+'button').disabled = false;
  }
  }
  
  function ClearComment(whichone) {  
  if (document.getElementById(whichone+'text').value == "comment here...") {
  document.getElementById(whichone+'text').value = "";
  }
  }
    
  function DisableComment(whichone) {  
  commentlength = document.getElementById(whichone+'text').value;
  commentlength = commentlength.replace(/\s+/g,'');
  if (document.getElementById(whichone+'text').value == "" || document.getElementById(whichone+'text').value.length < 1 || commentlength.length < 1 ) {
  document.getElementById(whichone+'button').disabled = true;
  } else {
  document.getElementById(whichone+'button').disabled = false;
  }
  }
  
  function Rememberme() {  
  if (document.getElementById('rememberme').value == "") {
  document.getElementById('rememberme').value = "yes";
  } else {
  document.getElementById('rememberme').value = "";
  }
  }

  function LogOut() {
  document.cookie ="rememberme=; expires=Thu, 5 Jul 2000 20:47:11 UTC; path=/";
  document.cookie ="remembermep=; expires=Thu, 5 Jul 2000 20:47:11 UTC; path=/";
  setTimeout("document.location = 'http://iplateu.com/index.php?logout'",50);
  }
 

 function WriteCall(where) {
 if (where.indexOf("disabled") != -1){
 document.getElementById(where).innerHTML = "<span style=\"position: relative; z-index: 0;\"><embed src='http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/xspf_player_slim.swf?playlist_url=http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/disabled.xspf&timedisplay=2' quality='high' bgcolor='#E6E6E6' name='xspf_player' allowscriptaccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' align='center' height='16' width='164'></embed></span>";
 } else {
document.getElementById(where).innerHTML = "<span style=\"position: relative; z-index: 0;\"><embed src='http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/xspf_player_slim.swf?playlist_url=http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/"+where+".xspf&timedisplay=2' quality='high' bgcolor='#E6E6E6' name='xspf_player' allowscriptaccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' align='center' height='16' width='164'></embed></span>"; 
 }
 }
 
  function DoMP3Stuff() {

  if(document.getElementById('lovemp3') && document.getElementById('lovemp3didit').value == "" ) {
	if(document.getElementById('lovemp3').value != "") {
	
	var mylovemp3s = document.getElementById('lovemp3').value;
	var lovelength = mylovemp3s.length;
	mylovemp3s = mylovemp3s.substring(0,lovelength-1);
	var lovemp3array = mylovemp3s.split(",");
	
	var preloadlovemap = document.getElementById('preloadlovemap').value;
	preloadlovemap = preloadlovemap.substring(0,lovelength-1);
	var lovemap = preloadlovemap.split("*");
	
	var part_num=0;
    while (part_num < lovemp3array.length){
	
	if(lovemap[part_num] !=""){
	var premap = preloadmap(lovemap[part_num]);
	//lovemap[part_num] = new Image(85,75);
    //lovemap[part_num].src = premap;
	document.getElementById('preloads').innerHTML = document.getElementById('preloads').innerHTML + " <img style=\"visibility:hidden\" height='75' width='85' src='"+premap+"' />";
	}
	
	if (lovemp3array[part_num].indexOf("disabled") != -1){
	document.getElementById(lovemp3array[part_num]).innerHTML = "<span style=\"position: relative; z-index: 0;\"><embed src='http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/xspf_player_slim.swf?playlist_url=http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/disabled.xspf&timedisplay=2' quality='high' bgcolor='#E6E6E6' name='xspf_player' allowscriptaccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' align='center' height='16' width='164'></embed></span>";
	} else {
   document.getElementById(lovemp3array[part_num]).innerHTML = "<span style=\"position: relative; z-index: 0;\"><embed src='http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/xspf_player_slim.swf?playlist_url=http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/"+lovemp3array[part_num]+".xspf&timedisplay=2' quality='high' bgcolor='#E6E6E6' name='xspf_player' allowscriptaccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' align='center' height='16' width='164'></embed></span>";
   
   }
   part_num+=1;
   //setTimeout("",100);
   }
   
	}
	document.getElementById('lovemp3didit').value = "yes";
	}
	
	if(document.getElementById('hatemp3') && document.getElementById('hatemp3didit').value == "") {
	if(document.getElementById('hatemp3').value != "") {
	
	var myhatemp3s = document.getElementById('hatemp3').value;
	var hatelength = myhatemp3s.length;
	myhatemp3s = myhatemp3s.substring(0,hatelength-1);
	var hatemp3array = myhatemp3s.split(",");
	
	var part_num2=0;
    
	var preloadhatemap = document.getElementById('preloadhatemap').value;
	preloadhatemap = preloadhatemap.substring(0,hatelength-1);
	var hatemap = preloadhatemap.split("*");
	
	while (part_num2 < hatemp3array.length) {
	
	if(hatemap[part_num2] !=""){
	var premap2 = preloadmap(hatemap[part_num2]);
	//hatemap[part_num2] = new Image(85,75);
    //hatemap[part_num2].src = premap2;
	document.getElementById('preloads').innerHTML = document.getElementById('preloads').innerHTML + " <img style=\"visibility:hidden\" height='75' width='85' src='"+premap2+"' />";
	}
	
    if (hatemp3array[part_num2].indexOf("disabled") != -1){
	document.getElementById(hatemp3array[part_num2]).innerHTML = "<span style=\"position: relative; z-index: 0;\"><embed src='http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/xspf_player_slim.swf?playlist_url=http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/disabled.xspf&timedisplay=2' quality='high' bgcolor='#E6E6E6' name='xspf_player' allowscriptaccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' align='center' height='16' width='164'></embed></span>";
	} else {
    document.getElementById(hatemp3array[part_num2]).innerHTML = "<span style=\"position: relative; z-index: 0;\"><embed src='http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/xspf_player_slim.swf?playlist_url=http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/"+hatemp3array[part_num2]+".xspf&timedisplay=2' quality='high' bgcolor='#E6E6E6' name='xspf_player' allowscriptaccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' align='center' height='16' width='164'></embed></span>";
   }
   part_num2+=1;
   //setTimeout("",100);
   }
   
	}
	
	document.getElementById('hatemp3didit').value = "yes";
	}
			

  if (document.getElementById('hidesearching')) {
	if (document.getElementById('hidesearching').value == "yes") {
	document.getElementById('searching').innerHTML = "";
	}
	}
	
	if (document.getElementById('searching')) { 
	if (document.getElementById('searching').style.visibility != "visible") {
	document.getElementById('searching').innerHTML = "<img src='/images/blank.gif' width='475' height='1' /><br />"+document.getElementById('pagestuff').innerHTML+"<br /><br /><br />"+document.getElementById('searching').innerHTML;
	document.getElementById('searching').style.visibility = "visible";
    if (document.getElementById('googs')) {
	  document.getElementById('googs').style.visibility = "visible";
	  }
	}
  } 
  }
 
 
 function DoMP3Stuff2() {
  top.document.onclick="";
  if(top.document.getElementById('lovemp3') && top.document.getElementById('lovemp3didit').value == "" ) {
	if(top.document.getElementById('lovemp3').value != "") {
	var ff3 = top.document.getElementById('ff3').value;
	var mylovemp3s = top.document.getElementById('lovemp3').value;
	var lovelength = mylovemp3s.length;
	mylovemp3s = mylovemp3s.substring(0,lovelength-1);
	var lovemp3array = mylovemp3s.split(",");
	
	var part_num=0;
    while (part_num < lovemp3array.length){
	if (lovemp3array[part_num].indexOf("disabled") != -1){
	top.document.getElementById(lovemp3array[part_num]).innerHTML = "<span style=\"position: relative; z-index: 0;\"><embed src='http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/xspf_player_slim.swf?playlist_url=http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/disabled.xspf&timedisplay=2' quality='high' bgcolor='#E6E6E6' name='xspf_player' allowscriptaccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' align='center' height='16' width='164'></embed></span>";
	} else {
    top.document.getElementById(lovemp3array[part_num]).innerHTML = "<span style=\"position: relative; z-index: 0;\"><embed src='http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/xspf_player_slim.swf?playlist_url=http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/"+lovemp3array[part_num]+".xspf&timedisplay=2' quality='high' bgcolor='#E6E6E6' name='xspf_player' allowscriptaccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' align='center' height='16' width='164'></embed></span>";
   
   }
   part_num+=1;
   //setTimeout("",100);
   }
   
	}
	top.document.getElementById('lovemp3didit').value = "yes";
	}
	
	if(top.document.getElementById('hatemp3') && top.document.getElementById('hatemp3didit').value == "") {
	if(top.document.getElementById('hatemp3').value != "") {
	var ff3 = top.document.getElementById('ff3').value;
	var myhatemp3s = top.document.getElementById('hatemp3').value;
	var hatelength = myhatemp3s.length;
	myhatemp3s = myhatemp3s.substring(0,hatelength-1);
	var hatemp3array = myhatemp3s.split(",");
	
	var part_num2=0;
    while (part_num2 < hatemp3array.length) {
    if (hatemp3array[part_num2].indexOf("disabled") != -1){
	top.document.getElementById(hatemp3array[part_num2]).innerHTML = "<span style=\"position: relative; z-index: 0;\"><embed src='http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/xspf_player_slim.swf?playlist_url=http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/disabled.xspf&timedisplay=2' quality='high' bgcolor='#E6E6E6' name='xspf_player' allowscriptaccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' align='center' height='16' width='164'></embed></span>";
	} else {
    top.document.getElementById(hatemp3array[part_num2]).innerHTML = "<span style=\"position: relative; z-index: 0;\"><embed src='http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/xspf_player_slim.swf?playlist_url=http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/"+hatemp3array[part_num2]+".xspf&timedisplay=2' quality='high' bgcolor='#E6E6E6' name='xspf_player' allowscriptaccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' align='center' height='16' width='164'></embed></span>";
   
   }
   part_num2+=1;
   //setTimeout("",100);
   }
   
	}
	
	top.document.getElementById('hatemp3didit').value = "yes";
	document.cookie ="geowindow=; expires=Thu, 5 Jul 2000 20:47:11 UTC; path=/";
	top.document.getElementById('hider').style.display = "none";
	}
  }
 
 function DoMP3FlashFix() {
  
  if(document.getElementById('lovemp3') && document.getElementById('lovemp3didit').value == "" ) {
	if(document.getElementById('lovemp3').value != "") {
	
	var mylovemp3s = document.getElementById('lovemp3').value;
	var lovelength = mylovemp3s.length;
	mylovemp3s = mylovemp3s.substring(0,lovelength-1);
	var lovemp3array = mylovemp3s.split(",");	
	var part_num=0;
    while (part_num < lovemp3array.length){
	if (lovemp3array[part_num].indexOf("disabled") != -1){
	document.getElementById(lovemp3array[part_num]).innerHTML = "<img src='/images/flashfix.gif' height='18' width='164' />";
	} else {
    document.getElementById(lovemp3array[part_num]).innerHTML = "<img src='/images/flashfix.gif' height='18' width='164' />";
	//<img src='/images/flashfix.gif' height='16' width='"+ff3+"' />
   
   }
   part_num+=1;
   //setTimeout("",100);
   }
   
	}
	document.getElementById('lovemp3didit').value = "yes";
	}
	
	if(document.getElementById('hatemp3') && document.getElementById('hatemp3didit').value == "") {
	if(document.getElementById('hatemp3').value != "") {
	
	var myhatemp3s = document.getElementById('hatemp3').value;
	var hatelength = myhatemp3s.length;
	myhatemp3s = myhatemp3s.substring(0,hatelength-1);
	var hatemp3array = myhatemp3s.split(",");
	
	var part_num2=0;
    while (part_num2 < hatemp3array.length) {
    if (hatemp3array[part_num2].indexOf("disabled") != -1){
	document.getElementById(hatemp3array[part_num2]).innerHTML = "<img src='/images/flashfix.gif' height='18' width='164' />";
	} else {
   document.getElementById(hatemp3array[part_num2]).innerHTML = "<img src='/images/flashfix.gif' height='18' width='164' />";
   
   }
   part_num2+=1;
   //setTimeout("",100);
   }
   
	}
	var wide = document.body.clientWidth;
  var high = document.body.clientHeight;
	document.getElementById('hatemp3didit').value = "yes";
    top.document.getElementById('hider').innerHTML="<div style='position: absolute;background: black url(/style/dhtml/modalfiles/blackdot.gif);width: "+wide+"px;height:"+high+"px;left: 0;top: 0;z-index: 5;filter:alpha(opacity=20); opacity: 0.2;'></div>";
  
  top.document.getElementById('hider').style.display = "block";
  } 
  }
 
 //you can set these variables
var totalTime = 250;//in milliseconds
var startOpacity = 0.00; // starting point for fade 
var stopOpacity = 99.9990; //end point for fade
var numberOfSteps = 8; //number of steps

//other variables
var speed; //in milliseconds
var opacity; //starting point
var step; //interval for each one
var div;
var startOpacity;

function startFade(elName){
 opacity = startOpacity;
 step = (stopOpacity - startOpacity) / numberOfSteps;
 speed = totalTime / numberOfSteps;
 div = document.getElementById(elName);
 if (elName.indexOf("*") !=-1) {
 elName = elName.substring(1,elName.length);
 div = top.document.getElementById(elName);
 }
 
 
 repeatFade();
 return true;
}

function repeatFade() {
 opacity += step;
 opacity = Math.round(opacity * 1000) / 1000;
 var last = false;
 if(Math.abs(stopOpacity - opacity) < Math.abs(step)) { 
  opacity = stopOpacity;
  last = true;
 }
 if(opacity >= 0 && opacity <= 100) {
  div.style.filter = "alpha(opacity="+Math.round(opacity)+")";// IE/Winfilter: alpha(opacity=50)
  div.style.KHTMLOpacity = opacity/100;// Safari<1.2, Konqueror
  div.style.MozOpacity = opacity/100;// Older Mozilla and Firefox
  div.style.opacity = opacity/100;// Safari 1.2, newer Firefox and Mozilla, CSS3
  
  if(last == false) {
   window.setTimeout("repeatFade()", speed);
  } else {
   if (navigator.userAgent.indexOf("Mac") != -1) { //firefox BUG on MAC !!!!! cannot add opacity around flash object... or it will disappear
   div.style.MozOpacity = 1;// Older Mozilla and Firefox
  div.style.opacity = 1;// Safari 1.2, newer Firefox and Mozilla, CSS3
  }
  div.style.width = "";
  
  if(document.getElementById('tagform')) {
  //document.getElementById('button2').disabled = true;
  document.getElementById('wassubmitted').value = "";
  }
  
 }


DoMP3Stuff();
}
}

function WriteIt(mesg,ff3) {

document.getElementById(mesg).innerHTML = "<embed src='http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/xspf_player_slim.swf?playlist_url=http://asterisk.itp.tsoa.nyu.edu/~gb314/playlist/"+mesg+".xspf' quality='high' bgcolor='#E6E6E6' name='xspf_player' allowscriptaccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' align='center' height='16' width='164'></embed>";
}
 
  /**
*
*  MD5 (Message-Digest Algorithm)
*  http://www.webtoolkit.info/
*
**/

var MD5 = function (string) {

	function RotateLeft(lValue, iShiftBits) {
		return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits));
	}

	function AddUnsigned(lX,lY) {
		var lX4,lY4,lX8,lY8,lResult;
		lX8 = (lX & 0x80000000);
		lY8 = (lY & 0x80000000);
		lX4 = (lX & 0x40000000);
		lY4 = (lY & 0x40000000);
		lResult = (lX & 0x3FFFFFFF)+(lY & 0x3FFFFFFF);
		if (lX4 & lY4) {
			return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
		}
		if (lX4 | lY4) {
			if (lResult & 0x40000000) {
				return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
			} else {
				return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
			}
		} else {
			return (lResult ^ lX8 ^ lY8);
		}
 	}

 	function F(x,y,z) { return (x & y) | ((~x) & z); }
 	function G(x,y,z) { return (x & z) | (y & (~z)); }
 	function H(x,y,z) { return (x ^ y ^ z); }
	function I(x,y,z) { return (y ^ (x | (~z))); }

	function FF(a,b,c,d,x,s,ac) {
		a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
		return AddUnsigned(RotateLeft(a, s), b);
	};

	function GG(a,b,c,d,x,s,ac) {
		a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
		return AddUnsigned(RotateLeft(a, s), b);
	};

	function HH(a,b,c,d,x,s,ac) {
		a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
		return AddUnsigned(RotateLeft(a, s), b);
	};

	function II(a,b,c,d,x,s,ac) {
		a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
		return AddUnsigned(RotateLeft(a, s), b);
	};

	function ConvertToWordArray(string) {
		var lWordCount;
		var lMessageLength = string.length;
		var lNumberOfWords_temp1=lMessageLength + 8;
		var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1 % 64))/64;
		var lNumberOfWords = (lNumberOfWords_temp2+1)*16;
		var lWordArray=Array(lNumberOfWords-1);
		var lBytePosition = 0;
		var lByteCount = 0;
		while ( lByteCount < lMessageLength ) {
			lWordCount = (lByteCount-(lByteCount % 4))/4;
			lBytePosition = (lByteCount % 4)*8;
			lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount)<<lBytePosition));
			lByteCount++;
		}
		lWordCount = (lByteCount-(lByteCount % 4))/4;
		lBytePosition = (lByteCount % 4)*8;
		lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80<<lBytePosition);
		lWordArray[lNumberOfWords-2] = lMessageLength<<3;
		lWordArray[lNumberOfWords-1] = lMessageLength>>>29;
		return lWordArray;
	};

	function WordToHex(lValue) {
		var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
		for (lCount = 0;lCount<=3;lCount++) {
			lByte = (lValue>>>(lCount*8)) & 255;
			WordToHexValue_temp = "0" + lByte.toString(16);
			WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
		}
		return WordToHexValue;
	};

	function Utf8Encode(string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";

		for (var n = 0; n < string.length; n++) {

			var c = string.charCodeAt(n);

			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}

		}

		return utftext;
	};

	var x=Array();
	var k,AA,BB,CC,DD,a,b,c,d;
	var S11=7, S12=12, S13=17, S14=22;
	var S21=5, S22=9 , S23=14, S24=20;
	var S31=4, S32=11, S33=16, S34=23;
	var S41=6, S42=10, S43=15, S44=21;

	string = Utf8Encode(string);

	x = ConvertToWordArray(string);

	a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476;

	for (k=0;k<x.length;k+=16) {
		AA=a; BB=b; CC=c; DD=d;
		a=FF(a,b,c,d,x[k+0], S11,0xD76AA478);
		d=FF(d,a,b,c,x[k+1], S12,0xE8C7B756);
		c=FF(c,d,a,b,x[k+2], S13,0x242070DB);
		b=FF(b,c,d,a,x[k+3], S14,0xC1BDCEEE);
		a=FF(a,b,c,d,x[k+4], S11,0xF57C0FAF);
		d=FF(d,a,b,c,x[k+5], S12,0x4787C62A);
		c=FF(c,d,a,b,x[k+6], S13,0xA8304613);
		b=FF(b,c,d,a,x[k+7], S14,0xFD469501);
		a=FF(a,b,c,d,x[k+8], S11,0x698098D8);
		d=FF(d,a,b,c,x[k+9], S12,0x8B44F7AF);
		c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);
		b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE);
		a=FF(a,b,c,d,x[k+12],S11,0x6B901122);
		d=FF(d,a,b,c,x[k+13],S12,0xFD987193);
		c=FF(c,d,a,b,x[k+14],S13,0xA679438E);
		b=FF(b,c,d,a,x[k+15],S14,0x49B40821);
		a=GG(a,b,c,d,x[k+1], S21,0xF61E2562);
		d=GG(d,a,b,c,x[k+6], S22,0xC040B340);
		c=GG(c,d,a,b,x[k+11],S23,0x265E5A51);
		b=GG(b,c,d,a,x[k+0], S24,0xE9B6C7AA);
		a=GG(a,b,c,d,x[k+5], S21,0xD62F105D);
		d=GG(d,a,b,c,x[k+10],S22,0x2441453);
		c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681);
		b=GG(b,c,d,a,x[k+4], S24,0xE7D3FBC8);
		a=GG(a,b,c,d,x[k+9], S21,0x21E1CDE6);
		d=GG(d,a,b,c,x[k+14],S22,0xC33707D6);
		c=GG(c,d,a,b,x[k+3], S23,0xF4D50D87);
		b=GG(b,c,d,a,x[k+8], S24,0x455A14ED);
		a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905);
		d=GG(d,a,b,c,x[k+2], S22,0xFCEFA3F8);
		c=GG(c,d,a,b,x[k+7], S23,0x676F02D9);
		b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);
		a=HH(a,b,c,d,x[k+5], S31,0xFFFA3942);
		d=HH(d,a,b,c,x[k+8], S32,0x8771F681);
		c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122);
		b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C);
		a=HH(a,b,c,d,x[k+1], S31,0xA4BEEA44);
		d=HH(d,a,b,c,x[k+4], S32,0x4BDECFA9);
		c=HH(c,d,a,b,x[k+7], S33,0xF6BB4B60);
		b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);
		a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6);
		d=HH(d,a,b,c,x[k+0], S32,0xEAA127FA);
		c=HH(c,d,a,b,x[k+3], S33,0xD4EF3085);
		b=HH(b,c,d,a,x[k+6], S34,0x4881D05);
		a=HH(a,b,c,d,x[k+9], S31,0xD9D4D039);
		d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);
		c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);
		b=HH(b,c,d,a,x[k+2], S34,0xC4AC5665);
		a=II(a,b,c,d,x[k+0], S41,0xF4292244);
		d=II(d,a,b,c,x[k+7], S42,0x432AFF97);
		c=II(c,d,a,b,x[k+14],S43,0xAB9423A7);
		b=II(b,c,d,a,x[k+5], S44,0xFC93A039);
		a=II(a,b,c,d,x[k+12],S41,0x655B59C3);
		d=II(d,a,b,c,x[k+3], S42,0x8F0CCC92);
		c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D);
		b=II(b,c,d,a,x[k+1], S44,0x85845DD1);
		a=II(a,b,c,d,x[k+8], S41,0x6FA87E4F);
		d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);
		c=II(c,d,a,b,x[k+6], S43,0xA3014314);
		b=II(b,c,d,a,x[k+13],S44,0x4E0811A1);
		a=II(a,b,c,d,x[k+4], S41,0xF7537E82);
		d=II(d,a,b,c,x[k+11],S42,0xBD3AF235);
		c=II(c,d,a,b,x[k+2], S43,0x2AD7D2BB);
		b=II(b,c,d,a,x[k+9], S44,0xEB86D391);
		a=AddUnsigned(a,AA);
		b=AddUnsigned(b,BB);
		c=AddUnsigned(c,CC);
		d=AddUnsigned(d,DD);
	}

	var temp = WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);

	return temp.toLowerCase();
}