var bV, NS4,NS6,IE4, ver4;
var popup;
bV = parseInt(navigator.appVersion);
NS4 = (document.layers) ? true : false;
IE4 = ((document.all)&&(bV>=4))?true:false;
NS6 = (document.getElementById) ? true : false;
ver4 = (NS4 || IE4) ? true : false;
isExpanded = false;

function getIndex(el) {
        ind = null;
        for (i=0; i<document.layers.length; i++) {
                whichEl = document.layers[i];
                if (whichEl.id == el) {
                        ind = i;
                        break;
                }
        }
        return ind;
}

function arrange() {
        nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
        for (i=firstInd+1; i<document.layers.length; i++) {
                whichEl = document.layers[i];
                if (whichEl.visibility != "hide") {
                        whichEl.pageY = nextY;
                        nextY += whichEl.document.height;
                }
        }
}

function initIt(){
        if (NS4) {
                for (i=0; i<document.layers.length; i++) {
                        whichEl = document.layers[i];
                        if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
                }
                arrange();
        }
        else {
           if (IE4==false) {
                 laenge = document.getElementsByTagName("DIV").length;
                 for (i=0; i < laenge; i++) {
                    tempColl = document.getElementsByTagName("DIV")[i];
                    if (tempColl.className = "child") tempColl.style.display = "none";
                 }
           }else{
                tempColl = document.all.tags("DIV");
                for (i=0; i<tempColl.length; i++) {
                        if (tempColl(i).className == "child") tempColl(i).style.display = "none";
                }
           }
        }
}

function expandIt(el) {
//        if (!ver4) return;
        if (IE4) {expandIE(el)} else {expandNS(el)}
}

function expandIE(el) {
        whichEl = eval(el + "Child");
        whichIm = event.srcElement;
        if (whichEl.style.display == "none") {
                whichEl.style.display = "block";
                whichIm.src = "/javascript/triUp.gif";
        }
        else {
                whichEl.style.display = "none";
                whichIm.src = "/javascript/triDown.gif";
        }
}

function expandNS(el) {
    if (NS6) {
        whichEl = document.getElementById(el + "Child");
        whichIm = document.getElementById(el + "Parent").getElementsByTagName("img")[0];
        if (whichEl.style.display == "none") {
                  whichEl.style.display = "block";
                  whichIm.src = "/javascript/triUp.gif";
        }
        else {
                 whichEl.style.display = "none";
                 whichIm.src = "/javascript/triDown.gif";
        }
        arrange();
    }else{
        whichEl = eval("document." + el + "Child");
        whichIm = eval("document." + el + "Parent.document.images['imEx']");
        if (whichEl.style.visibility == "hide") {
                whichEl.style.visibility = "show";
                whichIm.src = "/javascript/triUp.gif";
        }
        else {
                whichEl.style.visibility = "hide";
                whichIm.src = "/javascript/triDown.gif";
        }
        arrange();
    }
}

function showAll() {
        for (i=firstInd; i<document.layers.length; i++) {
                whichEl = document.layers[i];
                whichEl.visibility = "show";
        }
}

function expandAll(isBot) {
        newSrc = (isExpanded) ? "/javascript/triDown.gif" : "/javascript/triUp.gif";

        if (NS4) {
        document.images["imEx"].src = newSrc;
                for (i=firstInd; i<document.layers.length; i++) {
                        whichEl = document.layers[i];
                        if (whichEl.id.indexOf("Parent") != -1) {
                                whichEl.document.images["imEx"].src = newSrc;
                        }
                        if (whichEl.id.indexOf("Child") != -1) {
                                whichEl.visibility = (isExpanded) ? "hide" : "show";
                        }
                }

                arrange();
                if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY);
        }
        else {
                divColl = document.all.tags("DIV");
                for (i=0; i<divColl.length; i++) {
                        if (divColl(i).className == "child") {
                                divColl(i).style.display = (isExpanded) ? "none" : "block";
                        }
                }
                imColl = document.images.item("imEx");
                for (i=0; i<imColl.length; i++) {
                        imColl(i).src = newSrc;
                }
        }

        isExpanded = !isExpanded;
}

with (document) {
        write("<STYLE TYPE='text/css'>");
        if (NS4) {
                write(".parent {position:absolute; visibility:hidden}");
                write(".child {position:absolute; visibility:hidden}");
                write(".regular {position:absolute; visibility:hidden}")
        }
        else {
                write(".child {display:none}")
        }
        write("</STYLE>");
}

function pop(i) {
   if(popup){
     popup.close();
   }
   L=window.screenLeft+190;
   T=window.screenTop-20;
   popup=window.open("../popup/popup.php?G=" + i +"&SW=" + screen.width ,"popwindow","width=1,height=1,left=" + L + ",top=" + T + ",dependent=yes,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");
}

onload = initIt;


