// Thickbox iframe support from CWS
// Note additional parameter - to allow functions to be called when
// the window is knocked down - last parameter is a function name
function CWS_thickboxiframeatag(stem, questionmark, width, height, modal, reload)
{
        var ws = CWS_browserWindowSize();
        if (width > ws[0] - 16) {
                width = ws[0] - 16;
        }
        if (height > ws[1] - 80) {
                height = ws[1] - 80;
        }
        var href=stem + questionmark + 'TB_iframe=true&width=' + width + '&height=' + height;
        if (modal) {
                href = href + '&modal=true';
        }
        if (reload != '') {
                href = href + '&reload='+reload;
        }
	document.write('<a class="thickbox" href="'+href+'">');
}
// from http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
function CWS_browserWindowSize()
{
        var myWidth = 0, myHeight = 0;
        if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
                myHeight = window.innerHeight;
        }
        else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
                //IE 6+ in 'standards compliant mode'
                myWidth = document.documentElement.clientWidth;
                myHeight = document.documentElement.clientHeight;
        }
        else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                //IE 4 compatible
                myWidth = document.body.clientWidth;
                myHeight = document.body.clientHeight;
        }
        var retv = new Array();
        retv[0] = myWidth;
        retv[1] = myHeight;
        return(retv);
}
function CWS_reloadme()
{
	setTimeout('window.location.reload()', 1);
}
function CWS_loadUrl(url)
{
	setTimeout('window.location = "' + url + '"', 1);
}

