window.name='complex';
function win_popup(name,w,h)
{
        var p=window.open(name,'pop_win',"width="+w+",height="+h+",top=0,left=0,location=0,toolbar=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,fullscreen=0");
        if(p)p.focus();
        return false;
}

function zoom(file){
        var p=window.open('/zoom.plx?file='+file,'preview_window',"width=10,height=10,top=0,left=0,location=0,toolbar=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,fullscreen=0");
        if(p)p.focus();
return false;
}

function zoomIT(id){
        var p=window.open('/zoomIT.plx?id='+id,'preview_window',"width=10,height=10,top=0,left=0,location=0,toolbar=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,fullscreen=0");
        if(p)p.focus();
return false;
}

function showMyFrame(url) {
 var p=window.open(url,'pop_win',"width=800,height=600,top=0,left=0,location=0,toolbar=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,fullscreen=0");
 if(p)p.focus();
 return false;
}

var el, timer;
function bannerMove(){
   var isSafari = (navigator.appVersion.indexOf( "Safari" ) > -1);
   var w  = el.offsetWidth; //parseInt(document.defaultView.getComputedStyle(el,null).getPropertyValue('width')),
       h  = el.offsetHeight; //parseInt(document.defaultView.getComputedStyle(el,null).getPropertyValue('height')),
       sw = isSafari ? window.innerWidth : document.body.clientWidth,
       sh = isSafari ? window.innerHeight : document.body.clientHeight;
   el.style.left = ( sw - w )/2;
   el.style.top  = ( sh - h )/2 + document.body.scrollTop;

}


function showBanner(){
   el = document.getElementById('banner');
   if( el ) {
      el.style.visibility='';
      bannerMove()
      if( window.addEventListener  ) {
         window.addEventListener('resize', bannerMove, false)
         window.addEventListener('scroll', bannerMove, false)
      } else {
         window.attachEvent( 'onresize', bannerMove );
         window.attachEvent( 'onscroll', bannerMove );
      }
      timeout = parseInt(timeout);
      if( timeout > 0 ) timer = setTimeout( hideBanner, 1000*timeout );
   }
   return true;
}


function hideBanner(){
   clearTimeout(timer);
   if( el ) el.style.display='none';
   if( window.removeEventListener  ) {
      window.removeEventListener('resize', bannerMove, false)
      window.removeEventListener('scroll', bannerMove, false)
   } else {
      window.detachEvent( 'onresize', bannerMove );
      window.detachEvent( 'onscroll', bannerMove );
   }
   return true;
}

if( window.addEventListener  ) {
   window.addEventListener( 'load', showBanner, false );
} else {
   window.attachEvent( 'onload', showBanner );
}