if (window.addEventListener) window.addEventListener('load', onLoader, false);
else if (window.attachEvent) window.attachEvent('onload', onLoader);


// wrapper fn for any required onLoad JS calls
function onLoader() {
    return true;
}

function checkContent(newurl, newprotocol) {
    var instr = "gedin_"
    var exists = newurl.indexOf(instr)
    if ((exists != -1) && (newprotocol == 'https:')) {
        return true;
    }
    else {
        return false;
    }
}

// open pop-up window
function popup(winName, url) 
{
    popWidth = 590, popHeight = 500, scrolling = true;
    if (scrolling === true) scrolling = 'yes';
    leftPos = (screen.availWidth - popWidth) / 2;
    rightPos = (screen.availHeight - popHeight) / 2;
    details = "height=" + popHeight + ",width=" + popWidth + ",left=" + leftPos + ",top=" + rightPos + ",status=no,resizable=yes,titlebar=no,toolbar=no,location=no,scrollbars=yes,directories=no";
    if (winName && winName.open && !winName.closed) {
        winName.resizeTo(popWidth, popHeight);				//only works in IE
        winName.location = url;
        winName.focus();
    } else { 
        winName = window.open(url, winName, details);
        winName.focus();
    }
    return false;
}


/* utility fns */
/**/
function getElementsByClassName(oElm, strTagName, strClassName){
    var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    strClassName = strClassName.replace(/\-/g, "\\-");
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;
    for(var i=0; i<arrElements.length; i++){
        oElement = arrElements[i];      
        if(oRegExp.test(oElement.className)){
            arrReturnElements.push(oElement);
        }   
    }
    return (arrReturnElements)
}
/**/
function getParent(e,obj) {
    while (e != null) {
        if (e == obj) return e;
        e = e.parentNode;
    }
    return null;
}


