[+]
';
} else {
var new_title = '
'+new_link[0]+'' + close_link[1] + '';
}
} else {
var thisTitle = r.title;
thisTitle = thisTitle.slice(450);
if (thisTitle.length > 0) {
thisTitle = r.title;
var new_title = '
[+]
';
} else {
var new_title = '
'+r.title+'';
}
}
qa_list = qa_list + '
\
' + new_title + '
\
\
\
0) {
qa_list = qa_list + ' title="Some of the answeres are accepted!"';
} else {
qa_list = qa_list + ' title="No accepted answers yet."';
}
qa_list = qa_list + '>
'+r.answers+'
answers
\
\
\
';
$.each(r.tags, function(index, value) {
qa_list = qa_list + ''+ decodeURIComponent(value.tag_name)+'';
});
qa_list = qa_list + '
\
\
'+format_date(r.created_date)+'\
\
';
});
if (qa_list == '') {
$('.essay-list').html('
No questions found
');
} else {
$('.essay-list').html(qa_list);
}
}
});
}
function scroll_to_mentor(m_id) {
var adjuster = 70; if (isMobile.any) adjuster = 10;
$('html, body').animate({ scrollTop: $('#'+m_id).offset().top-adjuster }, 100, function() {
// $('#'+m_id).effect("highlight");
});
}
function get_mentors() {
$.post('/api/v1/get_mentors', function(e) {
if (e.request == 'OK') {
var qa_list = '
By Name';
$.each(e.types, function(i, r) {
qa_list = qa_list + '' + r.description + '';
mentor_types.push(r.mentor_type_id);
});
qa_list = qa_list + '
';
$.each(e.data, function(i, r) {
id = (r.first_name+'-'+r.last_name.replace('-','')).replace(/ /g,'');
qa_list = qa_list + '
\
\

\
\
'+r.first_name+' '+r.last_name+'
\
'+r.bio+'
';
if (r.affiliation_url != null) {
qa_list = qa_list + '
';
}
qa_list = qa_list + '
';
});
$('.essay-list').html(qa_list);
mentor_div_id = get_parameter_by_name('m');
if (mentor_div_id.length > 0) { setTimeout(function(){scroll_to_mentor(mentor_div_id);}, 200); }
}
});
}
function SearchTags() {
var search_tags = '';
$('.qa-tag-search .tag-active').each(function() {
if (search_tags.length == 0) search_tags = $(this).find('.name-of-tag').attr('data-tag-id')
else search_tags += ','+$(this).find('.name-of-tag').attr('data-tag-id');
})
return search_tags;
}
$(document).on({
click : function() {
var type = $(this).attr('rel');
if (type == 0) {
$('.mentors-block').fadeIn('fast');
$('.qa-mentor-type').css('fontWeight', 'normal');
$(this).css('fontWeight', 'bold');
return;
}
for(i = 0; i
');
window.history.pushState("object or string", "Title", "/career/ask?" +essay_val);
if (essay_val == 'mentors') {
get_mentors();
}
if (essay_val == 'mostviewed') {
load_questions_list('popular', '', '');
}
if (essay_val == 'recent') {
load_questions_list('recent', '', '');
}
});
$('.search-career-input').keypress(function (e) {
if (e.which == 13) {
$('.essay-list').html('