window.thumbnails = {};
															thumbnails[8381911] = clik.newPhoto({"id":8381911,"src":"C22_thumb.jpg","galleries_id":"","server_id":19,"link":"#","width":130,"caption":"","height":87});
															thumbnails[661130] = clik.newPhoto({"id":661130,"src":"IMG_9828_thumb.jpg","galleries_id":50068,"server_id":15,"link":"photo_661130.html","width":130,"caption":"","height":87});
															thumbnails[661143] = clik.newPhoto({"id":661143,"src":"IMG_9649_thumb.jpg","galleries_id":50068,"server_id":15,"link":"photo_661143.html","width":130,"caption":"","height":87});
															thumbnails[665544] = clik.newPhoto({"id":665544,"src":"IMG_0061_thumb.jpg","galleries_id":50068,"server_id":15,"link":"photo_665544.html","width":130,"caption":"","height":87});
															thumbnails[665550] = clik.newPhoto({"id":665550,"src":"IMG_0383_thumb.jpg","galleries_id":390461,"server_id":15,"link":"photo_665550.html","width":130,"caption":"","height":87});
															thumbnails[665551] = clik.newPhoto({"id":665551,"src":"IMG_04051_thumb.jpg","galleries_id":390461,"server_id":15,"link":"photo_665551.html","width":130,"caption":"","height":87});
															thumbnails[665552] = clik.newPhoto({"id":665552,"src":"IMG_9603_thumb.jpg","galleries_id":50068,"server_id":15,"link":"photo_665552.html","width":130,"caption":"","height":87});
															thumbnails[665629] = clik.newPhoto({"id":665629,"src":"IMG_9681_thumb.jpg","galleries_id":50068,"server_id":15,"link":"photo_665629.html","width":130,"caption":"","height":87});
															thumbnails[665631] = clik.newPhoto({"id":665631,"src":"IMG_9653_thumb.jpg","galleries_id":50068,"server_id":15,"link":"photo_665631.html","width":130,"caption":"","height":87});
															thumbnails[665639] = clik.newPhoto({"id":665639,"src":"IMG_9940_thumb.jpg","galleries_id":50068,"server_id":15,"link":"photo_665639.html","width":130,"caption":"","height":87});
															thumbnails[683325] = clik.newPhoto({"id":683325,"src":"img_0273_thumb.jpg","galleries_id":50071,"server_id":15,"link":"photo_683325.html","width":130,"caption":"","height":87});
															thumbnails[683326] = clik.newPhoto({"id":683326,"src":"img_0288_thumb.jpg","galleries_id":50071,"server_id":15,"link":"photo_683326.html","width":130,"caption":"","height":87});
															thumbnails[683328] = clik.newPhoto({"id":683328,"src":"img_0190_thumb.jpg","galleries_id":50071,"server_id":15,"link":"photo_683328.html","width":130,"caption":"","height":87});
															thumbnails[683329] = clik.newPhoto({"id":683329,"src":"img_0307_thumb.jpg","galleries_id":50071,"server_id":15,"link":"photo_683329.html","width":130,"caption":"","height":87});
															thumbnails[683349] = clik.newPhoto({"id":683349,"src":"img_9907_thumb.jpg","galleries_id":50071,"server_id":15,"link":"photo_683349.html","width":130,"caption":"","height":87});
															thumbnails[683350] = clik.newPhoto({"id":683350,"src":"img_9916_thumb.jpg","galleries_id":50071,"server_id":15,"link":"photo_683350.html","width":130,"caption":"","height":87});
															thumbnails[808061] = clik.newPhoto({"id":808061,"src":"IMG_0417_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808061.html","width":130,"caption":"","height":87});
															thumbnails[808063] = clik.newPhoto({"id":808063,"src":"IMG_04631_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808063.html","width":130,"caption":"","height":87});
															thumbnails[808066] = clik.newPhoto({"id":808066,"src":"IMG_0793_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808066.html","width":130,"caption":"","height":87});
															thumbnails[808072] = clik.newPhoto({"id":808072,"src":"IMG_0708_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808072.html","width":130,"caption":"","height":87});
															thumbnails[808074] = clik.newPhoto({"id":808074,"src":"IMG_0897_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808074.html","width":130,"caption":"","height":87});
															thumbnails[808078] = clik.newPhoto({"id":808078,"src":"IMG_3326_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808078.html","width":130,"caption":"","height":87});
															thumbnails[808080] = clik.newPhoto({"id":808080,"src":"IMG_3598_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808080.html","width":130,"caption":"","height":87});
															thumbnails[808082] = clik.newPhoto({"id":808082,"src":"IMG_0915_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808082.html","width":130,"caption":"","height":87});
															thumbnails[808084] = clik.newPhoto({"id":808084,"src":"IMG_3287_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808084.html","width":130,"caption":"","height":87});
															thumbnails[808087] = clik.newPhoto({"id":808087,"src":"IMG_3427_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808087.html","width":130,"caption":"","height":87});
															thumbnails[808089] = clik.newPhoto({"id":808089,"src":"IMG_3706_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808089.html","width":130,"caption":"","height":87});
															thumbnails[808093] = clik.newPhoto({"id":808093,"src":"IMG_3550_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808093.html","width":130,"caption":"","height":87});
															thumbnails[808095] = clik.newPhoto({"id":808095,"src":"IMG_3395_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808095.html","width":130,"caption":"","height":87});
															thumbnails[808096] = clik.newPhoto({"id":808096,"src":"IMG_3305_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808096.html","width":130,"caption":"","height":87});
															thumbnails[808099] = clik.newPhoto({"id":808099,"src":"IMG_0577_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808099.html","width":130,"caption":"","height":87});
															thumbnails[808100] = clik.newPhoto({"id":808100,"src":"IMG_3437_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808100.html","width":130,"caption":"","height":87});
															thumbnails[808102] = clik.newPhoto({"id":808102,"src":"IMG_0838_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808102.html","width":130,"caption":"","height":87});
															thumbnails[808103] = clik.newPhoto({"id":808103,"src":"IMG_0440_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808103.html","width":130,"caption":"","height":195});
															thumbnails[808104] = clik.newPhoto({"id":808104,"src":"IMG_0597_thumb.JPG","galleries_id":62628,"server_id":15,"link":"photo_808104.html","width":130,"caption":"","height":195});
															thumbnails[1170058] = clik.newPhoto({"id":1170058,"src":"IMG_3908s_thumb.jpg","galleries_id":390461,"server_id":15,"link":"photo_1170058.html","width":130,"caption":"","height":87});
															thumbnails[1170067] = clik.newPhoto({"id":1170067,"src":"NJD_0114s_thumb.jpg","galleries_id":50068,"server_id":15,"link":"photo_1170067.html","width":130,"caption":"","height":87});
															thumbnails[1170114] = clik.newPhoto({"id":1170114,"src":"IMG_9734s_thumb.jpg","galleries_id":390461,"server_id":15,"link":"photo_1170114.html","width":130,"caption":"","height":87});
															thumbnails[1858173] = clik.newPhoto({"id":1858173,"src":"A11_thumb.jpg","galleries_id":50068,"server_id":15,"link":"photo_1858173.html","width":130,"caption":"","height":87});
															thumbnails[3313643] = clik.newPhoto({"id":3313643,"src":"NDunridge-Hawgsmoke-19w_thumb.jpg","galleries_id":201947,"server_id":15,"link":"photo_3313643.html","width":130,"caption":"","height":87});
															thumbnails[3313644] = clik.newPhoto({"id":3313644,"src":"NDunridge-Hawgsmoke-6w_thumb.jpg","galleries_id":201947,"server_id":15,"link":"photo_3313644.html","width":130,"caption":"","height":87});
															thumbnails[3313649] = clik.newPhoto({"id":3313649,"src":"NDunridge-Hawgsmoke-32w_thumb.jpg","galleries_id":201947,"server_id":15,"link":"photo_3313649.html","width":130,"caption":"","height":87});
															thumbnails[3313650] = clik.newPhoto({"id":3313650,"src":"NDunridge-Hawgsmoke-2w_thumb.jpg","galleries_id":201947,"server_id":15,"link":"photo_3313650.html","width":130,"caption":"","height":87});
															thumbnails[3313655] = clik.newPhoto({"id":3313655,"src":"NDunridge-Hawgsmoke-43w_thumb.jpg","galleries_id":201947,"server_id":15,"link":"photo_3313655.html","width":130,"caption":"","height":87});
															thumbnails[3313656] = clik.newPhoto({"id":3313656,"src":"NDunridge-Hawgsmoke-3w_thumb.jpg","galleries_id":201947,"server_id":15,"link":"photo_3313656.html","width":130,"caption":"","height":87});
															thumbnails[3313657] = clik.newPhoto({"id":3313657,"src":"NDunridge-Hawgsmoke-5w_thumb.jpg","galleries_id":201947,"server_id":15,"link":"photo_3313657.html","width":130,"caption":"","height":87});
															thumbnails[3313666] = clik.newPhoto({"id":3313666,"src":"NDunridge-Hawgsmoke-9s_thumb.jpg","galleries_id":201947,"server_id":15,"link":"photo_3313666.html","width":130,"caption":"","height":87});
															thumbnails[7227476] = clik.newPhoto({"id":7227476,"src":"A10-NDunridge-KAF-100210-6922_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227476.html","width":130,"caption":"","height":87});
															thumbnails[7227477] = clik.newPhoto({"id":7227477,"src":"A10-NDunridge-KAF-230210-8434_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227477.html","width":130,"caption":"","height":87});
															thumbnails[7227478] = clik.newPhoto({"id":7227478,"src":"A10-NDunridge-KAF-230210-8553_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227478.html","width":130,"caption":"","height":87});
															thumbnails[7227479] = clik.newPhoto({"id":7227479,"src":"Chinook-NDunridge-Bastion-210210-8132_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227479.html","width":130,"caption":"","height":87});
															thumbnails[7227480] = clik.newPhoto({"id":7227480,"src":"Chinook-NDunridge-Bastion-210210-8212_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227480.html","width":130,"caption":"","height":87});
															thumbnails[7227481] = clik.newPhoto({"id":7227481,"src":"Chinook-NDunridge-Bastion-210210-8475_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227481.html","width":130,"caption":"","height":87});
															thumbnails[7227482] = clik.newPhoto({"id":7227482,"src":"Hercules-NDunridge-Bagram-160210-7913_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227482.html","width":130,"caption":"","height":87});
															thumbnails[7227484] = clik.newPhoto({"id":7227484,"src":"Hercules-NDunridge-Bagram-160210-7915_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227484.html","width":130,"caption":"","height":87});
															thumbnails[7227485] = clik.newPhoto({"id":7227485,"src":"Hercules-NDunridge-Bagram-160210-8139_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227485.html","width":130,"caption":"","height":87});
															thumbnails[7227486] = clik.newPhoto({"id":7227486,"src":"Hercules-NDunridge-Bastion-220210-8267_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227486.html","width":130,"caption":"","height":87});
															thumbnails[7227488] = clik.newPhoto({"id":7227488,"src":"Merlin-NDunridge-Bastion-210210-8144_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227488.html","width":130,"caption":"","height":87});
															thumbnails[7227489] = clik.newPhoto({"id":7227489,"src":"Merlin-NDunridge-Bastion-210210-8344_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227489.html","width":130,"caption":"","height":87});
															thumbnails[7227492] = clik.newPhoto({"id":7227492,"src":"Mil17-NDunridge-ANAAC-140210-7511_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227492.html","width":130,"caption":"","height":87});
															thumbnails[7227494] = clik.newPhoto({"id":7227494,"src":"Mil17-NDunridge-ANAAC-140210-7636_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227494.html","width":130,"caption":"","height":87});
															thumbnails[7227495] = clik.newPhoto({"id":7227495,"src":"Mil17-NDunridge-ANAAC-140210-7647_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227495.html","width":130,"caption":"","height":87});
															thumbnails[7227496] = clik.newPhoto({"id":7227496,"src":"Mil17-NDunridge-ANAAC-140210-7650_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227496.html","width":130,"caption":"","height":87});
															thumbnails[7227497] = clik.newPhoto({"id":7227497,"src":"Mil17-NDunridge-ANAAC-140210-7653_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227497.html","width":130,"caption":"","height":87});
															thumbnails[7227499] = clik.newPhoto({"id":7227499,"src":"Tornado-NDunridge-KAF-100210-6883_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227499.html","width":130,"caption":"","height":87});
															thumbnails[7227500] = clik.newPhoto({"id":7227500,"src":"Tornado-NDunridge-KAF-120210-7129_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227500.html","width":130,"caption":"","height":87});
															thumbnails[7227501] = clik.newPhoto({"id":7227501,"src":"Tornado-NDunridge-KAF-120210-7210_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227501.html","width":130,"caption":"","height":87});
															thumbnails[7227502] = clik.newPhoto({"id":7227502,"src":"Tornado-NDunridge-KAF-120210-7401_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227502.html","width":130,"caption":"","height":87});
															thumbnails[7227503] = clik.newPhoto({"id":7227503,"src":"Tornado-NDunridge-KAF-120210-7405_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227503.html","width":130,"caption":"","height":87});
															thumbnails[7227504] = clik.newPhoto({"id":7227504,"src":"Tornado-NDunridge-KAF-230210-8578_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227504.html","width":130,"caption":"","height":87});
															thumbnails[7227505] = clik.newPhoto({"id":7227505,"src":"Hawk-NDunridge-100Sqn-200508-7826_thumb.jpg","galleries_id":390461,"server_id":15,"link":"photo_7227505.html","width":130,"caption":"","height":87});
															thumbnails[7227506] = clik.newPhoto({"id":7227506,"src":"Hawk-NDunridge-100Sqn-200508-0005_thumb.jpg","galleries_id":390461,"server_id":15,"link":"photo_7227506.html","width":130,"caption":"","height":87});
															thumbnails[7227507] = clik.newPhoto({"id":7227507,"src":"Hawk-NDunridge-100Sqn-200508-7909_thumb.jpg","galleries_id":390461,"server_id":15,"link":"photo_7227507.html","width":130,"caption":"","height":87});
															thumbnails[7227508] = clik.newPhoto({"id":7227508,"src":"Hawk-NDunridge-100Sqn-200508-0007_thumb.jpg","galleries_id":390461,"server_id":15,"link":"photo_7227508.html","width":130,"caption":"","height":87});
															thumbnails[7227509] = clik.newPhoto({"id":7227509,"src":"Hawk-NDunridge-100Sqn-200508-7926_thumb.jpg","galleries_id":390461,"server_id":15,"link":"photo_7227509.html","width":130,"caption":"","height":87});
															thumbnails[3313647] = clik.newPhoto({"id":3313647,"src":"NDunridge-Hawgsmoke-18w_thumb.jpg","galleries_id":201947,"server_id":15,"link":"photo_3313647.html","width":130,"caption":"","height":195});
															thumbnails[3313646] = clik.newPhoto({"id":3313646,"src":"NDunridge-Hawgsmoke-11w_thumb.jpg","galleries_id":201947,"server_id":15,"link":"photo_3313646.html","width":130,"caption":"","height":195});
															thumbnails[3313658] = clik.newPhoto({"id":3313658,"src":"NDunridge-Hawgsmoke-10w_thumb.jpg","galleries_id":201947,"server_id":15,"link":"photo_3313658.html","width":130,"caption":"","height":195});
															thumbnails[7227491] = clik.newPhoto({"id":7227491,"src":"Mil17-NDunridge-ANAAC-140210-7494_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227491.html","width":130,"caption":"","height":195});
															thumbnails[7227498] = clik.newPhoto({"id":7227498,"src":"Mil17-NDunridge-ANAAC-140210-7657_thumb.jpg","galleries_id":390457,"server_id":15,"link":"photo_7227498.html","width":130,"caption":"","height":195});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[390457] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Afghanistan","link":"gallery_390457.html","maxRecords":0.0,"photoIDs":[7227476.0,7227477.0,7227478.0,7227479.0,7227480.0,7227481.0,7227482.0,7227484.0,7227485.0,7227486.0,7227488.0,7227489.0,7227492.0,7227494.0,7227495.0,7227496.0,7227497.0,7227499.0,7227500.0,7227501.0,7227502.0,7227503.0,7227504.0,7227491.0,7227498.0],"skipIndex":0,"section_code":"gallery","featured_images":"7227504,7227503,7227502,7227501,7227500,7227499,7227498,7227497,7227496,7227495","id":390457,"singleSection":false});				  						galleries[201947] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Hawgsmoke 2008","link":"gallery_201947.html","maxRecords":0.0,"photoIDs":[3313643.0,3313644.0,3313649.0,3313650.0,3313655.0,3313656.0,3313657.0,3313666.0,3313647.0,3313646.0,3313658.0],"skipIndex":0,"section_code":"gallery","featured_images":"3313666,3313658,3313657,3313656,3313655,3313650,3313649,3313647,3313646,3313644","id":201947,"singleSection":false});				  						galleries[50068] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Operation Iraqi Freedom","link":"gallery_50068.html","maxRecords":0.0,"photoIDs":[661130.0,661143.0,665544.0,665552.0,665629.0,665631.0,665639.0,1170067.0,1858173.0],"skipIndex":0,"section_code":"gallery","featured_images":"1858173,1170067,665639,665631,665629,665552,665544,661143,661130","id":50068,"singleSection":false});				  						galleries[390461] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Royal Air Force","link":"gallery_390461.html","maxRecords":0.0,"photoIDs":[665550.0,665551.0,1170058.0,1170114.0,7227505.0,7227506.0,7227507.0,7227508.0,7227509.0],"skipIndex":0,"section_code":"gallery","featured_images":"7227509,7227508,7227507,7227506,7227505,1170114,1170058,665551,665550","id":390461,"singleSection":false});				  						galleries[62628] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"USS Eisenhower - Op Enduring Freedom","link":"gallery_62628.html","maxRecords":0.0,"photoIDs":[808061.0,808063.0,808066.0,808072.0,808074.0,808078.0,808080.0,808082.0,808084.0,808087.0,808089.0,808093.0,808095.0,808096.0,808099.0,808100.0,808102.0,808103.0,808104.0],"skipIndex":0,"section_code":"gallery","featured_images":"808104,808103,808102,808100,808099,808096,808095,808093,808089,808087","id":62628,"singleSection":false});				  						galleries[50071] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Warbirds","link":"gallery_50071.html","maxRecords":0.0,"photoIDs":[683325.0,683326.0,683328.0,683329.0,683349.0,683350.0],"skipIndex":0,"section_code":"gallery","featured_images":"683350,683349,683329,683328,683326,683325","id":50071,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8381911,7227509,7227508,7227507,7227506,7227505,7227504,7227503,7227502,7227501,7227500,7227499,7227498,7227497,7227496,7227495,7227494,7227492,7227491,7227489,7227488,7227486,7227485,7227484,7227482,7227481,7227480,7227479,7227478,7227477,7227476,3313666,3313658,3313657,3313656,3313655,3313650,3313649,3313647,3313646,3313644,3313643,1858173,1170114,1170067,1170058,808104,808103,808102,808100';
imageSets[3] = '8381911,7227509,7227508,7227507,7227506,7227505,7227504,7227503,7227502,7227501,7227500,7227499,7227498,7227497,7227496,7227495,7227494,7227492,7227491,7227489,7227488,7227486,7227485,7227484,7227482,7227481,7227480,7227479,7227478,7227477,7227476,3313666,3313658,3313657,3313656,3313655,3313650,3313649,3313647,3313646,3313644,3313643,1858173,1170114,1170067,1170058,808104,808103,808102,808100';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/ndunridge/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/ndunridge/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Neil Dunridge Aviation Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id),					title: galleries[gallery_id].title				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

