function setPhotos()
{
	try
	{
		var photos = $('photoHolder').getElementsByTagName('img');
		for(var i=0; i<photos.length; i++)
		{
			photos[i].onclick = function()
			{		
				$('main_image').className += ' hidden' ;
				$('kep_link').href = this.src.replace('/k_kep','/kep');	
				$('main_image').onload = function()
				{
					new resizeImage(this,$('kep_link'),{width:300, height:200});
					this.className = this.className.replace(' hidden','');
				}
				$('main_image').src = this.src.replace('/k_kep','/kep');
			}
			photos[i].style.cursor = 'pointer';
		}
		setFirst(photos[0]);
	}
	catch(e){}
}

function setFirst(img)
{
	try
	{
		$('kep_link').href = img.src.replace('/k_kep','/kep');	
		$('main_image').onload = function()
		{
			new resizeImage(this,$('kep_link'),{width:300, height:200});
		}
		$('main_image').src = img.src.replace('/k_kep','/kep');
	}
	catch(e){}
}

function setSWFLayer()
{
	try
	{
		new showOnMap('photo','photoHolder','photo_shadow','closephoto');
		var mapDragger = new Dragger([['photoHolder']]);
	}
	catch(e){}
}

function setPanorama()
{
	if($('panorama'))
	{
		$('panorama').onclick = function()
		{
			
			var layer = $('windowHolder');	
			
			if(!SWFHidden)
			{			
				SWFHidden = true;
				Scroller.setPosition(layer, 810,635);
				layer.style.display = 'block';
				layer.style.visibility = 'visible';							
			}
			else
			{	
				Scroller.setPosition(layer, 810,635);			
				layer.style.visibility = 'visible';					
			}	

			new showOnMap('photo','windowHolder','photo_shadow','closewindow');
			var mapDragger = new Dragger([['windowHolder']]);
		}
	}
}

var SWFHidden = false;

window.onload = function()
{	
	setPhotos();
	setPanorama();	
}
