///*
// * To change this template, choose Tools | Templates
// * and open the template in the editor.
// */
//
//// Functions of jQuery
//var ajax_request = function() {
//  jQuery.ajax({
//    url: '/content/questions',
//    type: 'GET',
//    data: jQuery('form#search-form123').serialize(),
//    success: function(response) {
//      if (response) {
//        jQuery(".lifetuner-questions").html(response)
//        jQuery(".lifetuner-questions").show()
//      }
//    }
//  })
//}
//
//var qst_request = function() {
//  jQuery.ajax({
//    url: '/content/create_member_and_question',
//    type: 'POST',
//    data: jQuery('form#askYourQuestionForm').serialize(),
//    success: function(response) {
//      if (response == 'not-accepted') {
//        alert("The terms of service must be accepted")
//      }
//      else {
//        jQuery("#askYourQuestionBox").hide();
//        jQuery('#thank-u-visitor').html(response);
//        jQuery('#thank-u-visitor').show();
//      }
//    }
//  })
//}
//
//var member_request = function() {
//  jQuery.ajax({
//    url: '/content/check-member',
//    type: 'POST',
//    success: function(response) {
//      if (response == "logged-in") {
//        jQuery("#mini-reg-form").show();
//        jQuery("#reg-form").hide();
//        jQuery("#submit-qst").css('margin-right', '0px').css('margin-top', '15px');
//      }
//      else {
//        jQuery("#mini-reg-form").show();
//        jQuery("#reg-form").show();
//      }
//
//    }
//  })
//}
//
//// Document ready function
//jQuery(document).ready(function() {
// // jQuery('a[rel*=facebox]').facebox();
//  /* jQuery("#datepicker").datepicker({
//        changeMonth:true,
//        changeYear:true,
//        yearRange: '1911:2010'
//    });*/
//  jQuery('ol.faq-list li').mouseover(function() {
//    jQuery(this).addClass('qst-highlight')
//  })
//
//  jQuery('ol.faq-list li').mouseout(function() {
//    jQuery(this).removeClass('qst-highlight')
//  })
//
//  jQuery('#submit-qst').click(function() {
//    var pattern = new RegExp("[a-zA-Z0-9]")
//    if (pattern.test(jQuery('#askYourQuestionFormInput').val())) {
//      qst_request();
//    }
//  });
//
//  jQuery('select#browse-by-topic-tools').change(function() {
//    var pathname = window.location.href
//    pathname = pathname.split('#')[0]
//    pathname += jQuery('select#browse-by-topic-tools').val();
//    window.location.href = pathname
//  })
//
//  jQuery('select#browse-by-topic-faqs').change(function() {
//    var pathname = window.location.href
//    pathname = pathname.split('#')[0]
//    pathname += jQuery('select#browse-by-topic-faqs').val();
//    window.location.href = pathname
//  })
//
//
//  // jQuery('#askYourQuestionSubmitButton').click(function() {
//  //   var str = jQuery("#askYourQuestionFormInput").val();
//  //   if (str != 'start by typing your question here...') {
//  //     jQuery(this).hide();
//  //     member_request();
//  //   }
//  // })
//
//  //ajax_request();
//  jQuery('#lifetuner-topics').change(ajax_request)
//  jQuery("input[name='helpSort']").change(ajax_request)
//
//})
//
//jQuery('.close-thank-you').live('click', function() {
//  jQuery('#thank-u-visitor').hide();
//  jQuery("#askYourQuestionBox").show();
//  jQuery("#askYourQuestionSubmitButton").show();
//  jQuery("#mini-reg-form").hide();
//  jQuery("#reg-form").hide();
//  jQuery("#askYourQuestionFormInput").attr('value', "start by typing your question here...")
//})
//
//jQuery('#close-thank-you-1').live('click', function() {
//  jQuery(this).hide();
//  jQuery('#thank-u-visitor').hide();
//  jQuery("#askYourQuestionBox").show();
//  jQuery("#askYourQuestionSubmitButton").show();
//})
//
//jQuery('div#questions_pagination a').live("click", function() {
//  jQuery.ajax({
//    url: jQuery(this).attr('href'),
//    type: 'GET',
//    data: '',
//    success: function(response) {
//      if (response) {
//        jQuery("#lifetuner-questions").html(response)
//        jQuery("#lifetuner-questions").show()
//      }
//    }
//  })
//});

