window.thumbnails = {};
															thumbnails[3642176] = clik.newPhoto({"id":3642176,"src":"swpp_logo_thumb.gif","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"List of Manchester Wedding Venues. Click Back on your Browser to return to AP Weddings when you have finished.","height":59});
															thumbnails[3584688] = clik.newPhoto({"id":3584688,"src":"MB-0031-5478_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[3578098] = clik.newPhoto({"id":3578098,"src":"Vouchers_thumb.jpg","galleries_id":218690,"server_id":1,"link":"photo_3578098.html","width":130,"caption":"Wedding Vouchers","height":98});
															thumbnails[160936] = clik.newPhoto({"id":160936,"src":"IMG_8891b_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160936.html","width":130,"caption":"","height":86});
															thumbnails[3583991] = clik.newPhoto({"id":3583991,"src":"NPW_PS_015_BW_thumb.jpg","galleries_id":219068,"server_id":1,"link":"photo_3583991.html","width":130,"caption":"","height":87});
															thumbnails[3586338] = clik.newPhoto({"id":3586338,"src":"Albums1_thumb.jpg","galleries_id":219109,"server_id":1,"link":"photo_3586338.html","width":130,"caption":"","height":130});
															thumbnails[160934] = clik.newPhoto({"id":160934,"src":"DA_0872_APWSite_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160934.html","width":130,"caption":"","height":86});
															thumbnails[160930] = clik.newPhoto({"id":160930,"src":"IMG_8738_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160930.html","width":130,"caption":"","height":86});
															thumbnails[160929] = clik.newPhoto({"id":160929,"src":"DA_0662_APWSite_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160929.html","width":130,"caption":"","height":195});
															thumbnails[299265] = clik.newPhoto({"id":299265,"src":"IMG_3133_bw_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_299265.html","width":130,"caption":"","height":195});
															thumbnails[280727] = clik.newPhoto({"id":280727,"src":"IMG_1287_2_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_280727.html","width":130,"caption":"","height":86});
															thumbnails[160937] = clik.newPhoto({"id":160937,"src":"IMG_4177a_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160937.html","width":130,"caption":"","height":195});
															thumbnails[160960] = clik.newPhoto({"id":160960,"src":"pw-r1-06_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160960.html","width":130,"caption":"","height":130});
															thumbnails[280722] = clik.newPhoto({"id":280722,"src":"IMG_1582_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_280722.html","width":130,"caption":"","height":195});
															thumbnails[160962] = clik.newPhoto({"id":160962,"src":"pw-r2-09a_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160962.html","width":130,"caption":"","height":131});
															thumbnails[3583994] = clik.newPhoto({"id":3583994,"src":"NPW_PS_005_BW_thumb.jpg","galleries_id":219068,"server_id":1,"link":"photo_3583994.html","width":130,"caption":"","height":87});
															thumbnails[160941] = clik.newPhoto({"id":160941,"src":"IMG_9201b1_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160941.html","width":130,"caption":"","height":53});
															thumbnails[160939] = clik.newPhoto({"id":160939,"src":"IMG_9195a_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160939.html","width":130,"caption":"","height":86});
															thumbnails[4361942] = clik.newPhoto({"id":4361942,"src":"CKW_107_1340_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_4361942.html","width":130,"caption":"","height":195});
															thumbnails[280728] = clik.newPhoto({"id":280728,"src":"IMG_1483a_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_280728.html","width":130,"caption":"","height":91});
															thumbnails[299259] = clik.newPhoto({"id":299259,"src":"IMG_8856_bw_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_299259.html","width":130,"caption":"","height":86});
															thumbnails[299262] = clik.newPhoto({"id":299262,"src":"IMG_3873_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_299262.html","width":130,"caption":"","height":195});
															thumbnails[160951] = clik.newPhoto({"id":160951,"src":"IMG_9585_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160951.html","width":130,"caption":"","height":195});
															thumbnails[4361967] = clik.newPhoto({"id":4361967,"src":"LDW_0320_2693_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_4361967.html","width":130,"caption":"","height":87});
															thumbnails[4361978] = clik.newPhoto({"id":4361978,"src":"LDW_0380_2014_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_4361978.html","width":130,"caption":"","height":87});
															thumbnails[3584000] = clik.newPhoto({"id":3584000,"src":"MPW-PS-17-4189_thumb.jpg","galleries_id":219068,"server_id":1,"link":"photo_3584000.html","width":130,"caption":"","height":195});
															thumbnails[4362017] = clik.newPhoto({"id":4362017,"src":"LDW_0384_2919_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_4362017.html","width":130,"caption":"","height":87});
															thumbnails[4361997] = clik.newPhoto({"id":4361997,"src":"LDW_0428_3071_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_4361997.html","width":130,"caption":"","height":195});
															thumbnails[160927] = clik.newPhoto({"id":160927,"src":"IMG_8503a_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160927.html","width":130,"caption":"","height":130});
															thumbnails[160966] = clik.newPhoto({"id":160966,"src":"pw-r2-12_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160966.html","width":130,"caption":"","height":130});
															thumbnails[160948] = clik.newPhoto({"id":160948,"src":"IMG_9459_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160948.html","width":130,"caption":"","height":86});
															thumbnails[299281] = clik.newPhoto({"id":299281,"src":"pw-r4-02a_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_299281.html","width":130,"caption":"","height":113});
															thumbnails[160926] = clik.newPhoto({"id":160926,"src":"IMG_0064_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160926.html","width":130,"caption":"","height":86});
															thumbnails[160944] = clik.newPhoto({"id":160944,"src":"IMG_9279a_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160944.html","width":130,"caption":"","height":268});
															thumbnails[160946] = clik.newPhoto({"id":160946,"src":"IMG_9299_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160946.html","width":130,"caption":"","height":86});
															thumbnails[160952] = clik.newPhoto({"id":160952,"src":"IMG_9586_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160952.html","width":130,"caption":"","height":195});
															thumbnails[160947] = clik.newPhoto({"id":160947,"src":"IMG_9343_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160947.html","width":130,"caption":"","height":86});
															thumbnails[3584007] = clik.newPhoto({"id":3584007,"src":"IMG_07751_thumb.jpg","galleries_id":219068,"server_id":1,"link":"photo_3584007.html","width":130,"caption":"","height":195});
															thumbnails[160933] = clik.newPhoto({"id":160933,"src":"IMG_8793_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160933.html","width":130,"caption":"","height":86});
															thumbnails[160953] = clik.newPhoto({"id":160953,"src":"IMG_9821_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160953.html","width":130,"caption":"","height":195});
															thumbnails[160954] = clik.newPhoto({"id":160954,"src":"IMG_9882_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160954.html","width":130,"caption":"","height":86});
															thumbnails[160955] = clik.newPhoto({"id":160955,"src":"IMG_9889a_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160955.html","width":130,"caption":"","height":206});
															thumbnails[160956] = clik.newPhoto({"id":160956,"src":"IMG_9911_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160956.html","width":130,"caption":"","height":86});
															thumbnails[3604507] = clik.newPhoto({"id":3604507,"src":"IMG_9798_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3604507.html","width":130,"caption":"","height":195});
															thumbnails[159691] = clik.newPhoto({"id":159691,"src":"HomePageImage_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_159691.html","width":130,"caption":"","height":163});
															thumbnails[160950] = clik.newPhoto({"id":160950,"src":"IMG_9495a_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160950.html","width":130,"caption":"","height":86});
															thumbnails[160932] = clik.newPhoto({"id":160932,"src":"IMG_8789a_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160932.html","width":130,"caption":"","height":86});
															thumbnails[160959] = clik.newPhoto({"id":160959,"src":"pw-r1-01_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160959.html","width":130,"caption":"","height":131});
															thumbnails[3584008] = clik.newPhoto({"id":3584008,"src":"IMG_07402_thumb.jpg","galleries_id":219068,"server_id":1,"link":"photo_3584008.html","width":130,"caption":"","height":195});
															thumbnails[280733] = clik.newPhoto({"id":280733,"src":"IMG_2243_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_280733.html","width":130,"caption":"","height":195});
															thumbnails[160942] = clik.newPhoto({"id":160942,"src":"SVW-0510_APWSite_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160942.html","width":130,"caption":"","height":87});
															thumbnails[819430] = clik.newPhoto({"id":819430,"src":"CRIS & BRIGITTA_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_819430.html","width":130,"caption":"","height":95});
															thumbnails[160957] = clik.newPhoto({"id":160957,"src":"IMG_7775_APWSite_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160957.html","width":130,"caption":"","height":86});
															thumbnails[819465] = clik.newPhoto({"id":819465,"src":"UNTITLED-21_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_819465.html","width":130,"caption":"","height":128});
															thumbnails[819468] = clik.newPhoto({"id":819468,"src":"UNTITLED-4_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_819468.html","width":130,"caption":"","height":119});
															thumbnails[819469] = clik.newPhoto({"id":819469,"src":"UNTITLED-8_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_819469.html","width":130,"caption":"","height":115});
															thumbnails[819488] = clik.newPhoto({"id":819488,"src":"UNTITLED-14_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_819488.html","width":130,"caption":"","height":133});
															thumbnails[280724] = clik.newPhoto({"id":280724,"src":"IMG_1525_2_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_280724.html","width":130,"caption":"","height":86});
															thumbnails[819489] = clik.newPhoto({"id":819489,"src":"UNTITLED-15_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_819489.html","width":130,"caption":"","height":112});
															thumbnails[3584017] = clik.newPhoto({"id":3584017,"src":"IMG_0608_thumb.jpg","galleries_id":219068,"server_id":1,"link":"photo_3584017.html","width":130,"caption":"","height":87});
															thumbnails[819504] = clik.newPhoto({"id":819504,"src":"IMG_1425a_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_819504.html","width":130,"caption":"","height":86});
															thumbnails[819505] = clik.newPhoto({"id":819505,"src":"IMG_1452_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_819505.html","width":130,"caption":"","height":195});
															thumbnails[160938] = clik.newPhoto({"id":160938,"src":"IMG_9193-1_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160938.html","width":130,"caption":"","height":195});
															thumbnails[819508] = clik.newPhoto({"id":819508,"src":"IMG_1550_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_819508.html","width":130,"caption":"","height":195});
															thumbnails[819509] = clik.newPhoto({"id":819509,"src":"IMG_1555_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_819509.html","width":130,"caption":"","height":195});
															thumbnails[160968] = clik.newPhoto({"id":160968,"src":"pw-r5-06_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160968.html","width":130,"caption":"","height":130});
															thumbnails[824636] = clik.newPhoto({"id":824636,"src":"Untitled-2ss_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_824636.html","width":130,"caption":"","height":109});
															thumbnails[160928] = clik.newPhoto({"id":160928,"src":"IMG_8529_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_160928.html","width":130,"caption":"","height":195});
															thumbnails[299266] = clik.newPhoto({"id":299266,"src":"CRW_3057_bw_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_299266.html","width":130,"caption":"","height":85});
															thumbnails[3584018] = clik.newPhoto({"id":3584018,"src":"IMG_1110_thumb.jpg","galleries_id":219068,"server_id":1,"link":"photo_3584018.html","width":130,"caption":"","height":87});
															thumbnails[3584079] = clik.newPhoto({"id":3584079,"src":"MLW-0053_0150_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584079.html","width":130,"caption":"","height":195});
															thumbnails[3584085] = clik.newPhoto({"id":3584085,"src":"MLW-0119_0375_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584085.html","width":130,"caption":"","height":87});
															thumbnails[3584087] = clik.newPhoto({"id":3584087,"src":"MLW-0123_0383_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584087.html","width":130,"caption":"","height":87});
															thumbnails[3584091] = clik.newPhoto({"id":3584091,"src":"MLW-0136_0435_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584091.html","width":130,"caption":"","height":195});
															thumbnails[3584094] = clik.newPhoto({"id":3584094,"src":"NSW-0264-8176_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584094.html","width":130,"caption":"","height":195});
															thumbnails[3584024] = clik.newPhoto({"id":3584024,"src":"IMG_1369_thumb.jpg","galleries_id":219068,"server_id":1,"link":"photo_3584024.html","width":130,"caption":"","height":87});
															thumbnails[3584096] = clik.newPhoto({"id":3584096,"src":"NSW-1722-9243_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584096.html","width":130,"caption":"","height":195});
															thumbnails[3584100] = clik.newPhoto({"id":3584100,"src":"NSW-0816-6009_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584100.html","width":130,"caption":"","height":195});
															thumbnails[3584103] = clik.newPhoto({"id":3584103,"src":"NSW-0897-8656_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584103.html","width":130,"caption":"","height":195});
															thumbnails[3584104] = clik.newPhoto({"id":3584104,"src":"MCW-0383-4588_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584104.html","width":130,"caption":"","height":87});
															thumbnails[3584106] = clik.newPhoto({"id":3584106,"src":"MCW-1138-4949_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584106.html","width":130,"caption":"","height":87});
															thumbnails[3584030] = clik.newPhoto({"id":3584030,"src":"IMG_1289_thumb.jpg","galleries_id":219068,"server_id":1,"link":"photo_3584030.html","width":130,"caption":"","height":87});
															thumbnails[3584109] = clik.newPhoto({"id":3584109,"src":"MCW-0315-5707_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584109.html","width":130,"caption":"","height":195});
															thumbnails[3584111] = clik.newPhoto({"id":3584111,"src":"NPW-0232-4833_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584111.html","width":130,"caption":"","height":87});
															thumbnails[3584113] = clik.newPhoto({"id":3584113,"src":"NPW-0239-1544_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584113.html","width":130,"caption":"","height":195});
															thumbnails[3584117] = clik.newPhoto({"id":3584117,"src":"NPW-0240-4852_thumb.jpg","galleries_id":14922,"server_id":1,"link":"photo_3584117.html","width":130,"caption":"","height":195});
															thumbnails[3584031] = clik.newPhoto({"id":3584031,"src":"IMG_8852_thumb.jpg","galleries_id":219068,"server_id":1,"link":"photo_3584031.html","width":130,"caption":"","height":195});
															thumbnails[3584045] = clik.newPhoto({"id":3584045,"src":"IMG_7110_thumb.jpg","galleries_id":219068,"server_id":1,"link":"photo_3584045.html","width":130,"caption":"","height":195});
															thumbnails[3584050] = clik.newPhoto({"id":3584050,"src":"IMG_0466_thumb.jpg","galleries_id":219068,"server_id":1,"link":"photo_3584050.html","width":130,"caption":"","height":87});
															thumbnails[3584053] = clik.newPhoto({"id":3584053,"src":"IMG_0036_thumb.jpg","galleries_id":219068,"server_id":1,"link":"photo_3584053.html","width":130,"caption":"","height":195});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[14922] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery","link":"gallery_14922.html","maxRecords":0.0,"photoIDs":[160936.0,160934.0,160930.0,160929.0,299265.0,280727.0,160937.0,160960.0,280722.0,160962.0,160941.0,160939.0,4361942.0,280728.0,299259.0,299262.0,160951.0,4361967.0,4361978.0,4362017.0,4361997.0,160927.0,160966.0,160948.0,299281.0,160926.0,160944.0,160946.0,160952.0,160947.0,160933.0,160953.0,160954.0,160955.0,160956.0,3604507.0,159691.0,160950.0,160932.0,160959.0,280733.0,160942.0,819430.0,160957.0,819465.0,819468.0,819469.0,819488.0,280724.0,819489.0,819504.0,819505.0,160938.0,819508.0,819509.0,160968.0,824636.0,160928.0,299266.0,3584079.0,3584085.0,3584087.0,3584091.0,3584094.0,3584096.0,3584100.0,3584103.0,3584104.0,3584106.0,3584109.0,3584111.0,3584113.0,3584117.0],"skipIndex":0,"section_code":"gallery","featured_images":160936.0,"id":14922,"singleSection":false});				  						galleries[219068] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Pre-Wedding","link":"gallery_219068.html","maxRecords":0.0,"photoIDs":[3583991.0,3583994.0,3584000.0,3584007.0,3584008.0,3584017.0,3584018.0,3584024.0,3584030.0,3584031.0,3584045.0,3584050.0,3584053.0],"skipIndex":0,"section_code":"gallery","featured_images":3583991.0,"id":219068,"singleSection":false});				  						galleries[219109] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Albums","link":"gallery_219109.html","maxRecords":0.0,"photoIDs":[3586338.0],"skipIndex":0,"section_code":"gallery","featured_images":3586338.0,"id":219109,"singleSection":false});				  						galleries[218690] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wedding Vouchers (Buy online)","link":"gallery_218690.html","maxRecords":0.0,"photoIDs":[3578098.0],"skipIndex":0,"section_code":"gallery","featured_images":3578098.0,"id":218690,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '160936,160934,160930,280727,160937,160962,280728,299259,160933,160954,160950,160942,819430,160957,819465,819488,819504,3584087,3584111';
imageSets[2] = '3583991,160936';
imageSets[3] = '4362017,4361997,4361978,4361967,4361942,3642176,3604507,3586338,3584688,3584117,3584113,3584111,3584109,3584106,3584104,3584103,3584100,3584096,3584094,3584091,3584087,3584085,3584079,3584053,3584050,3584045,3584031,3584030,3584024,3584018,3584017,3584008,3584007,3584000,3583994,3583991,3578098,824636,819509,819508,819505,819504,819489,819488,819469,819468,819465,819430,299281,299266';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/mell_a/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/mell_a/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/mell_a/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/mell_a/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/mell_a/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/mell_a/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/mell_a/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 || photos || {})[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 = 'A.P.Weddings - Wedding Photographers: ' + 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>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (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 online</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp += '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="MELL_A">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* 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;
	}
}

			

