
$(function() {

	$(".searchCats").sexyCombo({ triggerSelected: true });

	$(".sf_searchText").toggleVal();

	/*$(".row.error").hover(
	function() {
	$(this).children('.inlinerror').show();
	$(this).children('.inlinerror').addClass('hovered');
	},
	function(){
	$(this).children('.inlinerror').hide();
	$(this).children('.inlinerror').removeClass('hovered');
	}
	);*/

});


$(function() {
	// Call stylesheet init so that all stylesheet changing functions 
	// will work.
	$.stylesheetInit();

	// When one of the styleswitch links is clicked then switch the stylesheet to
	// the one matching the value of that links rel attribute.
	$('.styleswitch').bind('click', function(e) {
		$.stylesheetSwitch(this.getAttribute('rel'));
		return false;
	});


	//$('#txtSze a:first').addClass('selected');

	$('#txtSze > a').click(function() {

		if (!$(this).hasClass('selected')) {
			$('#txtSze > a').removeClass('selected');
			$(this).addClass('selected');
		}

	});

});



/* Lightboxes */
$(function() {
	// add rels to each <a> in each .gallery to group them.
	$galleries = $("#mainContent .gallery");
	$galleries.each(function(k, v) {
		$(this).find("a").attr("rel", "lightbox-group-" + k);
	});
	$("#mainContent .gallery a").lightbox({
		fitToScreen: true,
		fileLoadingImage: '/baytril/images/loading.gif',
		fileBottomNavCloseImage: '/baytril/images/closelabel.gif',
		imageClickClose: false,
		displayHelp: false
	});
});

