function openWindow(url,w,h,tb,stb,l,mb,sb,rs) {
    tb=(tb)?'yes':'no'; stb=(stb)?'yes':'no'; l=(l)?'yes':'no';
    mb=(mb)?'yes':'no'; sb=(sb)?'yes':'no'; rs=(rs)?'yes':'no';

    var x=window.open(url, 'newWin'+new Date().getTime(), 
      'scrollbars='+sb+',width='+w+',height='+h+',toolbar='+tb+
      ',status='+stb+',menubar='+mb+',links='+l+',resizable='+rs);
    x.focus();
}

function windowDimensions() {
    var x,y;
    if (self.innerHeight) // all except Explorer
	{
	    x = self.innerWidth;
	    y = self.innerHeight;
	}
    else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
	{
	    x = document.documentElement.clientWidth;
	    y = document.documentElement.clientHeight;
	}
    else if (document.body) // other Explorers
	{
	    x = document.body.clientWidth;
	    y = document.body.clientHeight;
	}
    return [x,y];
}

function scrollOffsets() {
    var x,y;
    if (this.pageYOffset) // all except Explorer
	{
	    x = this.pageXOffset;
	    y = this.pageYOffset;
	}
    else if (document.documentElement && document.documentElement.scrollTop)
	// Explorer 6 Strict
	{
	    x = document.documentElement.scrollLeft;
	    y = document.documentElement.scrollTop;
	}
    else if (document.body) // all other Explorers
	{
	    x = document.body.scrollLeft;
	    y = document.body.scrollTop;
	}
    return [x,y];
}

function pageSize() {
    var x,y;
    var test1 = document.body.scrollHeight;
    var test2 = document.body.offsetHeight;
	if (test1 > test2) // all but Explorer Mac
	    {
		x = document.body.scrollWidth;
		y = document.body.scrollHeight;
	    }
	else // Explorer Mac;
	     //would also work in Explorer 6 Strict, Mozilla and Safari
	    {
		x = document.body.offsetWidth;
		y = document.body.offsetHeight;
	    }
    return [x,y];
}

function showdims() {
    var ary;
    ary = windowDimensions();
    alert("windowDimensions: "+ ary[0] + "x" + ary[1]);
    ary = scrollOffsets();
    alert("scrollOffsets: "+ ary[0] + "x" + ary[1]);
    ary = pageSize();
    alert("pageSize: "+ ary[0] + "x" + ary[1]);
}




