var http1, http2;

function get_http_object() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else if (window.ActiveXObject()) {
		return new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		return null;
	}
}



function set_hits() {
	if (http1.readyState == 4) {
		document.getElementById('hits').innerHTML = http1.responseText;
	}
}

function show_series(id) {
	if (id > 0) {
		http2 = get_http_object();
		if ( (http2.readyState == 4) || (http2.readyState == 0) ) {
			http2.open('GET', '/cache/database/series/' + id + '.html');
			http2.onreadystatechange = set_series;
			http2.send(null);
		}
	}
}

function set_series() {
	if ( (http2.readyState == 4) && (http2.status == 200) ) {
		document.getElementById('series').innerHTML = http2.responseText;
	}
}

function show_flash(src, height, width) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + width + '" height="' + height + '">');
	document.write('<param name="movie" value="' + src + '">');
	document.write('<param name="quality" value="high">');
	document.write('<embed src="' + src + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" menu="0"></embed>');
	document.write('</object>');
}

function show_shockwave(src, height, width) {
	document.write('<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=7,0,2,0" width="' + width + '" height="' + height + '">');
	document.write('<param name="swRemote" value="swSaveEnabled=\'true\' swVolume=\'true\' swRestart=\'true\' swPausePlay=\'true\' swFastForward=\'true\' swContextMenu=\'true\'">');
	document.write('<param name="swStretchStyle" value="meet">');
	document.write('<param name="bgColor" value="#000000">');
	document.write('<param name="src" value="' + src + '">');
	document.write('<embed src="' + src + '" width="' + width + '" height="' + height + '" bgColor="#000000" swRemote="swSaveEnabled=\'true\' swVolume=\'true\' swRestart=\'true\' swPausePlay=\'true\' swFastForward=\'true\' swContextMenu=\'true\'" swStretchStyle="meet" type="application/x-director" pluginspage="http://www.macromedia.com/shockwave/download/"></embed>');
	document.write('</object>');
}

function show_frame(src, height, width) {
	document.write('<iframe src="' + src + '" height="' + height + '" width="' + width + '"></iframe>');
}

function show_thumb(title, thumb, src, height, width) {
	document.write('<table cellpadding="3" cellspacing="0"><tr>');
	document.write('<td width="190"><a href="' + src + '" target="_blank"><img src="' + thumb + '" height="135" width="180"></a></td>');
	document.write('<td width="190"><a href="' + src + '" target="_blank"><font size="4">Click here to play<br><strong>' + title + '</strong></a></font></td>');
	document.write('</tr></table>');
	
}

function show_voting_system(flashvars) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="600" height="70">');
	document.write('<param name="movie" value="/vote.swf">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="flashVars" value="' + flashvars + '">');
	document.write('<embed src="/vote.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="600" height="70" menu="0" flashVars="' + flashvars + '"></embed>');
	document.write('</object>');
}
