// JavaScript Document
//if (!document.getElementById) {
    //window.location = 
	   //"http://www.webstandards.org/upgrade/"
//}

// <![CDATA[
favicon = new Image();
favicon.src="/favicon.ico"; 
// ]]>

function checkwidth(object,thewidth){
	if(thewidth < object.width)
	object.width = thewidth;
	}

function openWindowTo(strUrl, iX, iY)
{
    //alert("Opening window to ["+strUrl+"]");
    //http://son-bfs-pth:8080/megaviewer/NewImage/zoomifyDynamicViewer.jsp?file=
    /*********************
     * Set up the window *
     *********************/
    iX -= 0;
    iY -= 0;
    var iScreenWidth = screen.availWidth;
    var iScreenHeight = screen.availHeight;
    var strScrollBar = "no";
    var strToolbar = "no";
    var strAddressBar = "no";
    var strDirectories = "no";
    var strStatBar = "no";
    var strMenuBar = "no";
    var strAllowResize = "no";
    var strAllowCopyHistory = "yes";
    iPosY = (iScreenHeight/2) -  (iY/2);
    iPosX = (iScreenWidth/2) -  (iX/2);

    if (window.outerWidth )
    {
        var option = "toolbar="+strToolbar+",location="+strAddressBar+",directories="+strDirectories+",status="+strStatBar+",menubar="+strMenuBar+",scrollbars="+strScrollBar+",resizable="+strAllowResize+",outerWidth="+iX+",outerHeight="+iY+",copyhistory="+strAllowCopyHistory+",left="+iPosX+",top="+iPosY;
        site=open(strUrl, "DisplayWindow", option);
        var Opera = (navigator.userAgent.indexOf('Opera') != -1);
        if(Opera)
        {
            site.resizeTo(iX,iY);
            site.moveTo(0,0);
        }
        if (site.opener == null) { site.opener = this.window; }
    }
    else
    {
        var option = "toolbar="+strToolbar+",location="+strAddressBar+",directories="+strDirectories+",status="+strStatBar+",menubar="+strMenuBar+",scrollbars="+strScrollBar+",resizable="+strAllowResize+",Width="+iX+",Height="+iY+",copyhistory="+strAllowCopyHistory+",left="+iPosX+",top="+iPosY;
        site=open('', "DisplayWindow", option);
        site.location=strUrl;
        if(site.open)
        {
            site.focus();
            return false;
        }
        if (site.opener == null) { site.opener = this.window; }
        site.resizeTo(iX,iY);
    }

}