if( document.location.hostname.indexOf( ".autodesk.com" ) != -1 ) {
    document.domain = "autodesk.com";
}

var g_searchDefault = null;

function init() {

}

function openPopup( url, width, height, name, features ) {

    function addFeature( features, name, value ) {
        if( value == null || value == "" ) {
            return features;
        }
        if( features != "" ) {
            features += ",";
        }
        return features + name + "=" + value;
    }

    if( name == null || name == "" ) {
        name = "popupWindow";
    }
    if( features == null || features == "") {
        features = "";
        features = addFeature( features, "scrollbars", "yes" );
        features = addFeature( features, "resizable", "yes" );
        if( name == "popupWindow" ) {
            features = addFeature( features, "location", "yes" );
            features = addFeature( features, "menubar", "yes" );
            features = addFeature( features, "toolbar", "yes" );
            features = addFeature( features, "status", "yes" );
        }
    }
    if( name == "viewlarger" ) {
        if( width == null || width == "" ) {
            width = 800;
        }
        if( height == null || height == "" ) {
            height = 600;
        }
    }
    if( name == "popupWindow" ) {
        if( width == null || width == "" ) {
            width = 800;
        }
        if( height == null || height == "" ) {
            height = 600;
        }
    }

    features = addFeature( features, "width", width );
    features = addFeature( features, "height", height );
    var popupWindow = window.open( url, name, features );
    popupWindow.focus();

    return false;
}

function pp_onBlurSearch( e ) {
    if( ! core_isEmpty( e ) ) {
        return;
    }
    e.value = g_searchDefault;
    g_searchDefault = null;
}

function pp_onFocusSearch( e ) {
    if( g_searchDefault != null ) {
        return;
    }
    g_searchDefault = e.value;
    e.value = "";
}