﻿





$(document).ready(function()

{



	$("div.productpage").hide();

	$("#productpage-1").show();

	

	var page_count = $("div.productpage").size();

	

	if (page_count > 1)

	{

		$("div.paging").append('<a href="#" class="view-all">View all</a>');

	}

	

	$("a.view-all").click( function(e) {

		if ($(this).text() == 'View all')

		{

			$("div.paging a").hide();

			$(this).text('View as pages');

			$("div.productpage").show();

		}

		else

		{

			$("div.paging a").show();

			$(this).text('View all');

			$("div.productpage").hide();

			$("#productpage-1").show();

		}

		$(this).show();

		e.preventDefault();

	});

	

	if (location.hash == '#all')

	{

		if (page_count > 1)

		{

			$("div.paging a").hide();

			$("div.paging a.view-all").text('View as pages');

			$("div.paging a.view-all").show();

			$("div.productpage").show();

		}

	}

	

});







function ShowPage(inPage,inMax)

{

	

	for(intx = 1; intx <= inMax; intx++)

	{

		$("#productpage-" + intx).hide();

	}

	$("#productpage-" + inPage).show();

	

}