/***************************************************************************
* Create a photo object                                                    *
***************************************************************************/
function photo(id, galleries_id, photo_ref, section_code, src, width, height, caption, thumbnail, thumbnail_width, thumbnail_height, home, gallery, description, takendate, photographer, location, item_price, purchase_instruction) {
	this.id = id;
	this.galleries_id = galleries_id;
	this.photo_ref = photo_ref;
	this.section_code = section_code;
	this.src = src;
	this.width = width;
	this.height = height;
	this.caption = caption;
	this.thumbnail = thumbnail;
	this.thumbnail_width = thumbnail_width;
	this.thumbnail_height = thumbnail_height;
	this.home = home;
	this.gallery = gallery;
	this.description = description;
	this.takendate = takendate;
	this.photographer = photographer;
	this.location = location;
	this.item_price = item_price;
	this.purchase_instruction = purchase_instruction;
}
/***************************************************************************
* Create a gallery object                                                  *
***************************************************************************/

function gallery(id,featured_images,title,section_code) {
	this.id = id;
	this.featured_images = featured_images;
	this.title = title;
	this.section_code = section_code;}

/***************************************************************************
* Select a random value from a comma separated list                        *
***************************************************************************/
function randomListVal(list) {
	arrayVals = list.split(',');
	pos = Math.round(Math.random() * (arrayVals.length - 1));
	debug('Returning ' + arrayVals[pos] + ' as random image');
	return arrayVals[pos];
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {

	imageID = randomListVal('748086');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if (!basic) {
			img.src = photos[j].src;
			img.width = photos[j].width;
			img.height = photos[j].height;
			}
			else {
				newImage = new Image(photos[j].width,photos[j].height);
				newImage.src = photos[j].src;
				document.images[img.name] = newImage;
				debug(newImage.src);
			}
			break;
		}
	}
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline() {
	
	imageID = randomListVal('748086');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if ('gallery' != '') {
						if (photos[j].galleries_id != '') {
						document.write('<a href="' + photos[j].section_code + '_' + photos[j].galleries_id + '.html">');
						}
						else {
						document.write('<a href="gallery.html">');
						}
			}
			document.write('<img src="' + photos[j].src + '" width="' + photos[j].width + '" height="' + photos[j].height + '" class="mainhomepageimage" id="mainSample" name="mainSample" alt="' + photos[j].caption  + '" border="0">');
			if ('gallery' != '') {
				document.write('</a>');
			}
			break;
		}
	}
	
}

/***************************************************************************
* Show the next image in a gallery.  field = hidden field containing       *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function next(field,img) {

	debug('IN next');
	imageID = field.value;
	
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k= j + 1;
	while (nextImg < 0) {
		for (; k < photos.length; k++) {
			debug('testing image ' + k + ': gallery = ' + photos[k].galleries_id + '(existing: ' + photos[j].galleries_id + ')');
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				debug('setting  nextImg = ' + k);
				break;
			}
		}
		if (nextImg == -1) {
			k = 0;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);
	}


}


/***************************************************************************
* Set a new image on the gallery detail page given its array position      *
***************************************************************************/
function updateImage (nextImg, field,img) {
	debug('Updating image');
	if (!basic && !(0)) {
		debug('In updateImage');
		debug('setting  img src = ' + photos[nextImg].src);
		
					
			document.getElementById('imagePhoto').innerHTML = '<img class="mainphoto" src="' + photos[nextImg].src + ' " id="mainPic" name="mainPic" width="' + photos[nextImg].width + '" height="' + photos[nextImg].height + '" alt="' + photos[nextImg].caption + '" border="0">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = photos[nextImg].caption;
			document.title = photos[nextImg].caption;
			/* apply 'blank' classname to element where */			if ( photos[nextImg].caption == '') {
				document.getElementById('imageTitle').style.className = 'blank';
			}
			else {
				document.getElementById('imageTitle').style.className = 'normal';
			}
						temp = '';
			if (photos[nextImg].description != '') {
				temp = temp +  '<p id="imageDescription">' + photos[nextImg].description + '</p>';
			}
			if (photos[nextImg].photo_ref != '') {
				temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + photos[nextImg].photo_ref + '</p>';
			}
			if (photos[nextImg].takendate != '') {
				debug('Resetting taken date');
				temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + photos[nextImg].takendate + '</p>';
			}
			
			if (photos[nextImg].location != '') {
				debug('Resetting location');
				temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  photos[nextImg].location + '</p>';
			}
			
			if (photos[nextImg].photographer != '') {
				debug('Resetting photographer');
				temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + photos[nextImg].photographer + '</p>';
			}
			if (temp != '') {				temp = temp + '<div class="spacer"></div>';			}					if (temp == '') {
			document.getElementById('imageDetails').style.display = 'none';
		}
		else {
			document.getElementById('imageDetails').style.display = 'block';
		}
		document.getElementById('imageDetails').innerHTML =temp;	
		
	}
	else {
		debug('Redirecting to id ' + photos[nextImg].id);
		window.location = 'photo_' + photos[nextImg].id + '.html';
	}
}

/***************************************************************************
* Show the previous image for a gallery. field = hidden field containing   *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function previous(field,img) {


	imageID = field.value;
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k = j -1;
	while (nextImg < 0) {
		for (; k >= 0; k--) {
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				break;
			}
		}
		if (nextImg == -1) {
			k = photos.length -1;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);	
	}
}

/***************************************************************************
* 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) {
	debug('Gallery = ' + gallery_id);
	for (i = 0; i < galleries.length; i++) {
		if (galleries[i].id == gallery_id) {
			imageID = randomListVal(galleries[i].featured_images);
				for (j = 0; j < photos.length; j++) {
					if (photos[j].id == imageID) {
						
						img.src = photos[j].thumbnail;
						img.width = photos[j].thumbnail_width;
						img.height = photos[j].thumbnail_height;
						
						break;
					}
				}
			break;
		}
	} 
	}

/***************************************************************************
* If we have dynamic HTML                                                  *
*  replace the galleries link with a list that                             *
* doesn't include the current gallery                                      *
***************************************************************************/
function showGalleries(gallery_id) {
	debug('Showing links for gallery ' + gallery_id);
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
			debug('Testing gallery ' + galleries[i].id);
			
			if (galleries[i].id != gallery_id) {
				debug('Adding link');
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="gallery_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}
/***************************************************************************
* Create the array of Photo objects                                        *
***************************************************************************/
photos = new Array();
photos[0] = new photo(741860,'','','','http://www1.clikpic.com/haapsalu/images/Mere.jpg',400,299,'','http://www1.clikpic.com/haapsalu/images/Mere_thumb.jpg',130, 97,0, 0,'Mere talu','','','','','');
photos[1] = new photo(741856,'57253','','gallery','http://www1.clikpic.com/haapsalu/images/Bosrand.jpg',400,299,'Mixed Forest','http://www1.clikpic.com/haapsalu/images/Bosrand_thumb.jpg',130, 97,0, 0,'Mixed forest near Martna, Läänemaa','','','','','');
photos[2] = new photo(741864,'57253','','gallery','http://www1.clikpic.com/haapsalu/images/SchotseHooglander2.jpg',400,299,'Matsalu Bay near Haeska','http://www1.clikpic.com/haapsalu/images/SchotseHooglander2_thumb.jpg',130, 97,0, 0,'Highlanders in the refreshing water of Matsalu Bay','','','','','');
photos[3] = new photo(741865,'57253','','gallery','http://www1.clikpic.com/haapsalu/images/StrandRoosta1.jpg',400,299,'Beach Roosta<br />\r\nNoarootsi<br />\r\nLäänemaa','http://www1.clikpic.com/haapsalu/images/StrandRoosta1_thumb.jpg',130, 97,0, 0,'Beach<br />\r\nRoosta','','','','','');
photos[4] = new photo(748086,'57253','','gallery','http://www1.clikpic.com/haapsalu/images/Matsalu15_06_2006A.jpg',400,300,'Kirikuküla, Matsalu National Park','http://www1.clikpic.com/haapsalu/images/Matsalu15_06_2006A_thumb.jpg',130, 98,1, 0,'Landscape near Kirikuküla in Matsalu National Park','','','','','');
photos[5] = new photo(748103,'57253','','gallery','http://www1.clikpic.com/haapsalu/images/Osmussaar.jpg',400,300,'Lighthouse, Osmussaar','http://www1.clikpic.com/haapsalu/images/Osmussaar_thumb.jpg',130, 98,0, 0,'Lighthouse on the island of Osmussaar','','','','','');
photos[6] = new photo(748115,'57253','','gallery','http://www1.clikpic.com/haapsalu/images/Peipsi.jpg',400,299,'Lake Peipsi','http://www1.clikpic.com/haapsalu/images/Peipsi_thumb.jpg',130, 97,0, 0,'Northern shore of Lake Peipsi in the northeast of Estonia','','','','','');
photos[7] = new photo(748145,'57253','','gallery','http://www1.clikpic.com/haapsalu/images/Sneeuw.jpg',400,300,'Winter in Estonia','http://www1.clikpic.com/haapsalu/images/Sneeuw_thumb.jpg',130, 98,0, 0,'Winterlandscape in Estonia','','','','','');
photos[8] = new photo(748146,'57253','','gallery','http://www1.clikpic.com/haapsalu/images/Stenenbult.jpg',400,299,'\"Island\" of stones','http://www1.clikpic.com/haapsalu/images/Stenenbult_thumb.jpg',130, 97,0, 0,'One of the many places where farmers have put big stones together during centuries','','','','','');
photos[9] = new photo(748152,'57253','','gallery','http://www1.clikpic.com/haapsalu/images/Tuhu.jpg',400,299,'Tuhu soo','http://www1.clikpic.com/haapsalu/images/Tuhu_thumb.jpg',130, 97,0, 0,'Typical Estonian landscape at Tuhu soo, Läänemaa','','','','','');
photos[10] = new photo(748153,'57253','','gallery','http://www1.clikpic.com/haapsalu/images/Tuulingu.jpg',400,299,'Renovated farmhouse','http://www1.clikpic.com/haapsalu/images/Tuulingu_thumb.jpg',130, 97,0, 0,'A renovated barn in traditional Estonian style (now guesthouse)','','','','','');
photos[11] = new photo(747115,'57251','','gallery','http://www1.clikpic.com/haapsalu/images/GrauweFranjepootC.jpg',300,400,'Red-necked Phalaropes','http://www1.clikpic.com/haapsalu/images/GrauweFranjepootC_thumb.jpg',130, 173,0, 0,'Red-necked Phalarope near Hara','','','','','');
photos[12] = new photo(747132,'57251','','gallery','http://www1.clikpic.com/haapsalu/images/Kraanvogels.jpg',400,300,'Common Cranes','http://www1.clikpic.com/haapsalu/images/Kraanvogels_thumb.jpg',130, 98,0, 0,'Common Cranes are common in Estonia, both as a breeding bird and as migrant','','','','','');
photos[13] = new photo(748098,'57251','','gallery','http://www1.clikpic.com/haapsalu/images/Orissaare09_05_2006.jpg',400,300,'Tufted Duck, Saaremaa','http://www1.clikpic.com/haapsalu/images/Orissaare09_05_2006_thumb.jpg',130, 98,0, 0,'Tufted Ducks in a small lake near Orissaare, Saaremaa','','','','','');
photos[14] = new photo(748148,'57251','','gallery','http://www1.clikpic.com/haapsalu/images/Stormmeeuw.jpg',400,299,'Common Gull','http://www1.clikpic.com/haapsalu/images/Stormmeeuw_thumb.jpg',130, 97,0, 0,'Common Gull, in Estonian Kalakajakas or \"Fish Gull\"','','','','','');
photos[15] = new photo(741861,'57256','','gallery','http://www1.clikpic.com/haapsalu/images/Orchidee1.jpg',299,400,'Orchid','http://www1.clikpic.com/haapsalu/images/Orchidee1_thumb.jpg',130, 174,0, 0,'Orchids can be seen at many places','','','','','');
photos[16] = new photo(741863,'57256','','gallery','http://www1.clikpic.com/haapsalu/images/SaaremaPlantsCoast1.jpg',400,299,'Lou, Saaremaa','http://www1.clikpic.com/haapsalu/images/SaaremaPlantsCoast1_thumb.jpg',130, 97,0, 0,'Vegetation at the coast of Saaremaa','','','','','');
photos[17] = new photo(747111,'57256','','gallery','http://www1.clikpic.com/haapsalu/images/Dagkoekoeksbloem.jpg',400,299,'Red campion','http://www1.clikpic.com/haapsalu/images/Dagkoekoeksbloem_thumb.jpg',130, 97,0, 0,'Red campion (Silene dioica)','','','','','');
photos[18] = new photo(748154,'57256','','gallery','http://www1.clikpic.com/haapsalu/images/Vetplanten.jpg',400,299,'Lõu, Saaremaa','http://www1.clikpic.com/haapsalu/images/Vetplanten_thumb.jpg',130, 97,0, 0,'Close up of the vegetation at Lõu, Saaremaa','','','','','');
photos[19] = new photo(747130,'58005','','gallery','http://www1.clikpic.com/haapsalu/images/Koniginnepage.jpg',400,299,'Swallowtail','http://www1.clikpic.com/haapsalu/images/Koniginnepage_thumb.jpg',130, 97,0, 0,'Swallowtail in a garden','','','','','');
photos[20] = new photo(741857,'57254','','gallery','http://www1.clikpic.com/haapsalu/images/BWT_Haeska.jpg',400,299,'Haeska','http://www1.clikpic.com/haapsalu/images/BWT_Haeska_thumb.jpg',130, 97,0, 0,'The very famous watching tower of Haeska at the northside of Matsalu Bay','','','','','');
photos[21] = new photo(741858,'57254','','gallery','http://www1.clikpic.com/haapsalu/images/BWT_SutlepaMeri.jpg',400,299,'Sutlepa meri','http://www1.clikpic.com/haapsalu/images/BWT_SutlepaMeri_thumb.jpg',130, 97,0, 0,'Watching platform north of Saare/Lyckholm with a good view over Sutlepa meri','','','','','');
photos[22] = new photo(747098,'57254','','gallery','http://www1.clikpic.com/haapsalu/images/BWT_Haapsalu.jpg',300,400,'Haapsalu','http://www1.clikpic.com/haapsalu/images/BWT_Haapsalu_thumb.jpg',130, 173,0, 0,'Watchingtower in the eastern part of the town of Haapsalu overlooking Haapsalu Bay','','','','','');
photos[23] = new photo(747100,'57254','','gallery','http://www1.clikpic.com/haapsalu/images/BWT_Keemu.jpg',400,300,'Keemu','http://www1.clikpic.com/haapsalu/images/BWT_Keemu_thumb.jpg',130, 98,0, 0,'Watchingtower in Keemu on the southern shore of Matsalu Bay','','','','','');
photos[24] = new photo(747109,'57254','','gallery','http://www1.clikpic.com/haapsalu/images/BWT_Rannajoe.jpg',400,299,'Rannajõe','http://www1.clikpic.com/haapsalu/images/BWT_Rannajoe_thumb.jpg',130, 97,0, 0,'Watchingplatform near Rannajõe from where you can see Elk very well during dusk and dawn','','','','','');
photos[25] = new photo(748091,'57254','','gallery','http://www1.clikpic.com/haapsalu/images/Matsalu15_06_2006C.jpg',300,400,'Kirikuküla','http://www1.clikpic.com/haapsalu/images/Matsalu15_06_2006C_thumb.jpg',130, 173,0, 0,'Watchingtower at Kirikuküla overlooking the vast reedbed areas of Matsalu National Park','','','','','');
photos[26] = new photo(748094,'57254','','gallery','http://www1.clikpic.com/haapsalu/images/Matsalu15_06_2006B.jpg',400,300,'Kirikuküla','http://www1.clikpic.com/haapsalu/images/Matsalu15_06_2006B_thumb.jpg',130, 98,0, 0,'Watchingtower of Kirikuküla (Matsalu NP)','','','','','');
photos[27] = new photo(748118,'57254','','gallery','http://www1.clikpic.com/haapsalu/images/Poosaspea.jpg',400,299,'Põõsaspea neem','http://www1.clikpic.com/haapsalu/images/Poosaspea_thumb.jpg',130, 97,0, 0,'Birdwatching spot at Põõsaspea neem (Cape) some 30 km north of Haapsalu. Well known for migrating divers and ducks.','','','','','');
photos[28] = new photo(741867,'57998','','gallery','http://www1.clikpic.com/haapsalu/images/TallinnPlein1.jpg',400,299,'Raekoja plats, Tallinn','http://www1.clikpic.com/haapsalu/images/TallinnPlein1_thumb.jpg',130, 97,0, 0,'The central square (Raekoja plats) in Tallinn','','','','','');
photos[29] = new photo(748121,'57998','','gallery','http://www1.clikpic.com/haapsalu/images/RaekojaPlats.jpg',400,299,'Old town hall, Tallinn','http://www1.clikpic.com/haapsalu/images/RaekojaPlats_thumb.jpg',130, 97,0, 0,'Old town hall at Raekoja plats in the centre of Tallinn','','','','','');
photos[30] = new photo(748123,'57998','','gallery','http://www1.clikpic.com/haapsalu/images/RooftopsTallinn.jpg',400,299,'Rooftops, Tallinn','http://www1.clikpic.com/haapsalu/images/RooftopsTallinn_thumb.jpg',130, 97,0, 0,'Overlooking the rooftops of the old centre of Tallinn','','','','','');
photos[31] = new photo(748150,'57998','','gallery','http://www1.clikpic.com/haapsalu/images/TallinnTerrasjes.jpg',400,300,'Centre of Tallinn','http://www1.clikpic.com/haapsalu/images/TallinnTerrasjes_thumb.jpg',130, 98,0, 0,'One of the many places in Tallinn where you can relax and have a drink','','','','','');
photos[32] = new photo(748151,'57998','','gallery','http://www1.clikpic.com/haapsalu/images/TallinnToren.jpg',299,400,'Walltower, Tallinn','http://www1.clikpic.com/haapsalu/images/TallinnToren_thumb.jpg',130, 174,0, 0,'Tower at the wall in Tallinn','','','','','');
photos[33] = new photo(741862,'57999','','gallery','http://www1.clikpic.com/haapsalu/images/SaaremaaCoastLou2.jpg',400,299,'Lõu, Saaremaa','http://www1.clikpic.com/haapsalu/images/SaaremaaCoastLou2_thumb.jpg',130, 97,0, 0,'Coast near Lõu, Saaremaa','','','','','');
photos[34] = new photo(747126,'57999','','gallery','http://www1.clikpic.com/haapsalu/images/KoguvaA.jpg',400,299,'Koguva, Muhu','http://www1.clikpic.com/haapsalu/images/KoguvaA_thumb.jpg',130, 97,0, 0,'The well preserved old fishing village Koguva on the isle of Muhu','','','','','');
photos[35] = new photo(748101,'57999','','gallery','http://www1.clikpic.com/haapsalu/images/Orissare09_05_2006.jpg',300,400,'Orissaare','http://www1.clikpic.com/haapsalu/images/Orissare09_05_2006_thumb.jpg',130, 173,0, 0,'Small lake near Orissaare, Saaremaa','','','','','');
photos[36] = new photo(748108,'57999','','gallery','http://www1.clikpic.com/haapsalu/images/Panga.jpg',400,300,'Cliffs Panga','http://www1.clikpic.com/haapsalu/images/Panga_thumb.jpg',130, 98,0, 0,'Panga cliffs in the north of the island Saaremaa','','','','','');
photos[37] = new photo(748128,'57999','','gallery','http://www1.clikpic.com/haapsalu/images/Saaremaa09_05_2006A.jpg',400,300,'Undva, Saaremaa','http://www1.clikpic.com/haapsalu/images/Saaremaa09_05_2006A_thumb.jpg',130, 98,0, 0,'The shore of Undva peninsula on Saaremaa','','','','','');
photos[38] = new photo(748131,'57999','','gallery','http://www1.clikpic.com/haapsalu/images/Saaremaa09_05_2006B.jpg',400,300,'Tagalaht near Veere','http://www1.clikpic.com/haapsalu/images/Saaremaa09_05_2006B_thumb.jpg',130, 98,0, 0,'The shore of Tagalaht Bay near Veere on Saaremaa','','','','','');
photos[39] = new photo(748133,'57999','','gallery','http://www1.clikpic.com/haapsalu/images/Saaremaa09_05_2006C.jpg',400,300,'Sõrve lighthouse','http://www1.clikpic.com/haapsalu/images/Saaremaa09_05_2006C_thumb.jpg',130, 98,0, 0,'The Sõrve lighthouse on the southernmost spot of the island of Saaremaa','','','','','');
photos[40] = new photo(748135,'57999','','gallery','http://www1.clikpic.com/haapsalu/images/Saaremaa21_06_2006A.jpg',400,300,'Meteorite crater Kaali','http://www1.clikpic.com/haapsalu/images/Saaremaa21_06_2006A_thumb.jpg',130, 98,0, 0,'The meteorite crater at Kaali on the island of Saaremaa','','','','','');
photos[41] = new photo(748140,'57999','','gallery','http://www1.clikpic.com/haapsalu/images/Saaremaa21_06_2006B.jpg',400,300,'Kuressaare, Saaremaa','http://www1.clikpic.com/haapsalu/images/Saaremaa21_06_2006B_thumb.jpg',130, 98,0, 0,'The old episcopal castle at Kuressaare on Saaremaa','','','','','');
photos[42] = new photo(748143,'57999','','gallery','http://www1.clikpic.com/haapsalu/images/SaaremaMolen.jpg',400,299,'Mill, Saaremaa','http://www1.clikpic.com/haapsalu/images/SaaremaMolen_thumb.jpg',130, 97,0, 0,'An old mill on the island of Saaremaa','','','','','');
photos[43] = new photo(741866,'58001','','gallery','http://www1.clikpic.com/haapsalu/images/Takhuna.jpg',400,299,'Takhuna, Hiiumaa','http://www1.clikpic.com/haapsalu/images/Takhuna_thumb.jpg',130, 97,0, 0,'Lighthouse at Takhuna, Hiiumaa','','','','','');
photos[44] = new photo(747118,'58001','','gallery','http://www1.clikpic.com/haapsalu/images/Hiiumaa28_04_2006.jpg',300,400,'Road through forest','http://www1.clikpic.com/haapsalu/images/Hiiumaa28_04_2006_thumb.jpg',130, 173,0, 0,'Road through a coniferous forest on Hiiumaa','','','','','');
photos[45] = new photo(747120,'58001','','gallery','http://www1.clikpic.com/haapsalu/images/Hiuumaa.jpg',400,300,'Shore on Hiiumaa','http://www1.clikpic.com/haapsalu/images/Hiuumaa_thumb.jpg',130, 98,0, 0,'Shore near Ristna, Hiiumaa','','','','','');
photos[46] = new photo(741859,'58002','','gallery','http://www1.clikpic.com/haapsalu/images/HaapsaluLossi1.jpg',400,299,'Haapsalu castle','http://www1.clikpic.com/haapsalu/images/HaapsaluLossi1_thumb.jpg',130, 97,0, 0,'Haapsalu castle','','','','','');
photos[47] = new photo(747116,'58002','','gallery','http://www1.clikpic.com/haapsalu/images/Haapsalu.jpg',400,300,'Haapsalu','http://www1.clikpic.com/haapsalu/images/Haapsalu_thumb.jpg',130, 98,0, 0,'Haapsalu in summer','','','','','');
photos[48] = new photo(747124,'58002','','gallery','http://www1.clikpic.com/haapsalu/images/Jaanilinn.jpg',400,299,'Ivangorod','http://www1.clikpic.com/haapsalu/images/Jaanilinn_thumb.jpg',130, 97,0, 0,'Ivangorod (Russia) as seen from the Estonian town Narva','','','','','');
photos[49] = new photo(748111,'58002','','gallery','http://www1.clikpic.com/haapsalu/images/Parnu.jpg',400,300,'Marina, Pärnu','http://www1.clikpic.com/haapsalu/images/Parnu_thumb.jpg',130, 98,0, 0,'The marina of Pärnu','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(57253,'748153,748152,748146,748145,748115,748103,748086,741865,741864,741856','Landscape','gallery');
galleries[1] = new gallery(57251,'748148,748098,747132,747115','Birds','gallery');
galleries[2] = new gallery(57256,'748154,747111,741863,741861','Flowers','gallery');
galleries[3] = new gallery(58005,'747130','Other wildlife','gallery');
galleries[4] = new gallery(57254,'748118,748094,748091,747109,747100,747098,741858,741857','Watchingtowers','gallery');
galleries[5] = new gallery(57998,'748151,748150,748123,748121,741867','Tallinn','gallery');
galleries[6] = new gallery(57999,'748143,748140,748135,748133,748131,748128,748108,748101,747126,741862','Saaremaa','gallery');
galleries[7] = new gallery(58001,'747120,747118,741866','Hiiumaa','gallery');
galleries[8] = new gallery(58002,'748111,747124,747116,741859','Other places','gallery');


