﻿$(document).ready(function() {

    /*Start:- This is for Left Tag*/
        $(".trigger").click(function() {
            $(".panel").toggle("fast");
            $(this).toggleClass("active");
            return false;

        });
    /*End:- This is for Left Tag*/
    
    /*Start:- Following code is being used in Default Page */
      
    /*End:- Following code is being used in Default Page */
    });

    //This function is used to check whether a textbox is blank or not
    function funcValidation_Blank(txtTextBox_Client,divName) 
    {
        var txtTextBox = document.getElementById(txtTextBox_Client); //Create the instance of the variable being passed

        if (txtTextBox.value == "") 
        {
            document.getElementById(divName).style.visibility = "visible";            
            txtTextBox.focus();
            return false;        
        }
    }

    //This function is used to check "Proper Email" validation 
    function funcValidation_Email(txtTextBox_Client, divName) 
    {
        var txtTextBox = document.getElementById(txtTextBox_Client); //Create the instance of the variable being passed
        var email = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

        if (email.test(txtTextBox.value) == false) {
            document.getElementById(divName).style.visibility = "visible";
            //window.alert("Please Enter ");
            txtTextBox.focus();
            return false;
        }
    }

    //This function is used to check "Proper Telephone" validation
    function funcValidation_Telephone(txtTextBox_Client, divName) 
    {
        var txtTextBox = document.getElementById(txtTextBox_Client); //Create the instance of the variable being passed    
        var strValidChars = "0123456789+-()";
        var strChar;
        var blnResult = true;
        var strString = txtTextBox.value;

        //Test strString consists of valid characters listed above
        for (i = 0; i < strString.length && blnResult == true; i++) {
            strChar = strString.charAt(i);
            if (strValidChars.indexOf(strChar) == -1) {
                document.getElementById(divName).style.visibility = "visible";
                txtTextBox.focus();
                return false;
            }
        }        
    }
