﻿// JScript File
      function openFile()
		{
			//document.getElementById("ContentHolder").src="Docs/Kbga Trust.doc";
			window.open('Docs/Kbga Trust.doc', '_new')
		}
      function BtnMLogin_onclick()
      {
		  var user = document.getElementById('TxtMUN');
		  var passwrd = document.getElementById('TxtMPW');
			
		  if(user.value.length <= 0 || user.value=="Enter Username")
		  {
		  alert('Please enter Username');
		  user.value="";
		  user.focus();
		  return false;
		  }
		  
		  if(passwrd.value.length <= 0 || passwrd.value=="password")
		  {
		  alert('Please enter Password');
		  passwrd.value="";
		  passwrd.focus();
		  return false;
		  }
		  
		  if(RegExpAlphaNum(user.value)== false)
		  {
		  alert('Username is Invalid');
		  user.value="";
		  user.focus();
		  return false;
		  }
		  
		  if(RegExpAlphaNum(passwrd.value)== false)
		  {
		  alert('Password is Invalid');
		  passwrd.value="";
		  passwrd.focus();
		  return false;
		  }
		  return true;
      }

      function onblurfun()
      {
      var user = document.getElementById('TxtMUN');
      if(user.value == "")
      {
      user.style.color = 'silver';
      user.value="Enter Username";
      }
      }

      function onclickfun()
      {
      var user = document.getElementById('TxtMUN');
      var passwrd = document.getElementById('TxtMPW');

      if(user.value == "Enter Username")
      {
      user.value="";
      user.style.color = 'black';
      user.focus();
      }
      }

      function onblurfun1()
      {
      var passwrd = document.getElementById('TxtMPW');
      if(passwrd.value == "")
      {
      passwrd.style.color = 'silver';
      passwrd.value="password";
      }
      }

      function onclickfun1()
      {
      var passwrd = document.getElementById('TxtMPW');
      if(passwrd.value == "password")
      {
      passwrd.value="";
      passwrd.style.color = 'black';
      passwrd.focus();
      }
      }
   function back2Article()
   {
   window.open("articles.php","_self");
   }
   
   
   // FUNCTION TO CHECK VALID AlphaNumerics 
    function RegExpAlphaNum(id)
    {
   
       var isValid=true;
       var validChars="abcdefghijklnmopqrstuvwxyz0123456789";
       var charIndex;
       for(charIndex=0;charIndex<id.length;charIndex++)
        {
        if(validChars.indexOf(id.charAt(charIndex).toLowerCase())<0)
        {
        isValid=false;
        break;
        }
        }
        return  isValid;
   }
