function checkXMLHTTP(xmlhttp) {
    xmlhttp = false;
    try {
        return xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            return xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E) {
            xmlhttp = false;
        }
    }
    if (!xmlhttp && typeof XMLHttpRequest !== 'undefined') {
        return xmlhttp = new XMLHttpRequest();
    }
}
function documentID(el) {
    return document.getElementById(el); //Get the element with the specified ID
}
/*
 -----------@@@Tania@ Start contact Part----------------------------------
 */

/*
 * @Function            : selectContactFor 
 * @Used IN             : front_end/contact/contact_form  line-76
 * @Description         : what types of 'contact for' selected if selected other then it shows input text field for typeing reason. 
 * @Developed By        : Tania Akter
 * @Start DateTime      : 23-04-2016 10:32 AM
 * @Status              : available      
 */
function selectContactFor(GivenText) {
    
    var xmlhttp3;
    xmlhttp3 = checkXMLHTTP(xmlhttp3);
     var OtherOption = document.getElementById('OtherOption');
     var contactFor ;
     contactFor  = document.getElementById('select_contact_for');
    
    if(GivenText === '0'){      //if select contact for option
        contactFor.setAttribute('class', 'form-control validate[required, custom[requiredContactFor]]');   
    }
    else if(GivenText === '6'){         //if selete other
       OtherOption.setAttribute('style', 'display:block');   
    }
    else{
     OtherOption.setAttribute('style', 'display:none');   
    }
}


  /*
 * @Function            : check_form
 * @Used IN             : contact form
 * @Description         : for validating google captcha
 * @parameter           : 
 * @Developed By        : Kazol
 * @Start DateTime      : 14/05/2017
 * @Status              : available   
 */
function check_form(){
   
    var v = grecaptcha.getResponse();
            if(v.length == 0)
        {
            //alert("please complete the captcha");
              swal({
                title: "",
                text: "please complete the captcha",
                type: "warning",
                confirmButtonColor: "#80c12c",
                confirmButtonText: "OK",
                closeOnConfirm: false

              });

            //document.getElementById('captcha').innerHTML="You can't leave Captcha Code empty";
            return false;
        }
        else{
             return true;
           }
    }


