// <!--
/*
    Popup(url,w,h)             
    PopupFull(url)
    PopupSamePage(url,w,h)
    PopupDialog(url,w,h)

*/



b=WhichBrowser();
v=WhichVersion(b);
files = new Array(0,"N/A","N/A","N/A","N/A","N/A");

function WhichBrowser(){
  var b="BR";
  var ua="UA";ua=navigator.userAgent;
  if((ua.indexOf('Mozilla')!= -1)&&((ua.indexOf('Spoofer')==-1)&&(ua.indexOf('compatible')==-1))){b="NS"}
  else if(ua.indexOf("MSIE")!=-1){b="IE"}
  else if(ua.indexOf("NAV")!=-1){b="Navio"}
  else if(ua.indexOf("Opera")!=-1){b="Opera"}
  else if(ua.indexOf("Microsoft URL Control")!= -1){b="IE"}
  return b
}

function WhichVersion(b){
  var v=0;
  v=navigator.appVersion.substring(0,1);
  ((b=="IE")||(b=="NS")) ? (parseInt(v)) : v= 0 ;
  return v;
}


function Popup(url,popW,popH) {

//-b=WhichBrowser();
//-v=WhichVersion(b);
    
  //n='POPUP';w=popW;h=popH;  
  n='';w=popW;h=popH;  

  //-((b=='IE')||(b=='NS')) ? parseInt(v) : v=0;
 //- if ((b=='IE')||(v==2)) {
 
    l=(screen.width-w)/2 ;   // sent to screen center
    t=(screen.height-h)/2;
    
 //- }
  o = 'width='+w+',height='+h+',resizable=1,status=0,left='+l+',top='+t+',scrollbars=1,toolbar=0,location=0,directories=0';
 
  //-if ((b=='IE')||(v==2)) {
    window.open(url,n,o)
 //- } else {
  //-  w1=window.open(url,n,'');
  //-  w1.focus();
  //-}
}


function PopupFull(url) {

b=WhichBrowser();
v=WhichVersion(b);
    
  //n='POPUP';w=popW;h=popH;  
  n='';

  ((b=='IE')||(b=='NS')) ? parseInt(v) : v=0;
  w=screen.width ;
  h=screen.height;
  o = 'width='+w+',height='+h+',left=0,top=0,resizable=1,status=0,scrollbars=1,toolbar=1,location=1,directories=1,menubar=1';
 
  if ((b=='IE')||(v==2)) {
    window.open(url,n,o)
  } else {
    w1=window.open(url,n,'');
    w1.focus();
  }
}





function PopupSamePage(url,popW,popH) {

//-b=WhichBrowser();
//-v=WhichVersion(b);
    
  //n='POPUP';w=popW;h=popH;  
  n='POPUP';w=popW;h=popH;  

  //-((b=='IE')||(b=='NS')) ? parseInt(v) : v=0;
  //-if ((b=='IE')||(v==2)) {
 
    l=(screen.width-w)/2 ;   // sent to screen center
    t=(screen.height-h)/2;
    
 //- }
  o = 'width='+w+',height='+h+',resizable=1,status=0,left='+l+',top='+t+',scrollbars=1,toolbar=0,location=0,directories=0';
  
  window.open(url,n,o)
  
 //- if ((b=='IE')||(v==2)) {
   //- window.open(url,n,o)
  //-} else {
 //-   w1=window.open(url,n,'');
    //window.open(url, "HelpWindow", "width=600,height=400,resizable=yes,scrollbars=yes");
  //-  w1.focus();
//-  }
 // alert("Hi");
}


function PopupSamePageWithName(url,popW,popH,titleName) {

//-b=WhichBrowser();
//-v=WhichVersion(b);
    
  //n='POPUP';w=popW;h=popH;  
  n=titleName;w=popW;h=popH;  

  //-((b=='IE')||(b=='NS')) ? parseInt(v) : v=0;
  //-if ((b=='IE')||(v==2)) {
 
    l=(screen.width-w)/2 ;   // sent to screen center
    t=(screen.height-h)/2;
    
 //- }
  o = 'width='+w+',height='+h+',resizable=1,status=0,left='+l+',top='+t+',scrollbars=0,toolbar=0,location=0,directories=0';
  
  window.open(url,n,o)
  
 //- if ((b=='IE')||(v==2)) {
   //- window.open(url,n,o)
  //-} else {
 //-   w1=window.open(url,n,'');
    //window.open(url, "HelpWindow", "width=600,height=400,resizable=yes,scrollbars=yes");
  //-  w1.focus();
//-  }
 // alert("Hi");
}


function EditBlockSamePage(url,popW,popH) {

//-b=WhichBrowser();
//-v=WhichVersion(b);
    
  //n='POPUP';w=popW;h=popH;  
  n='EditBlock';w=popW;h=popH;  

  //-((b=='IE')||(b=='NS')) ? parseInt(v) : v=0;
  //-if ((b=='IE')||(v==2)) {
 
    l=(screen.width-w)/2 ;   // sent to screen center
    t=(screen.height-h)/2;
    
 //- }
  o = 'width='+w+',height='+h+',resizable=1,status=0,left='+l+',top='+t+',scrollbars=1,toolbar=0,location=0,directories=0';
  
  window.open(url,n,o)
  
 //- if ((b=='IE')||(v==2)) {
   //- window.open(url,n,o)
  //-} else {
 //-   w1=window.open(url,n,'');
    //window.open(url, "HelpWindow", "width=600,height=400,resizable=yes,scrollbars=yes");
  //-  w1.focus();
//-  }
 // alert("Hi");
}



function PopupDialog(url,popW,popH) {

b=WhichBrowser();
v=WhichVersion(b);
    
  //n='POPUP';w=popW;h=popH;  
  n='';w=popW;h=popH;  

  ((b=='IE')||(b=='NS')) ? parseInt(v) : v=0;
  if ((b=='IE')||(v==2)) {
 
    l=(screen.width-w)/2 ;   // sent to screen center
    t=(screen.height-h)/2;
    
  }
  // dialogHeight=450px;dialogWidth=220px;status=no
  o = 'dialogHeight='+h+'px;dialogWidth='+w+'px;status=no;scrollbars=no';
 
  if ((b=='IE')||(v==2)) {
    //window.open(url,n,o)
       window.showModalDialog(url,n,o);
  } else {
    w1=window.showModalDialog(url,n,o);
    w1.focus();
  }
}
