 window.___gcfg = {lang: 'en-GB'};

  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();


(function () {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

function SearchResults() {
var q2 = $('#q').val();
window.location = "../search?searchresults&search=&cx=005827600984494812304:lxmrbvjdkpo&cof=FORID:9;NB:1&ie=UTF-8&q=" + q2 + "&sa=Search";
}

$(document).ready(function () {    
    /*Alternate Table*/
    $('.medita_details tr').each(function () {
        var RowData = $('td', this).text();
        RowData = $.trim(RowData);  
        if (RowData == "") { $(this).remove(); }
    });
    $('.medita_details tr:even').addClass('alternate');
    
    $(".signup-button").click(function () {
        if ($(this).data('formstatus') !== 'submitting') {
            var form = $('#signup-form'),
             formData = form.serialize(),
             formMethod = form.attr('method'),
             responseMsg = $('#signup-response');

            form.data('formstatus', 'submitting');

            //show response message - waiting  
            responseMsg.hide()
                   .addClass('response-waiting')
                   .text('Please Wait...')
                   .fadeIn(200);

            $.ajax({
                //url: "/site/RegisterEmail",
                url: "site/RegisterEmail",
                type: formMethod,
                data: formData,
                dataType: 'json',
                success: function (data) {

                    switch (data.status) {
                        case 'error':
                            klass = 'response-error';
                            break;
                        case 'success':
                            klass = 'response-success';
                            break;
                    }
                    responseMsg.fadeOut(200, function () {
                        $(this).removeClass('response-waiting')
									   .addClass(klass)
									   .text(data.message)
									   .fadeIn(200, function () {
									       //set timeout to hide response message  
									       setTimeout(function () {
									           responseMsg.fadeOut(200, function () {
									               $(this).removeClass(klass);
									           });
									       }, 3000);
									   });
                    });
                }
            })
        }
        return false;
    });
});

$(function () {
    iFrames = document.getElementsByName('googleSearchFrame');

    if (iFrames.length > 0) {
        iFrames[0].style.width = '650px';
    }
});

    
