function Flash(){this.movie="";this.img="";this.width="";this.height="";this.alt="";this.bgcolor="transparent";this.ver=7;this.link="";this.tracker="";this.ie=((navigator.userAgent.toLowerCase().indexOf("opera")==-1)&&navigator.appName=="Microsoft Internet Explorer")?true:false;this.className="";this.id="";this.urlparam="url";this.target="_blank";this.install=false;this.flashvars=null}
Flash.prototype.iF=function(i){if(!this.ie)return true;try{var a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);return true}catch(e){return false}}
Flash.prototype.write=function(m,w,h,a,b){var o=this.HTML(m,w,h,a,b);document.write(o)}
Flash.prototype.param=function(n,v){return '<param name="'+n+'" value="'+v+'" />';}
Flash.prototype.writeBanner=function(i,w,h,l,t,b){this.preBanner(i,null,w,h,l,t,b);var lnk=(this.link==null||this.link=="")?false:true;this.movie=this.img.slice(0,this.img.lastIndexOf('.'))+".swf"+((lnk)?"?"+this.urlparam+"="+escape(this.link):"");this.write();}
Flash.prototype.writeBannerAlt=function(i,m,w,h,l,t,b){this.preBanner(i,m,w,h,l,t,b);var lnk=(this.link==null||this.link=="")?false:true;if(m!=null&&m!='')this.movie=m+((lnk)?"?"+this.urlparam+"="+escape(this.link):"");this.write();}
Flash.prototype.preBanner=function(i,m,w,h,l,t,b){if(i!=null&&i!="")this.img=i;if(l!=null&&l!="")this.link=l;if(t!=null&&t!="")this.tracker=t;if(w!=null&&w!="")this.width=w;if(h!=null&&h!="")this.height=h;if(b!=null&&b!="")this.bgcolor=b;var lnk=(this.link==null||this.link=="")?false:true;if(lnk&&(this.tracker!=null&&this.tracker!=""))this.link=this.tracker+escape(this.link);var a='<img src="'+this.img+'" width="'+this.width+'" height="'+this.height+'" alt="" border="0" class="'+this.className+'" />';this.alt=((!lnk)?a:'<a href="'+this.link+'" target="'+this.target+'">'+a+'</a>');}
Flash.prototype.HTML=function(m,w,h,a,b){if(m!=null&&m!="")this.movie=m;if(w!=null&&w!="")this.width=w;if(h!=null&&h!="")this.height=h;if(a!=null&&a!="")this.alt=a;if(b!=null&&b!="")this.bgcolor=b;var ci=(this.ie)?' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"':'';var p=(this.ie&&this.install)?' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.ver+',0,0,0"':'';var o;var z=this.iF(this.ver);var z1=this.iF(1);if (this.movie!=null&&this.movie!=""&&(this.install||(z1&&z)||(!z1&&!z)))o='<object type="application/x-shockwave-flash" data="'+this.movie+'" width="'+this.width+'" height="'+this.height+'"'+ci+p+' id="'+this.id+'" class="'+this.className+'" >'+this.param("movie",this.movie)+((this.flashvars!=null)?this.param("flashvars",this.flashvars):"")+this.param("quality","high")+this.param("menu","false")+((this.bgcolor=="transparent")?this.param("wmode","transparent"):this.param("bgcolor",this.bgcolor))+this.alt+'</object>';else o=this.alt;return o}
Flash.prototype.writeTo=function(id,m,w,h,a,b){var el=document.getElementById(id);if(el)el.innerHTML=this.HTML(m,w,h,a,b)}

function preload(){
	document.write('<div id="preload">');
	for(var i=0;arguments[i];i++){
		document.write('<img src="'+arguments[i]+'" height="1" width="1" />');
	}
	document.write('</div>');
}


var lastHelp=null;
function help_init(){
	var help=document.getElementById('help');
	help.className='help-data';
	var h=help.getElementsByTagName('h4');
	for(var i=0;h[i];i++){
		h[i].onclick=function(){help_open(this)}
		h[i].className='a';
		h[i].id="_"+h[i].id;
	}
	var help_cont=document.getElementById('help-sub');
	help_cont.className='help-sub';
	help_hash();
	//setInterval(help_hash,400);
}

function help_hash(){
	var b=null;
	var a=location.hash.substr(1);
	if(a)b=document.getElementById("_"+a);
	help_open(b);
}

function help_open(el){
	var hidebc=false;
	if(!el){
		var help=document.getElementById('help');
		var h=help.getElementsByTagName('h4');
		el=h[0];
		hidebc=true;
	}
	if(el==lastHelp)return false;

	el.className='active';
	if(lastHelp)lastHelp.className='a';
	var help_data=el.nextSibling;
	var help_cont=document.getElementById('help-sub');
	while(help_cont.childNodes[0])help_cont.removeChild(help_cont.childNodes[0]);
	var bc=document.createElement('div');
	bc.innerHTML='<a href="#" onclick="help_open();return false">Help</a> > ';
	bc.appendChild(el.childNodes[0].cloneNode(true))
	bc.className="bc";
	var h1=document.createElement('h1');
	h1.appendChild(el.childNodes[0].cloneNode(true))
	if(!hidebc)help_cont.appendChild(bc);
	help_cont.appendChild(h1);
	help_cont.appendChild(help_data.cloneNode(true));
	var a=el.id.substr(1);
	if(a)location.href="#"+a;

	lastHelp=el;
}

var Scroller={parent_id:'scroll-box',duration:500,scroll:function(el,parent_id){if(!parent_id)parent_id=Scroller.parent_id;var parent=(typeof(parent_id)=="string")?document.getElementById(parent_id):parent_id;var id;if(typeof(el)=="string")id=el;else{id=el.href.substr(el.href.lastIndexOf("#")+1);try{el.blur()}catch(e){};}var target=document.getElementById(id);var ft=parent.scrollTop;var fl=parent.scrollLeft;var fh=parent.offsetHeight;var tt=target.offsetTop;var tl=target.offsetLeft;var th=target.offsetHeight;var ts=(new Date).getTime();var timer=null;var doscroll=function(){var ta = (new Date).getTime();if (ta >= Scroller.duration+ts) {clearTimeout(timer);parent.scrollTop=tt;parent.scrollLeft=tl;parent.style.height=target.offsetHeight+"px"}else{var p = (ta - ts) / Scroller.duration;var st = ((Math.cos(p*Math.PI)/2) + 0.5) * (ft-tt) + tt;var sl = ((Math.cos(p*Math.PI)/2) + 0.5) * (fl-tl) + tl;parent.scrollTop=st;parent.scrollLeft=sl;if(fh!=th){var sh = ((Math.cos(p*Math.PI)/2) + 0.5) * (fh-th) + th;parent.style.height=sh+"px";}timer=setTimeout(doscroll,10);}};doscroll();return false;}}

function scrollTo(el,init){
	var a=document.getElementById('tab-links').getElementsByTagName('a');
	var id;
	if(typeof(el)=="string")id=el.replace(/^_/,"");
	else{id=el.href.substr(el.href.lastIndexOf("#")+1)};
	for(var i=0;i<a.length;i++){
		if(id==a[i].href.substr(a[i].href.lastIndexOf("#")+1))a[i].className+=" active";
		else a[i].className=a[i].className.replace(/[\s]*active/g,"");
	}

	if(!init)if(a)location.href="#_"+id;

	return Scroller.scroll((typeof(el)=="string")?id:el);
}

function scrollInit(){
	var a=location.hash.substr(1);
	if(a=="")a="easy";
	scrollTo(a,true);
}

function fixPNG(){
	var a=document.getElementsByTagName('img');
	for(var i=0;i<a.length;i++)
		if(a[i].src.search(/\.png/)!=-1){
			a[i].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + a[i].src + "', sizingMethod='scale')";
			a[i].style.width=a[i].offsetWidth+"px";
			a[i].style.height=a[i].offsetHeight+"px";
			a[i].src='img/blank.gif';
		}
}