function pop_div_mutat(f,kw,kh,tip,tit)
{
	POPDIV.pop_div_mutat(f,kw,kh,tip,tit);
}

var POPDIV={
/////////////////
obj_PDid:"POPDIV",
obj_PDCid:"POPDIVCONTENTDIV",
need_animation: true, //true=igen; false=nem; 
/////////////////
temp_top:0,
temp_hided_selbox:[],

obj_PD:"undefined",
obj_PDC:"undefined",

pop_div_brObj: function() {
	if(document.getElementById)
	{
		this.obj_PD=document.getElementById(this.obj_PDid);
		this.obj_PDC=document.getElementById(this.obj_PDCid);
		return true;
	}
	else if(document.all && !window.opera)
	{
		this.obj_PD=document.all(this.obj_PDid);
		this.obj_PDC=document.all(this.obj_PDCid);
		return true;
	}
	else
	{
		alert('Az Ön böngészője nagyon elavult.\Használjon modernebb böngészőt!\npl. Internet Explorer 6+, Firefox, Opera...\n\nYour browser is too old.\nUse modern browser!\nLike:Explorer 7+, Firefox 3+, Opera 9+...');
		return false;
	}
},

pop_div_mutat: function (f,kw,kh,tip,tit)
{
	this.createDiv();
	
	this.pop_div_brObj();
	
	if(!this.obj_PD || !this.obj_PDC)
	{
		return;
	}

	kw=parseInt(kw);
	kh=parseInt(kh);
	
	this.obj_PD.style.display='block'; //látható!
	this.obj_PD.style.height=0;
	this.obj_PD.style.top=0;
	
	this.obj_PDC.style.display='block';
	this.obj_PDC.style.height=0;
	

	//méretek:
	var has_inner = typeof(window.innerWidth) == 'number';
	var has_element = document.documentElement && document.documentElement.clientWidth;

    	var w = has_inner ? window.innerWidth : has_element ? document.documentElement.clientWidth : document.body.clientWidth;
    	
    	var h = has_inner ? window.innerHeight : has_element ? document.documentElement.clientHeight : document.body.clientHeight;
    	
	var t = has_inner ? pageYOffset : has_element ? document.documentElement.scrollTop : document.body.scrollTop;
	
	//get scrollbar width:
	var scrw= this.getScrollerWidth();
	if(scrw>0)
	{
		var h=(h-scrw );
		var w=(w-scrw );
	}
	
	//save top position:
	this.temp_top=t;
	
	//scroll to top, left
	self.scrollTo(0, 0)

	//hide flash divs:
	var l=pop_div_tohide.length;
	var i=0;
	for(i=0;i<l;i++)
	{
		if(document.getElementById)
		{
			if(document.getElementById(pop_div_tohide[i])!=this.obj_PDid)
			{
				document.getElementById(pop_div_tohide[i]).style.display="none";
			}
		}
		else if(document.all)
		{
			if(document.all(pop_div_tohide[i])!=this.obj_PDid)
			{
				document.all(pop_div_tohide[i]).style.display="none";
			}
		}
	}//end for

	//hide and save selectboxes in IE6/IE5/IE4:
	if(document.all && !window.opera && typeof document.body.style.maxHeight == "undefined")
	{
		selects = document.all.tags('select');
		var i;
		var sl=selects.length;
		for(i=0;i<sl;i++)
		{
			if(selects[i].style.display!="none")
			{
				selects[i].style.display="none"
				this.temp_hided_selbox.push(selects[i]);
			}
		}//end for		
	}

	var cnt="<table id='POPDIV_cntTable' cellspacing='0' cellpadding='0' border='0' style='background-color:#fff;color:#000'>\n<tr>\n<td align='right' class='a10' style='padding:3px 10px 3px 0'><a href='javascript:void(0)' onclick='POPDIV.pop_div_rejt();return false' style='color:#00f'><span style='font-family:Arial;font-size:10px'>Bezár - Close</span><img src='img/popdivclose.png' width='20' height='20' border='0' style='margin-left:5px' align='middle' alt='bezár - close' title='bezár - close' /></a></td></tr>";
	
	//titel:
	if(!tit)
	{
		tit='';
	}
	
	tit=tit.replace(/\'/g,"&#039;");

	var alt_tit=tit.replace(/<br \/>/g," &bull; ")
	alt_tit=alt_tit.replace(/\[:sortores:\]/g," ")
	alt_tit=this.strip_tags(alt_tit);

	tit=tit.replace(/\[:sortores:\]/g,"<br />")		
	
	if(document.all && !window.opera)
	{
		alt_tit=alt_tit.replace(/<br \/>/g,"\n").replace(/<br>/g,"\n");
	}
	else
	{
		alt_tit=alt_tit.replace(/<br \/>/g," ").replace(/<br>/g," ");
	}
	
	switch(tip)
	{
		case 'iframe':
			cnt+="<tr><td><iframe src='"+f+"' width='"+kw+"' height='"+kh+"'  marginwidth='0' marginheight='0' frameborder='0' align='middle' scrolling=no style='padding:0'></iframe></td></tr>";
			break;

		case 'img':
			cnt+="<tr><td style='padding:0px 10px 0px 10px;text-align:center' align='center'><a href='javascript:void(0)' onclick='POPDIV.pop_div_rejt();return false'><img id='POPDIV_kep' src='"+f+"' width='"+kw+"' height='"+kh+"' border='0' alt='"+alt_tit+"' title='"+alt_tit+"' /></a></td></tr>";

			if(tit!="")
			{
				cnt+="<tr><td class='a12' align='center' style='width:"+(kw+20)+"px; padding:5px 0px 10px 0px'>"+tit+"</td></tr>";
			}
			else
			{
				cnt+="<tr><td style='width:"+(kw+20)+"px;line-height:10px'>&nbsp;</td></tr>";
			}
			cnt+="</table>\n";
			break;
	}

	this.obj_PDC.innerHTML=cnt;
	
	var bodyHeight=this.getBodySize().h;
	if(bodyHeight>0)
	{
		this.obj_PD.style.height=parseInt(bodyHeight,10)+'px';
	}	
	
	var full_kw=document.getElementById('POPDIV_cntTable').offsetWidth;
	var full_kh=document.getElementById('POPDIV_cntTable').offsetHeight;

	this.obj_PDC.style.width=parseInt(full_kw)+'px';
	this.obj_PDC.style.height=parseInt(full_kh)+'px';
	
	var kleft=( w/2 - (full_kw/2) )+'px';
	
	var ktop=( h/2 - (full_kh/2) );
	ktop = ktop>=10 ? (ktop+'px') : "10px";

	//pozicionálás, méretezés:
	this.obj_PDC.style.left=kleft;
	this.obj_PDC.style.top=ktop;
	
	//ha nagyobb a kép,mint a div:
	if(parseInt(this.obj_PD.style.height)<=full_kh)
	{
		this.obj_PD.style.height=(full_kh+100)+"px";
	}
	if(parseInt(this.obj_PD.style.width)<=full_kw)
	{
		this.obj_PD.style.width=(full_kw+100)+"px";
	}
	
	//opera hibajavítás:
	if(window.opera)
	{
		this.obj_PD.scrollIntoView(true);
	}
	
	//animation:
	if(this.need_animation)
	{
		document.getElementById('POPDIV_kep').style.width=0;
		document.getElementById('POPDIV_kep').style.height=0;
		
  		var uw=(kw/10);
  		var uh=(kh/10);
    		var rate=Math.round( Math.min( (100/(kw/60)),(100/(kh/60)) ) );		
		
		this.ani(kw,kh,uw,uh,rate);
	}
},

//***************
pop_div_rejt:function() {

	//kiürítés
	this.obj_PD.parentNode.removeChild(this.obj_PD);
	this.obj_PDC.parentNode.removeChild(this.obj_PDC);

	//scroll to temp_top
	self.scrollTo(0, this.temp_top);
	
	
	//Show hided selectboxes in IE6/IE5/IE4:
	if(document.all && !window.opera && typeof document.body.style.maxHeight == "undefined")
	{
		var i;
		var sl=this.temp_hided_selbox.length;
		for(i=0;i<sl;i++)
		{
			this.temp_hided_selbox[i].style.display="block"
		}		
	}
	//empty array
	this.temp_hided_selbox.splice(0,this.temp_hided_selbox.length) 
	
	
	//Show hided flash divs
	var l=pop_div_tohide.length;
	var i=0;
	for(i=0;i<l;i++)
	{
	
		if(document.getElementById)
		{
			if(document.getElementById(pop_div_tohide[i])!=this.obj_PDid)
			{
				document.getElementById(pop_div_tohide[i]).style.display="block";
			}
		}	
		else if(document.all)
		{
			if(document.all(pop_div_tohide[i])!=this.obj_PDid)
			{
				document.all(pop_div_tohide[i]).style.display="block";
			}
		}
	}
},


//*********
ani: function(kw,kh,uw,uh,rate){

		var s;
		if(document.getElementById)
  		{
			s=document.getElementById('POPDIV_kep').style;;
  		}
		else if(document.all && !window.opera)
  		{
			s=document.all('POPDIV_kep').style;;
  		}

  		var h=parseFloat(s.height);
  		var w=parseFloat(s.width);

		if ( w < kw || h < kh)
		{
    			s.width=(w+uw)>kw ? kw+'px' : (w+uw)+'px';
    			s.height=(h+uh)>kh ? kh+'px' : (h+uh)+'px';
    			var aniID = window.setTimeout("POPDIV.ani("+kw+","+kh+","+uw+","+uh+","+rate+")",rate);
    		}	
  		else
  		{
  			window.clearTimeout(aniID);  		
  		}
},

getScrollerWidth: function ()
{
    var scr = null;
    var inn = null;
    var wNoScroll = 0;
    var wScroll = 0;
    scr = document.createElement('div');
    scr.style.position = 'absolute';
    scr.style.top = '-1000px';
    scr.style.left = '-1000px';
    scr.style.width = '100px';
    scr.style.height = '50px';
    scr.style.overflow = 'hidden';
    inn = document.createElement('div');
    inn.style.width = '100%';
    inn.style.height = '200px';
    scr.appendChild(inn);
    document.body.appendChild(scr);
    wNoScroll = inn.offsetWidth;
    scr.style.overflow = 'auto';
    wScroll = inn.offsetWidth;
    document.body.removeChild(document.body.lastChild);
    return (wNoScroll - wScroll);
},

getBodySize: function()
{
	var bh=0;
	var bw=0;
	
	//Opera:
	if(window.opera)
	{
	
		bh=document.documentElement.scrollHeight;
		bw=document.documentElement.scrollWidth;
	}
	
	// Firefox:
	/**/
	else if( window.innerHeight && window.scrollMaxY ) 
	{
		bh = window.innerHeight + window.scrollMaxY;
		bw = window.innerWidth + window.scrollMaxX;
	}
	
	//all but Explorer Mac
	else if( document.body.scrollHeight > document.body.offsetHeight ) 
	{
		bh = document.body.scrollHeight;
		bw = document.body.scrollWidth;
	}
	//Explorer 6 Strict, Mozilla (not FF) and Safari
	else
	{
		bh = document.body.offsetHeight + document.body.offsetTop;
		bw = document.body.offsetWidth + document.body.offsetLeft;
	}
	
	return {w:bw,h:bh}
},


//Tartalék megoldás (nincs használva):
getDocHeight: function()
{
    	var D = document;
    	return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    	);
},

createDiv: function()
{
        if(document.getElementsByTagName("body"))
        {
        	var body = document.getElementsByTagName("body")[0];
        }
        else if(window.content.document.getElementsByTagName("body"))
        {
        	body = window.content.document.getElementsByTagName("body")[0];
        }
        else if(document.childNodes[1])
        {
        	body = document.childNodes[1];
        }
       
        var ujDiv = document.createElement("div");
        ujDiv.setAttribute("title", "Bezár");
        ujDiv.id=this.obj_PDid;
        ujDiv.onclick=function(){POPDIV.pop_div_rejt()}
	ujDiv.style.cursor='pointer';
	ujDiv.style.backgroundColor='#000';
	ujDiv.style.opacity=0.7;
	ujDiv.style.position='relative';
	ujDiv.style.filter='alpha(opacity=70)';
	ujDiv.style.width=this.getBodySize().w+"px";

	ujDiv.style.position='absolute';
	ujDiv.style.top='0';
	ujDiv.style.left='0';
	ujDiv.style.display='none';
	ujDiv.style.zIndex ='9998';

        var ujContDiv  = document.createElement('div');
       	ujContDiv.id=this.obj_PDCid;
       	ujContDiv.style.textAlign='center';
	ujContDiv.style.backgroundColor='#fff';
	ujContDiv.style.width='auto';
	ujContDiv.style.height='auto';
	ujContDiv.style.position='absolute';
	ujContDiv.style.top='10px';
	ujContDiv.style.left='0';
	ujContDiv.style.display='none';
	ujContDiv.style.zIndex ='9999';  

 	var firstEl=body.childNodes[0];
	body.insertBefore(ujDiv,firstEl);
	body.insertBefore(ujContDiv,firstEl);
},


strip_tags: function (str, allowed_tags)
{
    var key = '', allowed = false;
    var matches = [];
    var allowed_array = [];
    var allowed_tag = '';
    var i = 0;
    var k = '';
    var html = '';
 
    var replacer = function(search, replace, str)
    {
        return str.split(search).join(replace);
    };
 
    // Build allowes tags associative array
    if (allowed_tags)
    {
        allowed_array = allowed_tags.match(/([a-zA-Z]+)/gi);
    }

    str += '';
 
    // Match tags
    matches = str.match(/(<\/?[\S][^>]*>)/gi);
 
    // Go through all HTML tags
    for (key in matches) {
        if (isNaN(key)) {
            // IE7 Hack
            continue;
        }
 
        // Save HTML tag
        html = matches[key].toString();
 
        // Is tag not in allowed list? Remove from str!
        allowed = false;
 
        // Go through all allowed tags
        for (k in allowed_array) {
            // Init
            allowed_tag = allowed_array[k];
            i = -1;
 
            if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+'>');}
            if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+' ');}
            if (i != 0) { i = html.toLowerCase().indexOf('</'+allowed_tag)   ;}
 
            // Determine
            if (i == 0) {
                allowed = true;
                break;
            }
        }
 
        if (!allowed) {
            str = replacer(html, "", str); // Custom replace. No regexing
        }
    }
 
    return str;
}


};
