ie=(navigator.userAgent.toLowerCase().indexOf("msie")!=-1);d=document;
function $(a){return document.getElementById(a)}
function I(a){var i=0;while(a=a.previousSibling){++i};return i}
function T(a,b){b=b?$(b):document;return b.getElementsByTagName(a)}
function IHR(a,b){try{$(a).innerHTML=b}catch(e){}}
function IH(a){try{return $(a).innerHTML}catch(e){}}
function DV(a){try{return $(a).value}catch(e){}}
function DVR(a,b){try{$(a).value=b}catch(e){}}
function BD(a){return $(a).disabled}
function BDR(a,b){try{$(a).disabled=b?true:false}catch(e){}}
function Dhide(a,b,c){try{$(a).style.display=b?(c?c:'block'):'none'}catch(e){}}
function cI(a){clearInterval(a)}
function oP1(a,b){a=a.style;a.zoom=1;ie?a.filters.alpha.opacity=b:a.opacity=b/100}
function oP2(a,b){ie?a.filters.alpha.opacity=b:a.style.opacity=b/100}
function oP5(a,b){a.style.zoom=1;ie?a.style.filter="alpha(opacity="+b+")":a.style.opacity=b/100}
function oP(a,b){if(!ie)a.style.opacity=b/100}
function oP4(a,b){a=a.style;a.zoom=1;a.filter=(a.filter||'').replace(/alpha\([^\)]*\)/gi,"")+(b==1?"":" alpha(opacity="+b+")")}
Scroll={
	curr:0,
    move:function(){
		var a=Math.abs(this.obj.scrollTop-this.end);
		if(this.s<11){
			this.s+=1;
			a=Math.ceil(this.s/2);
		}else if(a<=30){
			a=Math.ceil((21-this.s)/2);
			this.s+=1;
		}else{
			var b=Math.abs(this.spd);
			a=a<30+b?a-30:b;
		}
		this.obj.scrollTop+=this.spd>0?a:(-a);
		if(a==0){
			this.obj.scrollTop=this.end;
			cI(this.intvl)
		}
    },
	ini:function(){
		cI(this.intvl);
		this.s=0;
		if(this.spd=Math.round((this.end-this.obj.scrollTop)/25))this.intvl=setInterval("Scroll.move()",20)
	}
}
function showCase(a,b){
	var c=$('nav').childNodes;
	if(b){
		b=b-1;
		a=c[b].firstChild;
	}else{
		a=ie?window.event.srcElement:a.target;
		if(a.nodeName.toLowerCase()!='a')return;
		b=I(a.parentNode);
	}
	var f=a.getAttribute('scroll');
	c[Scroll.curr].firstChild.className='';
	$('showcase').childNodes[Scroll.curr].className='';
	c[b].firstChild.className='active';
	$('showcase').childNodes[b].className='active';
	Scroll.obj=$('showcase');
	Scroll.end=f;
	Scroll.curr=b;
	Scroll.ini()
}
function nav(a){
	IHR('heading',$('heading-text').childNodes[a].innerHTML);
	var b = [",7,",",7,",",3,",",3,",",3,4,5,6,"];
	for(var i=1;i<8;i++){
		$('li'+i).style.display=b[a].search(','+i+',')==-1?'block':'none';
	}
	showCase('',1);
}
Zoom={
	ver:function(){
		this.obj.style.marginTop=245-this.cur*6+'px';
		this.obj2.style.height=20+this.cur*12+'px';
		this.cur+=1;
		if(this.cur==20){
			cI(this.intvl);
			this.cur=0;
			this.intvl=setInterval("Zoom.hor()",20)
		}
    },
	hor:function(){
		this.obj.style.width=100+this.cur*20+'px';
		this.cur+=1;
		if(this.cur==20){
			cI(this.intvl);
			Fade.ini('maintext');
		}
    },
	ini:function(){
		this.cur=0;
		this.obj=$('floatmain');
		this.obj2=$('floattext');
		cI(this.intvl);
		this.intvl=setInterval("Zoom.ver()",20)
		this.obj2.style.height='20px';
		this.obj.style.width='100px';
		Fade.ini('floatdiv');
	}
}
function sh_tabs(a,b){
	if(!b){
		a=ie?window.event.srcElement:a.target;
		if(a.nodeName.toLowerCase()!='a')return;
		a=a.href;
		b=a.indexOf('#layer-');
		b=a.substr(b+1);
	}
	IHR('maintext',IH(b));
	Dhide('maintext');
	Zoom.ini()
}
Fade={
	a:function(){
		this.cur+=1;
		oP(this.obj,this.cur*5);
//		this.obj.style.opacity=this.cur/20;
		if(this.cur==20){
			cI(this.intvl);
		}
    },
	b:function(){
		this.cur-=1;
		oP(this.obj,this.cur*5);
//		this.obj.style.opacity=this.cur/20;
		if(this.cur==0){
			this.obj.style.display='none';
			cI(this.intvl);
		}
    },
	ini:function(a,b){
		this.obj=$(a);
		if(!b){
			Dhide(a,1);
			oP(this.obj,0);
//			this.obj.style.opacity=0;
		}
		this.cur=b?20:0;
		if(ie)this.cur=b?1:19;
//		this.cur=b?20*this.obj.style.opacity:0;
		cI(this.intvl);
		this.intvl=setInterval(b?"Fade.b()":"Fade.a()",20)
	}
}
Glide={
	x:0,
	y:0,
	v:0,
	h:0,
	sc:function(){return this.v?this.o.scrollTop:this.o.scrollLeft},
	ver:function(){
		this.o.scrollTop+=this.v;
		if(Math.abs(this.o.scrollTop-this.end)<=Math.abs(this.v)){
			this.o.scrollTop=this.end;
			this.nxt();
		}
	},
	hor:function(){
		this.o.scrollLeft+=this.v;
		if(Math.abs(this.o.scrollLeft-this.end)<=Math.abs(this.v)){
			this.o.scrollLeft=this.end;
			this.nxt();
		}
	},
	ini:function(){
		this.intvl=setInterval(this.h?"Glide.hor()":"Glide.ver()",25);
	},
	nxt:function(){
		cI(this.intvl);
		var r=Math.ceil(Math.random()*2);
		if(Math.floor(Math.random()*2)){
			this.h=0;
			r+=this.y;
			this.v=r>2?(-2):2;
			this.y=r>2?r-3:r;
			this.end=this.y*138;
		}else{
			this.h=1;
			r+=this.x;
			this.v=r>2?(-2):2;
			this.x=r>2?r-3:r;
			this.end=this.x*228;
		}
		this.intvl=setTimeout("Glide.ini()",4000);
	},
	load:function(){
		this.o=$('glider');
		this.o.onmouseover=function(){cI(Glide.intvl);clearTimeout(Glide.intvl)};
		this.o.onmouseout=function(){Glide.ini()};
		this.nxt();
	}
}