// JavaScript Document
$(document).ready(function() {
	$(document).pngFix();
	$('li a').lightBox();
	$('.mainimage a').lightBox();
	$('h5 a').lightBox();
	
	// show and hide travertine sub navigation bar
	var $subnavigation = $('#navigation ul#other');
	var $button = $("#navigationopen");
	$button.addClass('tobeopenuptravertine');	

	$("#navigationopen").click(function () { 
		$subnavigation.slideToggle('normal');
		var $button = $(this);
		if ($button.is('.tobeopentravertine')) {
			$button.addClass('tobeopentravertine').removeClass('tobeopenuptravertine');
		}
		else {
			$button.addClass('tobeopenuptravertine').removeClass('tobeopentravertine');
		}
		return false;
	});
	
	// sub travertine navigation
	$.get('/SS/xml/stone.xml', function(data) {
		$(data).find('travertine').each(function() {
		
			var $stone = $(this);
			var html = '<li><a href="';
			html += $stone.find('link').text();
			html += '">';
			html += $stone.find('name').text();
			html += '</a></li>';
			$('ul#other').append($(html));
		});
	});
	return false;
});

$(document).ready(function() {
	$('div.mainimage').hover(
      function () {
        $(this).append($('<span id="enlarge"></span>'));
      }, 
      function () {
        $(this).find('span:last').remove();
      }
    );
});



