jQuery(document).ready(function () { // ----------- Start Show the active page depending on the page that is open -------- var current_page_title = $(document).attr('title'); $('#navigation a').each(function () { var LinkTitle = $(this).attr('title'); if (current_page_title == LinkTitle) { $(this).addClass('active'); } if (current_page_title.indexOf("FAQ") !== -1 || current_page_title.indexOf("HOW TO") !== -1) { $('#SubMenu').show(); } }); // ----------- End Show the active tab depending on the page that is open -------- // ------- Start Contact Us form ----------- $('#Btn_Submit_Feedback').click(function () { // disable the clicked button $(this).attr('disabled', true); var email = $('#email').val(); var msg = $('#msg').val(); if (!isValidEmailAddress(email) || msg == "Your message") { $('#response').remove(); $('#FeedbackContainer').append('

Please verify your email and message.

'); } else { $('#FeedbackContainer').append('Currently Loading'); $.ajax({ url: ServicesUrl + '/SendFeedback', type: 'POST', data: '{"email":"' + email + '", "msg":"' + msg + '"}', contentType: "application/json; charset=utf-8", success: function (result) { // To convert an object to a string var json_text = JSON.stringify(result); // To convert a string to JSON object result = JSON.parse(json_text); $('#loading').fadeOut(500, function () { $(this).remove(); }); $('#response').remove(); $('#FeedbackContainer').append('

' + result.d + '

'); $('#email').val("Your email"); $('#msg').val("Your message"); }, error: function () { $('#loading').fadeOut(500, function () { $(this).remove(); }); $('#response').remove(); $('#FeedbackContainer').append('

Sorry, your message cannot be sent.

'); $('#email').val("Your email"); $('#msg').val("Your message"); } }); } // enable the clicked button $(this).attr('disabled', false); return false; }); // Validate email function isValidEmailAddress(emailAddress) { var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i); return pattern.test(emailAddress); }; // ------- End Contact Us form ----------- // ------- Start Large images animation ----------- var offsetX = -530; var offsetY = 10; $('.rander a').hover(function (e) { var href = $(this).attr('href'); $('big image') .css('top', e.pageY + offsetY) .css('left', e.pageX + offsetX) .appendTo('#rightcol'); }, function () { $('#largeImage').remove(); }); $('.rander a').mousemove(function (e) { $("#largeImage").css('top', e.pageY + offsetY).css('left', e.pageX + offsetX); }); $('.rander a').click(function () { return false; }); // ------- End Large images animation ----------- // ---- start FAQs - How to page --------------------------------- $('.faqs dd').hide(); // Hide all DDs inside .faqs $('.faqs dt').hover(function () { $(this).addClass('hover') }, function () { $(this).removeClass('hover') }).click(function () { // Add class "hover" on dt when hover $(this).next().slideToggle('normal'); // Toggle dd when the respective dt is clicked }); // ---- end FAQs - How to page --------------------------------- });