﻿function resizeWindow(windowWidth, windowHeight) {
    if (self.innerWidth)
    {
	    parent.window.resizeTo(windowWidth + 8, windowHeight + 56);
        if(self.innerWidth != windowWidth || self.innerHeight != windowHeight) {
	        parent.window.resizeTo(windowWidth + 8 + (windowWidth - self.innerWidth), windowHeight + 56 + (windowHeight - self.innerHeight));
        }
        return true;
    }
    else if (document.documentElement && document.documentElement.clientWidth)
    {
	    parent.window.resizeTo(windowWidth + 12, windowHeight + 38);
        if(document.documentElement.clientWidth != windowWidth || document.documentElement.clientHeight != windowHeight) {
	        parent.window.resizeTo(windowWidth + 12 + (windowWidth - document.documentElement.clientWidth), windowHeight + 38 + (windowHeight - document.documentElement.clientHeight));
        }
        return true;
    }
    else if (document.body)
    {
	    parent.window.resizeTo(windowWidth, windowHeight);
        if(document.documentElement.clientWidth != windowWidth || document.documentElement.clientHeight != windowHeight) {
	        parent.window.resizeTo(windowWidth + (windowWidth - document.documentElement.clientWidth), windowHeight + (windowHeight - document.documentElement.clientHeight));
        }
        return true;
    }
    else return false;
}

function windowOpen(targetUrl, width, height, isScroll) {
	    windowSpawn = window.open (targetUrl, "Scoreboard",  "location=0, status=0, scrollbars=" + isScroll + ", menubar=0, resizable=0, width=" + width + ", height=" + height);
        return true;
}
