﻿// JScript File
function ShowFiles(reg,no){
var wnd=window.open("/viewfiles/default.asp?reg=" + reg+'&no='+no,"wnd","width=640 height=480");
wnd.focus();
}
function Form2Popup(params, actionUrl, name, popupConfig, get) {
      // free in choice: post or get
      var method = (get == undefined || !get) ? 'POST' : 'GET';
      // it's important to assign non-null name!
      if (name == undefined || name == '') {
       name = 'tmpPopup';
      }
      var form = document.createElement("form");
      form.action=actionUrl;
      form.method=method;
      form.target=name
      form.style.display="none"
      var element = null;
      for (var propName in params) {
        //element = document.createElement('<input type="text" name="' + propName + '" value="' + params[propName] + '">');
        element = document.createElement("input");
        element.type="text"
        element.name=propName
        element.value=params[propName]
      form.appendChild(element);
      }
      document.body.appendChild(form);
      // First, open empty window: why make redundant request to server?
      var win = window.open('about:blank', name, popupConfig);
      // in order to restore this window
      // if it's already been opened before
      win.focus();
      form.submit();
      //form.removeNode(true);
      document.body.removeChild(form);
      return win;
   }
function GoLPT(iss){
        var frm
        var ch=""
        frm=document.getElementById("frmxls")
        for (var i=2; i<frm.length-2; i++){
         if (frm[i].type=="checkbox"){
            if (frm[i].checked){
                ch +=(String(frm[i].name).substr(3,3) + ",")
            }
         }
        }
        ch=ch.substr(0,ch.length-1)
        var params = {ids : ch,   iss:iss};
       	var width="1024", height="768";
    	var left = (screen.width/2) - width/2;
	    var top = (screen.height/2) - height/2;

       	var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;

        var previewPopup = Form2Popup(params, "/issuers/lpt/index.asp", "print", styleStr);
    }
/*
    function openIssuer(ticker) {
        var width = "1024", height = "900";
        var left = (screen.width / 2) - width / 2;
        var top = (screen.height / 2) - height / 2;
        var win_name = String(ticker).replace("%21", "_").replace("!", "_")
        var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',screenX=' + left + ',screenY=' + top;
        window.open('/issuers/' + ticker + '/', win_name, styleStr);
    } 
  */ 

