$(document).ready(function() {
				var status1 = {
						target: '#output1',
						type:	'post'
				 };
				var status2 = {
						target: '#output2',
						type:	'post'
				 };
				var status3 = {
						target: '#output3',
						type:	'post'
				 };
				var status4 = {
						target: '#output4',
						type:	'post'
				 };
				var status5 = {
						target:	'#output5',
						type:	'post'
				 };
				var status6 = {
						target: '#output6',
						type:	'post'
				 };

			// bind form using 'ajaxForm'
				$('#form1').ajaxForm(status1);
				$('#form2').ajaxForm(status2);
				$('#form3').ajaxForm(status3);
				$('#form4').ajaxForm(status4);
				$('#form5').ajaxForm(status5);
				$('#form6').ajaxForm(status6);
			});

                Seadragon.Config.maxZoomPixelRatio=1;
                Seadragon.Config.minZoomImageRatio=1;
                Seadragon.Config.visibilityRatio=0.9;

                // Start the viewer
		//
                		var product1 = null;
				var product2 = null;
				var product3 = null;
				var product4 = null;
				var product5 = null;
				var product6 = null;

            

			//open the viewer for the clicked product. Set the form description field accordingly
            function switch1(event, dzi, n, p) {
                if (n==1) {
                    product1.openDzi(dzi);
					document.form1.description.value = p
				}
				else if (n==2) {
				    product2.openDzi(dzi);
					document.form2.description.value = p
				}
				else if (n==3) {
					product3.openDzi(dzi);
					document.form3.description.value = p
					}
				else if (n==4) {
					product4.openDzi(dzi);
					document.form4.description.value = p
					}
				else if (n==5) {
					product5.openDzi(dzi);
					document.form5.description.value = p
					}
				else if (n==6) {
					product6.openDzi(dzi);
					document.form6.description.value = p
					}

				Seadragon.Utils.cancelEvent(event);    // so links aren't processed

			}