var roll_images = new Array("suggestion","send","prev","next","random","archive","share_digg","share_twitter","share_facebook","share_stumbleupon","share_reddit","sub_feed","sub_mail","sub_twitter","sub_facebook","sub_other","close");
var roll_temp;
for(var i=0; i<roll_images.length; i++) {
	roll_temp = roll_images[i];
	eval("roll" + roll_temp + "0 = new Image();");
	eval("roll" + roll_temp + "0.src = \"/images/" + roll_temp + ".gif\";");
	eval("roll" + roll_temp + "1 = new Image();");
	eval("roll" + roll_temp + "1.src = \"/images/" + roll_temp + "-over.gif\";");
}
var transgrey = new Image();
transgrey.src = "/images/trans-grey.png";

function swapImage(imageID,change) {
	document.images["roll"+imageID].src = eval("roll"+imageID+change+".src");
}
function smartImageIsGo(divName) {
	document.getElementById('details'+divName).style.display = '';
}
function smartImageIsNo(divName) {
	document.getElementById('details'+divName).style.display = 'none';
}
function embedBox(fileName,pageLink,imgWidth,imgHeight) {
	var embedCode = '<a href="http://www.robotswithfeelings.com' + pageLink + '"><img src="http://www.robotswithfeelings.com/' + fileName + '" border=0></a><br /><a href="http://www.robotswithfeelings.com/">Robots With Feelings</a>';
	var imgCode = '<img src="' + fileName + '" ';
	if (imgWidth > imgHeight ) {
		imgHeightFixed = (88 / (imgHeight-16)) * imgHeight;
		if (imgHeightFixed > Math.round(imgHeightFixed)) { imgHeightFixed++; }
		imgHeightFixed = Math.round(imgHeightFixed);
		imgCode += 'height='+imgHeightFixed;
	} else {
		imgCode += 'width=88';
	}
	imgCode += ' />';
	document.getElementById('codeImg').innerHTML = imgCode;
	document.getElementById('codeCopy').value = embedCode;
	document.getElementById('codeBox').style.display = '';
}
function ballsagna() {
	document.getElementById('codeBox').style.display = 'none';
}
function FineBeThatWay() {
	document.getElementById('anonlogin').style.display = '';
}
function rulespop() {
	window.open("/twitter/rules.htm", "commentRules", "status=1,width=350,height=250,resizable=0");
}
function createXMLHttpRequest() {
	try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
	try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
	try { return new XMLHttpRequest(); } catch(e) {}
	alert("Your browser sucks. GTFO.");
	return null;
}
function GoGoGadgetAjax(theUrl) {
	var xhReq = createXMLHttpRequest();
	xhReq.open("GET", theUrl, true);
	xhReq.onreadystatechange = function() {
		if (xhReq.readyState != 4)  { return; }
		var trashVar = xhReq.responseText;
	};
	xhReq.send(null);
}