




    var JB_Mini = function() {
    	this.jobs = [{"id":554193,"title":"Assistant to the Chair, MFA Visual Narrative","company_name":"School of Visual Arts","date_to_sort_by":"\/Date(1730145900000)\/","city":"New York","state":33,"state_name":"NY","country":217,"state_name_text":"New York","country_name":"United States","custom_url":"Assistant-to-the-Chair-MFA-Visual-Narrative","job_poster_id":1470478,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_554193_auz3s2ilpdnqq9ahw3kdbnm9g.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":40},{"id":554191,"title":"Assistant Professor of Graphic Design, Tenure Track","company_name":"James Madison University","date_to_sort_by":"\/Date(1730140740000)\/","city":"Harrisonburg","state":47,"state_name":"VA","country":217,"state_name_text":"Virginia","country_name":"United States","custom_url":"Assistant-Professor-of-Graphic-Design-Tenure-Track","job_poster_id":1470474,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_554191_sivnnrhywsqymq0abgmf5ztbx.jpg","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":554159,"title":"INDUSTRIAL DESIGN INTERN (6 MONTHS - for candidates in China only)","company_name":"LIXIL ","date_to_sort_by":"\/Date(1730102460000)\/","city":"Shanghai","state":0,"state_name":"  ","country":41,"state_name_text":"","country_name":"China","custom_url":"INDUSTRIAL-DESIGN-INTERN-6-MONTHS-for-candidates-in-China-only","job_poster_id":1470385,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_554159_g3y3qzw_pymw_dx590kbyejlg.png","is_featured":false,"msa_name_text":"","is_highlighted":false,"job_level":0,"type_of_work":1,"job_url":null,"location_type":0,"job_role":15},{"id":553899,"title":"Production Operations Coordinator","company_name":"Air Line Pilots Association","date_to_sort_by":"\/Date(1729799040000)\/","city":"Tysons","state":47,"state_name":"VA","country":217,"state_name_text":"Virginia","country_name":"United States","custom_url":"Production-Operations-Coordinator","job_poster_id":221072,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_553899_sgu0ci6vyhoaxohfn4ipw9ih8.jpeg","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":553673,"title":"Design Innovation Associate","company_name":"Calbright College","date_to_sort_by":"\/Date(1729726200000)\/","city":"","state":5,"state_name":"CA","country":217,"state_name_text":"California","country_name":"United States","custom_url":"Design-Innovation-Associate","job_poster_id":1469585,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_553673_fsdyle6j644dxwzuv_e22rjha.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":21},{"id":553659,"title":"Assistant or Associate, Industrial Design","company_name":"Rhode Island School of Design","date_to_sort_by":"\/Date(1729716420000)\/","city":"Providence","state":40,"state_name":"RI","country":217,"state_name_text":"Rhode Island","country_name":"United States","custom_url":"Assistant-or-Associate-Industrial-Design","job_poster_id":1469565,"logo":"https://www.coroflot.com/user_files/job_logos/tiny_553659_gcycmbp0yeqefww4h7yfuhfjn.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://www.printmag.com/job-board/";


        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;
        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=" + "12";
                _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 = "is-style-topper has-large-font-size";
                loc.setText(_header_, "Job Board");


                var _col_text = document.createElement("p");
                loc.setText(_col_text, "");

                _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 = "how.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();























