window.onload = function(){
document.getElementById('img').style.opacity = 0;
}
function img_active(img){
	var old_img = img.src;
	var new_img = old_img.replace(/off/g,'active');
	img.src = new_img;
}
function img_off(img){
	var old_img = img.src;
	var new_img = old_img.replace(/active/g,'off');
	img.src = new_img;
}
var pop = null;
function popdown() {
  if (pop && !pop.closed) pop.close();
}
function popup(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 150;  // 150px*150px is the default size
  h = (h) ? h += 25 : 150;
  var args = 'width='+w+',height='+h+',resizable';
  popdown();
  pop = window.open(url,'',args);
  return (pop) ? false : true;
}
window.onunload = popdown;
window.onfocus = popdown;

function fadeIn(){
	var attr_show = { 
		opacity: { 
			from: 0,
			to: 1 
		}
	};
	var anim = new YAHOO.util.Anim('img', attr_show);
	anim.duration = 1;
	anim.animate();
}
function fadeOut(link){
	var attr_hide = { 
		opacity: { 
			from: 1,
			to: 0 
		}
	};
	
	var anim = new YAHOO.util.Anim('img', attr_hide);
	anim.duration = 1;
	changePage = function() {
		if(typeof link == 'string'){
			document.getElementById('bigimg').src = link.substring(7);
			window.setTimeout('fadeIn()',500);
		}else{
			top.location.href = link.href;
		}
	}
	anim.onComplete.subscribe(changePage);
	anim.animate();
	return false;
}

function changeimg(newimg){
	fadeOut('notlink' + newimg.href);
	return false;
}