var win = null;
function CenterWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
        settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',status=1';
	win = window.open(mypage,myname,settings)
}

var CurOn = new Image(); CurOn.src = "img/curon.gif";
var CurOff = new Image(); CurOff.src = "img/curoff.gif";
function NavMouseOver(imgID)
{
  document[imgID].src = CurOn.src;
}
function NavMouseOut(imgID)
{
  document[imgID].src = CurOff.src;
}


var twnd;
function tw(present,codetov) {
  var w = 300;
  var h = 150;
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no';
  if ( ! twnd || twnd.closed ) {
         twnd = window.open('eg.php?tp='+present+'&idt='+codetov,'',settings);
         } 
          else { twnd.focus(); 
                 twnd.location = 'eg.php?tp='+present+'&idt='+codetov;
         }
}


var twndcomp;
function opentw2(group) {
  var w = 700;
  var h = 450;
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes';
  if ( ! twndcomp || twndcomp.closed ) {
         var cnt = document.CH.length;
         var params = "";
         for (var i = 0; i<cnt; ++i ) {
           if (document.CH[i].name="choice") {
              if (document.CH[i].checked) {
               params=params + "&choice[]="+document.CH[i].value;
              }
           }
         }
         var ff = document.CH[0].checked;
         twndcomp = window.open('compare.php?group='+group+params,'',settings);
         } 
          else { twndcomp.focus(); 
                 twndcomp.location = 'compare.php?group='+group+params;
         }
}


var wintov;
function tovWindow(codetov,mypage,myname,w,h,scroll){
        var mypage = "";
        var myname = "MyWin";
        var w = 300;
        var h = 100;
        scroll = "no";
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
        settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll
        if ( ! wintov || wintov.closed ) {
               wintov = window.open('a.php?tov='+codetov,'',settings);
               // wintov.document.write("<html><body>ddddddd</body></html>");
         } 
          else { wintov.focus(); 
                 wintov.location = 'a.php?'+codetov;
         }
          
}
