

$(window).load(function(){ 

	// start the image viewers
	$('#home-slideshow').cycle({fx: 'fade', speed: 2500, cleartypeNoBg: true });

	//click images for Bridal photo gallery page
	$("#table-rings img").click(function() {		
			x = $(this).attr('src');
			x = 'images/rings/fs' + (x.substring(x.search('-')));
			$('#view-rings img').attr({'src': x});
		});

	// Hilight menu
	xStr = window.location.pathname
	xStr = xStr.substring(xStr.lastIndexOf('/')+1);
	if (xStr.length >= 1) {
		$("#menu a[href*='" + xStr + "']").css({'background-position': '0 -10px'});
	}
	
	// Decorate the background
	switch(xStr) {
		case 'contact':
			$('#decoration').addClass(xStr).html('<img src="images/flower-contact.png" alt="" />');
			break;
		case 'history':
			$('#decoration').addClass(xStr).html('<img src="images/flower-history.png" alt="" />');
			break;
		case 'thank-you':
			$('#decoration').addClass('repair').html('<img src="images/flower-repair.png" alt="" />');
			break;
		case 'repair':
			$('#decoration').addClass(xStr).html('<img src="images/flower-repair.png" alt="" />');
			break;
		case 'watches':
			$('#decoration').addClass(xStr).html('<img src="images/flower-watches.png" alt="" />');
			break;
		case 'bridal':
			$('#decoration').addClass(xStr).html('<img src="images/flower-bridal.png" alt="" />');
			break;
		case 'diamonds': 
			$('#decoration').addClass(xStr).html('<img src="images/flower-diamonds.png" alt="" />');
			break;
		default: 
			$('#decoration').addClass('home').html('<p><img id="flower-home-top" src="images/flower-home-top.png" alt="" /><br /><img id="flower-home" src="images/flower-home.png" alt="" /></p>');
			break;
	}

});

