function alert2(uzi, gomb, topic, ablak, opa){
	//ha nem adunk meg ablakot, akkor az alert2 lesz az alapértelmezett, illetve a szurkit és a gomb is
	if(gomb==null) {gomb  = '<p class="c" style="margin-top: 5px"><input class="alert2_gomb" type="button" value="Ok" onclick="alert2()">';}
	if(topic==null){topic = 'Üzenet';}
	if(ablak==null){ablak = document.getElementById('alert2');}
	if(opa==null)  {opa=document.getElementById('szurkit');}
	
	//Ha az alert nem látszik
	if(opa.style.height==''){
		alert_opacity = Number(60);
		
		koord=getXY();
		width  = koord[0];
		height = koord[1]*2;
		
		height2=document.body.offsetHeight;
		if(height2>height){height=height2;}
		width+='px';
		height+='px';
		
		document.getElementById('alert2_topic').innerHTML=topic;
		document.getElementById('alert2_uzi').innerHTML=uzi+gomb;
		document.getElementById('alert2_uzi').className="uzi";
		ablak.style.display = "";
		center('alert2');
	//Egyébként ha van üzenet, akkor még ne tűntessük el, csak a tartalmat cseréljük
	}else if(uzi){
		document.getElementById('alert2_topic').innerHTML=topic;
		document.getElementById('alert2_uzi').innerHTML=uzi+gomb;
		document.getElementById('alert2_uzi').className="uzi";
	//Egyébként meg "bezárjuk"
	}else{
		alert_opacity = Number(0);
		width  = '';
		height = '';
		ablak.style.display = "none";
	}
	
	opa.style.opacity = (alert_opacity / 100);
	opa.style.Mozopacity = (alert_opacity / 100);
	opa.style.Khtmlopacity = (alert_opacity / 100);
	opa.style.filter = "alpha(opacity=" + alert_opacity + ")"; 
	opa.style.width=width;
	opa.style.height=height;
}

function center(id) {
	t=getScrollXY();
	obj=document.getElementById(id);
	
	if (self.innerHeight){
		obj.style.top= ( parseInt( (self.innerHeight/2) - (parseInt(obj.style.height)/2) ) + t[1])+'px';
		obj.style.left=( parseInt( (self.innerWidth/2) - (parseInt(obj.style.width)/2) ) + t[0])+'px';	
	}else if(document.documentElement && document.documentElement.clientHeight){
		obj.style.top= ( parseInt( (document.documentElement.clientHeight/2) - (parseInt(obj.style.height)/2) ) + t[1]);
		obj.style.left=( parseInt( (document.documentElement.clientWidth/2) - (parseInt(obj.style.width)/2) ) + t[0]);
	}else if (document.body){
		obj.style.top= ( parseInt( (document.body.clientWidth/2) - (parseInt(obj.style.height)/2) ) + t[1])+'px';
		obj.style.left=( parseInt( (document.body.clientWidth/2) - (parseInt(obj.style.width)/2) ) + t[0])+'px';
	}
	
	window.setTimeout("center('"+id+"')",50);
}

function getXY(){
	if (self.innerHeight){
		width = self.innerWidth;
		height = self.innerHeight;
	}else if (document.documentElement && document.documentElement.clientHeight){
		width = document.documentElement.clientWidth;
		height = document.documentElement.clientHeight;
	}else if (document.body){
		width = document.body.clientWidth;
		height = document.body.clientHeight;
	}
	
	return [width, height];
}

function getScrollXY() {
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	return [ scrOfX, scrOfY ];
}
