// JavaScript Document
$(document).ready(function() {
	$(document).pngFix();
	$('li a').lightBox();
	$('.mainimage a').lightBox();
	$('h5 a').lightBox();
	
// show and hide slate sub navigation bar
	var $subnavigation = $('#navigation ul#other');
	var $button = $("#navigationopen");
	$button.addClass('tobeopenupslate');	

	$("#navigationopen").click(function () { 
		$subnavigation.slideToggle('normal');
		$('#navigationopen p a').attr("href", "/SS/NaturalStone/Slate.htm");
		var $button = $(this);
		if ($button.is('.tobeopenslate')) {
			$button.addClass('tobeopenslate').removeClass('tobeopenupslate');
		}
		else {
			$button.addClass('tobeopenupslate').removeClass('tobeopenslate');
		}
		return false;
	});
	
	// sub slate navigation
	$.get('/SS/xml/stone.xml', function(data) {
		$(data).find('slate').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();
      }
    );
});



