﻿/**************** Global Variables *************************/

var cartBaseUrl = "/TPOnline/TPOnline.dll/Custom Student Class Apply/DENAME=";

/**************** Document Ready functions *****************/

(function ($) {
	$(function () {
		// Courses Tabbed content
		$("#tabs").tabs();

        // Fix for IE6 dropdown         
        if ($.browser.msie && $.browser.version.substr(0,1)<7) {
              $('#nav li').live({
                mouseenter: function() {       
                  $(this).find('ul').show();
                },
                mouseleave: function() {
                  $(this).find('ul').hide();
                }
              });
      
              $('#nav li ul').live({
                mouseenter: function() {       
                  $(this).show();
                },
                mouseleave: function() {
                  $(this).hide();
                }
              });
        }
       

		// Fancybox - Hotel Information
		$('.course-hotelwindow').fancybox({
			'hideOnContentClick': false, 
			'type' : 'iframe',
			'width' : 400, 
			'height': 400
		});

        $('.course-catalog').dataTable({
            "bPaginate": false,
            "bLengthChange": false,
            "bFilter": false,
            "bSort": true,
            "bInfo": false,
            "bAutoWidth": false,   
            "aaSorting": [[ 1, "asc" ]],
            "aoColumns": [null, null, null, { "bSortable": false }]
        });
	});
})(jQuery);


/****************Course Page *******************************/

// Update Add to cart button with selected course
function updateAddToCartButtonWithId(itemType, classId) {
    $('.addtocart').attr("href", cartBaseUrl + classId).removeAttr("disabled");
    $('.choose-city').attr("disabled", "disabled");
}


