﻿function bodyLoaded() {
}
$(document).ready(function () {
	// put all your jQuery goodness in here.
	if (self.startFlashApplication)
		self.startFlashApplication(pageHeight() - 170);
	document.getElementById("contentContainer").style.minHeight = (pageHeight() - 230).toString() + "px";
})

function pageHeight() {
	return window.innerHeight != null ? window.innerHeight :
    document.documentElement && document.documentElement.clientHeight ?
    document.documentElement.clientHeight : document.body != null ?
    document.body.clientHeight : 450;
}

function reportActivityComplete() {
    if (window.XMLHttpRequest) {
        xhttp = new XMLHttpRequest();
    }
    else // Internet Explorer 5/6
    {
        xhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xhttp.open("GET", "/Activities/ActivityComplete.ashx?activityUrl=" + location.href, false);
    xhttp.send("");
    xmlDoc = xhttp.responseXML;
}

function resizeSwf() {
	if (self.startFlashApplication)
		document.getElementById("swfParentContainer").style.height = document.documentElement.clientHeight - 190;
}

function reportActivityCompleteAndRedirect() {
    reportActivityComplete();
    closeWindow();
}

function closeWindow() {
    window.close();
}

function prepareLinkButtonForDefault(clientID) {
    if (clientID == null || clientID == "")
        return;
    var tag = document.getElementById(clientID);
    if (tag && typeof (tag.click == 'undefined')) {
        tag.click = function() {
            var result = true;
            if (tag.onclick) {
                result = tag.onclick();
            }
            if (typeof (result) == 'undefined' || result) {
                eval(unescape(tag.href));
            }
        }
    }
}