	var author = '';
	var longauthor = '';
	var author = '';
	var longauthor = '';
	if (!tcolor) var tcolor = '0x000000';
	if (!tcolor2) var tcolor2 = '0x000000';
	if (!hicolor) var hicolor = '0x999999';
	if (!bgcolor) var bgcolor = '#336699';
	if (!hsize) var hsize = '600';
	if (!vsize) var vsize = '400';
	if (!transparency) var transparency = 0;


	function makeflash(xml) {
		var so = new SWFObject("http://www.geekosophy.net/author_cloud/tagcloud.swf", "tagcloud", hsize, vsize, "7", bgcolor);
		if (transparency && transparency==1)
		{
			so.addParam("wmode", "transparent");
		}
		else
		{
			so.addVariable("bgcolor", bgcolor);
		}
		so.addVariable("mode", "tags");
		so.addVariable("distr", "true");
		so.addVariable("tcolor", tcolor);
		so.addVariable("tcolor2", tcolor2);
		so.addVariable("hicolor", hicolor);
		so.addVariable("tagcloud", xml);
		so.write("authorcloud");
	}



	function stripAccents(s, c){
	    var $acc, $str, o, r, i

	    // if character case for output string is not set set it to -1 (lowercase)
	    if (typeof(c)=='undefined'){
	      c = -1;
	    }

	    // convertion table. It can be copied from PHP source.
		$acc =	'É	Ê	Ë	š	Ì	Í	ƒ	œ	µ	Î	Ï	ž	Ð	Ÿ	Ñ	Ò	Ó	Ô	Š	£	Õ	Ö	Œ	¥	Ø	Ž	§	À	Ù	Á	Ú	Â	Û	Ã	Ü	Ä	Ý	';
		$str =	'E	E	E	s	I	I	f	o	m	I	I	z	D	Y	N	O	O	O	S	L	O	O	O	Y	O	Z	S	A	U	A	U	A	U	A	U	A	Y	';
		$acc+=	'Å	Æ	ß	Ç	à	È	á	â	û	Ĕ	ĭ	ņ	ş	Ÿ	ã	ü	ĕ	Į	Ň	Š	Ź	ä	ý	Ė	į	ň	š	ź	å	þ	ė	İ	ŉ	Ţ	Ż	æ	ÿ	';
		$str+=	'A	A	S	C	a	E	a	a	u	E	i	n	s	Y	a	u	e	I	N	S	Z	a	y	E	i	n	s	z	a	p	e	I	n	T	Z	a	y	';
		$acc+=	'Ę	ı	Ŋ	ţ	ż	ç	Ā	ę	Ĳ	ŋ	Ť	Ž	è	ā	Ě	ĳ	Ō	ť	ž	é	Ă	ě	Ĵ	ō	Ŧ	ſ	ê	ă	Ĝ	ĵ	Ŏ	ŧ	ë	Ą	ĝ	Ķ	ŏ	';
		$str+=	'E	l	n	t	z	c	A	e	I	n	T	Z	e	a	E	i	O	t	z	e	A	e	J	o	T	i	e	a	G	j	O	t	e	A	g	K	o	';
		$acc+=	'Ũ	ì	ą	Ğ	ķ	Ő	ũ	í	Ć	ğ	ĸ	ő	Ū	î	ć	Ġ	Ĺ	Œ	ū	ï	Ĉ	ġ	ĺ	œ	Ŭ	ð	ĉ	Ģ	Ļ	Ŕ	ŭ	ñ	Ċ	ģ	ļ	ŕ	Ů	';
		$str+=	'U	i	a	G	k	O	u	i	C	g	k	o	U	i	c	G	L	O	u	i	C	g	l	o	U	o	c	G	L	R	u	n	C	g	l	r	U	';
		$acc+=	'ò	ċ	Ĥ	Ľ	Ŗ	ů	ó	Č	ĥ	ľ	ŗ	Ű	ô	č	Ħ	Ŀ	Ř	ű	õ	Ď	ħ	ŀ	ř	Ų	ö	ď	Ĩ	Ł	Ś	ų	Đ	ĩ	ł	ś	Ŵ	ø	đ	';
		$str+=	'o	c	H	L	R	u	o	C	h	l	r	U	o	c	H	L	R	u	o	D	h	l	r	U	o	d	I	L	S	c	D	i	l	s	W	o	d	';
		$acc+=	'Ī	Ń	Ŝ	ŵ	ù	Ē	ī	ń	ŝ	Ŷ	Ə	ú	ē	Ĭ	Ņ	Ş	ŷ	 	:	;	.	,';
		$str+=	'I	N	S	w	u	E	i	n	s	Y	e	u	e	I	N	S	y	_	_	_	_	_';

	    // If charactes wasn't in convertion table and it is not a [a-zA-z0-9_-] convert it to this char
	    o = '';

	    // convert convertion tables into arrays
	    var ta = $acc.split("\t");
	    var ts = $str.split("\t");

	    // iterate over convertion tables and replace every char in string
	    for (i = 0; i < ta.length; i++){
	      r = new RegExp('[' + ta[i] + ']', 'g');
	      s = s.replace(r, ts[i]);
	    }

	    // remove every character not found in convertion table
	    s = s.replace(/[^a-zA-Z0-9_-]/gi, o);

	    // some optimization - you can change it if you change conversion tables
	    // here I replace multiple underscores into one undercore and strip
	    // underscores at begining and ehd of string
	    s = s.replace(/[_]+/, '_');
	    s = s.replace(/^_*(.*?)_*$/gi, '$1')

	    // return converted string
		if(c == -1){
			return s.toLowerCase();
		}else if(c == 1){
			return s.toUpperCase();
		}else{
			return s;
		}
	}



	function cbfunc(jdata){
		var wc={};
		j=0;
		for (i=0; i<jdata.query.results.entry.length; i++)
		{
			var str=jdata.query.results.entry[i].author.name;
			var end=str.lastIndexOf(' ')+1;
			var newstr=str.charAt(0)+'. '+str.substring(end,str.length);
			if (!wc[newstr]) {
				wc[newstr] = 1;
			}
			else {
				wc[newstr]++;
			}
		}
		var min=10000;
		var max=0;
		for (i in wc) {
			if (wc[i]<min) min=wc[i];
			if (wc[i]>max) max=wc[i];
		}
		var fmin=6;
		var fmax=20;
		var spans = new Array();
		var xml= '<tags>';
		j = 0;
		for (i in wc) {
			i = i.replace(/'/,'\'');
			coauthor = i.substring(3,i.length)+'_'+i.charAt(0);
			coauthor = stripAccents(coauthor);
			if (coauthor.toLowerCase()==author.toLowerCase()) {
				xml += "<a href='http://arxiv.org/find/all/1/au:%2B"+longauthor+"/0/1/0/all/0/1' target='_blank' style='font-size:"+(fmin+(fmax-fmin)*(wc[i]-min)/(max-min))+"px;'>"+i+"</a>";
			}
			else {
				xml += "<a href='http://arxiv.org/find/all/1/au:%2BAND%2B"+author+"%2B"+coauthor+"/0/1/0/all/0/1' target='_blank' style='font-size:"+(fmin+(fmax-fmin)*(wc[i]-min)/(max-min))+"px;'>"+i+"</a>";
			}
			j++;
		}
		xml += '</tags>';
		makeflash(xml);
	}



	function added_on_load() {
		//if (origOL) eval(origOL);
		niceauthor=document.getElementById("authorcloud").innerHTML;
		var end=niceauthor.lastIndexOf(' ')+1;
		var firstname=niceauthor.substring(0,niceauthor.lastIndexOf(' '));
		author=niceauthor.substring(end,niceauthor.length)+'_'+niceauthor.charAt(0);
		longauthor=niceauthor.substring(end,niceauthor.length)+'_'+firstname;
		if (longauthor.indexOf('.')>0) longauthor=longauthor.substring(0,longauthor.length-1);
		document.getElementById("authorcloud").innerHTML="Loading "+niceauthor+" and coauthors...";
		//alert(el);
		var script=document.createElement('script');
		script.setAttribute('type','text/javascript');
		script.setAttribute('src',"http://geekosophy.net/author_cloud/swfobject.js");
		document.getElementsByTagName('head')[0].appendChild(script);

		var script=document.createElement('script');
		script.setAttribute('type','text/javascript');
		script.setAttribute('src',"http://query.yahooapis.com/v1/public/yql?q=use%20'http%3A%2F%2Fgithub.com%2Fyql%2Fyql-tables%2Fraw%2Fmaster%2Farxiv%2Farxiv.search.xml'%20as%20arxiv%3Bselect%20author.name%20from%20arxiv%20where%20search_query%3D%22au%3A"+longauthor+"%22%20and%20max_results%3D%22100%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=cbfunc");
		document.getElementsByTagName('head')[0].appendChild(script);
	}
	//var origOL=window.onLoad;
	//window.onLoad=added_on_load();
	function addLoadEvent(func) {
	  var oldonload = window.onload;
	  if (typeof window.onload != 'function') {
	    window.onload = func;
	  } else {
	    window.onload = function() {
	      if (oldonload) {
	        oldonload();
	      }
	      func();
	    }
	  }
	}



	addLoadEvent(added_on_load);
	
