function addEvent(in_Event, in_Element, in_Function)
{
	if(in_Element.addEventListener)
	{
		in_Element.addEventListener(in_Event, in_Function, false);
	}
	else if(in_Element.attachEvent)
	{
		f = function() {
			in_Function.call(in_Element);
		}
		in_Element.attachEvent('on'+in_Event, f);
	}
	else
	{
		eval('in_Element.on'+in_Event+' = in_Function;');
	}
}

function resizePhoto(e)
{
	if(window.bigPhoto)
	{
		//window.bigPhoto = 
		src = new String(window.bigPhoto.firstChild.getAttribute('src'));
		newSrc = src.replace('min=3', 'min=1');
		window.bigPhoto.firstChild.setAttribute('src', newSrc);
	}
	/*var big = document.getElementById('BigPhoto');
	var imgs = big.getElementsByTagName('img');
	if(!imgs['0'])
	{
		return false;
	}
	*/
	src = new String(this.firstChild.getAttribute('src'));
	newSrc = src.replace('min=1', 'min=3');
	//imgs['0'].setAttribute('src', newSrc);
	this.firstChild.setAttribute('src', newSrc);
	window.bigPhoto = this;
}

function addResizePhotos()
{
	var photos = document.getElementById('Photos');
	if(photos)
	{
		var img = photos.getElementsByTagName('img');
		var a = photos.getElementsByTagName('a');
		var href;
		s = a.length;
			
		for(i = 0; i < s; i++)
		{
			href = a[i].getAttribute('href');
			a[i].setAttribute('href', '#Big');
			addEvent('click', a[i], resizePhoto);
		}
	}
}

addEvent('load', window, addResizePhotos);

