// JavaScript Document

var smallImgDir = 'small/'; 




addListener( window, 'load', scrollScreen );	
function scrollScreen(){
	if( !isPage('archives') ) return;
	$('#scroller').children().each( function(){
		$(this).mouseover( function(){
			$(this).css({cursor:"pointer"});
		});
		$(this).mousedown( function(){
			var smallImgSrc = $(this).attr('src');
			var bigImgName = smallImgSrc.substring( smallImgSrc.indexOf(smallImgDir) + smallImgDir.length, smallImgSrc.length );
			var bigImgSrc = smallImgSrc.substring( 0, smallImgSrc.indexOf(smallImgDir)) + bigImgName;			
			$('#screen').html('<img src="'+ bigImgSrc +'" alt="" />');
		});
	});
}

function addListener( objet, evenement, action ){	
	if( document.addEventListener ){
		objet.addEventListener(evenement, action, false);
	}
	else if( document.attachEvent ){
		objet.attachEvent("on"+evenement, action);
	}
}

function removeListener(obj, evnt, fnct){	
	if( document.removeEventListener ){
		obj.removeEventListener(evnt, fnct, false);
	}
	else if( document.detachEvent ){
		obj.detachEvent('on'+evnt,fnct);	
	}	 
}

function isPage( id ){
	if( document.getElementsByTagName('body').item(0).id == id)
		return true;
	else
		return false;
}