// global function calls by events ////////////////////////////////////////////////////
window.onresize=reloadWin;  
document.onmousedown = getPop;
document.onmousemove = movePop;
document.onmouseup = dropPop;

// global variables for moveable POPUPS ///////////////////////////////////////////////
var popObj = null;
var popMove = false;
var popX=0, popY=0;

///////////////////////////////////////////////////////////////////////////////////////
// Ultimate client-side JavaScript client sniff. Version 3.03                        //
// (C) Netscape Communications 1999-2001.  Permission granted to reuse and distribute./
// This is not a full version                                                        //
///////////////////////////////////////////////////////////////////////////////////////
var agt       = navigator.userAgent.toLowerCase();
var is_major  = parseInt(navigator.appVersion);
var is_minor  = parseFloat(navigator.appVersion);
var is_nav    = ((agt.indexOf("mozilla") != -1) && (agt.indexOf("spoofer") == -1) && 
                 (agt.indexOf("compatible") == -1) && (agt.indexOf("opera") == -1) && 
                 (agt.indexOf("webtv") == -1) && (agt.indexOf("hotjava") == -1));
var is_nav6up = (is_nav && (is_major >= 5));
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4") != -1));
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
// Above script have been chopped /////////////////////////////////////////////////////


// drop the popup obj /////////////////////////////////////////////////////////////////
function dropPop()
{
    if (popMove) { // chk popMove control
//        getObj("POP").style.overflow = "auto"; // note* ns has prob with auto overflow
//        getObj("POP").innerHTML = popObj.temp; // restor innerHTML

        popObj = null;
        popMove = false;
    }
}


// get pop layer //////////////////////////////////////////////////////////////////////
function getPop(e)
{
    if (popMove) { // chk popMove control
        popObj = getObj("popWin");

//        popObj.temp = getObj("POP").innerHTML; // remember pop innerhtml
//        getObj("POP").innerHTML = "&nbsp;"; // replace HTML to make it move faster
//        getObj("POP").style.overflow = "visible"; // ns has prob w overflow

        if (is_nav) { // if netscape
            popX=e.layerX;
            popY=e.layerY;
        } else if (is_ie) { // if ie
            popX=event.offsetX;
            popY=event.offsetY;
        }
        return false;
    }
}

// move the popup obj /////////////////////////////////////////////////////////////////
function movePop(e) {
    if (popObj) {
        if (is_nav) {
            popObj.style.left = e.pageX-popX;
            popObj.style.top = e.pageY-popY;
        } else if (is_ie) {
            popObj.style.left = event.clientX-popX + document.body.scrollLeft;
            popObj.style.top = event.clientY-popY + document.body.scrollTop;
            return false;
        }
    }
}


function verifyEventFilter(f) {
    var opt = 0;
   
    if (f.filter[0].checked) {
        if ((f.n.value>0) || (f.n.value<99)) {
           return true;
        } else {
           f.n.style.backgroundColor = "#dddddd";
           return false;
        }

    } else {

        if ((f.yr.value<2000) || (f.yr.value>2020)) {
            f.yr.style.backgroundColor = "#dddddd";
            return false;
        } else {
            switch (f.m.value.toUpperCase()) {
            case "JAN" : f.m.value = 1;  return true; break;
            case "FEB" : f.m.value = 2;  return true; break;
            case "MAR" : f.m.value = 3;  return true; break;
            case "APR" : f.m.value = 4;  return true; break;
            case "MAY" : f.m.value = 5;  return true; break;
            case "JUN" : f.m.value = 6;  return true; break;
            case "JUL" : f.m.value = 7;  return true; break;
            case "AUG" : f.m.value = 8;  return true; break;
            case "SEP" : f.m.value = 9;  return true; break;
            case "OCT" : f.m.value = 10; return true; break;
            case "NOV" : f.m.value = 11; return true; break;
            case "DEC" : f.m.value = 12; return true; break;
            default : 
                f.m.style.backgroundColor = "#dddddd";
                return false;
                break;
            }
        }
    }
}

function closePop(u)
{
    window.location = u+".asp?pop=0";
}

