function PopWin(myurl)
{
  var path;
  var title;
  var w;
  var mail="/print/mail.php";
  var pri ="/print/printer.php";
  var comment="/print/comment.php";
  var new_sct="/print/report_new_sub_cat.php";
  var footer_url;
  path=window.location;
  path= replaceCH(path);
  title=window.document.title;
  switch (myurl)
  {
	case ("mail"): docurl = mail + "?title=" + title + "&path=" + path;
                   w = open(docurl,"mail","resizable=no, width=430, height=445, scrollbars=yes, status=no, top=50, left=150, screenX=430, screenY=445");
				   break;
	case ("print"): docurl = pri + "?title=" + title + "&path=" + path;
	               w = open(docurl,"print", "location=no, scrollbars=yes, menubars=no, toolbars=no, resizable=yes, status=no, width=790, height=520, top=0, left=0, screenX=0, screenY=0");
				   break;
	case ("comment"): docurl = comment + "?title=" + title + "&path=" + path;
	               w = open(docurl,"comment","resizable=no, width=400, height=380, scrollbars=no, status=no, top=100, left=150, screenX=400, screenY=380");
				   break;
	case ("new_sct"):
		w=open(new_sct,"Suggestion","resizable=no,width=430,height=445,scrollbars=no,top=60,left=150");
  }
		if(w.opener==null) w.opener= self;
		
}

function PopWin4list(myurl,p_in_clause,p_require_parm)
{
  var path;
  var title;
  var w;
  var mail="/print/mail.php";
  var pri ="/print/printer.php";
  var comment="/print/comment.php";
  var new_sct="/print/report_new_sub_cat.php";
  var footer_url;
  var is_execution_for_print="Y";
  path=window.location;
  footer_link=Get_footer_link(path);
  footer_link=replaceCH(footer_link + p_require_parm);
  path=path + "&in_clause=" + p_in_clause;
  path= replaceCH(path);
  title=window.document.title;
  docurl = pri + "?title=" + title + "&path=" + path + "&footer_link=" +footer_link + "&is_execution_for_print=" + is_execution_for_print;
	              w = open(docurl,"print", "location=no, scrollbars=yes, menubars=no, toolbars=no, resizable=yes, status=no, width=790, height=520, top=0, left=0, screenX=0, screenY=0");
  if(w.opener==null) w.opener= self;
		
}

function replaceCH(p_str)
 { 
	
   p_str="" + p_str;  //do not uncomment or alter this line
   var len=p_str.length;
   var lstr=""; 
   var j=0;
   for(i=0;i<len;i++)
   {
      ch=p_str.substr(i,1)
	  if(ch=="&")
	  {
	   ch="%26";
	  }
	  lstr=lstr+ch;
   }
   return lstr;
 }
function Get_footer_link(p_path)
 { 
	
   p_path="" + p_path;  //do not uncomment or alter this line
   var len=p_path.length;
   var lstr=""; 
   var j=0;
   for(i=0;i<len;i++)
   {
      ch=p_path.substr(i,1)
	  if(ch=="?")
	  {
	   break;
	  }
	  lstr=lstr+ch;
   }
   return lstr;
 }
