 var browser_msie6=false;
 if ( (navigator.appName=='Microsoft Internet Explorer') && (navigator.appVersion.indexOf('MSIE 6')!=-1) ) browser_msie6=true;

 function set_Forms_Select_Element_Disabled(t){
   for ( i=0; i<document.forms.length; i++ ){
     for ( j=0; j<document.forms[i].length; j++ ){
       if ( document.forms[i][j].type=='select-one' ) document.forms[i][j].style.display=t;
     }
   }
 }

 function byId(id){
   return document.getElementById(id);
 }

 function byTagName(name){
   return document.getElementsByTagName(name);
 }

 function getWaitDiv_CenterPosition(){
   var windowWidth,windowHeight,xScroll,yScroll;
   var waitDiv_Width=508;
   var waitDiv_Height=363;

   // 1. lekerjuk a bongeszo ablak szelesseget es magassagat
   if ( self.innerHeight ){
     if ( document.documentElement.clientWidth ){
       windowWidth = document.documentElement.clientWidth; 
     }else{
         windowWidth = self.innerWidth;
      }
     windowHeight = self.innerHeight;
   }else if ( document.documentElement && document.documentElement.clientHeight ){
      windowWidth = document.documentElement.clientWidth;
      windowHeight = document.documentElement.clientHeight;
    }else if ( document.body ){
       windowWidth = document.body.clientWidth;
       windowHeight = document.body.clientHeight;
     }
   // 2. lekerjuk az aktualis page poziciojat, mennyit scrolloztunk
   if ( self.pageYOffset ){
     yScroll = self.pageYOffset;
     xScroll = self.pageXOffset;
   }else if ( document.documentElement && document.documentElement.scrollTop ){
      yScroll = document.documentElement.scrollTop;
      xScroll = document.documentElement.scrollLeft;
    }else if ( document.body ){
       yScroll = document.body.scrollTop;
       xScroll = document.body.scrollLeft; 
     }
   
   var center={
     x: Math.round(windowWidth/2)-Math.round(waitDiv_Width/2)+xScroll,
     y: Math.round(windowHeight/2)-Math.round(waitDiv_Height/2)+yScroll
   };
   return center;
 }


 function setVisibleOCommon(obj,value,type){
   if(obj!=null){
     if(type=='display'){
       obj.style.display=(value=='block' || value=='true' || value==true) ? 'block' : 'none';
     }
     else{
       obj.style.visibility = (value=='block' || value=='true' || value==true || value=='visible') ? 'visible':'hidden';
     }
   }
 }

 function setVisibleO(obj,value){
   setVisibleOCommon(obj,value,'display');
 }

 function openIndexDialog(){
   divwaitbg_height='100%';
   if ( browser_msie6 ){
     divwaitbg_height=document.body.clientHeight + 'px';
     set_Forms_Select_Element_Disabled('none');
   }
   var f=byId('divwait_iframe');
   var w=byId('divwait');
   var bg=byId('divwaitbg');
   f.style.height=divwaitbg_height;
   bg.style.height=divwaitbg_height;
   var c=getWaitDiv_CenterPosition();
   w.style.top = c.y+'px'; 
   w.style.left = c.x+'px';
   setVisibleO(w,true);
   setVisibleO(f,true);
   setVisibleO(bg,true);
 }
 
 function closeIndexDialog(){
   var f=byId('divwait_iframe');
   var w=byId('divwait');
   var bg=byId('divwaitbg');
   setVisibleO(w,false);
   setVisibleO(f,false);
   setVisibleO(bg,false);
   if ( browser_msie6 ) set_Forms_Select_Element_Disabled('');
 }

