//browser/platform checker
function duk_checkBrowser(){
	this.ver=navigator.appVersion;this.dom=document.getElementById?1:0;this.mac=(this.ver.indexOf("PPC")!= -1)?1:0;this.win=(this.ver.indexOf("Win")!= -1)?1:0;
	this.ie5up=(this.ver.indexOf("MSIE") && this.dom && parseInt(this.ver) >= 4) ?1:0;
	this.ie4=(document.all && !this.dom)?1:0; this.ie=(this.ie5up || this.ie4);
	this.ns5up=(this.ver.indexOf("MOZILLA") && this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0; this.ns=(this.ns4 || this.ns5up);
	this.duk=(this.ie || this.ns);
	return this;
}
duk=new duk_checkBrowser();
// reload the window if Nav4 resized //
function duk_reloadPage(init) { 
	if (init==true) with (navigator) {if (duk.ns) {
	    document.duk_pgW=innerWidth; document.duk_pgH=innerHeight; onresize=duk_reloadPage; }}
	else if (innerWidth!=document.duk_pgW || innerHeight!=document.duk_pgH) location.reload();
	}
duk_reloadPage(true);
//if(!duk.duk) location.href='sorry.html'
function duk_doc_size(){ //Page positions - needed!
	this.x=0;this.x2=duk.ie && document.body.offsetWidth-5||innerWidth||0;
	this.y=0;this.y2=duk.ie && document.body.offsetHeight-5||innerHeight||0;
	if(!this.x2||!this.y2) return message('Document has no width or height') 
	this.x50=this.x2/2;this.y50=this.y2/2;this.x10=(this.x2*10)/100;this.y10=(this.y2*10)/100
	return this;
}
function duk_message(txt){ //Error feedback function
	alert(txt);	return false;
}
//Default duk functions
function duk_obj(obj,nest){
	function duk_moveIt(x,y){ //Move to a spesified position
	        this.x=x;this.y=y;this.css.left=x;this.css.top=y;
	}
	function duk_moveBy(x,y){ //Move by a spesified number of pixels
	        this.moveIt(this.x+x,this.y+y)
	}
	function duk_showIt(){ //Show a layer
	        this.css.visibility="visible"
	}
	function duk_hideIt(){ //Hide a layer
	        this.css.visibility="hidden"
	}
	function duk_bg(color){ //Changing backgroundcolor
	        if(duk.dom || duk.ie4) this.css.backgroundColor=color
	        else if(duk.ns4) this.css.bgColor=color  
	}
	function duk_writeIt(text,startHTML,endHTML){  //Writing new content to a layer
	        if(duk.ns4){
	                if(!startHTML){startHTML=""; endHTML=""}
	                this.ref.open("text/html"); this.ref.write(startHTML+text+endHTML); this.ref.close()
	        }else this.evnt.innerHTML=text //NOTE: This only works on Explorer4+5 and Gecko M16+
	}
	function duk_clipTo(t,r,b,l,setwidth){ //Clip to a spesified setting
		this.ct=t; this.cr=r; this.cb=b; this.cl=l
		if(duk.ns4){
			this.css.clip.top=t;this.css.clip.right=r
			this.css.clip.bottom=b;this.css.clip.left=l
		}else{
			if(t<0)t=0;if(r<0)r=0;if(b<0)b=0;if(b<0)b=0
			this.css.clip="rect("+t+","+r+","+b+","+l+")";
			if(setwidth){this.css.width=r; this.css.height=b}
		}
	}
	function duk_clipBy(t,r,b,l,setwidth){ //Clip by a spesified number of pixels
		this.clipTo(this.ct+t,this.cr+r,this.cb+b,this.cl+l,setwidth)
	}
	if(!duk.duk) return message('Old browser')
	this.evnt=duk.dom && document.getElementById(obj)||duk.ie4 && document.all[obj]|| (nest?duk.ns4 && document[nest].document[obj]:duk.ns4 && document.layers[obj]);
	if(!this.evnt) return duk_message('The layer does not exist ('+obj+') - Exiting script\n\nIf your using Netscape please check the nesting of your tags!')
	this.css=duk.dom||duk.ie4?this.evnt.style:this.evnt;this.ref=duk.dom||duk.ie4?document:this.css.document;
	this.x=this.css.left||this.css.pixelLeft||this.evnt.offsetLeft||0;this.y=this.css.top||this.css.pixelTop||this.evnt.offsetTop||0
	this.w=this.ref.width||this.evnt.offsetWidth||this.css.pixelWidth||0;this.h=this.ref.height||this.evnt.offsetHeight||this.css.pixelHeight||0
	this.moveIt=duk_moveIt; this.moveBy=duk_moveBy;this.showIt=duk_showIt; this.hideIt=duk_hideIt;this.writeIt=duk_writeIt; this.bg=duk_bg;
	this.down=goDown;
	//Clip values
	this.c=0
	if((duk.dom || duk.ie4) && this.css.clip) {
		this.c=this.css.clip; this.c=this.c.slice(5,this.c.length-1); 
		this.c=this.c.split(' '); 
		for(var i=0;i<4;i++){this.c[i]=parseInt(this.c[i])}
	}
	this.ct=this.css.clip.top||this.c[0]||0;this.cr=this.css.clip.right||this.c[1]||this.w||0;
	this.cb=this.css.clip.bottom||this.c[2]||this.h||0;this.cl=this.css.clip.left||this.c[3]||0;
	this.clipTo=duk_clipTo;	this.clipBy=duk_clipBy;this.obj = obj + "Object";eval(this.obj + "=this");
	return this
}
var rollIt=0; // do not change
var loop, timer
//handles the scrolling and the pause
function goDown(move){
//alert(rollIt+","+oText.y);
	if (rollIt<=rollStop) {
		if(this.y>-conTent){
			this.moveIt(0,this.y-move)
				if(loop) { timer = setTimeout(this.obj+".down("+move+")",speed); }
				rollIt=rollIt+1;
		} else if (this.y<=-conTent){
			this.moveIt(0,-overflow);
			oText.down(move);
		}	
	} else {
		noScroll();
		setTimeout("scroll("+1+")",pause);
	}
}
//Calls the scrolling functions. Also checks whether the page is loaded or not.
function scroll(speed){
//alert(-oText.h+oCont.cb)
	if(loaded){
		loop=true;
		if(speed>0) oText.down(speed)
	}
}
//Stops the scrolling (called on mouseout)
function noScroll(){
	loop=false;
	clearTimeout(timer);
	rollIt=0;
}
//Makes the object
var loaded;
function scrollInit(){
	oCont=new duk_obj('divCont');
	oText=new duk_obj('divText','divCont');
	oText.moveIt(0,0);
	oCont.showIt();
	loaded=true;
}
//Call the init on page load
onload=scrollInit;
setTimeout("scroll("+1+")",pause);
