window.thumbnails = {};
															thumbnails[6318867] = clik.newPhoto({"id":6318867,"src":"_DSC8064_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6318867.html","width":130,"caption":"","height":86});
															thumbnails[6318891] = clik.newPhoto({"id":6318891,"src":"_DSC8886_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6318891.html","width":130,"caption":"","height":86});
															thumbnails[6318899] = clik.newPhoto({"id":6318899,"src":"_DSC7530_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6318899.html","width":130,"caption":"","height":86});
															thumbnails[6318902] = clik.newPhoto({"id":6318902,"src":"_DSC4632_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6318902.html","width":130,"caption":"","height":86});
															thumbnails[6318907] = clik.newPhoto({"id":6318907,"src":"DSC_6938_thumb.jpg","galleries_id":350493,"server_id":32,"link":"photo_6318907.html","width":130,"caption":"","height":87});
															thumbnails[6318950] = clik.newPhoto({"id":6318950,"src":"DSC_9533_thumb.jpg","galleries_id":350493,"server_id":32,"link":"photo_6318950.html","width":130,"caption":"","height":87});
															thumbnails[6319017] = clik.newPhoto({"id":6319017,"src":"DSC_0462_thumb.jpg","galleries_id":350493,"server_id":32,"link":"photo_6319017.html","width":130,"caption":"","height":194});
															thumbnails[6319024] = clik.newPhoto({"id":6319024,"src":"DSC_9942_thumb.jpg","galleries_id":350493,"server_id":32,"link":"photo_6319024.html","width":130,"caption":"","height":87});
															thumbnails[6319159] = clik.newPhoto({"id":6319159,"src":"sea_thumb.jpg","galleries_id":350504,"server_id":32,"link":"photo_6319159.html","width":130,"caption":"","height":163});
															thumbnails[6321742] = clik.newPhoto({"id":6321742,"src":"_DSC7780_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6321742.html","width":130,"caption":"","height":86});
															thumbnails[6321743] = clik.newPhoto({"id":6321743,"src":"_DSC8136_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6321743.html","width":130,"caption":"","height":86});
															thumbnails[6321744] = clik.newPhoto({"id":6321744,"src":"_DSC7649_thumb.jpg","galleries_id":350493,"server_id":32,"link":"photo_6321744.html","width":130,"caption":"","height":87});
															thumbnails[6321751] = clik.newPhoto({"id":6321751,"src":"_DSC4062_thumb.jpg","galleries_id":350629,"server_id":32,"link":"photo_6321751.html","width":130,"caption":"","height":87});
															thumbnails[6321752] = clik.newPhoto({"id":6321752,"src":"_DSC4071_thumb.jpg","galleries_id":350629,"server_id":32,"link":"photo_6321752.html","width":130,"caption":"","height":87});
															thumbnails[6321754] = clik.newPhoto({"id":6321754,"src":"_DSC4092_thumb.jpg","galleries_id":350629,"server_id":32,"link":"photo_6321754.html","width":130,"caption":"","height":87});
															thumbnails[6321755] = clik.newPhoto({"id":6321755,"src":"_DSC4109_thumb.jpg","galleries_id":350629,"server_id":32,"link":"photo_6321755.html","width":130,"caption":"","height":87});
															thumbnails[6321756] = clik.newPhoto({"id":6321756,"src":"_DSC4179_thumb.jpg","galleries_id":350629,"server_id":32,"link":"photo_6321756.html","width":130,"caption":"","height":87});
															thumbnails[6324969] = clik.newPhoto({"id":6324969,"src":"thenationalpano_thumb.jpg","galleries_id":350504,"server_id":32,"link":"photo_6324969.html","width":130,"caption":"","height":45});
															thumbnails[6324979] = clik.newPhoto({"id":6324979,"src":"Mungo_thumb.jpg","galleries_id":350504,"server_id":32,"link":"photo_6324979.html","width":130,"caption":"","height":194});
															thumbnails[6325072] = clik.newPhoto({"id":6325072,"src":"_DSC6788_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6325072.html","width":130,"caption":"","height":86});
															thumbnails[6325125] = clik.newPhoto({"id":6325125,"src":"_DSC7454_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6325125.html","width":130,"caption":"","height":86});
															thumbnails[6325197] = clik.newPhoto({"id":6325197,"src":"_DSC7674_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6325197.html","width":130,"caption":"","height":86});
															thumbnails[6325280] = clik.newPhoto({"id":6325280,"src":"_DSC8168_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6325280.html","width":130,"caption":"","height":86});
															thumbnails[6325301] = clik.newPhoto({"id":6325301,"src":"_DSC88581_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6325301.html","width":130,"caption":"","height":86});
															thumbnails[6325309] = clik.newPhoto({"id":6325309,"src":"_DSC8932_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6325309.html","width":130,"caption":"","height":86});
															thumbnails[6330488] = clik.newPhoto({"id":6330488,"src":"_DSC7919_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6330488.html","width":130,"caption":"","height":86});
															thumbnails[6330502] = clik.newPhoto({"id":6330502,"src":"_DSC8205_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6330502.html","width":130,"caption":"","height":86});
															thumbnails[6330503] = clik.newPhoto({"id":6330503,"src":"_DSC8087_thumb.jpg","galleries_id":350488,"server_id":32,"link":"photo_6330503.html","width":130,"caption":"","height":86});
															thumbnails[7055658] = clik.newPhoto({"id":7055658,"src":"_DSC4118_as_Smart_Object-1_thumb.jpg","galleries_id":381948,"server_id":32,"link":"photo_7055658.html","width":130,"caption":"","height":195});
															thumbnails[7055659] = clik.newPhoto({"id":7055659,"src":"_DSC4141_as_Smart_Object-1_thumb.jpg","galleries_id":381948,"server_id":32,"link":"photo_7055659.html","width":130,"caption":"","height":86});
															thumbnails[7055661] = clik.newPhoto({"id":7055661,"src":"_DSC4240_as_Smart_Object-1_thumb.jpg","galleries_id":381948,"server_id":32,"link":"photo_7055661.html","width":130,"caption":"","height":86});
															thumbnails[7055662] = clik.newPhoto({"id":7055662,"src":"_DSC4259_as_Smart_Object-1_thumb.jpg","galleries_id":381948,"server_id":32,"link":"photo_7055662.html","width":130,"caption":"","height":86});
															thumbnails[7055663] = clik.newPhoto({"id":7055663,"src":"_DSC8331_thumb.jpg","galleries_id":381948,"server_id":32,"link":"photo_7055663.html","width":130,"caption":"","height":195});
															thumbnails[7055664] = clik.newPhoto({"id":7055664,"src":"_DSC8706_thumb.jpg","galleries_id":381948,"server_id":32,"link":"photo_7055664.html","width":130,"caption":"","height":86});
															thumbnails[7055665] = clik.newPhoto({"id":7055665,"src":"_DSC1698_thumb.jpg","galleries_id":350504,"server_id":32,"link":"photo_7055665.html","width":130,"caption":"","height":195});
															thumbnails[7055666] = clik.newPhoto({"id":7055666,"src":"_DSC1053_thumb.jpg","galleries_id":350504,"server_id":32,"link":"photo_7055666.html","width":130,"caption":"","height":195});
															thumbnails[7288907] = clik.newPhoto({"id":7288907,"src":"_DSC5327_thumb.jpg","galleries_id":381948,"server_id":32,"link":"photo_7288907.html","width":86,"caption":"","height":130});
															thumbnails[7376519] = clik.newPhoto({"id":7376519,"src":"_DSC0439_thumb.jpg","galleries_id":350493,"server_id":32,"link":"photo_7376519.html","width":86,"caption":"","height":130});
															thumbnails[7376524] = clik.newPhoto({"id":7376524,"src":"_DSC8162_thumb.jpg","galleries_id":350493,"server_id":32,"link":"photo_7376524.html","width":87,"caption":"","height":130});
															thumbnails[7376527] = clik.newPhoto({"id":7376527,"src":"_DSC9801b_thumb.jpg","galleries_id":350493,"server_id":32,"link":"photo_7376527.html","width":86,"caption":"","height":130});
															thumbnails[7376541] = clik.newPhoto({"id":7376541,"src":"_DSC4474_thumb.jpg","galleries_id":350629,"server_id":32,"link":"photo_7376541.html","width":130,"caption":"","height":87});
															thumbnails[7376544] = clik.newPhoto({"id":7376544,"src":"_DSC4505_thumb.jpg","galleries_id":350629,"server_id":32,"link":"photo_7376544.html","width":130,"caption":"","height":87});
															thumbnails[7376546] = clik.newPhoto({"id":7376546,"src":"_DSC4597_thumb.jpg","galleries_id":350629,"server_id":32,"link":"photo_7376546.html","width":87,"caption":"","height":130});
															thumbnails[7376565] = clik.newPhoto({"id":7376565,"src":"_DSC4565_thumb.jpg","galleries_id":350629,"server_id":32,"link":"photo_7376565.html","width":130,"caption":"","height":87});
															thumbnails[8291587] = clik.newPhoto({"id":8291587,"src":"_DSC7330-2crop_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_8291587.html","width":86,"caption":"","height":130});
															thumbnails[8291588] = clik.newPhoto({"id":8291588,"src":"_DSC9434_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_8291588.html","width":86,"caption":"","height":130});
															thumbnails[8291589] = clik.newPhoto({"id":8291589,"src":"_DSC3407_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_8291589.html","width":130,"caption":"","height":86});
															thumbnails[8291590] = clik.newPhoto({"id":8291590,"src":"_DSC3524_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_8291590.html","width":130,"caption":"","height":86});
															thumbnails[8291591] = clik.newPhoto({"id":8291591,"src":"_DSC3566_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_8291591.html","width":130,"caption":"","height":86});
															thumbnails[8291592] = clik.newPhoto({"id":8291592,"src":"_DSC3633_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_8291592.html","width":86,"caption":"","height":130});
															thumbnails[8291593] = clik.newPhoto({"id":8291593,"src":"_DSC4511_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_8291593.html","width":86,"caption":"","height":130});
															thumbnails[8291594] = clik.newPhoto({"id":8291594,"src":"_DSC4557_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_8291594.html","width":130,"caption":"","height":86});
															thumbnails[8291595] = clik.newPhoto({"id":8291595,"src":"_DSC92211_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_8291595.html","width":130,"caption":"","height":86});
															thumbnails[8291596] = clik.newPhoto({"id":8291596,"src":"_DSC4576_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_8291596.html","width":130,"caption":"","height":86});
															thumbnails[8291597] = clik.newPhoto({"id":8291597,"src":"_DSC0328_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_8291597.html","width":87,"caption":"","height":130});
															thumbnails[6321745] = clik.newPhoto({"id":6321745,"src":"_DSC4759_thumb.jpg","galleries_id":350628,"server_id":32,"link":"photo_6321745.html","width":130,"caption":"","height":86});
															thumbnails[6846742] = clik.newPhoto({"id":6846742,"src":"_DSC0712_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846742.html","width":130,"caption":"","height":86});
															thumbnails[6321746] = clik.newPhoto({"id":6321746,"src":"_DSC4909_thumb.jpg","galleries_id":350628,"server_id":32,"link":"photo_6321746.html","width":130,"caption":"","height":86});
															thumbnails[6846752] = clik.newPhoto({"id":6846752,"src":"_DSC1002_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846752.html","width":130,"caption":"","height":86});
															thumbnails[6846805] = clik.newPhoto({"id":6846805,"src":"_DSC1486_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846805.html","width":130,"caption":"","height":86});
															thumbnails[6846950] = clik.newPhoto({"id":6846950,"src":"_DSC4990_thumb.jpg","galleries_id":350628,"server_id":32,"link":"photo_6846950.html","width":130,"caption":"","height":86});
															thumbnails[6846853] = clik.newPhoto({"id":6846853,"src":"_DSC1541_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846853.html","width":130,"caption":"","height":86});
															thumbnails[6846943] = clik.newPhoto({"id":6846943,"src":"_DSC4878_thumb.jpg","galleries_id":350628,"server_id":32,"link":"photo_6846943.html","width":130,"caption":"","height":86});
															thumbnails[6846862] = clik.newPhoto({"id":6846862,"src":"_DSC1586_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846862.html","width":130,"caption":"","height":86});
															thumbnails[6846945] = clik.newPhoto({"id":6846945,"src":"_DSC4897_thumb.jpg","galleries_id":350628,"server_id":32,"link":"photo_6846945.html","width":130,"caption":"","height":86});
															thumbnails[6846875] = clik.newPhoto({"id":6846875,"src":"_DSC1943_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846875.html","width":130,"caption":"","height":86});
															thumbnails[6846953] = clik.newPhoto({"id":6846953,"src":"_DSC5035_thumb.jpg","galleries_id":350628,"server_id":32,"link":"photo_6846953.html","width":130,"caption":"","height":86});
															thumbnails[6846872] = clik.newPhoto({"id":6846872,"src":"_DSC1858_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846872.html","width":130,"caption":"","height":86});
															thumbnails[6846955] = clik.newPhoto({"id":6846955,"src":"_DSC5046_thumb.jpg","galleries_id":350628,"server_id":32,"link":"photo_6846955.html","width":130,"caption":"","height":86});
															thumbnails[6321747] = clik.newPhoto({"id":6321747,"src":"_DSC5073_thumb.jpg","galleries_id":350628,"server_id":32,"link":"photo_6321747.html","width":130,"caption":"","height":86});
															thumbnails[6846874] = clik.newPhoto({"id":6846874,"src":"_DSC1897_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846874.html","width":130,"caption":"","height":86});
															thumbnails[6846866] = clik.newPhoto({"id":6846866,"src":"_DSC1661_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846866.html","width":130,"caption":"","height":86});
															thumbnails[6846899] = clik.newPhoto({"id":6846899,"src":"_DSC1668_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846899.html","width":130,"caption":"","height":86});
															thumbnails[6846895] = clik.newPhoto({"id":6846895,"src":"_DSC1599_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846895.html","width":130,"caption":"","height":86});
															thumbnails[6846886] = clik.newPhoto({"id":6846886,"src":"_DSC2183_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846886.html","width":130,"caption":"","height":86});
															thumbnails[7506842] = clik.newPhoto({"id":7506842,"src":"_DSC0358_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_7506842.html","width":130,"caption":"","height":87});
															thumbnails[6846880] = clik.newPhoto({"id":6846880,"src":"_DSC2171_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846880.html","width":130,"caption":"","height":86});
															thumbnails[7288604] = clik.newPhoto({"id":7288604,"src":"_DSC5065_7F558A0E-1E4F-37DC-71EF8662FFF4440C_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_7288604.html","width":130,"caption":"","height":130});
															thumbnails[6846878] = clik.newPhoto({"id":6846878,"src":"_DSC2153_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846878.html","width":130,"caption":"","height":86});
															thumbnails[7288860] = clik.newPhoto({"id":7288860,"src":"WestGateB_thumb.jpg","galleries_id":407010,"server_id":32,"link":"photo_7288860.html","width":130,"caption":"","height":130});
															thumbnails[6846876] = clik.newPhoto({"id":6846876,"src":"_DSC2066_thumb.jpg","galleries_id":371726,"server_id":32,"link":"photo_6846876.html","width":130,"caption":"","height":86});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[407010] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Architecture ","link":"gallery_407010.html","maxRecords":0.0,"photoIDs":[8291587.0,8291588.0,8291589.0,8291590.0,8291591.0,8291592.0,8291593.0,8291594.0,8291595.0,8291596.0,8291597.0,7506842.0,7288604.0,7288860.0],"skipIndex":0,"section_code":"gallery","featured_images":"8291597,8291596,8291595,8291594,8291593,8291592,8291591,8291590,8291589,8291588","id":407010,"singleSection":false});				  						galleries[350488] = clik.newGallery({"parentGallery":350487,"usePopups":false,"title":"CFA Fiskville ","link":"gallery_350488.html","maxRecords":0.0,"photoIDs":[6318867.0,6318891.0,6318899.0,6318902.0,6321742.0,6321743.0,6325072.0,6325125.0,6325197.0,6325280.0,6325301.0,6325309.0,6330488.0,6330502.0,6330503.0],"skipIndex":0,"section_code":"gallery","featured_images":6318867.0,"id":350488,"singleSection":false});				  						galleries[350628] = clik.newGallery({"parentGallery":350487,"usePopups":false,"title":"Great Western ","link":"gallery_350628.html","maxRecords":0.0,"photoIDs":[6321745.0,6321746.0,6846950.0,6846943.0,6846945.0,6846953.0,6846955.0,6321747.0],"skipIndex":0,"section_code":"gallery","featured_images":6321747.0,"id":350628,"singleSection":false});				  						galleries[371726] = clik.newGallery({"parentGallery":350487,"usePopups":false,"title":"Japan","link":"gallery_371726.html","maxRecords":0.0,"photoIDs":[6846742.0,6846752.0,6846805.0,6846853.0,6846862.0,6846875.0,6846872.0,6846874.0,6846866.0,6846899.0,6846895.0,6846886.0,6846880.0,6846878.0,6846876.0],"skipIndex":0,"section_code":"gallery","featured_images":"6846899,6846895,6846886,6846880,6846878,6846876,6846875,6846874,6846872,6846866","id":371726,"singleSection":false});				  						galleries[350629] = clik.newGallery({"parentGallery":350487,"usePopups":false,"title":"Victorian Police Dog Squad","link":"gallery_350629.html","maxRecords":0.0,"photoIDs":[6321751.0,6321752.0,6321754.0,6321755.0,6321756.0,7376541.0,7376544.0,7376546.0,7376565.0],"skipIndex":0,"section_code":"gallery","featured_images":"7376565,7376546,7376544,7376541,6321756,6321755,6321754,6321752,6321751","id":350629,"singleSection":false});				  						galleries[350487] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Documentary ","link":"gallery_350487.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"6321747,6318867","id":350487,"singleSection":false});				  						galleries[350493] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_350493.html","maxRecords":0.0,"photoIDs":[6318907.0,6318950.0,6319017.0,6319024.0,6321744.0,7376519.0,7376524.0,7376527.0],"skipIndex":0,"section_code":"gallery","featured_images":"7376527,7376524,7376519,6321744,6319024,6319017,6318950,6318907","id":350493,"singleSection":false});				  						galleries[350504] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscape","link":"gallery_350504.html","maxRecords":0.0,"photoIDs":[6319159.0,6324969.0,6324979.0,7055665.0,7055666.0],"skipIndex":0,"section_code":"gallery","featured_images":7055666.0,"id":350504,"singleSection":false});				  						galleries[381948] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"gallery_381948.html","maxRecords":0.0,"photoIDs":[7055658.0,7055659.0,7055661.0,7055662.0,7055663.0,7055664.0,7288907.0],"skipIndex":0,"section_code":"gallery","featured_images":"7288907,7055664,7055663,7055662,7055661,7055659,7055658","id":381948,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8291597,8291596,8291595,8291594,8291593,8291592,8291591,8291590,8291589,8291588,8291587,7506842,7376565,7376546,7376544,7376541,7376527,7376524,7376519,7288907,7288860,7288604,7055666,7055665,7055664,7055663,7055662,7055661,7055659,7055658,6846955,6846953,6846950,6846945,6846943,6846899,6846895,6846886,6846880,6846878,6846876,6846875,6846874,6846872,6846866,6846862,6846853,6846805,6846752,6846742';
imageSets[2] = '7055666,6318867,6321747';
imageSets[3] = '8291597,8291596,8291595,8291594,8291593,8291592,8291591,8291590,8291589,8291588,8291587,7506842,7376565,7376546,7376544,7376541,7376527,7376524,7376519,7288907,7288860,7288604,7055666,7055665,7055664,7055663,7055662,7055661,7055659,7055658,6846955,6846953,6846950,6846945,6846943,6846899,6846895,6846886,6846880,6846878,6846876,6846875,6846874,6846872,6846866,6846862,6846853,6846805,6846752,6846742';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/changas/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/changas/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/changas/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/changas/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/changas/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/changas/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/changas/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/changas/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 = 'Christopher Chan 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> AU$' + (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.item_price !== '') {
																		temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="chris_2188@hotmail.com">';
					temp += '<input type="hidden" name="currency_code" value="AUD">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="chris_2188@hotmail.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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;
	}
}

			

