$(document).ready(function() {

	//init gallery slider
	var dreamcafeEventsHp = new ImageFlow();
	dreamcafeEventsHp.init({ImageFlowID: 'gallery-slider',
				reflections: false,
				reflectionP: 0.9,
				buttons:true,
				captions: false,
				opacity: false,
				xStep:  125,
				imageFocusM: 1.3,
				startID: 3,
				onClick: function() {
					return hs.expand(this,
						{
							src: this.getAttribute('longdesc'),
							outlineType: 'rounded-white',
							fadeInOut: true
						}
				);}
	});

	//var imgNo = Math.round($("#gallery-slider_images img").length/2);

	//cufonize
	Cufon.replace("#primary #content-slider ul li h2", {
		textShadow: "1px 1px #000"
	});

	Cufon.replace("body.about #primary h2", {
		textShadow: "1px 1px #000"
	});

	Cufon.replace("body.menu #primary ul li h2", {
		textShadow: "1px 1px #000"
	});

	Cufon.replace("body.events #page #main #content #primary .upcoming-events ul li .body h3", {
		textShadow: "1px 1px #000"
	});

	Cufon.replace("body.events #page #main #content #primary .past-events ul li h3", {
		textShadow: "1px 1px #000"
	});
	Cufon.replace("body.events #page #main #content #primary .the_event ul li h3", {
		textShadow: "1px 1px #000"
	});
	
	Cufon.replace(".my_title", {
		textShadow: "1px 1px #000"
	});
	
	
	//init content slider
	$("#slider").easySlider({
		prevId: 'slider-controls-prev',
		nextId: 'slider-controls-next'
	});

	//ie6 fixes
	if ($.browser.msie && $.browser.version == "6.0") {
		$("#slider-controls-prev").css({"top":"30px", "left":"-20px"});
		DD_belatedPNG.fix('#slider-controls-next a');
		DD_belatedPNG.fix('#slider-controls-prev a');
		DD_belatedPNG.fix('#gallery-slider_next');
		DD_belatedPNG.fix('#gallery-slider_previous');
		DD_belatedPNG.fix('#header #nav li a');
		DD_belatedPNG.fix('#header #nav li span');
		DD_belatedPNG.fix('#footer');
		DD_belatedPNG.fix('.dev');
		DD_belatedPNG.fix('.contact-icon a');
		DD_belatedPNG.fix('.menu-icon a');
		DD_belatedPNG.fix('.gallery-icon a');
		DD_belatedPNG.fix('.highslide-container table tr td');
		DD_belatedPNG.fix('.upcoming-events h2');
		DD_belatedPNG.fix('.past-events h2');
	}


});

$(function() {
	// Use this example, or...
	
	$("a.fancybox").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
		}
	});


});

