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="Close" onclick="alert2()">';}
	if(topic==null){topic='Message';}
	if(ablak==null){ablak=document.getElementById('alert2');}
	if(opa==null){opa=document.getElementById('szurkit');}
	
	if(opa.style.height==''){
		opacity = Number(60);
		
		koord=getXY();
		width=koord[0];
		height=koord[1];
		
		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();
	}else{
		opacity = Number(0);
		width='';
		height='';
		ablak.style.display="none";
	}
	
	opa.style.opacity = (opacity / 100);
	opa.style.MozOpacity = (opacity / 100);
	opa.style.KhtmlOpacity = (opacity / 100);
	opa.style.filter = "alpha(opacity=" + opacity + ")"; 
	opa.style.width=width;
	opa.style.height=height;
}

function center() {
	t=getScrollXY();
	obj=document.getElementById("alert2");
	
	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()",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 ];
}