<!--
function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
    var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//
function isLayerShows(layer) {
    //
    var obj;

    //
    if(!isEmpty(layer)) {
        //
        obj = document.getElementById(layer);
        return (obj.style.display == 'block');
    }    

    return false;
}

//
function showLayer(layer) {
    //
    var obj;

    //
    if(!isEmpty(layer)) {
        //
        obj = document.getElementById(layer);
        obj.style.display = 'block';
    }    
}
//
function showLayers(layerIDStartWith) {
    //
    var tags;   // layer tags

    if(!isEmpty(layerIDStartWith)) {
        // create object of all div tags in the document
        tags = document.getElementsByTagName('DIV');

        for(var x=0; x<tags.length; x++) {
            try {
                if(tags[x].getAttribute("id").indexOf(layerIDStartWith) > -1) {
                    tags[x].style.display="block";
                }    
            } catch(err) {}
        }    
    }        
}

//
function hideLayer(layer) {
    //
    var obj;

    //
    if(!isEmpty(layer)) {
        //
        obj = document.getElementById(layer);
        obj.style.display = 'none';
    }    
}
//
function hideLayers(layerIDStartWith) {
    //
    var tags;   // layer tags

    if(!isEmpty(layerIDStartWith)) {
        // create object of all div tags in the document
        tags = document.getElementsByTagName('DIV');

        for(var x=0; x<tags.length; x++) {
            if(tags[x].getAttribute("id").indexOf(layerIDStartWith) > -1) {
                tags[x].style.display="none";
            }    
        }    
    }        
}

//
function showHideLayer(layer) {
    //
    var obj;

    //
    if(!isEmpty(layer)) {
        //
        obj = document.getElementById(layer);

        if(obj.style.display == 'none') {
            obj.style.display = 'block';
        } else {
            obj.style.display = 'none';
        }
    }    
}

//
function showHideLayers(layer, imgID, imgName) {
    //
    var obj;

    //
    if(!isEmpty(layer) && !isEmpty(imgID)) {
        //
        obj = document.getElementById(layer);

        if(obj.style.display == 'none') {
            obj.style.display = 'block';
            document.images[imgID].src = "/images/" + imgName + "_on.gif";
        } else {
            obj.style.display = 'none';
            document.images[imgID].src = "/images/" + imgName + "_off.gif";
        }
    }    
}

//
function showLayerHideOthers(layerID, layerIDStartWith, imageID, imageIDStartWith) {
    //
    hideOtherLayers(layerID, layerIDStartWith);
    hideOtherImages(imageID, imageIDStartWith);
}

//
function hideOtherLayers(layerID, layerIDStartWith) {
    //
    var obj;    // layer
    var tags;   // layer tags

    if(!isEmpty(layerID) && !isEmpty(layerIDStartWith)) {
        // create object of all div tags in the document
        tags = document.getElementsByTagName('DIV');

        for(var x=0; x<tags.length; x++) {
            if(tags[x].getAttribute("id").indexOf(layerIDStartWith) > -1) {
                if(tags[x].getAttribute("id") == layerID) {
                    tags[x].style.display="block";
                } else {
                    tags[x].style.display="none";
                }
            }    
        }    
    }        
}

//
function hideOtherImages(imageID, imageIDStartWith) {
    //
    var obj;    // layer
    var tags;   // layer tags

    if(!isEmpty(imageID) && !isEmpty(imageIDStartWith)) {
        // Collecting a list of all DIV tags
        tags = document.getElementsByTagName('IMG');
        for(var x=0; x<tags.length; x++) {
            if(tags[x].getAttribute("id").indexOf(imageIDStartWith) > -1) {
                if(tags[x].getAttribute("id") == imageID) {
                    tags[x].src = tags[x].src.replace("_off", "_on");
                } else {
                    tags[x].src = tags[x].src.replace("_on", "_off");
                }
            }
        } //End for
    } //End If(!isEmpty
}

//
function hideOtherImages(imageID, imageIDStartWith) {
    //
    var obj;    // layer
    var tags;   // layer tags
    var newImg;

    if(!isEmpty(imageID) && !isEmpty(imageIDStartWith)) {
        // Collecting a list of all DIV tags
        tags = document.getElementsByTagName('IMG');
        for(var x=0; x<tags.length; x++) {
            if(tags[x].getAttribute("id").indexOf(imageIDStartWith) > -1) {
                //
                newImg = new Image();

                //tags[x].src = tags[x].src.replace("_on", "_off");
                //document[tags[x].name].src = tags[x].src.replace("_on", "_off");
                if(tags[x].getAttribute("id") == imageID) {
                    newImg.src = tags[x].src.replace("_off", "_on");;
                } else {
                    newImg.src = tags[x].src.replace("_on", "_off");;
                }
                //
                tags[x].src = newImg.src;
            }
        } //End for
    } //End If(!isEmpty...
}

//
function setOtherTDClass(tdID, tdIDStartWith, overClass, outClass) {
    //
    var obj;    // layer
    var tags;   // layer tags

    if(!isEmpty(tdID) && !isEmpty(tdIDStartWith)) {
        // create object of all div tags in the document
        tags = document.getElementsByTagName('TD');

        for(var x=0; x<tags.length; x++) {
            if(tags[x].getAttribute("id").indexOf(tdIDStartWith) > -1) {
                if(tags[x].getAttribute("id") == tdID) {
                    tags[x].className = overClass;
                } else {
                    tags[x].className = outClass;
                }
            }    
        }    
    }        
}

//
function showHideOverlayLayer(layer) {
    //
    var obj;

    //
    if(!isEmpty(layer)) {
        //
        obj = document.getElementById(layer);

        if(obj.style.visibility == 'hidden') {
            obj.style.visibility = 'visible';
        } else {
            obj.style.visibility = 'hidden';
        }
    }    
}

//
function blinkIt() {
    if (document.all) {
        for(i=0;i<document.all.tags('blink').length;i++){
            s=document.all.tags('blink')[i];
            s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
        }
    }
}

//
function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
    newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
    newWindow.document.open();
    newWindow.document.write('<html><head><meta http-equiv="imagetoolbar" content="no"></head><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" oncontextmenu="return false" onBlur="self.close()" ondragstart="return false" onselectstart="return false">'); 
    newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>'); 
    newWindow.document.write('</body></html>');
    newWindow.document.close();
    newWindow.focus();
}

// Open a new browser
function openWindow(url) {
    window.open(url, "NewWindow");
}

//
function openWindow(url,width,height) {
    newWindow = window.open(url,"newWindow","width="+width+",height="+height+",left="+((screen.width-width)/2)+",top="+((screen.height-height)/2)+",resizable=yes,scrollbars=yes");
    newWindow.focus();
}

//
function openWindowWithName(url,name,width,height) {
    newWindow = window.open(url,name,"width="+width+",height="+height+",left="+((screen.width-width)/2)+",top="+((screen.height-height)/2)+",resizable=yes,scrollbars=yes");
    newWindow.focus();
}

//
function openClearWindow(url,width,height) {
    newWindow = window.open(url,"newWindow","width="+width+",height="+height+",left="+((screen.width-width)/2)+",top="+((screen.height-height)/2)+",resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,menubar=no");
    newWindow.focus();
}

//
function openClearWindowWithStatus(url,width,height) {
    newWindow = window.open(url,"newWindow","width="+width+",height="+height+",left="+((screen.width-width)/2)+",top="+((screen.height-height)/2)+",resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,menubar=no,status=yes");
    newWindow.focus();
}

//
function openWindowWithPicture(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
    newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
    newWindow.document.open();
    newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
    newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>'); 
    newWindow.document.write('</body></html>');
    newWindow.document.close();
    newWindow.focus();
}

//
function openWindowWithSize(url,width,height) {
    newWindow = window.open(url,"newWindow","width="+width+",height="+height+",left="+((screen.width-width)/2)+",top="+((screen.height-height)/2)+",resizable=yes,scrollbars=yes");
    newWindow.focus();
}

//
function openWindowWithSizePos(url,width,height,x,y) {
    newWindow = window.open(url,"newWindow","width="+width+",height="+height+",left="+x+",top="+y+",resizable=yes,scrollbars=yes");
    newWindow.focus();
}

//
function openWindowWithName(url,name,width,height) {
    newWindow = window.open(url,name,"width="+width+",height="+height+",left="+((screen.width-width)/2)+",top="+((screen.height-height)/2)+",resizable=yes,scrollbars=yes");
    newWindow.focus();
}

// Submit after pressed Enter key
function submitK13(myfield, e) {
    var keycode;
    if (window.event) keycode = window.event.keyCode;
    else if (e) keycode = e.which;
    else return true;

    if (keycode == 13) {
       myfield.form.submit();
       return false;
    } else {
       return true;
    }   
}

//
function getX(obj) {
    var curleft = 0;
    if(obj.offsetParent) {
        while(1) {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    } else if(obj.x) {
        curleft += obj.x;
    }    

    return curleft;
}

//
function getY(obj) {
    var curtop = 0;
    if(obj.offsetParent) {
        while(1) {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    } else if(obj.y) {
        curtop += obj.y;
    }

    return curtop;
}

//
function setXY(str, x, y) {
    //
    var obj;

    //
    if(!isEmpty(str)) {
        //
        obj = document.getElementById(str);
        obj.style.left = x;
        obj.style.top = y;
    }    
}

//-->
