﻿// JScript File
  
   function quote()
    {
      if(window.event.keyCode==39)
      {
       window.event.keyCode=96;
       return false;
      }
    }
   function AlphaOnly() 
    { 
    var Key = window.event.keyCode; 
    if((Key >= 65  && Key <= 90) || (Key >= 97  && Key <= 122)||Key==32) 
    return true; 
    return false; 
    } 
   function isEmail(InputValue)
    {
     var retValue=true;
     validRegExp = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
     strEmail = InputValue;
     if (strEmail.search(validRegExp) == -1) 
     {
     retValue=false;
     return retValue;
     } 
     return retValue;
    }
    
    function CallPrint(strid)
    {
         var prtContent = document.getElementById(strid);
         var strOldOne=prtContent.innerHTML;
         var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
         WinPrint.document.write(prtContent.innerHTML);
         WinPrint.document.close();
         WinPrint.focus();
         WinPrint.print();
         //SetPrintProperties() ;
         WinPrint.close();
         prtContent.innerHTML=strOldOne;
    }
    
    function callPrintFunction()
    {
        if (document.getElementById('hdn_Rpt').value=='Membership')
        {
          //alert(document.getElementById('hdn_Rpt').value);
            CallPrint('divRptMember');
        }
        else
        {
           // alert(document.getElementById('hdn_Rpt').value);
            CallPrint('divRptOthers');
        }
    }
   
    function loadUniquePage(page)
    {
        //if (opener && !opener.closed)
        //{
        //    opener.focus();
        //}
        //else 
        //{
            var myWin = window.open(page,'','');
            opener = myWin;
        //}
    }

//    function SetPrintProperties() 
//    {
//      try 
//      {  
//        var shell = new ActiveXObject("WScript.Shell");
//         shell.SendKeys(\'%fu\'); 
//         window.setTimeout("javascript:shell.sendKeys(\'%a{ENTER}\');", 1000); 
//         window.setTimeout("javascript:shell.SendKeys(\'%fv\');", 1000);  
//      } 
//      catch (e) 
//      {    
//      alert ("An exception occured: " + e + "\nCode is: " + e.number + "\nDescription is: " + e.description); 
//     // document.location.href="printhelp.htm";  
//      }
//    }