window.onload=function(){

/*
document.getElementById('photo_link1').onclick=showPhoto;
document.getElementById('photo_link2').onclick=showPhoto;
document.getElementById('photo_link3').onclick=showPhoto;

document.getElementById('video_link1').onclick=showVideo;
document.getElementById('video_link2').onclick=showVideo;
*/


var atags = document.getElementsByTagName('a');
for(i=0;i<atags.length;i++)
	{
		if(atags[i].getAttribute('class') == 'video_link')
		{
			atags[i].onclick=showVideo;
		}
		if(atags[i].getAttribute('class') == 'photo_link')
		{
			atags[i].onclick=showPhoto;
		}
	}

function showPhoto()
	{
		var file = this.getAttribute('href');
		document.getElementById('photo_box').innerHTML='<img src="'+file+'">';
		return false;
	}

function showVideo()
	{
		var code_num = this.getAttribute('rel');
		var new_video=document.getElementById('video_box'+code_num).innerHTML;
		document.getElementById('video_box').innerHTML=new_video;
		return false;
	}
};
