//function $(what) {
//	return document.getElementById(what);
//}

function roll(what) {
	if ( what.className == "on" ) {
		what.className = "off";
	} else {
		what.className = "on";		
	}
}

function go2(where) {
	top.document.location.href=where;
}


function civroll(what) {
	if ( what == "on" ) {
		$("civ").src="./images/civ_roll.png";
	} else {
		$("civ").src="./images/civ.png";
	}
}

function checkwidth() {
	if ( document.body.clientWidth < 900 ) {
		$("last_col").style.display = "none";
	}
}

function fadewarning() {
	$("warning").style.display="none";
}

// ajax stuff //
//
var http = createRequestObject();

function update_extra(id) {
    http.open("get", "./update_extra.php?id=" + id);
    http.onreadystatechange = ajax_contents;
    http.send(null);
}
function ajax_contents() {
    if( http.readyState == 4 ) {
        var response = http.responseText;
		$("extra_img").innerHTML = response;
    }
}
function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if( browser == "Microsoft Internet Explorer" ) {
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
        ro = new XMLHttpRequest();
    }
    return ro;
}

function pop(what, popwidth, popheight) {
	day = new Date();
	id = day.getTime();
	x = (screen.width-popwidth)/2;
	y = (screen.height-popheight)/2;
	eval("page" + id + " = window.open(what, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=583,height=598,left=' + x + ',top=' + y);");
}

function togglepop(what) {
	Effect.toggle(what, "appear");
}
