﻿$(document).ready(function () {

//    $.ajax({
//        type: "POST",
//        url: "SportsClassic.asmx/getHtmlFragment",
//        data: "{sectionId:'result',refUrl:'" + window.location.pathname + "'}",
//        contentType: "application/json; charset=utf-8",
//        dataType: "json",
//        success: function (msg) {
//      
//            $("#Result").html(msg.d);
//        },
//        error: function (e) {
//            $("#Result").html("Unavailable");
//        }
//    }); 


});
function getParameterByName( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return decodeURIComponent(results[1].replace(/\+/g, " "));
}
$(function () {

    // Accordion

    if (getParameterByName('aid') == "") {
        $("#accordion").accordion({ header: "h3", collapsible: true, active:false });
        $("#accordion").accordion("activate", false);
    } else {
        $("#accordion").accordion({ header: "h3", collapsible: false, active: parseInt(getParameterByName('aid'))  });
        $("#accordion").accordion("activate", parseInt(getParameterByName('aid')));
    }
    // Tabs
    $('#tabs').tabs();

    // Buttons
    $('#radioset').buttonset();
    $('.loginBtn').button();
    $('.button').button();
    // Dialog			
    //    $('#dialog').dialog({
    //        autoOpen: false,
    //        width: 600,
    //        buttons: {
    //            "Ok": function () {
    //                $(this).dialog("close");
    //            },
    //            "Cancel": function () {
    //                $(this).dialog("close");
    //            }
    //        }
    //    });

    //    // Dialog Link
    //    $('#dialog_link').click(function () {
    //        $('#dialog').dialog('open');
    //        return false;
    //    });
    $('#topmenu ul li').hover(
					function () { $(this).addClass('ui-state-hover'); },
					function () { $(this).removeClass('ui-state-hover'); }
				);

    //    // Datepicker
    //    $('#datepicker').datepicker({
    //        inline: true
    //    });

    //    // Slider
    //    $('#slider').slider({
    //        range: true,
    //        values: [17, 67]
    //    });

    //    // Progressbar
    //    $("#progressbar").progressbar({
    //        value: 20
    //    });

    //    //hover states on the static widgets
    //    $('#dialog_link, ul#icons li').hover(
    //					function () { $(this).addClass('ui-state-hover'); },
    //					function () { $(this).removeClass('ui-state-hover'); }
    //				);

}
);

/* Photo Gallery Code */
$(function () {
    $('#gallery li a').lightBox();
});
/* Parts Light box Code */

$(function () {
    $('.PartsListTable a').lightBox();
});

/* Button Code */
$(function () {

    $(".jquerybuttonedit").button({ icons: { primary: "ui-icon-wrench"} });
    $(".jquerybuttonadd").button({ icons: { primary: "ui-icon-plusthick"} });
    $(".jquerybuttondel").button({ icons: { primary: "ui-icon-closethick"} });
    $(".jquerybutton").button();
   
});

/* Slider Code */
$(function () {
    $('#slider').nivoSlider();
});
