




    var JB_Mini = function() {
    	this.jobs = [{"id":667508,"title":"Industrial Designer (Bilingual – English/Chinese)","company_name":"Smoore International Ltd.","date_to_sort_by":"\/Date(1764090780000)\/","city":"Phoenix","state":3,"state_name":"AZ","country":217,"state_name_text":"Arizona","country_name":"United States","custom_url":"Industrial-Designer-Bilingual-EnglishChinese","job_poster_id":1612579,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_667508_aoslmusmbovmtzdauoho5qnri.png","is_featured":false,"msa_name_text":"","is_highlighted":true,"job_level":0,"type_of_work":4,"job_url":null,"location_type":0,"job_role":15},{"id":667480,"title":"Technical Design Manager","company_name":"Powerhouse Arts","date_to_sort_by":"\/Date(1764013080000)\/","city":"Brooklyn","state":33,"state_name":"NY","country":217,"state_name_text":"New York","country_name":"United States","custom_url":"Technical-Design-Manager","job_poster_id":1612489,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_667480_b2rlkt9jxusxm8kkw87zsyfxi.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":15},{"id":667351,"title":"Lecturer, Industrial Design","company_name":"Rochester Institute of Technology","date_to_sort_by":"\/Date(1763744520000)\/","city":"Rochester","state":33,"state_name":"NY","country":217,"state_name_text":"New York","country_name":"United States","custom_url":"Lecturer-Industrial-Design","job_poster_id":752131,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_667351_wwzhe2qsnalsopoezqtblyqy6.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":15},{"id":667350,"title":"Assistant Teaching Professor of Animation","company_name":"University of Kansas","date_to_sort_by":"\/Date(1763744340000)\/","city":"Lawrence","state":17,"state_name":"KS","country":217,"state_name_text":"Kansas","country_name":"United States","custom_url":"Assistant-Teaching-Professor-of-Animation","job_poster_id":752131,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_667350_duylqmcwszadtgkdiyugr5rmy.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":46},{"id":667313,"title":"Request for Proposals: Freelance Graphic Designer (1099 Contractor)","company_name":"Lead for America","date_to_sort_by":"\/Date(1763669280000)\/","city":"","state":0,"state_name":"  ","country":0,"state_name_text":"","country_name":"","custom_url":"Request-for-Proposals-Freelance-Graphic-Designer-1099-Contractor","job_poster_id":1612116,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_667313_2kmounlodbtehxaqvp_bc0map.png","is_featured":false,"msa_name_text":"","is_highlighted":false,"job_level":0,"type_of_work":3,"job_url":null,"location_type":1,"job_role":13},{"id":667259,"title":"Visual Storyteller - Graphic \u0026 Motion Designer","company_name":"Gap International","date_to_sort_by":"\/Date(1763568120000)\/","city":"","state":39,"state_name":"PA","country":217,"state_name_text":"Pennsylvania","country_name":"United States","custom_url":"Visual-Storyteller-Graphic-n-Motion-Designer","job_poster_id":1611984,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_667259_xtkn3dvf7hmcuw66peuf7rvtp.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":13}];
        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();























