var TANR=0;
var TA = new Array();
/*var currentpage= '';
var historylist = new Array();
var historylist2 = new Array();
var historylistids = new Array();
var disabledcatch = 0;
var expectedHash='';*/

function newxmldoc(xml)
{
	//hier maak ik een nieuw xml document wat ik daarna uitlees.. we moeten nog iets
	//van een standaard error voor niet gesupporte browsers
	var xmlDoc;
	if (document.implementation && document.implementation.createDocument)
	{

		xmlDoc = document.implementation.createDocument("","",null);
		xmlDoc.async = false
		xmlDoc = new DOMParser().parseFromString(xml, 'text/xml');

	}
	else
	{

		if (window.ActiveXObject)
		{
			var DOMDocument = NewXMLParser('DOMDocument');

			xmlDoc = new ActiveXObject(DOMDocument);

			xmlDoc.async = false;
			xmlDoc.loadXML(xml);

		}

	}


	return xmlDoc;

}

function deleteresponse(nr)
{
	if(TA[nr].deleted!='yes')
	{
		delete(TA[nr].xmlhttp);
		TA[nr].deleted='yes';
	}
	
}
function getresponse(nr)
{
	TA[nr].doctosend='';
	setTimeout('deleteresponse('+nr+')',2000);
	return TA[nr].xmlhttp.responseText;
	
}
function getresponsexml(nr)
{
	
	TA[nr].doctosend='';
	setTimeout('deleteresponse('+nr+')',2000);
	return TA[nr].xmlhttp.responseXML;
}

function tooutput1(data)
{
	var application_elem = document.getElementById('mainout');

	document.getElementById('output1').innerHTML='';
	application_elem.removeChild(document.getElementById('output1'));
	var div_new = document.createElement('div');
	div_new.setAttribute('id', 'output1');
	div_new.innerHTML = data;


	application_elem.appendChild(div_new);
	var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
	var bOpera = (navigator.userAgent.indexOf('Opera') != -1);
	var bMoz = (navigator.appName == 'Netscape');
	if (bSaf) {

	} else if (bOpera) {

	} else if (bMoz) {

	} else {
		execJS(document.getElementById('output1'));
	}
}
function tooutput2(data)
{
	document.getElementById('output2').innerHTML=data;

}
function tooutput3(data)
{
	document.getElementById('output3').innerHTML=data;
}
function execJS(node) {

	var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
	var bOpera = (navigator.userAgent.indexOf('Opera') != -1);
	var bMoz = (navigator.appName == 'Netscape');

	var st = node.getElementsByTagName('script');

	var strExec;

	for(var i=0;i<st.length; i++) {

		if (bSaf) {
			strExec = st[i].innerHTML;
		} else if (bOpera) {
			strExec = st[i].text;
		} else if (bMoz) {
			strExec = st[i].textContent;
		} else {
			strExec = st[i].text;
		}

		try {

			var html_doc = document.getElementsByTagName('head').item(0);
			var js = document.createElement('script');
			js.setAttribute('language', 'javascript');
			js.setAttribute('type', 'text/javascript');
			js.text = strExec;
			html_doc.appendChild(js);


		} catch(e) {


			alert(e);
		}
	}
}
function tarobly(cn)
{
	this.cn = cn;
	this.items = new Array();
	this.dowith = 'loadfile';
	this.notificationtimeout='empty';
	this.imagekey='';
	this.randomvote=0;
	this.currentpicsonpage= new Array();

}
/*
prints to the debug layer if the debug is on.
*/
tarobly.prototype.clearCurrentPicsOnPage = function(string)
{
	this.currentpicsonpage= new Array();
}
tarobly.prototype.addPicOnPage = function(key)
{
	ln=this.currentpicsonpage.length;
	this.currentpicsonpage[ln] = key;
}
tarobly.prototype.tagCurrentPicsOnPage = function(tags)
{
	alert(tags);
	for(ln=0;ln<this.currentpicsonpage.length;ln++)
	{
	
		this.tag(this.currentpicsonpage[ln],tags);
	}
}
tarobly.prototype.changeCurrentPicsOnPage = function(status)
{
	
	for(ln=0;ln<this.currentpicsonpage.length;ln++)
	{
	
		this.changeStatus(this.currentpicsonpage[ln],status);
	}
}
tarobly.prototype.debug = function(string)
{
	if(taroblydebugon=='1')
	{
		document.getElementById('DEBUG').innerHTML+= string+"<br/>";
	}
}
tarobly.prototype.notification = function(msg)
{
	if(this.notificationtimeout!='empty')
	{
	clearTimeout(this.notificationtimeout)
	}
	document.getElementById('notificationbox').innerHTML=msg;
	document.getElementById('notificationbox').style.display='block';
	
	this.notificationtimeout=setTimeout(this.cn+'.hidenotification();',2000);
}
tarobly.prototype.hidenotification = function()
{
	document.getElementById('notificationbox').style.display='';
}
tarobly.prototype.addboard = function()
{
	
	boardname = document.getElementById('tboardname').value;
	boardtitle = document.getElementById('tboardtitle').value;
	boarddescription = document.getElementById('tboarddescript').value;
	boardrank = document.getElementById('tboardrank').value;
	if(document.getElementById('tboardlisted').checked){boardlisted= '1';}else{boardlisted= '0';}
	if(document.getElementById('tboardonline').checked){boardonline= '1';}else{boardonline= '0';}
	
	
	if((boardname!='')&&(boarddescription!=''))
	{
		doc = 'doaddboard=yes&boardname='+encodeURIComponent(boardname)+'&boardtitle='+encodeURIComponent(boardtitle)+'&listed='+encodeURIComponent(boardlisted)+'&online='+encodeURIComponent(boardonline)+'&boarddescription='+encodeURIComponent(boarddescription)+'&minimalrank='+encodeURIComponent(boardrank);
//		alert(doc);
		this.doCommand('#makeboardDomake','makeboard','','',doc);
		
	}
	else
	{
		alert('you forgot something please retry');
	}
	
	
}
tarobly.prototype.out = function(anchor,data)
{
	window.scrollTo(0,0);
	value= data.split('^^^SPLIT^^^');
	
	tooutput1(value[0]);
	tooutput2(value[1]);
	tooutput3(value[2]);
	oldtitle = document.title;
	oldtitle2 = oldtitle.split('->');
	document.title = oldtitle2[0]+'->'+anchor;

	//alert(data);
	ajaxhist.registerhistory(anchor,value[0],value[1],value[2]);
	
	disabledcatch=0;
}
/*
Sends a command to tarobly. With data being a url encoded string
*/

tarobly.prototype.jump = function(command,data)
{
	this.doCommand('#jump'+command+'_'+data,command,data,'');
}
tarobly.prototype.doCommand = function(anchor,command,data,query,doc)
{

	_tnotes.cleanup();
	TANR++
	TA[TANR] = new TaroAJAX();
	TA[TANR].cn = 'TA['+TANR+']';
	TA[TANR].Sourcefile= basepath+'CMD/'+encodeURIComponent(command);
	if(data!="")
	{
		TA[TANR].Sourcefile += '/'+encodeURIComponent(data);
	}
	if(query!="")
	{
		TA[TANR].Sourcefile += '?'+query;
	}
	
	if((doc!=undefined)&&(doc!=''))
	{
		TA[TANR].doctosend = doc;
	}

	TA[TANR].onReadyresponsecommand = this.cn+'.notification("Recieved response!");'+this.cn+'.out(\''+anchor+'\',getresponse('+TANR+'));'+this.cn+'.notification("Done");';

	disabledcatch=1;
	this.notification('Requesting!');
	TA[TANR].doPost();
	if(hasurchin=='yes')
	{
		urchinTracker(TA[TANR].Sourcefile); 
		//alert('yes');
	}	
	return false;

}
tarobly.prototype.removetag = function(key,tag)
{
	if(confirm('Are you sure you want to remove '+tag+' from this image?'))
	{
		this.doremovetag(key,tag);
		
	}
}
tarobly.prototype.getselectvals = function(selectid)
{
  var opts2='';
  var selectedArray = new Array();
  var selObj = document.getElementById(selectid);
  var i;
  var count = 0;
  for (i=0; i<selObj.options.length; i++) {
    if (selObj.options[i].selected) {
      opts2 +=','+selObj.options[i].value;
      count++;
    }
  }
  return opts2;
}

tarobly.prototype.qtvalues = function(targ)
{
	
	var returnstring='';
	opts ='';
	opts += this.getselectvals(targ+'_hairstyle_QT');
	opts += this.getselectvals(targ+'_genre_QT');
	opts += this.getselectvals(targ+'_type_QT');
	opts += this.getselectvals(targ+'_generic_QT');
	return opts;
	
}
tarobly.prototype.isok = function(key,type)
{
	this.isoknotok(key,type,'ok');
}
tarobly.prototype.isnotok = function(key,type)
{
	this.isoknotok(key,type,'notok');
}

tarobly.prototype.isoknotok = function(key,type,vote)
{
	command='janitorisoknotok';
	tags = document.getElementById('oknotoktaglist').value;

	this.randomvote = this.randomvote+1;
	anchor ='#random'+this.randomvote;
	TANR++
	TA[TANR] = new TaroAJAX();
	TA[TANR].cn = 'TA['+TANR+']';
	TA[TANR].Sourcefile= basepath+'CMD/'+encodeURIComponent(command);
	TA[TANR].Sourcefile += '/'+encodeURIComponent(key);
	TA[TANR].Sourcefile += '?type='+encodeURIComponent(type);
	TA[TANR].Sourcefile += '&vote='+encodeURIComponent(vote);
	
	TA[TANR].Sourcefile += '&tags='+encodeURIComponent(tags);

		
	if(type=='random')
	{
		TA[TANR].onReadyresponsecommand = this.cn+'.notification("Recieved response!");'+this.cn+'.out(\''+anchor+'\',getresponse('+TANR+'));'+this.cn+'.notification("Done");';
	}
	else
	{
		TA[TANR].onReadyresponsecommand = 'alert(getresponse('+TANR+'));';
	}


	disabledcatch=1;
	TA[TANR].doPost();
}

tarobly.prototype.doremovetag = function(key,tag)
{
	command='removetag';
	TANR++
	TA[TANR] = new TaroAJAX();
	TA[TANR].cn = 'TA['+TANR+']';
	TA[TANR].Sourcefile= basepath+'CMD/'+encodeURIComponent(command);
	TA[TANR].Sourcefile += '/'+encodeURIComponent(key);
	TA[TANR].Sourcefile += '?tag='+encodeURIComponent(tag);



		TA[TANR].onReadyresponsecommand = this.cn+'.removetagdone(getresponse('+TANR+'),\'nochange\');';


	disabledcatch=1;
	TA[TANR].doPost();
}
tarobly.prototype.removetagdone = function(data)
{
	if(data=="[^OK^]")
	{
		this.notification('tag removed');
		//alert('tag removed');
	}
	else
	{
		this.notification('tag NOT removed');
		//alert('tag not removed:'+data);
	}
}
tarobly.prototype.saveasset = function(edit)
{
	setid=document.getElementById('Setid').value;
	
	if(setid!='')
	{
		data=setid;
		setname=document.getElementById('Setname').value;
		setdescr=document.getElementById('Setdescr').value;
		settype=document.getElementById('Settype').value;
	}
	else
	{
		
		setname=document.getElementById('Setname').value;
		setdescr=document.getElementById('Setdescr').value;
		settype=document.getElementById('Settype').value;
		data=0;
	}
	if(edit==undefined)
	{
		command='saveset';
		data2 = document.getElementById('lightbox_list').value;
	}
	else
	{
		command='editset';
		data2='';
	}
	
	query='dosave=yes';
	
	
	
	doc='setdata='+encodeURIComponent(data2)+'&name='+encodeURIComponent(setname)+'&descr='+encodeURIComponent(setdescr)+'&status='+settype;
	this.doCommand('#saveset'+data+(TANR+1),command,data,query,doc);

	
}

tarobly.prototype.report = function(type,data3,data2)
{
	command='report';
	data=type;
	
	doc='text='+encodeURIComponent(data2);
	doc+='&title='+encodeURIComponent(data3);
	
	query='';
	TANR++
	TA[TANR] = new TaroAJAX();
	TA[TANR].cn = 'TA['+TANR+']';
	TA[TANR].Sourcefile= basepath+'CMD/'+encodeURIComponent(command);
	TA[TANR].doctosend=doc;
	if(data!="")
	{
		TA[TANR].Sourcefile += '/'+encodeURIComponent(data);
	}
	TA[TANR].onReadyresponsecommand = this.cn+'.out("#reported_'+type+'",getresponse('+TANR+'));';
	this.notification('Requesting!');
	disabledcatch=1;
	TA[TANR].doPost();
}

tarobly.prototype.tag = function(key,tags,noresponsecommand)
{
	
	command='tag';
	data=key;
	query='tags='+tags;
	TANR++
	TA[TANR] = new TaroAJAX();
	TA[TANR].cn = 'TA['+TANR+']';
	TA[TANR].Sourcefile= basepath+'CMD/'+encodeURIComponent(command);
	if(data!="")
	{
		TA[TANR].Sourcefile += '/'+encodeURIComponent(data);
	}
	if(query!="")
	{
		TA[TANR].Sourcefile += '?'+query;
	}
	//alert(TA[TANR].Sourcefile);
	if(noresponsecommand=='yes')
	{
		TA[TANR].onReadyresponsecommand = this.cn+'.tagdone(\''+key+'\',getresponse('+TANR+'),\'nochange\');';

	}
	else
	{
		TA[TANR].onReadyresponsecommand = this.cn+'.tagdone(\''+key+'\',getresponse('+TANR+'),\'\');';
	}

	disabledcatch=1;
	TA[TANR].doPost();

}
tarobly.prototype.changeStatus = function(key,status)
{

	command='changestatus';
	data=key;
	query='status='+status;
	TANR++
	TA[TANR] = new TaroAJAX();
	TA[TANR].cn = 'TA['+TANR+']';
	TA[TANR].Sourcefile= basepath+'CMD/'+encodeURIComponent(command);
	if(data!="")
	{
		TA[TANR].Sourcefile += '/'+encodeURIComponent(data);
	}
	if(query!="")
	{
		TA[TANR].Sourcefile += '?'+query;
	}
	//alert(TA[TANR].Sourcefile);

	TA[TANR].onReadyresponsecommand = this.cn+'.statusDone(\''+key+'\',getresponse('+TANR+'));';

	disabledcatch=1;
	TA[TANR].doPost();

}
tarobly.prototype.statusDone = function(key,msg)
{

	//alert(msg);
	/*document.getElementById('tags_'+key).value=msg;
	document.getElementById('tags_'+key).disabled=true;
	document.getElementById('tagsbutton_'+key).disabled=true;*/
}
tarobly.prototype.tagdone = function(key,msg,msg2)
{
	//alert(msg);
	this.notification('Item tagged!');

	if(msg2!='nochange')
	{
		document.getElementById('tags_'+key).value=msg;
		document.getElementById('tags_'+key).disabled=true;
		document.getElementById('tagsbutton_'+key).disabled=true;
		document.getElementById('tags_'+key).className="tags_saved";
	}
}

tarobly.prototype.postcomment= function(key,comment)
{
	command='comment';
	data=key;
	doc='key='+encodeURIComponent(key);
	doc+='&comment='+encodeURIComponent(document.getElementById(comment).value);
	query='';
	TANR++
	TA[TANR] = new TaroAJAX();
	TA[TANR].cn = 'TA['+TANR+']';
	TA[TANR].Sourcefile= basepath+'CMD/'+encodeURIComponent(command);
	TA[TANR].doctosend=doc;
	if(data!="")
	{
		TA[TANR].Sourcefile += '/'+encodeURIComponent(data);
	}
	if(query!="")
	{
		TA[TANR].Sourcefile += '?'+query;
	}
	//alert(TA[TANR].Sourcefile);

	//TA[TANR].onReadyresponsecommand = this.cn+'.doCommand(\'#'+command+'_'+key+'\',\'loadfile\',\''+key+'\');';
	TA[TANR].onReadyresponsecommand = this.cn+'.commentposted(\''+comment+'\',getresponse('+TANR+'))';

	disabledcatch=1;
	TA[TANR].doPost();
}


tarobly.prototype.commentposted = function(id,reply)
{
	
	if(reply!='[^OK^]')
	{
		this.notification('Error in reply!');
		document.getElementById('replyform_error').innerHTML = reply;
	}
	else
	{
		this.notification('Reply posted!');
		document.getElementById('replyform').className = 'commentform_asreply';
		document.getElementById(id).disabled = true;
		document.getElementById('replyform_error').innerHTML ='comment posted';
		
	}
}
tarobly.prototype.loadfile = function(key)
{
	this.doCommand('#loadfile_'+key,'loadfile',key);
}
tarobly.prototype.touchfile = function(key)
{

	if(this.dowith=='loadfile')
	{
		this.loadfile(key);
	}
	else if(this.dowith=='tag')
	{
		if(document.getElementById('tagfield_allimages')!='')
		{
			this.tag(key,document.getElementById('tagfield_allimages').value,'yes');
		}
	}
	else if(this.dowith=='removetag')
	{
		this.doremovetag(key,document.getElementById('tagfield_allimages').value);
	}
	else if(this.dowith=='lightbox')
	{
		//add them to the lightbox
		
		document.getElementById('lightbox_list').value += key+',';
		this.repaintLightbox();
		this.notification('File saved in lightbox');
		//document.getElementById('lightbox_content').innerHTML='<a onclick="'+this.cn+'.loadfile(\''+key+'\');"><img src="'+basepath+'data/'+pa1+'/'+pa2+'/'+key+'_thumb.jpg"></a> '+document.getElementById('lightbox_content').innerHTML;
	}
	else
	{
		//do nothing
	}
}
tarobly.prototype.repaintLightbox = function()
{
	list = document.getElementById('lightbox_list').value;
	newinner = '';
	splitted = list.split(',');
	for(i=0;i<splitted.length-1;i++)
	{
		key = splitted[i];
		if(key!='')
		{
			pa1 = key.substr(0,2);
			pa2 = key.substr(2,2);
			newinner ='<a onclick="'+this.cn+'.loadfile(\''+key+'\');"><img src="'+basepath+'data/'+pa1+'/'+pa2+'/'+key+'_thumb.jpg"></a> '+newinner;
		}
	}

	document.getElementById('lightbox_actualoutput').innerHTML = newinner;
}
tarobly.prototype.toggledisplay = function(item)
{
	itemple =document.getElementById(item);
	if(itemple.style.display!='block')
	{
		itemple.style.display='block'
	}
	else
	{
		itemple.style.display='none';
	}

}
tarobly.prototype.clearlightbox = function()
{
	document.getElementById('lightbox_list').value='';
	document.getElementById('lightbox_actualoutput').innerHTML='';
	
}
tarobly.prototype.doSearch = function(value)
{
	var options='';
	try
	{
		if(document.getElementById('enablesearchfilter').checked)
		{
			if(document.getElementById('widthsearchtype').value!='')
			{
				//send it along
				options+='&widthsearchtype='+document.getElementById('widthsearchtype').value+'&widthsearch1='+document.getElementById('widthsearch1').value+'&widthsearch2='+document.getElementById('widthsearch2').value
			}
			if(document.getElementById('heightsearchtype').value!='')
			{
				//send it along
				options+='&heightsearchtype='+document.getElementById('heightsearchtype').value+'&heightsearch1='+document.getElementById('heightsearch1').value+'&heightsearch2='+document.getElementById('heightsearch2').value
			}			
		}
		else
		{
			
		}
		
	}
	catch(e)
	{
		
	}
	
	//alert(options);
	this.doCommand('#search_'+value+'?page=0'+options,'search',value,'page=0'+options);
}
tarobly.prototype.keycheck = function(evnt,onenter)
{
	
	
	if (!evnt)
	{ evnt = window.event;
	}
	
	
	if (evnt.keyCode)
	{ theKey = evnt.keyCode;
	}
	else if (evnt.which)
	{ theKey = evnt.which
	}
	if(theKey==13)
	{
		if(onenter==undefined)
		{
			
		}
		else
		{
			eval(onenter);
		}
		
	}
	
	
	if((theKey>96)&&(theKey<123))
	{
		return true;
	}
	if((theKey>64)&&(theKey<91))
	{
		return true;
	}
	if((theKey>47)&&(theKey<58))
	{
		return true;
	}
	if((theKey==32)||(theKey==8)||(theKey==44)||(theKey==45)||(theKey==46)||(theKey==36)||(theKey==39)||(theKey==37)||(theKey==35)||(theKey==95))
	{
		return true;
	}
	//alert(theKey);
	return false;

}
tarobly.prototype.togglesearchfilter = function(toggle)
{
	if(toggle)
	{
		document.getElementById('searchfilteroptions').style.display='block';
	}
	else
	{
		document.getElementById('searchfilteroptions').style.display='none';
	}
	
}
tarobly.prototype.nextpage = function(plus)
{
	if(this.currentresultpage>-1)
	{
		nextpage = this.currentresultpage+plus;
		
		if(nextpage<this.currentresultpages)
		{
			this.unregisterresultsetevents();
			this.doCommand('#'+this.currentresultcommand+'_'+this.currentresultcommandtags+'_page'+nextpage+this.currentresultsearchoptions,this.currentresultcommand,this.currentresultcommandtags,'page='+nextpage+this.currentresultsearchoptions);
			
		}
	}
}
tarobly.prototype.prevpage = function(plus)
{
	if(this.currentresultpage>-1)
	{
		
		nextpage = this.currentresultpage-plus;
		if(nextpage>=0)
		{
			this.unregisterresultsetevents();
			this.doCommand('#'+this.currentresultcommand+'_'+this.currentresultcommandtags+'_page'+nextpage+this.currentresultsearchoptions,this.currentresultcommand,this.currentresultcommandtags,'page='+nextpage+this.currentresultsearchoptions);
		}
	}
}


tarobly.prototype.registerresultsetevents = function(currentpage,pages,command,tags,searchoptions)
{
	
	this.currentresultpage = currentpage;
	this.currentresultpages = pages;
	this.currentresultcommand = command;
	this.currentresultcommandtags = tags;
	this.currentresultsearchoptions = searchoptions;

	
	

}
tarobly.prototype.unregisterresultsetevents = function()
{
	
this.currentresultpage = -1;
	
}



tarobly.prototype.doautotag = function(tag)
{
	this.tag(this.imagekey,tag);
}
tarobly.prototype.registerimage = function(id)
{
	this.imagekey = id;
}
tarobly.prototype.settouchbutton = function(value)
{
//	alert(document.touch.optionset_dowith.length);
	for (var i=0; i<document.touch.optionset_dowith.length; i++)  { 
		if (document.touch.optionset_dowith[i].value==value)  {
			document.touch.optionset_dowith[i].checked=true;
		}
	} 
	document.touch.optionset_dowith.value=value
	if((value=='tag')||(value=='removetag'))
	{
		document.getElementById('tagfield_allimages').style.display='block';		
	}
	else
	{
		document.getElementById('tagfield_allimages').style.display='none';
	}
	
	this.dowith=value;
}
tarobly.prototype.unregisterimage = function()
{
	this.imagekey = '';
}

/**
messanging code
**/
tarobly.prototype.msgnit = function()
{
	this.currentmessages=0;
	command='messages';
	query='';
	TANR++
	TA[TANR] = new TaroAJAX();
	TA[TANR].cn = 'TA['+TANR+']';
	TA[TANR].Sourcefile= basepath+'CMD/'+encodeURIComponent(command);
	TA[TANR].doctosend=doc;
	if(data!="")
	{
		TA[TANR].Sourcefile += '/'+encodeURIComponent(data);
	}
	if(query!="")
	{
		TA[TANR].Sourcefile += '?'+query;
	}
	//alert(TA[TANR].Sourcefile);

	//TA[TANR].onReadyresponsecommand = this.cn+'.doCommand(\'#'+command+'_'+key+'\',\'loadfile\',\''+key+'\');';
	TA[TANR].onReadyresponsecommand = this.cn+'.messagesrecieve(getresponsexml('+TANR+'),getresponse('+TANR+')';

	disabledcatch=1;
	TA[TANR].doPost();	
	
}
tarobly.prototype.messagesrecieve = function(messages,messagescleartext)
{
	alert(messagescleartext);
	
}
tarobly.prototype.msgrotate = function()
{
	
	nextmessages= this.currentmessages+1;
	if(nextmessages>this.maxmessages)
	{
		//rotate to 0;
		this.currentmessages =0;
		nextmessages = this.currentmessages;
	}
}



tarobly.prototype.addpage = function()
{
	newpagename = document.getElementById('addpagename').value;
	this.doCommand('createpage'+newpagename,'addpage',newpagename,'','');
}


tarobly.prototype.init = function()
{
	//inits tarobly
}







tarobly = new tarobly('tarobly');
//handleHistory();
//window.setInterval("handleHistory()", 400);
