function todo(){
	this.action=new Array();
	this.execute=function(){for(var i in this.action){
		try{todo.action[i]();}catch(er){alert('todo >> "'+er.message+'" in "'+er.fileName+'" on "'+er.lineNumber+'"');}
	}};
	var onLoadAction=function(o){return function(){o.execute();}}(this);
	if(typeof document.attachEvent!='undefined')window.attachEvent('onload',onLoadAction);
	else window.addEventListener('load',onLoadAction,false);
};

todo.prototype.onload=function(func){this.action[this.action.length]=func;};
todo=new todo();

function openWindow(name, href, width, height, scrollbar){
	FLS=window.open(href, name, "width="+width+", height="+height+",scrollbars="+scrollbar+", resizable=no,left=100,top=100");
	FLS.focus();
return false;
}

function viewPhoto(img_number, next){
    if(next == 'next'){
	if(images[(current_image+1)])
	    current_image++;
	else
	    current_image = 0;
    }
    else if(next == 'prev'){
	if(images[(current_image-1)])
	    current_image--;
	else
	    current_image=(images.length-1);
    }else
	current_image = img_number;

    if(images[current_image]){
	var img_box = document.getElementById('position-image-box');
	document.getElementById('position-image-title-box').innerHTML = image_title[current_image];
	if(document.getElementById('position-image-link-box'))
	    document.getElementById('position-image-link-box').href = image_link[current_image];
	$(img_box).animate(
	    {opacity: 0}, 300,
		function(){
		  img_box.src = images[current_image].src;
		  $(img_box).animate(
			{opacity: 1}, 300,
			function(){});
		});
    }
    return false;
}

