function updateTweetIt (xmlDoc)
{
	var result 		= xmlDoc.getElementsByTagName ("result")[0].firstChild.nodeValue;				
	var statusID 	= xmlDoc.getElementsByTagName ("status-id")[0].firstChild.nodeValue;					
		
//	document.getElementById("tweet-button").disabled = false;
	if (result == "success")
	{
		document.getElementById("tweet-button").value = "Successful!";		
		document.getElementById("successfully-tweeted").innerHTML = "View it <a href = 'http://twitter.com/flamewhale/status/"+ statusID + "' target='_blank'>here</a>";				
	}
	// we can make these errors more specific
	/*
	if (status == "bookmark saved")
	{	
		//alert ("bookmark saved");
		header = status;
	}
	else
	{		
		header = "error";
		message = "Sorry, there was a problem. Bookmark was not saved: " + status;
	
		//alert ("Sorry, there was a problem. Bookmark was not saved: " + status);
	}
	*/
} 

function sendRequestToTweet (quoteNumber, twitterUser, mode)
{		
	if ((quoteNumber != "") && (twitterUser != ""))
	{
		document.getElementById("tweet-button").disabled = true;
		document.getElementById("tweet-button").value = "Tweeting...";				
		sendAJAXRequest ("function=tweet-it&quoteNumber=" + quoteNumber + "&twitterUser=" + twitterUser + "&mode=" + mode);			
	}
	else	
	{	
		alert ("Sorry, there was a problem. Please try again!");
	}
} 


