<!--
function load_image()
{
}

function PreviewWindow(url,name,width,height,fullscreen)
{
	iWidth = width + 40;
	iHeight = height + 40;
	sScrolls = "yes";
	sResizable = "yes";

	var fstring = "";
	if (fullscreen == 1)
		fstring = "width=" + screen.availWidth + ",height=" + screen.availHeight + ",toolbar=yes,resizable=" + sResizable + ",scrollbars=" + sScrolls + ",left=0,screenX=0,top=0,screenY=0"
	else
		fstring = "width=" + iWidth + ",height=" + iHeight + ",toolbar=yes,resizable=" + sResizable + ",scrollbars=" + sScrolls + ",left=1,screenX=1,top=1,screenY=1"

	var hWnd = window.open(url,"_blank",fstring);

	if (hWnd.focus != null) hWnd.focus();

	return;
}

function EnumWindowPosition()
{
	this.ScreenCenter = "ScreenCenter";
	this.WindowCenter = "WindowCenter";
	this.Absolute = "ScreenCenter";
}

var WindowPosition = new EnumWindowPosition();

function OpenWindow(url, name, position, x, y, width, height)
{
	if (position == WindowPosition.ScreenCenter)
	{
		x = window.screen.width/2 - width/2;
		y = window.screen.height/2 - height/2;
	}
	else if (position == WindowPosition.WindowCenter)
	{
		x = (window.screenLeft + window.document.body.clientWidth/2) - width/2;
		y = (window.screenTop + window.document.body.clientHeight/2) - height/2;
	}
	
	sScrolls = "yes";
	sResizable = "yes";
	sToolbars = "yes";

	var fstring = "width=" + width + ",height=" + height + ",location=1,status=1,toolbar=" + sToolbars + ",resizable=" + sResizable + ",scrollbars=" + sScrolls + ",left=" + x + ",screenX=" + x + ",top=" + y + ",screenY=" + y;

	if (name == "")
	{
		name = "_blank";
	}
	
	var hWnd = window.open(url, name, fstring, true);

	if (hWnd != null && hWnd.focus != null)
	{
		hWnd.focus();
	}

	return hWnd;
}

function writeDocument(s)
{
	document.write(s);
}

function setClipboard(maintext) 
{
    if (window.clipboardData) 
    {
        return (window.clipboardData.setData("Text", maintext));
    } 
    else 
    {
        if (window.netscape) 
        {
            try{
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            var clip = Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);
            if (!clip) 
            {
                return;
            }
            var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
            if (!trans) 
            {
                return;
            }
            trans.addDataFlavor("text/unicode");
            var str = new Object();
            var len = new Object();
            var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
            var copytext = maintext;
            str.data = copytext;
            trans.setTransferData("text/unicode", str, copytext.length * 2);
            var clipid = Components.interfaces.nsIClipboard;
            if (!clip) 
            {
                return false;
            }
            clip.setData(trans, null, clipid.kGlobalClipboard);
            return true;
            }
            catch(e)
            {
                alert("Firefox security restrictions your operations to the clipboard, please open the 'about: config' will 'signed.applets.codebase_principal_support' set to 'true' after the retry");
                return false;
            }
        }
    }
    return false;
}

-->
