// conContactFunction
//This triggers the JQuery for the contact form

$(document).ready(function() {
    
        $.ajax({
            //this is the php file that processes the data and send mail
            url: "../subscriptions/live_stream/index.php?page=login",  
            
            //GET method is used
            type: "POST",

            //Do not cache the page
            cache: false,
            
            //success
            success: function (html) {              
                //if process.php returned 1/true (send mail success)
                if (html==1) {                  
                    //hide the form
                    $('.parentDiv').fadeOut('slow');                    
                    
                    //show the success message
                    $('.streamDiv').fadeIn('slow');
                    
                //if process.php returned 0/false (send mail failed)
                } else alert('Sorry, unexpected error. Please try again later.');               
            }       
        });
        
        //cancel the submit button default behaviours
        return false;
    }); 

