v3 = 0; op = 0; ie4  = 0; ie5 = 0; nn4 = 0; nn6 = 0; isMac = 0;

popupWin = 0;
   
if(document.images){
    if(navigator.userAgent.indexOf("Opera") != -1){
        op = 1;
    } else {
        ie4 = (document.all && !document.getElementById);
        nn4 = (document.layers);
        ie5 = (document.all && document.getElementById);
        nn6 = (document.addEventListener);
    }
} else {
    v3 = 1;    
}

if(navigator.userAgent.indexOf("Mac") != -1){
    isMac = 1;
}

// start the actual code for an alert

function alert_confirm(){
    if(ie4 || ie5){
        // if its IE4+ call the VB Script 
        retVal = makeMsgBox ("Delete record","Are you sure?",32,1,256,4096);
      
        // which button was pressed?
        if(retVal == 1)
        {
           document.grid.grid_delete.value = "Delete";
           document.grid.submit();
        }
    } else {
        // else use a simple alert
        alert("I am not IE");
    }
}

function set_current_rec (pk)
{
   document.grid.current_rec.value = pk;
}

function popupfoto (url, width, height)
{
   if(popupWin) {
      if(!popupWin.closed) popupWin.close();
   }   
   popupWin=window.open(url,'','scrollbars=no,status=no,width=' + width + ',height=' + height);
}

function popup (url, width, height)
{
   if(popupWin) {
      if(!popupWin.closed) popupWin.close();
   }   
   popupWin=window.open(url,'','scrollbars=no,status=no,width=' + width + ',height=' + height);
}

function popup2 (url, width, height)
{
   
   popup2=window.open(url,'help','resizable=yes,scrollbars=yes,status=no,width=' + width + ',height=' + height);
}

function resetphoto ()
{
   document.paspoort.manager_photo.src = "images/empty_photo.gif";
   document.paspoort.p_photo_url.value = "";
}
