$(document).ready(function(){

// open links in external window	
		externalLinks();
		internalLinks();
	
		//funwith fab
		reset();
		var val;
		
// jquery accordion panels Tour 2010 	
	$(".accordion div.acc-top:first");
	$(".accordion div.acc-btm").hide();

	$(".accordion div.acc-top").click(function(){
		$(this).next("div").slideToggle("800")
		.siblings("div.acc-btm:visible").slideUp("800");
		$(this).toggleClass("open");
		$(this).siblings("div.acc-top").removeClass("open");
	});
	$('div.acc-top').css( 'cursor', 'pointer' );

});


function reload1(form){
	reset();
	val=form.numberChildren.options[form.numberChildren.options.selectedIndex].value;
	
	if (val==2) {
		$('div#child-2').show();
		$('div#childage-2').show();
	};
	if (val==3) {
		$('div#child-2').show();
		$('div#childage-2').show();
		$('div#child-3').show();
		$('div#childage-3').show();
	};
	if (val==4  || val== '4+') {
		$('div#child-2').show();
		$('div#childage-2').show();
		$('div#child-3').show();
		$('div#childage-3').show();
		$('div#child-4').show();
		$('div#childage-4').show();
	};
}

function reset(){
		$('div#child-2').hide();
		$('div#child-3').hide();
		$('div#child-4').hide();
		
		$('div#childage-2').hide();
		$('div#childage-3').hide();
		$('div#childage-4').hide();
	}
	
function externalLinks() {
	if (!document.getElementsByTagName) return;  
	var anchors = document.getElementsByTagName("a");  
	for (var i=0; i<anchors.length; i++) {  var anchor = anchors[i];  
	if (anchor.getAttribute("href") &&  anchor.getAttribute("rel") == "external")  anchor.target = "_blank";  
	}
};  
		
function internalLinks() {  
	if (!document.getElementsByTagName) return;  
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {  var anchor = anchors[i];  
	if (anchor.getAttribute("href") &&  anchor.getAttribute("rel") == "internal")  anchor.target = "_self";  
	}  
};


// lightbox

$(function() {
	$('.gallery a').lightBox();
});
$(function() {
	$('.gallery2 a').lightBox();
});
$(function() {
	$('.gallery3 a').lightBox();
});

