/**
---------------------------------------------------------------------------------------------
        EplosNET 3.0.0 PHP keretrendszer 2001-2006
---------------------------------------------------------------------------------------------
	DIV-ek kapcsolgatása
	Példa:
	<div id='menu_01' style="display:block"><a href="javascript:bekapcs('menu_02')">Menü_02</a></div>
	<div id='menu_02' style="display:none">Menü 02</div>
---------------------------------------------------------------------------------------------
*/
var stateCookieName="HunPressState";
var current_idx='';
var protect_idx='';

function bekapcs(id) {
	var obj=document.getElementById(id);
	if(obj!=null) obj.style.display='';
	current_idx=id;
}
function kikapcs(id) {
	var obj=document.getElementById(id);
	if(id!=protect_idx && obj!=null) obj.style.display='none';
	//current_idx='';
}

function switchtab(id){
	var e;
	//e=document.getElementById("tab1"); e.style.display = "none";
	//e=document.getElementById("tab2"); e.style.display = "none";
	//e=document.getElementById("tab3"); e.style.display = "none";
	//e=document.getElementById(id); e.style.display = "block";
	//current_tab=id;
}

function GetCookie(name)
{
    var index = document.cookie.indexOf(name + "=");
    if (index == -1) return null;
    index = document.cookie.indexOf("=", index) + 1;
    var endstr = document.cookie.indexOf(";", index);
    if (endstr == -1) endstr = document.cookie.length;
    return unescape(document.cookie.substring(index, endstr));
}
                                         
function SetCookie(cookieName,cookieValue,nDays)
{
 var today = new Date();
 var expire = new Date();
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString();
}

function SaveState()
{
	SetCookie(stateCookieName,protect_idx,1);
}

function LoadState()
{
	var str=GetCookie(stateCookieName);
	current_idx=str;
	protect_idx=str;
	bekapcs(current_idx);
}

function setprotect(id)
{
	var tmp=protect_idx;
	protect_idx=id;
	kikapcs(tmp);
}

function gotopage(url)
{
	protect_idx=current_idx;
	SaveState();
	document.location.href=url;
}
/**
---------------------------------------------------------------------------------------------
	PopUpImage
---------------------------------------------------------------------------------------------
*/
function PopUpImage(imageURL2,imageWidth2,imageHeight2,imageURL,imageWidth,imageHeight) {

	if (imageURL2) imageURL = imageURL2;
	if (imageWidth2) imageWidth = imageWidth2;
	if (imageHeight2) imageHeight = imageHeight2;
	
	if (imageURL){
		var posLeft=window.screen.width/2 - imageWidth/2;
		var posTop=window.screen.height/2 - imageHeight/2;

		newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
		newWindow.document.open();
		newWindow.document.write('<htm'+'l><t'+'itle>Hungaropress.hu</t'+'itle><bo'+'dy bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');
		newWindow.document.write('<img s'+'rc="'+imageURL+'" width='+imageWidth+' height='+imageHeight+'>');
		newWindow.document.write('</b'+'ody></ht'+'ml>');
		newWindow.document.close();
		newWindow.focus();
	}
}
/**
---------------------------------------------------------------------------------------------
        EplosNET 3.0.0 PHP keretrendszer 2001-2006
        Kancsal Zoltán - mail: kancsal.zoltan@proaction.hu
---------------------------------------------------------------------------------------------
	Javascript oldal nyomtatás - használatához kell egy <DIV id='printReady'>...</DIV>
---------------------------------------------------------------------------------------------
*/
function printSpecial()
{                                                                                                                      
if (document.getElementById != null)                                                                                   
{                                                                                                                      
	var html = '<HTML><HEAD>';                                                                                             
	var printreadyElem = document.getElementById("printready");                                                            
	if (printreadyElem != null)                                                                                            
	{                                                                                                                      
		var headTags = document.getElementsByTagName("head");                                                                  
		if (headTags.length > 0){
			html += headTags[0].innerHTML;                                                                                 
			var r=headTags[0].innerHTML.match(/[^\'\"\=]+\.css/);                                                          
			if(r){                                                                                                         
			if (window.XMLHttpRequest) {                                                                                   
				http_request = new XMLHttpRequest();                                                                       
				if (http_request.overrideMimeType) http_request.overrideMimeType('text/css');                              
			} else if (window.ActiveXObject) {                                                                             
				try {                                                                                                      
					http_request = new ActiveXObject("Msxml2.XMLHTTP");                                                    
				} catch (e) {                                                                                              
					try {                                                                                                  
						http_request = new ActiveXObject("Microsoft.XMLHTTP");                                             
					} catch (e) {r=0;}
				}                                                                                                          
																														   
			} else r=0;
			if(r){
				http_request.open('GET', r, false);                                                                            
				http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");                            
				http_request.send(null);                                                                                       
				html+=(http_request.status==200?"\n<STYLE type='text/css'>\n"+http_request.responseText+'\n</STYLE>\n':'');    
			}
			}                                                                                                              
		}                                                                                                                      
		html += '</HE' + 'AD><BOD' + 'Y leftmargin="20" topmargin="20" marginwidth="20" marginheight="20" rightmargin="20" bottommargin="20" onload="setTimeout(\'window.print();\',100);">';                                                                                  
		html += printreadyElem.innerHTML;                                                                                      
	}                                                                                                                      
	else                                                                                                                   
	{                                                                                                                      
		alert("Az oldalnak nem létezik nyomtatható verziója!\nCould not find the printable version of this page");             
		return;                                                                                                                
	}                                                                                                                      
																														   
	html += '</BO' + 'DY></HT' + 'ML>';                          
																														   
	var printWin = window.open("","printSpecial","width=650, height=650, menubar=1, toolbar=1, location=0,status=0,scrollbars=1");                                                                                               
	printWin.document.open();                                                                                              
	printWin.document.write(html);                                                                                         
	printWin.document.close();                                                                                             
	}
}                                                                                                                      

/**
---------------------------------------------------------------------------------------------
        EplosNET 3.0.0 PHP keretrendszer 2001-2006
---------------------------------------------------------------------------------------------
	Javascript - képcsere
	
	példa:
	<a href="#" title="Mentornak" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menu02','','images/hdr_menu_02a.gif',1)">
	<img src="images/hdr_menu_02.gif" border="0" name="menu02"/>
	</a>
	
---------------------------------------------------------------------------------------------
*/
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
MM_preloadImages('menu_head_01a.gif','menu_head_02a.gif','menu_head_03a.gif','menu_head_04a.gif','menu_head_05a.gif','menu_head_06a.gif','menu_head_07a.gif','lang_en_a.gif','lang_hu_a.gif','tab1_arrow.gif','tab2_arrow.gif','tab3_arrow.gif')

var gAutoPrint = true; 
function printSpecial() 
{ 
	if (document.getElementById != null){ 
		var html = '<HTML><HEAD>'; 
		if (document.getElementsByTagName != null){ 
			var headTags = document.getElementsByTagName("head"); 
			if (headTags.length > 0) html += headTags[0].innerHTML; 
		} 
		html += '</HE' + 'AD><BOD' + 'Y class="printext" leftmargin="30" style="background-color:#ffffff;" topmargin="30" marginwidth="30" marginheight="30" rightmargin="30" bottommargin="30">'; 
		var printreadyElem = document.getElementById("printready"); 
		if (printreadyElem != null){ 
			html += printreadyElem.innerHTML; 
		}else{ 
			alert("Az oldalnak nem létezik nyomtatható verziója! Could not find the print version of this page!"); 
			return; 
		} 
		html += '<script type=text/javascript>document.print();</'+'script></BO' + 'DY></HT' + 'ML>'; 
		var printWin = window.open("","printSpecial","width=600, height=400, menubar=1, toolbar=1, location=0,status=0,scrollbars=1"); 
		printWin.document.open(); 
		printWin.document.write(html); 
		printWin.document.close(); 
		if (gAutoPrint) 
			printWin.print(); 
	}else{  
		alert("Az Ön böngészője sajnos nem támogatja a nyomtatási funkciót! Sorry, the print ready feature is only available in modern browsers!"); 
	} 
}

/**
---------------------------------------------------------------------------------------------
        EplosNET 3.0.0 PHP keretrendszer 2001-2006
        Baldaszti Zoltan - mail: baldaszti.zoltan@proaction.hu
---------------------------------------------------------------------------------------------
	Javascript DIV ablak
---------------------------------------------------------------------------------------------
*/
var active = 0, coordsX=0,coordsY=0,dragWind;
function divwin_close(){
	dragWind.style.display='none';
}
function divwin_open(url, windowId, x, y, w, h){
	dragWind = document.getElementById('window'+windowId);
	if(dragWind==null){
		allWin = document.getElementById("windows");
		if(allWin==null) alert("Please insert <DIV id='windows'></DIV> in your code.");
		allWin.innerHTML+="<div id='window"+windowId+"' class='wins'><IFRAME id='container"+windowId+"' width=100% height=100% src='' frameborder=0 scrolling=no></IFRAME></div>";
		dragWind = document.getElementById('window'+windowId);
	}
	dragCont = document.getElementById('container'+windowId);
	dragCont.src = url;
	dragWind.style.display = 'block';
	dragWind.style.top = y;
	dragWind.style.left = x;
	dragWind.style.width = w;
	dragWind.style.height = h;
	dragWind.style.zIndex = 10;
}
document.onmouseup = new Function("active=0");
document.onselectstart = new Function("return false");