// JavaScript Document
	function close_window()
	{						
		window.opener.document.location.reload();
		window.close();
	}
	
	function popup_agreement()
	{
		var browse = "agreement.php";
		var hnwd = launchCenter(browse, "AGREEMENT", 500, 450, true );	
	}
	
	
	function onhelp()
	{
		var browse = "help.html";
		window.open(browse,'popup', 'resizable=yes,status=no,toolbar=no,scrollbars=yes,location=no,menu=no,width=550,height=700');  
	}
	
	function upload_new_watermark()
	{
		var browse = "upload_logo.php";
		var hnwd = launchCenter(browse, "LOGO", 120, 510, false );	
	}
	
	function popupBrowsewin( )
	{	
		var browse = "download_browse.php";
		var hnwd = launchCenter(browse, "DownloadBrowse", 400, 300, false );	
	}
	
	function show_icon(sel)
	{
		var form = document.category;

		form.showIcon.src = sel.options[sel.selectedIndex].value;
	}
	
	
	function upload_download_image(id, name, check)
	{
		if ( check.checked )
		{
			var file = "upload.php?id="+id+"&name="+name+"&act=rem";
		}
		else
		{
			var file = "upload.php?id="+id+"&name="+name+"&act=add";
		}
		
		var opener = launchCenter(file, "LOGO", 120, 500, false) 
	}
	
	function launchCenter(url, name, height, width, resize) 
	{
	 	var str = "height=" + height + ",innerHeight=" + height;
			
		if ( resize )
		{
  			str += ",width=" + width + ",innerWidth=" + width + ",resizable=yes";
		}
		else
		{
			str += ",width=" + width + ",innerWidth=" + width;
		}
		
		if (window.screen) 
		{
			var ah = screen.availHeight - 30;
		    var aw = screen.availWidth - 10;

		    var xc = (aw - width) / 2;
		    var yc = (ah - height) / 2;

		    str += ",left=" + xc + ",screenX=" + xc;
		    str += ",top=" + yc + ",screenY=" + yc;
		}
		
	    return window.open(url, name, str);
	}
