//GENERIC DROP DOWN NAVIGATION
function goDropDown(objElement) {
    var objElementValue = objElement[objElement.selectedIndex].value;
    if (objElementValue != "") {
        window.location = objElementValue;
    }
}

//IMAGE PRELOAD
//imgObj - the name of the object associated with the image 
//imgSrc - the source filename (url) of the image
function doPreload(imgObj,imgSrc) {
    if (document.images) {
        eval(imgObj + ' = new Image()');
        eval(imgObj + '.src = "' + imgSrc + '"');
    }
}

//IMAGE EVENT FUNCTION
//layer - layer name if provided otherwise blank ''
//imgName - name or id of event image
//imgObj -  name or id of the preloaded image object
var glayer;
var gimgName;
var gimgObj;

function imgSwap(layer,imgName,imgObj) {
var layer;
var imgName;
var imgObj;
glayer = layer;
gimgName = imgName;
gimgObj = imgObj;
    if(document.images) {
        //NN 4.x DOM
        if(document.layers && layer != "") {
            eval('document.' + layer + '.document.images["' + imgName + '"].src = ' + imgObj + '.src');
        }
        //NN6 Gecko subroutine
        else if((objClient.application == "nn") && (objClient.version >= 5)) {
            //setTimeout("imgSwapTimeOut()",1);
            imgSwapTimeOut();
        }
        else {
            document.images[imgName].src = eval(imgObj + ".src");
        }
    }
}
//NN Gecko subroutine
function imgSwapTimeOut() {
    document.images[gimgName].src = eval(gimgObj + ".src");
}

//HISTORY NAVIGATION
//i - the place in the history array ( can be a negative | positive number )
function goHistory(i) {
    history.go(i);
	return false;
}

//GENERIC COOKIE CHECK
function checkForCookie(strCookieName) {
    
    //get all cookies
    var objAllCookies = document.cookie;

    //does cookie exist?
    var checkPos = objAllCookies.indexOf(strCookieName);
    
    if (checkPos != -1) {
        return true;
    }
    
    return false;
}

function setCookie (name,value,expires,path,domain,secure) {
    //test for params and set if provided
    document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function getCookieValue (offset) {
    var endstr = document.cookie.indexOf (";", offset);
        if (endstr == -1) {
            endstr = document.cookie.length;
        }
        return unescape(document.cookie.substring(offset, endstr));
}

function getCookie(name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    if((document.cookie == null) || (document.cookie.length == null)) {
        return null;
    }
    var i = 0;
    while (i < clen) {
        var j = i + alen;

        if (document.cookie.substring(i,j) == arg) {
        return getCookieValue(j);
        }
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) {
            break;
        }
    }
    return null;
}
//PVA-2904 Ends

