
/*
	*Copyright 2009 Maurice Ferguson (electronfusion). All rights reserved.
	*http://www.electronfusioncreative.com

	*Below are the only 2 variables to change, twitter_id and twitter_username.
	*Set them once here and the rest of the applet will know what to do.
*/

var twitter_id="76257608";
var twitter_username="electronfusion";

function readTweets(){
	the_tweets=new xmlFile("twitter_applet_proxy.php?twitter_id="+twitter_id+"&twitter_username="+twitter_username);
	the_tweets.onreadystatechange=function(){if (the_tweets.readyState==4){document.getElementById('tweets').innerHTML=the_tweets.responseText;}};
}



function xmlFile(url){//my simple wrapper for XMLHTTPRequest, so multiple requests can be made simultaneously without explicitly repeating all the code for each instance
	this.the_xml;
	if(window.XMLHttpRequest){this.the_xml=new XMLHttpRequest();}
	else if(window.ActiveXObject){this.the_xml=new ActiveXObject("Microsoft.XMLHTTP");}
	else{return null;}
	this.the_xml.open("GET",url,true);
	this.the_xml.send(null);
	return this.the_xml
}//end of function xmlFile





//gradually change (animate) some element attribute from some initial value to some final value
function domAnimation (steps, total_time, element, attribute, init, end){

	this.e=document.getElementById(element);
	this.interval=Math.round(steps/total_time);
	this.step=1;
	this.current=init;
	this.timer=setInterval("animate("+e+", "+attribute+", "+current+", "+end+")",interval);
	function animate(e, attribute, current, end){
		//the magic goes in here!!!!!
	}
}//end of function domAnimation



