function check_enter(e, action) {
    var c,
        retval = true;
    if (e && e.which) {
        e = e;
        c = e.which;
    } else {
        try {
            e = event;
            c = e.keyCode;
        } catch (err) {
            c = 0;
        }
    }
    switch (c) {
        case 13:
            action();
        case 0:
            retval = false;
            break;
        default:
            retval = true;
            break;
    }
    return retval;
}

// search descendents for class, return element or null if not found
function getDescendentByClass(ancestor, className) {
    var i,
        result;

    // if we found the sought tag, return the element
    if (typeof ancestor.className == 'string' &&
        ancestor.className.toLowerCase() == className.toLowerCase())
    {
        return ancestor;
    }

    // if we have no children, return null
    if (ancestor.childNodes.length === 0) {
        return null;
    }

    // for each child, repeat above, return element if we found sought tag
    for (i = 0; i < ancestor.childNodes.length; i++) {
        result = getDescendentByClass(ancestor.childNodes[i], className);
        if (result !== null) {
            return result;
        }
    }

    // if we did not find the sought tag, return null
    return null;
}

// search descendents for tag, return element or null if not found
function getDescendentByTag(ancestor, tagName) {
    var i,
        result;

    // if we found the sought tag, return the element
    if (ancestor.nodeName.toLowerCase() == tagName) {
        return ancestor;
    }

    // if we have no children, return null
    if (ancestor.childNodes.length === 0) {
        return null;
    }

    // for each child, repeat above steps, returning the element if we found the sought tag
    for (i = 0; i < ancestor.childNodes.length; i++) {
        result = getDescendentByTag(ancestor.childNodes[i], tagName);
        if (result !== null) {
            return result;
        }
    }

    // if we did not find the sought tag, return null
    return null;
}

function google_track_ext(url, googleId, googleDomain) {
    var pageTracker = _gat._getTracker(googleId);
    pageTracker._setDomainName(googleDomain); 
    pageTracker._initData();
    if (url == null) {
        pageTracker._trackPageview();
    } else {
        pageTracker._trackPageview(url);
    }
}

function google_redirect(url, track) {
    if (track == null) {
        track = url;
    }
    google_track(track);
    window.location = url;
}

function load() {
    if (window.google_map_load) {
        google_map_load();
    }
    google_track();
}

function trim(str) {
    return str.replace(/^\s+|\s+$|&nbsp;/g, '');
}

function unload() {
    if (window.google_map_unload) {
        google_map_unload();
    }
}

function goldClose() {
    document.getElementById('home-gold0').className = 'homeGoldClose';
}

function goldOpen() {
    document.getElementById('home-gold0').className = 'homeGoldOpen';
    google_track('/images/t24_au_en_usoz_6.gif');
}

