
// Multi-Browser DOM operator
var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;

if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
   browserVersion = parseInt(navigator.appVersion);
   if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
   else {
     if (document.all) {isAll = 1; isDHTML = 1;}
}}

function findDOM(objectID,withStyle) {
        if (withStyle == 1) {
                if (isID) { return (document.getElementById(objectID).style) ; }
                else { 
                        if (isAll) { return (document.all[objectID].style); }
                else {
                        if (isLayers) { return (document.layers[objectID]); }
                };}
        }
        else {
                if (isID) { return (document.getElementById(objectID)) ; }
                else { 
                        if (isAll) { return (document.all[objectID]); }
                else {
                        if (isLayers) { return (document.layers[objectID]); }
                };}
        }
}



// Popup Menu code for Secondary Navigation

var domSMenu = null;
var oldDomSMenu = null;
var t = 0;
var lDelay = 3;
var lCount = 0;
var pause = 100;

function popMenu(menuNum){

///// STRING STOP
                var idRUN = 'snav' + 0;
                var domRUN = findDOM(idRUN,1);
                        domRUN.visibility = 'hidden';
                        domRUN.zIndex = '0';

        
        if (isDHTML) {

///// Sets the previous menu's visibility to hidden
                t = 2;
                if (oldDomSMenu) {
                        
                        oldDomSMenu.visibility = 'hidden'; 
                        oldDomSMenu.zIndex = '0'; 
                        t = 2; 
                        lCount = 0;
                }

///// Defines the DOMs  of the menu objects

                var idSMenu = 'snav' + menuNum;
                var domSMenu = findDOM(idSMenu,1);

///// Positions and shows the menu
                if (oldDomSMenu != domSMenu) {  
                        domSMenu.visibility = 'visible';
                        domSMenu.zIndex = '100';
                        oldDomSMenu = domSMenu;
                }

///// Resets oldDom if it is the same as the current DOM
                else { oldDomSMenu = null; }
        }

////// Returns a 'null' value for non-DHTML Browsers 
        else { return null; }
}

function delayHide() {
///// Checks to see if there is a menu showing and whether 
///// the global variable 't' has been set to 0

    if ((oldDomSMenu) && (t == 0)) {


///// STRING RUN
                var idRUN = 'snav' + 0;
                var domRUN = findDOM(idRUN,1);
                        domRUN.visibility = 'visible';
                        domRUN.zIndex = '100';

        
///// Hides the old menu, resets menu conditions, 
///// and stops the function running
        oldDomSMenu.visibility = 'hidden'; 
        oldDomSMenu.zIndex = '0';
        oldDomSMenu = null;
        lCount = 0; 
        return false;
    }


///// Interupts the function if another menu is opened
    if (t == 2) { lCount = 0; return false; }

///// Repeats the function adding 1 to lCount each time until 
///// lCount is equal to lDelay and then sets 't' to 0 so that 
///// the menu will hide when it runs again
    if (t == 1) { 
        lCount = lCount + 1;
        if (lDelay <= lCount) { t = 0; }
        if (lDelay >= lCount) { setTimeout('delayHide(' + t + ')',pause); }
    }
}



//     
 browser = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)))
    if (browser)
    {

    im11on=new Image(35,35);
    im12on=new Image(35,35);
    im13on=new Image(35,35);
    im14on=new Image(35,35);

     im11off=new Image(35,35);
     im12off=new Image(35,35);
     im13off=new Image(35,35);
     im14off=new Image(35,35);

     im11on.src="images/menu/usl1_on.gif";
     im12on.src="images/menu/usl2_on.gif";
     im13on.src="images/menu/usl3_on.gif";
     im14on.src="images/menu/usl4_on.gif";

     im11off.src="images/menu/usl1.gif";
     im12off.src="images/menu/usl2.gif";
     im13off.src="images/menu/usl3.gif";
     im14off.src="images/menu/usl4.gif";

    im21on=new Image(35,35);
    im22on=new Image(35,35);
    im23on=new Image(35,35);

     im21off=new Image(35,35);
     im22off=new Image(35,35);
     im23off=new Image(35,35);

     im21on.src="images/menu/ab1_on.gif";
     im22on.src="images/menu/ab2_on.gif";
     im23on.src="images/menu/ab3_on.gif";

     im21off.src="images/menu/ab1.gif";
     im22off.src="images/menu/ab2.gif";
     im23off.src="images/menu/ab3.gif";

    im31on=new Image(35,35);
    im32on=new Image(35,35);
    im33on=new Image(35,35);
    im34on=new Image(35,35);

     im31off=new Image(35,35);
     im32off=new Image(35,35);
     im33off=new Image(35,35);
     im34off=new Image(35,35);

     im31on.src="images/menu/fx1_on.gif";
     im32on.src="images/menu/fx2_on.gif";
     im33on.src="images/menu/fx3_on.gif";
     im34on.src="images/menu/fx4_on.gif";

     im31off.src="images/menu/fx1.gif";
     im32off.src="images/menu/fx2.gif";
     im33off.src="images/menu/fx3.gif";
     im34off.src="images/menu/fx4.gif";

     }
        
function ChImg(imgID, imgName)
{
   if (browser) document.images[imgID].src = eval(imgName + ".src")
}

//  
function getRandomImg(x,y){
var range = y-x+1;
var i = ("" + range).length;
var num = (Math.floor(Math.random() * Math.pow(10,i) % range) + parseInt(x));
document.write ("<img src=images/collages/" + num + ".jpg width=214 height=147 border=0><br>" );
return num;
}


function openwin_ank(){
window.open('ank.asp',"ank","target=ne,width=600,height=500,center,top=112,status=no,resizable=yes,tolbar=no,menubar=no,location=no,scrollbars=yes");
}

function openwin_grf(){
window.open('grf.asp',"ban","target=ne,width=600,height=500,center,top=112,status=no,resizable=yes,tolbar=no,menubar=no,location=no,scrollbars=yes");
}


var pos = 1
var text = "test testfgdtyrybbc bcvbvcbfgffhfghgfjkjhjkhkhkjhkjhkjhkjhkjhjkhkjhkj"

function scrollIn(){
document.running.text.value = text.substring(0,pos)
if(pos >= text.length){
pos=1
window.setTimeout("scrollOut()",300)
}
else{
pos++
window.setTimeout("scrollIn()",50)

}

}

function scrollOut(){

document.running.text.value = text.substring(pos, text.length)

if(pos >= text.length){
pos = 1
window.setTimeout("scrollIn()",100)
}
else{
pos++
window.setTimeout("scrollOut()",50)
}

}


function refreshDefault(){
        window.location.replace('#');
}

