/* rpc.js - Version 0.1 (c) A. Groth
   uses code from FLASH DETECT 2.5 by Ryan Parman and mjac, http://www.skyzyx.com
	Script level, Cookies, Java, window Width, Flash
*/
function rpc (pid, style, w, h) {
	var caps = "S2,";
	var n = navigator;
	if (n.cookieEnabled==true) caps += "C1"; else if (n.cookieEnabled == false) caps += "C0"; else caps = "C-";

	caps += n.javaEnabled() ? ",J1" : ",J0";

	var x;
	if (self.innerHeight) x = self.innerWidth;
	else
		if (document.documentElement && document.documentElement.clientWidth) x = document.documentElement.clientWidth;
			else if (document.body) x = document.body.clientWidth;
				else x = '-';
	caps += ",W"+x;

	var flash = false;
	if (n.plugins && n.plugins.length)
		for (x=0; x < n.plugins.length; x++)
			if (n.plugins[x].name.indexOf('Shockwave Flash') != -1) {
				flash = true;
				break;
			}
	else
		if (window.ActiveXObject) {
			for (x=10; x>0; x--) {
				try {
					if ( eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');") )
						flash = true;
				}
				catch(e) {}
			}
		}
	caps += flash ? ",F1" : ",F0";
	
	if (style=="s") {
		var d = new Image (1, 1);
		d.src = "http://www.rapidium.net/img.php?pid=" + escape(pid)
			+"&style=s&page=" + escape(document.URL)
			+"&rfrr=" + escape(document.referrer)
			+"&caps="+caps;
	} else
		document.write ("<img src=\"http://www.rapidium.net/img.php?pid=" + escape(pid)
				+"&amp;style=" + escape(style)
				+"&amp;page=" + escape(document.URL)
				+"&amp;rfrr=" + escape(document.referrer)
				+"&amp;caps=" + caps
				+"\"" + (w>1?" width="+w:"") + (h>1?" height="+h:"") +" border=1 alt=\"\">");
}
