// Generic Utilities for picsquare

/**
 * Returns url for the static resource at given path.
 * Finds out the hostname of the static server from the document.location and appends path to it.
 * For example static server for whoever.picsquare.com will be static.picsquare.com.
 */
function static_url(path) {
    var host = document.location.host;
    var static_host = "http://static" + host.substr(host.indexOf("."));
    
    // XXX: Dirty hack to fix problem with sqnindia + s3
    if (static_host == "http://static.sqnindia.com:8000") 
        static_host = "http://static.sqnindia.com";

    return static_host + path;
}

