function ajaxFunction(){    
      
 	var xmlhttp; 
	
	if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
  }
		else if (window.ActiveXObject)
  {
  // code for IE6, IE5
	 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
	else
  {

	// The browser doesn't support Ajax, so die silently
  }
		
	var ref = encodeURIComponent(document.referrer);
	var my_page = encodeURIComponent(window.location.href);
	if(ref) {
		var queryString = "gre_ref=" + ref + "&my_page=" + my_page;	
		xmlhttp.open("POST","/cgi-bin/rank_extractor.pl",true);
        xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlhttp.setRequestHeader("Content-length", queryString.length);
        xmlhttp.setRequestHeader("Connection", "close");
        xmlhttp.send(queryString);               
	}
}

function GRE_LoadEvent(func) {  
    var oldonload = window.onload;  
    if (typeof window.onload != 'function') { window.onload = func; }   
    else {    
        window.onload = function() {      
            if(oldonload){oldonload();}      
            func();    
        }  
     }
}

GRE_LoadEvent(ajaxFunction);

