$('html').addClass('js');
$(document).ready(function() {
	$('.js .scroll-pane').css('display', 'block');
	$('.scroll-pane').show().jScrollPane({scrollbarWidth:6, scrollbarMargin:4});

	reinitialiseScrollPane = function()
	{
		$('.scroll-pane').show().jScrollPane({scrollbarWidth:6, scrollbarMargin:4});
	}

	//$(".colorbox").colorbox({width:"50%", inline:true, href:$(this).attr("rel")});
	
	$(".colorbox").click(function(){
		var rel = $(this).attr("rel");			
		$(this).colorbox({width:"400px", inline:true, href:'#' + rel});
	});
	
	$(".radio").click(function(){
		$('.searchOptions').hide();
		$('#searchQuoteForm').clearCheckboxes()
		var value = $(this).attr("value");
		if($('#searchOptions_' + value).length != 0) {
			$('#searchOptions_' + value).show();
		}
	});
});

$.fn.clearCheckboxes = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearCheckboxes();
	if (type == 'checkbox')
	  this.checked = false;
  });
};
