﻿// JScript File


function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
}

is = new BrowserCheck()


function verifyCompatibleBrowser()
{ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 

bw=new verifyCompatibleBrowser() 

var initialised; 

function InitialiseScrollableArea()
{ 
    objContainer2=new ConstructObject2('divContainer') ;
    objScroller2=new ConstructObject2('divContent','divContainer') ;
    objScroller2.MoveArea(0,0) ;
    objContainer2.css.visibility='visible' ;

    initialised=true;
} 

// sajat scrollozas


var speed2=20
var stop=false;

function ConstructObject2(obj,nest)
{ 
    nest=(!nest) ? '':'document.'+nest+'.' ;
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight ;
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight ;
    this.up=MoveAreaUp2;
    this.down=MoveAreaDown2; 
    this.pos=1;
    this.MoveArea=MoveArea; 
    this.x; 
    this.y; 
    this.obj = obj + "Object" ;
    eval(this.obj + "=this") ;
    return this 
} 

function over()
{
	stop=true;
}

function out()
{
	stop=false;
}

function PerformScroll2(speed)
{ 
	if (initialised)
	{ 
		loop2=true; 
		if(speed>0)
		{ 
			objScroller2.down(speed) ;
		}                  
		else 
		{
			objScroller2.up(speed);
		} 
	} 
} 
 
function CeaseScroll2()
{ 
    loop2=false ;
    if(timer) clearTimeout(timer) ;
} 

function MoveAreaDown2(move)
{ 
	if(this.y>-this.scrollHeight+objContainer2.clipHeight)
	{ 
		if (!stop)
		{
			this.MoveArea(0,this.y-move);
		}
		if(loop2) setTimeout(this.obj+".down("+move+")",speed2);

	}
	else
	{
		pause(-1);
	}
	 
} 

function MoveAreaUp2(move)
{ 
	if(this.y<0)
	{
		if (!stop)
		{
			this.MoveArea(0,this.y-move) ;
		}
		if(loop2) setTimeout(this.obj+".up("+move+")",speed2) ;

	} 
	else
	{
		pause(1);
	}

} 


function start()
{
	pause(1);
//	PerformScroll2(1);
}


function pause(dir) 
{
	var irany = eval(dir);
	if (irany==-1) {myTimer=setTimeout("fel()", 3000);}
	else {myTimer=setTimeout("le()", 3000);}
}


function fel() 
{
	clearTimeout(myTimer) ;	
	PerformScroll2(-1);
}

function le() 
{
	clearTimeout(myTimer) ;	
	PerformScroll2(1);
}

function MoveArea(x,y)
{ 
    this.x=x;
    this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
} 


function lenyit(id, root)
{
    var img=document.getElementById('le_'+id);
    var doboz=document.getElementById('div_'+id);

    if (doboz.style.display=='none')
    {
        doboz.style.display='block';
        img.src=root + "img/minusz.gif";
    }
    else
    {
        doboz.style.display='none';
        img.src=root + "img/plusz.gif";
    }
   
}

function lenyit_reszletek(id)
{
    var doboz=document.getElementById('div_'+id);

    if (doboz.style.display=='none')
    {
        doboz.style.display='block';
    }
    else
    {
        doboz.style.display='none';
    }
   
}

function biztos()
{
    return confirm ("Biztos törölni akarja?");
}


