externalLinks=function() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 

function fontresizeStart() {
  fontresizeShow();
  StyleActivate( CookieGet('preferences_fontsize') );
}

function fontresizeShow() {
  divId = "toolset";
  showWithNoImage(divId);
}

function StyleActivate( value ) {
  if (value == '') { return; }
  var i, lnk;
  for( i = 0; (lnk = document.getElementsByTagName("link")[i]); i++ ) {
    if ( lnk.getAttribute('rel').indexOf('style') != -1 && lnk.getAttribute('title') ) {
      lnk.disabled = true;
      if ( lnk.getAttribute('title') == value ) {
          lnk.disabled = false;
        }
    }
  }
}

function CookieSet(name,value) {
  document.cookie=name + "=" + escape(value) +
    ";expires=Thu Feb 10 2028 12:00:00 GMT+0100;path=/;domain=" + document.domain;
}

function StyleActual( prefix ) {
  var i, lnk;
  for( i = 0; (lnk = document.getElementsByTagName("link")[i]); i++ ) {
    if ( lnk.getAttribute('rel').indexOf('style') != -1 &&
         lnk.getAttribute('title') && !lnk.disabled ) {
        return lnk.getAttribute('title');
    }
  }
  return null;
}

function fontresizeEnd() {
  CookieSet( 'preferences_fontsize', StyleActual() );
}

function CookieGet( name ) {
  var name = name + "=";
  var cs = document.cookie.split(';');
  for (var i=0; i<cs.length; i++) {
    var c = cs[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
  }
  return null;
}

function printPage() {
  if (window.print) {
    setTimeout('window.print();', 200);
  }
  else if (agt.indexOf("mac") != -1) {
    alert("Az oldal nyomtatĂĄsĂĄhoz nyomd meg a 'Cmd+p' gombokat!");
  }
  else {
    alert("Az oldal nyomtatĂĄsĂĄhoz nyomd meg a 'Ctrl+p' gombokat!");
  }
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height, resizable, scrollbar)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar='+scrollbar+',resizable='+resizable+',copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function placeFocus(id)
{
	if (document.getElementById)
	{
		document.getElementById(id).focus();
	}
}


function showhide(divId,imageId, rootdir) {
	if (document.getElementById)
	{
		var id = document.getElementById(divId);
		var imgid = document.getElementById(imageId);
		var imgsrc = '';
	
		if (id.style.display == "none") {
			imgsrc = rootdir+'i/common/minus.gif';
			eval("id.style.display = 'block'");
			eval( "imgid.src = imgsrc");
		}
		else {
			imgsrc = rootdir+'i/common/plus.gif';
			eval("id.style.display = 'none'");
			eval( "imgid.src = imgsrc"); 
		}
	}
}

function showhideWithNoImage(divId) {
	if (document.getElementById)
	{
		var id = document.getElementById(divId);
	
		if (id)
		{
			if (id.style.display == "none") {
				eval("id.style.display = 'block'");
			}
			else {
				eval("id.style.display = 'none'");
			}
		}
	}
}

function showWithNoImage(divId) {
	if (document.getElementById)
	{
		var id = document.getElementById(divId);
	
		if (id)
		{
			if (id.style.display == "none") {
				eval("id.style.display = 'block'");
			}
		}
	}
}

function hideWithNoImage(divId) {
	if (document.getElementById)
	{
		var id = document.getElementById(divId);
		
		if (id)
		{
			if (id.style.display == "none") {
			}
			else {
				eval("id.style.display = 'none'");
			}
		}
	}
}

function showStep(step, maxStep){
	var i = 1;
	
	for(i = 1; i <= maxStep; i++)
	{
		if (step == i)
		{
			showWithNoImage('evsstep'+i);
		}
		else
		{
			hideWithNoImage('evsstep'+i);
		}
	}
}

function changePage(s)
{
	if (self.parent.frames.length != 0) self.parent.location=s;
}

