
if(!window.Fish)
{
	window.Fish=new Object();
}

Fish.InfoPane=new function()
{
	var me=this;
	var se=null;
	var t=null;
	var dly=4;
	var tm=1;
	var st=0;
	var w=window;
	if(w.ipFadeSecs)
	{
		tm=w.ipFadeSecs;
	}
	if(w.ipDelaySecs)
	{
		dly=w.ipDelaySecs;
	}

function E(id)
{
	return document.getElementById(id);
}

function ol()
{
	if(!se&&ct())
	{
		res();
	}
}
function init()
{
	if(!se)
	{
		var ss=E('slideshow');
		if(ss)
		{
			se=fc(ss);
			if(se)
			{
				ss.onmousemove=pause;
				ss.onfilterchange=trans;
			}
		}
	}
}

function uninit()
{
	var ss=E('slideshow');
	if(ss)
	{
		ss.onfilterchange=null;
		ss.onmousemove=null;
	}
}

function hide()
{
	st=1;
	var ss=E('slideshow');
	if(ss.filters&&ss.filters[0])
	{
		f(ss,0);
	}
	else
	{
		h();
		t=w.setTimeout(trans,tm*1000/4);
	}
}

function trans()
{
	if(st==1)
	{
		st=2;
		se=ns(se);
		var ss=E('slideshow');
		if(ss.filters&&ss.filters[0])
		{
			f(ss,1);
		}
		else
		{
			s();
			res();
		}
	}
	else if(st==2)
	{
		res();
	}
}

function res()
{
	st=0;
	t=w.setTimeout(hide,dly*1000);
}

function ct()
{
	w.clearTimeout(t);
	init();
	return(se!==null);
}

function f(ss,v)
{
	ss.filters[0].apply();
	(v?s():h());
	ss.filters[0].play(duration=tm);
}

function s()
{
	se.style.display="block";
}

function h()
{
	se.style.display="none";
}

function pause()
{
	if(!st)
	{
		if(ct())
		{
			res();
		}
	}
}

function fc(p)
{
	var n=p.firstChild;
	while(n&&n.nodeType!=1)
	{
		n=n.nextSibling;
	}
	return n;
}

function lc(p)
{
	var n=p.lastChild;
	while(n&&n.nodeType!=1)
	{
		n=n.previousSibling;
	}
	return n;
}

function pe(n)
{
	var p=n.parentNode;
	while(p&&p.nodeType!=1)
	{
		p=p.parentNode;
	}
	return p;
}

function ns(n)
{
	var s=n.nextSibling;
	while(s&&s.nodeType!=1)
	{
		s=s.nextSibling;
	}
	if(!s)
	{
		s=fc(pe(n));
	}
	return s;
}

function ps(n)
{
	var s=n.previousSibling;
	while(s&&s.nodeType!=1)
	{
		s=s.previousSibling;
	}
	if(!s)
	{
		s=lc(pe(n));
	}
	return s;
}

this.Flip=function(r)
{
	if(!st)
	{
		if(ct())
		{
			h();
			se=(r?ps(se):ns(se));
			s();
			res();
		}
	}
	if(w.event)
	{
		w.event.returnValue=false;
	}
	return false;
};

this.oncreate=function()
{
	if(w.attachEvent)
	{
		w.attachEvent("onload",ol);
		w.attachEvent("onunload",me.ondestroy);
	}
	else
	{
		w.addEventListener("load",ol,false);
	}
};

this.ondestroy=function()
{
	if(w.detachEvent)
	{
		w.detachEvent("onunload",me.ondestroy);
		w.detachEvent("onload",ol);
		uninit();
	}
};

this.oncreate();
return this;
};

function flip(r)
{
	if(Fish&&Fish.InfoPane)
	{
		Fish.InfoPane.Flip(r);
	}
}
