var size = 7;
	var currentPic = 1;
	
	// Event Handlers (from quirksmode.org)
	//
	function addEvent( obj, type, fn )
	{
		if (obj.addEventListener)
			obj.addEventListener( type, fn, false );
		else if (obj.attachEvent)
		{
			obj["e"+type+fn] = fn;
			obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
			obj.attachEvent( "on"+type, obj[type+fn] );
		}
	}

	function removeEvent( obj, type, fn )
	{
		if (obj.removeEventListener)
			obj.removeEventListener( type, fn, false );
		else if (obj.detachEvent)
		{
			obj.detachEvent( "on"+type, obj[type+fn] );
			obj[type+fn] = null;
			obj["e"+type+fn] = null;
		}
	}
	

	// Forward button action
	//
	forward = function(){
		
		if(window.currentPic != window.size){
			var nextPic = window.currentPic + 1;
			var nextClass = 'pic_' + nextPic;
			document.getElementById('big_picture').className = nextClass; 
			window.currentPic++;
		}
		else
		{
			var nextPic = 1;
			var nextClass = 'pic_' + nextPic;
			document.getElementById('big_picture').className = nextClass; 
			window.currentPic=1;
		}
	};
	
	// Back button action
	//
	back = function(){
		
		if(window.currentPic != 1){
			var nextPic = window.currentPic - 1;
			var nextClass = 'pic_' + nextPic;
			document.getElementById('big_picture').className = nextClass; 
			window.currentPic--;
		}
		else
		{
			var nextPic = window.size;
			var nextClass = 'pic_' + nextPic;
			document.getElementById('big_picture').className = nextClass; 
			window.currentPic=window.size;
		}
	};
	
	load = function(){

		addEvent( document.getElementById('gal_right'), 'click', function(){ forward(); });		
		addEvent( document.getElementById('gal_left'), 'click', function(){ back(); });
		
	};