﻿ var WinWidth = 0;
 var WinHeight = 0 ;
 var WinScrollHeight = 0 ;
 var backhref ;
 
 function WOpen(hrefPage)
 {
 if (navigator.userAgent.indexOf('Safari') != -1) 
 {
    window.open(hrefPage,"_blank",'top=70,left=150;toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=750,height=800');
    backhref = hrefPage ;
    return false;
 }else{
    GetWinSize()
    var PopWidth = parseInt(document.getElementById('adPopup').style.width);
    var PopHeight = parseInt(document.getElementById('adPopup').style.height);
    var leftPos = (WinWidth - PopWidth)/2 ;
//    var topPos = (WinHeight - PopHeight)/2 ;
    document.getElementById('BigDiv').style.display = "inline";
    document.getElementById('BigDiv').style.width = screen.availWidth + "px";
    document.getElementById('BigDiv').style.height = screen.availHeight + WinScrollHeight + "px";
    document.getElementById('BigDiv').style.top = "0px";
    document.getElementById('BigDiv').style.left = "-20px";
    document.getElementById('adPopup').style.left=leftPos + "px";
    document.getElementById('adPopup').style.top= "50px";
    document.getElementById('frmContent').src = hrefPage ;
    backhref = hrefPage ;
    Effect.Grow('adPopup'); 
    return false;
 }
 }
 function EnlarImgCliked()
 {
 if (parent.document.getElementById('backSynop'))
    {
        parent.document.getElementById('backSynop').style.display = "inline";
        parent.document.getElementById('closewin').style.display = "none";
    }
 }
 function WBack()
 {
    document.getElementById('frmContent').src = backhref ;
    parent.document.getElementById('backSynop').style.display = "none";
    parent.document.getElementById('closewin').style.display = "inline";
 }
 function WClose()
 {
    document.getElementById('adPopup').style.display = "none" 
    document.getElementById('BigDiv').style.display = "none";   
    return false;
 }
 function GetWinSize() 
 {
  if( typeof( window.innerWidth ) == 'number' ) 
  {
    //Non-IE
    WinWidth = window.innerWidth;
    WinHeight = window.innerHeight;
    WinScrollHeight = document.body.scrollHeight;
    document.documentElement.scrollTop=0 ;
    document.body.scrollTop=0 ;
  } 
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    WinWidth = document.documentElement.clientWidth;
    WinHeight = document.documentElement.clientHeight ;
    WinScrollHeight = document.body.scrollHeight ;
    document.documentElement.scrollTop=0;
  } 
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    WinWidth = document.body.clientWidth;
    WinHeight = document.body.clientHeight;
    WinScrollHeight = document.body.scrollHeight ;
    document.documentElement.scrollTop=0;
  }
 }