




    var JB_Mini = function() {
    	this.jobs = [{"id":556271,"title":"Design Director for Social Impact Design Agency (F/T, Remote)","company_name":"Constructive","date_to_sort_by":"\/Date(1732740780000)\/","city":"","state":0,"state_name":"  ","country":0,"state_name_text":"","country_name":"","custom_url":"Design-Director-for-Social-Impact-Design-Agency-FT-Remote","job_poster_id":1474814,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_556271_vijmdgxdheomt4yevvbvjlqp0.jpg","is_featured":false,"msa_name_text":"","is_highlighted":false,"job_level":0,"type_of_work":5,"job_url":null,"location_type":1,"job_role":6},{"id":556260,"title":"Assistant or Associate Professor - Animation","company_name":"University of Kansas","date_to_sort_by":"\/Date(1732720380000)\/","city":"Lawrence","state":17,"state_name":"KS","country":217,"state_name_text":"Kansas","country_name":"United States","custom_url":"Assistant-or-Associate-Professor-Animation","job_poster_id":1474784,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_556260_eqixwumwf_rg7libns9bvnxqa.png","is_featured":false,"msa_name_text":"","is_highlighted":false,"job_level":0,"type_of_work":2,"job_url":null,"location_type":0,"job_role":41},{"id":555941,"title":"Human Factors Designer","company_name":"Synex Medical","date_to_sort_by":"\/Date(1732312920000)\/","city":"Toronto","state":60,"state_name":"ON","country":33,"state_name_text":"Ontario","country_name":"Canada","custom_url":"Human-Factors-Designer","job_poster_id":1474145,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_555941_hitw8ntv0fvrmyjvbdkjoouqp.png","is_featured":false,"msa_name_text":"","is_highlighted":false,"job_level":0,"type_of_work":3,"job_url":null,"location_type":0,"job_role":39},{"id":555930,"title":"Assistant Professor - Educator, Industrial Design, Myron E. Ullman, Jr. School of Design","company_name":"University of Cincinnati","date_to_sort_by":"\/Date(1732303140000)\/","city":"Cincinnati","state":36,"state_name":"OH","country":217,"state_name_text":"Ohio","country_name":"United States","custom_url":"Assistant-Professor-Educator-Industrial-Design-Myron-E-Ullman-Jr-School-of-Design","job_poster_id":1474126,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_555930_vffvdrosyflipzq6rh7ge9aik.jpg","is_featured":false,"msa_name_text":"","is_highlighted":false,"job_level":0,"type_of_work":3,"job_url":null,"location_type":0,"job_role":15},{"id":555851,"title":"Assistant Professor, Graphic Design","company_name":"University of Central Florida","date_to_sort_by":"\/Date(1732197480000)\/","city":"Orlando","state":10,"state_name":"FL","country":217,"state_name_text":"Florida","country_name":"United States","custom_url":"Assistant-Professor-Graphic-Design","job_poster_id":1473949,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_555851_2dcsok7kl_zxw7g_0p6wy_qzc.png","is_featured":false,"msa_name_text":"","is_highlighted":false,"job_level":0,"type_of_work":2,"job_url":null,"location_type":0,"job_role":13},{"id":555792,"title":"Assistant Professor - Educator, Communication Design, Myron E. Ullman, Jr. School of Design","company_name":"University of Cincinnati","date_to_sort_by":"\/Date(1732133100000)\/","city":"Cincinnati","state":36,"state_name":"OH","country":217,"state_name_text":"Ohio","country_name":"United States","custom_url":"Assistant-Professor-Educator-Communication-Design-Myron-E-Ullman-Jr-School-of-Design","job_poster_id":1473818,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_555792_6ykkweb59or0lfbqwupdqrq9y.jpg","is_featured":false,"msa_name_text":"","is_highlighted":false,"job_level":0,"type_of_work":3,"job_url":null,"location_type":0,"job_role":41}];
        this.wrapper_id = "pjb_mini";
        }

        JB_Mini.prototype = {
        constructor: JB_Mini,
        load_js_css: function(_src, filetype, _callback) {
        if (filetype == "js") {

        var _ready = false;
        var _ref = document.createElement('script');
        _ref.type = "text/javascript";
        _ref.src = _src;
        _ref.onload = _ref.onreadystatechange = function() {
        if (!_ready && (!this.readyState || this.readyState == "complete" || this.readyState == "loaded")) {
        _ready = true;
        _callback();
        }
        }
        } else if (filetype == "css") {
        var _ref = document.createElement("link");
        _ref.rel = "stylesheet";
        _ref.type = "text/css";
        _ref.href = _src;
        }
        if (typeof _ref != "undefined") {
        document.getElementsByTagName("head")[0].appendChild(_ref);
        }
        },
        get_location: function(_obj) {
        var location_str = new String();
        if(_obj.location_type == 1) {
        return "This is a Remote Position";
        }
        location_str += _obj.city != "" ?  _obj.city + ", " : "";
        location_str += _obj.country == 217 ? _obj.state_name : _obj.country_name;
        if (_obj.location_type == 2) {
        location_str += "  - Onsite or Remote Possible";
        }
        return location_str;
        },
        setText: function(elem, set_val) {
        if ((elem.innerText) && (typeof (elem.innerText) != "undefined")) {
        elem.innerText = set_val;
        } else {
        elem.textContent = set_val;
        }
        },
        draw_recent_jobs: function() {
        var loc = this;
        var fix_inner;
        var _html = new String();
        var job_board_url = "https://metropolismag.com/jobs";


        var _list = document.createElement("ul");
        _list.id = "jb_list_mini";

        for (var k=0; k < loc.jobs.length; k++) {
        var _item = document.createElement("li");
        var _link = document.createElement("a");
            _link.href = job_board_url + "#job_id=" + loc.jobs[k].id;
        var _title = document.createElement("span");
        _title.className = "jb_title";
        var _title_to_use = loc.jobs[k].title;
            _title_to_use = loc.to_title_case(loc.jobs[k].title);
        loc.setText(_title, _title_to_use);


        var _company = document.createElement("span");
        _company.className = "jb_company";
        loc.setText(_company, loc.jobs[k].company_name);


        var _location = document.createElement("span");
        _location.className = "jb_location";
        loc.setText(_location, loc.get_location(loc.jobs[k]));


            _link.appendChild(_title);
        _link.appendChild(_company);
        _link.appendChild(_location);

        _item.appendChild(_link);
        _list.appendChild(_item);
        }

        var _buttons_ul = document.createElement("ul");
        _buttons_ul.id = "post_more";

        var _item1 = document.createElement("li");
        var _item1_link = document.createElement("a");
            
                _item1_link.href = "http://partnerjobs.coroflot.com" + "/post-a-job-form?origin_id=" + "43";
                _item1_link.target = "_blank";
            
        loc.setText(_item1_link, "Post A Job");
        _item1.appendChild(_item1_link);

        var _item2 = document.createElement("li");
        var _item2_link = document.createElement("a");
            _item2_link.href = job_board_url;
        loc.setText(_item2_link, "View All Jobs");
        _item2.appendChild(_item2_link);

            _buttons_ul.appendChild(_item1);
        _buttons_ul.appendChild(_item2);


            
                var _poweredby_ul = document.createElement("ul");
                _poweredby_ul.id = "powered_by";

                var _img_pb = document.createElement("li");
                var _img_pb_img = document.createElement("img");
                _img_pb_img.src = "https://www.coroflot.com/images/partner_images/powered_by.png";
                _img_pb_img.width = 70;
                _img_pb.appendChild(_img_pb_img);

                var _pb_text = document.createElement("li");
                loc.setText(_pb_text, "Powered By");

                _poweredby_ul.appendChild(_pb_text);
                _poweredby_ul.appendChild(_img_pb);
            
            
                var _first_column = document.createElement("div");
                _first_column.id = "primary_column";

                var _top_section = document.createElement("div");
                _top_section.id = "top_sect";
            
            
                var _header_ = document.createElement("h2");
                _header_.className = "";
                loc.setText(_header_, "Design Jobs");


                var _col_text = document.createElement("p");
                loc.setText(_col_text, "Find or post design career opportunities, and connect with those in the architecture and design industry.");

                _top_section.appendChild(_header_);
                _top_section.appendChild(_col_text);

                _first_column.appendChild(_top_section);
                _first_column.appendChild(_buttons_ul);
            
            
                document.getElementById(loc.wrapper_id).appendChild(_first_column);
                document.getElementById(loc.wrapper_id).appendChild(_list);

            
        },
        to_title_case: function(str) {
            if (str != null && str != undefined && str != "") {
                str = str.toLowerCase().split(' ');
                for (var i = 0; i < str.length; i++) {
                    str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);
                }
                return str.join(' ');
            } else {
                return str;
            }
        },
        init: function() {
        var loc = this;
        var elem = document.createElement("div");
        elem.id  = loc.wrapper_id;

        var ref = document.getElementById("jb_scr_mini");
        ref.parentNode.insertBefore(elem, ref);

        loc.draw_recent_jobs();


        // load css assets file
        var css_asset_name = "metropolis.js";
        css_asset_name = css_asset_name.replace(".js", "_mini.min.css");
        css_asset_name = "https://www.coroflot.com/stylesheets/partner_styles/" + css_asset_name;

        loc.load_js_css(css_asset_name, "css");



        }
        }

        var _pjb_mini = new JB_Mini();
        _pjb_mini.init();























