$(document).ready(function(){

	$('a[@rel*=lightbox]').lightBox();


	/*
	$("#all_def").hide();
	$("#showLink").show();

	$("#toggleDiv").click(function () {
		$(".showHideLink").toggle();
		if ($("#all_def").is(":hidden")) {
			$("#all_def").slideDown("normal");
		} else {
			$("#all_def").slideUp("normal");
		}
	});
	*/




	$('ul.sf-menu').superfish();




});

/*  Tooltip script   */

this.tooltip = function(){
	/* CONFIG */
		xOffset = -20;
		yOffset = -50;
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
	/* END CONFIG */
	$("a.tooltip").hover(function(e){
		this.t = this.title;
		this.title = "";
		$("body").append("<div id='tooltip'><p>"+ this.t +"</p></div>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");
    },
	function(){
		this.title = this.t;
		$("#tooltip").remove();
    });
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});
};

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};


// starting the script on page load
$(document).ready(function(){
	tooltip();



	// form radiobutton check
/*
	// disable alternative years if checkbox for alternative is not checked
	if ($("input[@name='years_amount']:checked").val() != 'anders') {
		$("input[@name='years_alternative']").attr('disabled', 'disabled');
	}
*/
/*
	// if no error reported, hide lijfrente part
	if (!$('li.lijfrente').hasClass('error')) {
	// init: hide lijfrente
		$("li.lijfrente").hide();
	}

	// on every change in years amount_part:
	$("input[@name='years_amount']").change(function(){
		// if 'anders' is checked, make input field usable
	    if ($("input[@name='years_amount']:checked").val() == 'anders') {
	         $("input[@name='years_alternative']").removeAttr('disabled');
	    // if any other option is checked, disable input field (again)
	    } else {
	       	$("input[@name='years_alternative']").attr('disabled', 'disabled');
	    }
	    // hide "lijfrente" part is "1 year"" is checked, because "lijfrente" is only possible with 5 years or more.
	    // check "lijfrente" -> NO
		if ($("input[@name='years_amount']:checked").val() == '1') {
			$("input[@name='lijfrente']:first").attr('checked', 'true');
			$("li.lijfrente").slideUp();
		} else {
			// if "1 year" is not checked, show "lijfrente" part, and uncheck every option
			$("input[@name='lijfrente']").removeAttr('checked');
			$("li.lijfrente").slideDown();
		}
	});
*/
});