﻿var countryid = 0;

$(document).ready(function() {


    $(".reflect").reflect(0.165, 0.5);
    $(".contactLink").click(function() {
        if ($(".contactForm").is(":hidden")) {
            $(".contactForm").slideDown("slow");
        }
        else {
            $(".contactForm").slideUp("slow");
        }
    });

    $(".cityBox").autocomplete("autocompletetext.aspx", {
        delay: 5,
        minChars: 1,
        matchSubset: 1,
        matchContains: 1,
        cacheLength: 10,
        autoFill: true,
        extraParams: {
            city: function() { return $(".countryddlList").val(); }

        }
    }
            );



});



function load() {

    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
}

function EndRequestHandler() {
    //these two line adds the color to each different row
    $("#ScoreCardTable tr:even").addClass("eventr");
    $("#ScoreCardTable tr:odd").addClass("oddtr");
    //handle the mouseover , mouseout and click event
    //$("#ScoreCardTable tr").mouseover(function() { $(this).addClass("trover"); }).mouseout(function() { $(this).removeClass("trover"); }).focus(function() { $(this).addClass("trclick"); });
    $('INPUT, SELECT').focus(function() { $(this).parents("tr:first").addClass("trover"); })
    $('INPUT, SELECT').blur(function() { $(this).parents("tr:first").removeClass("trover"); })

    $(".contactLink").click(function() {
        if ($(".contactForm").is(":hidden")) {
            $(".contactForm").slideDown("slow");
        }
        else {
            $(".contactForm").slideUp("slow");
        }
    });


}
$(function() {

    $('.cbx input').checkBox();

    $('#toggle-all').click(function() {
        $('#example input[type=checkbox]').checkBox('toggle');
        return false;
    });

    $('#check-all').click(function() {
        $('#example input[type=checkbox]').checkBox('changeCheckStatus', true);
        return false;
    });
    $('#uncheck-all').click(function() {
        $('#example input[type=checkbox]').checkBox('changeCheckStatus', false);
        return false;
    });
    $('#check-2').click(function() {
        $('#example input[type=radio]:eq(1)').checkBox('changeCheckStatus', true);
        return false;
    });
    $('#native').click(function() {
        //native methods
        $('#example input[type=radio]:eq(0)').attr({ checked: true, disabled: true })
        //reflect the current state
						.checkBox('reflectUI');
        return false;
    });

    $('a.lightbox').lightBox();
});
        
        