var current = -1; // current ad showing
var loaded  = false;
var canswf  = false;
var swfile = 'http://reporting.tvlicensing.co.uk/cgi-bin/redshot.cgi/R2_EMBED_PARAMS/r2_f/1312005/yhukad/ros4/';
var swfct  = 'http://reporting.tvlicensing.co.uk/cgi-bin/redshot.cgi/R2_EMBED_PARAMS/r2_al/1312005/yhukad/ros4/';
var popup;


// infinite loop
function loopDaLoop()
{
	if (loaded) {
		current++;

		// wrap around when we go past the last ad in the feed
if (current >= Array.length) {
			current = 0;
		}

		// update the background and text
		if (document.getElementById("redeyeidiv").style.backgroundImage != "url(http://reporting.tvlicensing.co.uk" + imgurlArray[current] + ")") {
			document.getElementById("redeyeidiv").style.backgroundImage = "url(http://reporting.tvlicensing.co.uk" + imgurlArray[current] + ")";
		}
document.getElementById("redeye").innerHTML = Array[current];

		setTimeout("loopDaLoop();", 3000);
	}
	else {
		try {
			if (document.getElementById("redeyeidiv")
&&  document.getElementById("redeye")
			) {
				loaded = true;
			}
		}
		catch (e) {
		}
		
		setTimeout("loopDaLoop();", 200);
	}
}

function jump()
{
	popup = window.open(cturlArray[current], "popup");
}

function hover(obj, what)
{
	return true;
	var strength = (what == true ? 0.8 : 1);

	if (typeof(obj.style.MozOpacity) == "string") {
		obj.style.MozOpacity = strength;
	}
	else if (typeof(obj.style.filter) == "string") {
		obj.style.filter = "alpha(opacity=" + (strength * 100) + ")";
	}

	return true;
}
	// flash sniffer
	if (navigator.plugins && navigator.plugins.length) {
		for (x = 0; x < navigator.plugins.length; x++) {
			if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
				canswf = true;
				break;
			}
		}
	}
	else if (window.ActiveXObject) {
		for (x = 10; x >= 2; x--) {
			try {
				flashtest = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");

				if (flashtest) {
					canswf = true;
					break;
				}
			}
			catch (e) {
			}
		}
	}
// if yctred defined then prefix clickthru with it
if (typeof(yctred) == "undefined" ) {
	swfct = escape(swfct);
}
else {
	swfct = escape(yctred + swfct);
}

// output swf or dhtml? gif taken care of by noscript tags in other file
if (canswf) { // swf
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=3,0,0,0" id="REDEYE" width="468" height="60"><param name="movie" value="' + swfile + '?clickTag=' + swfct + '&xmlsrc="><param name="quality" value="autohigh"><param name="wmode" value="opaque"><embed src="' + swfile + '?clickTag=' + swfct + '&xmlsrc=" quality="autohigh" swLiveConnect="true" width="468" height="60" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object>');
}
else {
document.write('<a target="_blank" href="http://reporting.tvlicensing.co.uk/cgi-bin/redshot.cgi/R2_EMBED_PARAMS/r2_al/1312005/yhukad/ros4gif/"><img src="http://reporting.tvlicensing.co.uk/cgi-bin/redshot.cgi/R2_EMBED_PARAMS/r2_g/1312005/yhukad/ros4gif/" border="0"></a>');
}