var obj;
var winModalWindow;

function tryItNow(AppID,dontShowPopup) {
	checkMessenger(dontShowPopup);
	launchApp(AppID, '');
}

function launchApp(AppID, emailID) {
	if (obj != null) {
		obj.LaunchApp(AppID, emailID);
	}
}

function checkMessenger(dontShowPopup) {
	eval ('try {obj = new ActiveXObject("MSNMessenger.P4QuickLaunch"); } catch (e) {obj = null;}');
	if (dontShowPopup==undefined){
		if (navigator.appName.indexOf("Microsoft") == -1) {
			ShowWindow('http://activity.oberon.nl/error/browser', 400, 300);
		}	else if (obj == null) {
			ShowWindow('http://activity.oberon.nl/error', 400, 300);
		}
	}
}

function IgnoreEvents(e) {
	return false
}

function ShowWindow(strError, width, height) {
	if (window.showModalDialog) {
		window.showModalDialog(strError,null,"dialogWidth="+width+"px;dialogHeight="+height+"px;help=no;dialogLeft=160");
	} else {
		var ah = screen.availHeight;
		var y = (ah - height) / 2;
		window.top.captureEvents (Event.CLICK|Event.FOCUS);
		window.top.onfocus=HandleFocus;
		winModalWindow = window.open (strError,"ModalChild","dependent=yes,width="+width+",height="+height+",top="+y+",left=160,screenX=160,screenY="+y);
		winModalWindow.focus()
	}
}

function HandleFocus() {
	if (winModalWindow) {
		if (!winModalWindow.closed)	{
			winModalWindow.focus();
		} else {
			window.top.releaseEvents (Event.CLICK|Event.FOCUS);
		}
	}
	return false;
}

function startActivity(movieID){
	document.cookie = 'movieID='+movieID+'; expires=Thu, 1 Jan 2009 00:00:00 UTC; path=/'
	tryItNow("99995757");
}
