﻿//Login JScript File

function RadioBtnChng()
{
    
		rbtn=document.getElementsByName('ctl00$cphsharmaTransports$rbtnlstlogin');
		for(i=0;i< rbtn.length;i++)
		{		
		    if (rbtn[i].checked==true)
		    {
		      val = rbtn[i].value;
		    }	
		 }	
         if(val=='A')
        {
             document.getElementById("ctl00_cphsharmaTransports_txtterminalid").focus();
            if (isEmpty(document.getElementById('ctl00_cphsharmaTransports_txtterminalid'), "Terminal Id can't be empty", document.getElementById('ctl00_cphsharmaTransports_lblmsg')))
		            {
				            if(isEmpty(document.getElementById('ctl00_cphsharmaTransports_txtusername'), "Username can't be empty", document.getElementById('ctl00_cphsharmaTransports_lblmsg')))
					            {
						            if(isEmpty(document.getElementById('ctl00_cphsharmaTransports_txtpassword'), "Password can't be empty", document.getElementById('ctl00_cphsharmaTransports_lblmsg')))
							            {
								            return true;
							            }
					            }
		           }
		           return false;
        	
         }
         else
         {
               document.getElementById("ctl00_cphsharmaTransports_txtusername").focus();
               if (isEmpty(document.getElementById('ctl00_cphsharmaTransports_txtusername'), "Username can't be empty", document.getElementById('ctl00_cphsharmaTransports_lblmsg')))
			                    {
				                    if(isEmpty(document.getElementById('ctl00_cphsharmaTransports_txtpassword'), "Password can't be empty", document.getElementById('ctl00_cphsharmaTransports_lblmsg')))
					                    {
						                    if(isValidEmail(document.getElementById('ctl00_cphsharmaTransports_txtusername'), "Invalid E Mail", document.getElementById('ctl00_cphsharmaTransports_lblmsg')))
							                    {
								                    return true;
								                }
							            }
					            }
			   return false;

         }
          return false; 
 }
 
        function logincheckDate(sender,args)
        {
            if (sender._selectedDate < new Date()) 
            {
                // alert("You cannot select a day earlier than today!");
                sender._selectedDate = new Date(); 
                // set the date back to the current date
                sender._textbox.set_Value(sender._selectedDate.format(sender._format))
            }
        }

