//SIFR
var barmenoB = { src: '/sifr/barmeno-b.swf' };
var barmenoR = { src: '/sifr/barmeno-r.swf' };
sIFR.activate(barmenoB,barmenoR);

sIFR.replace(barmenoB, {
	selector: '#going #content h1, #share #content h1, #rsvp #content h1'
	,css: [
	  '.sIFR-root { color: #612b85; font-size: 30px; line-height:30px; }'
	]
	,wmode: 'transparent'
});

sIFR.replace(barmenoB, {
	selector: '#share #content h2, #rsvp #content h2'
	,css: [
	  '.sIFR-root { color:#612b85; font-size:21px; }'
	]
	,wmode: 'transparent'
});

sIFR.replace(barmenoB, {
	selector: '.subpage #content h1, #home .primaryContent h2'
	,css: [
	  '.sIFR-root { color: #ffffff; font-size: 30px; line-height: 30px; }'
	]
	,wmode: 'transparent'
});

sIFR.replace(barmenoB, {
	selector: '#share #content .meta'
	,css: [
	  '.sIFR-root { color:#000000; font-size:18px; line-height:18px; }'
	]
	,wmode: 'transparent'
});

sIFR.replace(barmenoB, {
	selector: '.subpage #content h2'
	,css: [
	  '.sIFR-root { color: #ffffff; font-size: 21px; line-height: 21px; }'
	]
	,wmode: 'transparent'
});

sIFR.replace(barmenoB, {
	selector: '.subpage #content h3'
	,css: [
	  '.sIFR-root { color: #b57ddb; font-size: 18px; line-height: 18px; }'
	]
	,wmode: 'transparent'
});

sIFR.replace(barmenoB, {
	selector: '#home .secondaryContent h2'
	,css: [
	  '.sIFR-root { color: #b57ddb; font-size: 21px; line-height: 21px; }'
	]
	,wmode: 'transparent'
});

sIFR.replace(barmenoR, {
	selector: '#funFactsDescription p'
	,css: [
	  '.sIFR-root { color: #3f3f3f; font-size: 14px; line-height: 18px; }'
	]
	,wmode: 'transparent'
});
//End SIFR

$(document).ready(function() {
	
	//Fun facts slider
	if($('body').attr('id') === 'fun-facts') {
		var funFactsWidth = 0;
		$('#fun-facts #funFactsContainer .slider li').each(function() {
			funFactsWidth += $(this).width();										 
		});
		$('#fun-facts #funFactsContainer .slider ul').width(funFactsWidth+'px');
		
		$('#fun-facts #funFactsContainer #sliderControl .sliderControlInner').slider({
			animate: true,
			change: handleSliderChange,
			slide: handleSliderSlide
		});
	}
	//End fun facts slider
	
	//IE6 PNG Fix
	if($.browser.msie  && jQuery.browser.version === '6.0') {
		DD_belatedPNG.fix('.inner, #header, #logo');
	}
	//END IE6 PNG Fix

	
});

function handleSliderChange(e, ui) {
	var maxScroll = $('#fun-facts #funFactsContainer .slider').attr("scrollWidth") - $('#fun-facts #funFactsContainer .slider').width();
	$('#fun-facts #funFactsContainer .slider').animate({scrollLeft: ui.value * (maxScroll / 100) }, 1000);
}

function handleSliderSlide(e, ui) {
	var maxScroll = $('#fun-facts #funFactsContainer .slider').attr("scrollWidth") - $('#fun-facts #funFactsContainer .slider').width();
	$('#fun-facts #funFactsContainer .slider').attr({scrollLeft: ui.value * (maxScroll / 100) });
}
