//csodamegjelenéshez szükséges függvények, változók
function move_center(){
      $("object, embed").hide();
      $("#zar_popup").show();
      var screenw=$(window).width();
      var screenh=$(window).height();
      var containerw=$("#inner_popup").width();
      var containerh=$("#inner_popup").height();
      var left=(screenw/2)-(containerw/2);
      var top=(screenh/2)-(containerh/2);
      var h=$("body").height();
      if (left<0) left=0;
      if (top<0) top=0;
      $("#inner_popup").css({'margin-top' : top+'px'});
      $("#overlayer").css({'height' : h+20+'px'})
      $("#close").click(function(){
          $("#zar_popup").hide();
          $("object, embed").show();
      });
}

function stretch(id){
  sobj=document.getElementById(id);
  hoh=parseInt(document.getElementById('head').offsetHeight);
  foh=parseInt(document.getElementById('foot').offsetHeight);
  tmb=sobj.childNodes;
  max=0;
  for (var i=0; i<tmb.length; i++){
    oh=tmb[i].offsetHeight;
    if (oh>max) max=parseInt(oh);
  }
  sobj.style.height=hoh+foh+max+5+'px';
}

function abscenter(){
var id='container';
var kepszel = 0, kepmag = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    kepszel = window.innerWidth;
    kepmag = window.innerHeight;
  } 
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    kepszel = document.documentElement.clientWidth;
    kepmag = document.documentElement.clientHeight;
  } 
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    kepszel = document.body.clientWidth;
    kepmag = document.body.clientHeight;
  }
  
  maindiv=document.getElementById(id);
  divmag=maindiv.offsetHeight;
  divszel=maindiv.offsetWidth;
  
  document.body.style.height=maindiv.offsetHeight+"px";
  document.getElementById('validate').style.top=maindiv.offsetHeight+35+"px";
  document.getElementById('foot').style.top=maindiv.offsetHeight+"px";
  
  if (divmag<kepmag){
    maindiv.style.top=(parseInt((kepmag/2)-(divmag/2)))+"px";
  }
  else{
    maindiv.style.top="0px";
  }
  if (divszel<kepszel){
    maindiv.style.left=parseInt(((kepszel-Math.abs(kepszel-document.documentElement.scrollWidth))/2)-(divszel/2))+"px";
    maindiv.style.marginLeft="0px";
  }
  else{
    maindiv.style.left="0px";
    maindiv.style.marginLeft="0px";
  }
}

window.onresize=abscenter;
