// cufon replace - berthold //
	// hovers //
	Cufon.replace('#content .page-content .gallery-content p .more-info a', { fontFamily: 'berthold regular', 
		hover: {color: '#c10c19'}
	});
	Cufon.replace('#content .page-content .sub-menu a', { fontFamily: 'berthold regular', 
		hover: {color: '#c10c19'}
	});
	Cufon.replace('#header .menu a', { fontFamily: 'berthold regular', 
		hover: {color: '#c10c19'}
	});

	// regular //
	Cufon.replace('p', { fontFamily: 'berthold regular'});
	Cufon.replace('td', { fontFamily: 'berthold regular'});
	Cufon.replace('p .more-info', { fontFamily: 'berthold regular'});
	
	// italics //
	Cufon.replace('em', { fontFamily: 'berthold italics'});
	Cufon.replace('i', { fontFamily: 'berthold italics'});
	
	// bold //
	Cufon.replace('h1', { fontFamily: 'berthold bold'});
	Cufon.replace('h2', { fontFamily: 'berthold bold'});
	Cufon.replace('h3', { fontFamily: 'berthold bold'});
	Cufon.replace('h4', { fontFamily: 'berthold bold'});
	Cufon.replace('b', { fontFamily: 'berthold bold'});
	Cufon.replace('strong', { fontFamily: 'berthold bold'});
	
$(document).ready(function() {
	// once the document is ready - display the whole page //
    var bodyElems = document.getElementsByTagName("body");
    bodyElems[0].style.visibility = "visible";

	$(".overlay[rel]").overlay({
		mask: "true",
		closeOnClick: true,
		closeOnEsc: true,
		top: 185,
		onLoad: function(){
			if($.mask.isLoaded()) {
				$.mask.getConf().closeSpeed = 0;
				this.getOverlay().expose({
					closeOnClick: true,
					closeOnEsc: true
				});
			}else{
				this.getOverlay().expose({
					closeOnClick: true,
					closeOnEsc: true
				});
			}
		},
		onClose: function(){
			if($.mask.isLoaded() == false) {
				$(".overlay").removeClass('active');
				$(".text-overlay").fadeIn('slow')
				$(".gallery-overview").fadeIn("slow");
			}
			Cufon.refresh("#header .menu a");
		}
	});
	
	$(".overlay.menu").click(function(){
		$(".overlay").removeClass('active');
		$(".gallery-overview").fadeOut("slow");
		$(".overlay").removeClass('active');
		$(this).addClass('active');
		$(".text-overlay").fadeOut('slow')
	});
	
	$(".overlay.gallery").click(function(){
		var pass = $(this).attr('pass');
		
		//fade out the background
		$(".gallery-overview").fadeOut("slow");
		
		//remove currently displayed item
		$(".gallery-slidetabs a").removeClass('current');
		$(".images.gal div").css({display: 'none'});
		
		//add classes and display as block
		$("#" + pass).addClass('current')
		$("#image_" + pass).css({display: 'block'});
	});
	
	$(".home-slidetabs").tabs(".images > div", {
	 
		// enable "cross-fading" effect
		effect: 'fade',
		fadeOutSpeed: 2500,
		fadeInSpeed: 2500,
		disabled: 'disabled',
	  	
		// start from the beginning after the last tab
		rotate: true
	 
	// use the slideshow plugin. It accepts its own configuration
	}).slideshow({autoplay: true, interval: 8000});// 20 second interval
	
	$(".gallery-slidetabs").tabs(".images > div", {
	  	// respect the browsers back button
	  	history: true,
	 
		// enable "cross-fading" effect
		effect: 'fade',
		fadeOutSpeed: "slow",
	 
		// start from the beginning after the last tab
		rotate: true
	 
	// use the slideshow plugin. It accepts its own configuration
	}).slideshow({autoplay: false});// gallery modal box sliders
	
	$("#accordion").tabs("#accordion div.pane", {tabs: 'h2', effect: 'slide', initialIndex: null});
	
});
