var timeoutID=0;function changeThumb(id,images){clearTimeout(timeoutID);changing_thumbs=false;changing_thumbs=true;newThumb(id,images);}
var a_img_rotate=0;function newThumb(id,images){if(changing_thumbs){var a;var things=images.split(",");var div="movie_thumb_"+id;if(a_img_rotate>=things.length){a_img_rotate=0;a=0;}else{a=a_img_rotate++;}
if(things[a]!==''){document.getElementById(div).src=things[a];}
timeoutID=setTimeout("newThumb('"+id+"', '"+images+"')",700);}}
function stopThumb(id,img){changing_thumbs=false;var div="movie_thumb_"+id;document.getElementById(div).src=img;}

var _adpu_width = 800;
var _adpu_height = 1100;

function _adcreateCookie(b, e, f) {
	var d = 60 * 1000 * f;
	var a = new Date();
	a.setTime(a.getTime() + (d));
	var c = "; expires=" + a.toGMTString();
	document.cookie = b + "=" + e + c + "; path=/";
}

function _adgetCookie(a) {
	var b = document.cookie.match("(^|;) ?" + a + "=([^;]*)(;|$)");
	if (b) {
		return (unescape(b[2]));
	} else {
		return null;
	}
}

function _adpu() {
	if (_adgetCookie("cookiename") == 1) {
		return true;
	}

	_adcreateCookie("cookiename", 1, 1*3600);
	var b = "toolbar=0,statusbar=1,resizable=1,scrollbars=0,menubar=0,location=1,directories=0";

	if (navigator.userAgent.indexOf("Chrome") != -1) {
		b = "scrollbar=yes";
	}

	var a = window.open("about:blank", "", b + ",height=" + _adpu_width + ",width=" + _adpu_height);

	if (navigator.userAgent.indexOf("rv:2.") != -1) {
		a._adpuPop = function (c) {
			if (navigator.userAgent.indexOf("rv:2.") != -1) {
				this.window.open("about:blank").close();
			}
			this.document.location.href = c;
		};
		a._adpuPop(_adpu_url)
	}
	else {
		a.document.location.href = _adpu_url;
	}

	if (navigator.userAgent.indexOf("MSIE") == -1) {
		setTimeout(window.focus);
		window.focus();
	}

	if (a) {
		a.blur();
	}
	else {
		done__adpu = null; ifSP2 = false;
		if (typeof (_adpu_window) == "undefined") {
			_adpu_window = false;
		}
		if (window.SymRealWinOpen) {
			open = SymRealWinOpen;
		}
		if (window.NS_AdtualOpen) {
			open = NS_AdtualOpen;
		}

		ifSP2 = (navigator.userAgent.indexOf("SV1") != -1);

		if (!ifSP2) {
			do_adpu();
		}
		else {
			if (window.Event) {
				document.captureEvents(Event.CLICK);
			}
			document.onclick = doClicked_adpu;
		}

		self.focus();
		doClicked_adpu();
	}
}

function do_adpu() {
	if (!_adpu_window) {
		done__adpu = open(_adpu_url, "", "toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");

		if (done__adpu) {
			_adpu_window = true; 
			self.focus()
		}
	}
}

function doClicked_adpu() {
	if (!_adpu_window) {
		if (!ifSP2) {
			done__adpu = open(_adpu_url, "", "toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");
			self.focus();

			if (done__adpu) {
				_adpu_window = true;
			}
		}
	}

	if (!_adpu_window) {
		if (window.Event) {
			document.captureEvents(Event.CLICK);
		}

		document.onclick = do_adpu; 
		self.focus();
	}
}

function _adinit_adpu() {
	if (document.attachEvent) {
		document.attachEvent("onclick", _adpu);
	}
	else if (document.addEventListener) {
		document.addEventListener("click", _adpu, false);
	}

	return true;
}
