/* ******************************************************
// Last Updated 3/3/16 by KJL
// Last Updated 10/22/15 by SC
// Previous Update 7/16/15 by ML
****************************************************** */
/* Set Vars For Moving Layers */
var theTop = 70;
var old = theTop;
var headerh = 0;
var windowhost = "http://" + (window.location.host);
var trackurl;
var locale = "us";
/* For scroll header transform */
$(window).scroll(function() {});
/*Header Dropdown Function*/
$(document).ready(function() {
//Adding the slideshow byline
$('#imgCollections .byline').html('Slideshow');
//add tracking to slideshow list items on reference homepage
if ($('.medscape_ref').length != 0 && $('.homestar').length != 0) {
$('#imgCollections .bucketContent ul li').each(function(index) {
$(this).find('a').attr("onclick","wmdTrack('slide_" + (index+1) + "')");
});
$('#featured .bucketContent ul.listLeft li').each(function(index) {
if (!$(this).hasClass('brandAlert')) {
$(this).find('a').attr("onclick","wmdTrack('feat_" + (index+1) + "')");
}
});
$('#featured .bucketContent ul.listRight li').each(function(index) {
if (!$(this).hasClass('brandAlert')) {
$(this).find('a').attr("onclick","wmdTrack('feat_" + (index+3) + "')");
}
});
};
var links = window.document.getElementsByTagName('link');
$(links).each(function() {
if ($(this).attr('rel') == "canonical") {
trackurl = $(this).attr('href');
}
});
addBrandAlert();
if (navigator.userAgent.match(/msie 8.0/i)) {
$("body").addClass('isIE8');
}
$('#rightheaderlinks').bind('click', function() {
$('#headerrightlinkdd').removeClass('hidesetingdd');
$('#headerrightlinkdd').addClass('showsetingdd');
});
$('#rightheaderlinks').bind('mouseover', function() {
$('#headerrightlinkdd').removeClass('hidesetingdd');
$('#headerrightlinkdd').addClass('showsetingdd');
});
$('#rightheaderlinks').bind('mouseout', function() {
$('#headerrightlinkdd').removeClass('showsetingdd');
$('#headerrightlinkdd').addClass('hidesetingdd');
});
$('#currentSpecialty, #headertopright .btn-close, .whiteout-header-dropdown').bind('click', function() {
if($("#headerborder").hasClass("dropdown-view")) {
$("#headerborder").removeClass("dropdown-view")
} else {
$("#headerborder").addClass("dropdown-view")
}
// $('#specialtyDropDown').show();
});
$('#currentSpecialty, #specialtyDropDown').bind('mouseout', function() {
// $('#specialtyDropDown').hide();
});
/* View Pub Hack For Right Rial Links */
if (document.getElementById('viewpub_publisher')) {
var vp_pub_a = $('#pubintro a#viewpub_publisher').attr('href');
var vp_pub_txt = $('#pubintro a#viewpub_publisher').html();
$('#journalnav ul:nth-child(2)').append('
' + vp_pub_txt + '');
}
if (document.getElementById('viewpub_subscribe')) {
var vp_scribe_a = $('#pubintro a#viewpub_subscribe').attr('href');
var vp_scribe_txt = $('#pubintro a#viewpub_subscribe').html();
$('#journalnav ul:nth-child(2)').append('' + vp_scribe_txt + '');
}
if (document.getElementById('viewpub_submit')) {
var vp_sub_a = $('#pubintro a#viewpub_submit').attr('href');
var vp_sub_txt = $('#pubintro a#viewpub_submit').html();
$('#journalnav ul:nth-child(2)').append('' + vp_sub_txt + '');
}
// if (!$.cookie("todaylayershow")) {
// setTimeout(function(){
// if($("#maincolboxdrugdbheader").length!=1 && $("#whiteoutlayer").length!=1 && $("#layerAd1").length!=1 && $("#layerAd2").length!=1 && $("#nDlayer_modal").length!=1) {
// $("#todaylayer").show();
// var expDate=new Date();
// expDate.setFullYear(2030,0,1);
// $.cookie("todaylayershow", "false", {domain: '.medscape.com', expires: expDate, path: '/'});
// $('body').bind('click').click(function(event) {
// $("#todaylayer").hide();
// // return false;
// });
// }
// },1000)
// }
//Quick temporary fix to remove ads anytime a URL has "medline" in it.
// if ($('link[rel=canonical]').attr("href")) {
// var con_part = window.location.href.split('/');
// var medcheck = con_part[3];
// if (medcheck == "medline") {
// $("body > *").each(function () {
// if ($(this).hasClass('prWrap')) {
// $(this).remove();
// }
// });
// $('#bodypadding').css('margin-top', '10px');
// $('#adtagheader').hide();
// $('#adtagfooter').hide();
// $('#textAd1').hide();
// $('#textAd2').hide();
// $('#sponsorad').hide();
// $('.rightcolad').each(function() {$(this).hide();});
// $('.mobile_adlabelleft').each(function() {$(this).hide();});
// }
// }
/* make the whole area of div#layer2 clickable */
$("body").on('click', "#layerAd2 .adContent", function(e) {
window.open($(this).find(".adTitle a").attr("href"));
});
/* avoid propagating the event to prevent div#layer2 click event from being called */
$("body").on('click', "#layerAd2 .adContent a", function(e) {
e.stopPropagation();
});
});
/* Global Ad Refreshing Script */
/* medscape.core.js $Revision: 1916 $ */
this.medscape = {
p: {},
m: {},
load: function(b, a) {
return $.xLazyLoader(b, a)
},
substitute: function(a, b) {
return a.replace(/\{([^{}]*)\}/g, function(d, c) {
var e = b[c];
return typeof e === "string" || typeof e === "number" ? e : d
})
},
htmlEncode: function(a) {
return a.replace(/\&/g, "&").replace(/\/g, ">").replace(/\"/g, """)
},
openWindow: function(d, c) {
var h, g, b, e, a;
if (!c) {
c = {}
}
h = {
name: "",
focus: true
};
if (c.standard) {
h = $.extend(h, {
location: 1,
menubar: 1,
resizable: 1,
scrollbars: 1,
status: 1,
toolbar: 1
})
}
c = $.extend(h, c);
e = {
name: 1,
focus: 1,
standard: 1
};
b = [];
for (g in c) {
if (c.hasOwnProperty(g)) {
if (e[g]) {
continue
}
b.push(g + "=" + c[g])
}
}
a = window.open(d, c.name, b.join(","));
if (c.focus && a) {
a.focus()
}
return a
},
object: (function() {
function a() {}
return function(d, c) {
a.prototype = d;
var b = new a();
if (c) {
$.extend(b, c)
}
return b
}
})()
};
$(function() {
window.document.write = function(a) {
throw ("INVALID document.write: " + a)
}
});
/* refreshes the banner and right side ads*/
medscape.ads = {
// Object to contain ad server URL parameters
params: {},
init: function() {
var re = new RegExp('(.*/)(.*)');
var paramsObj = {};
// Find real ad modules
$("[id*='ad1']").each(function() {
splitParams(this, paramsObj);
});
// Find interactive ad modules
$.each(medscape.ads.refresh.defaults.src, function() {
splitParams(this, paramsObj);
});
function splitParams(adframe, paramsObj) {
var fullParams, paramsArray, i, nvSplit, name, value;
var adsurl = $(adframe).attr("src");
var m = re.exec(adsurl);
if (m !== null) {
fullParams = m[2] === undefined ? "" : m[2];
}
if (fullParams) {
fullParams = fullParams.replace(/amp;/g, ""); // Clean up messy & parameters in the fullParams string
paramsArray = fullParams.split('&');
for (i = 0; i < paramsArray.length; i++) {
nvSplit = paramsArray[i].split('=');
name = decodeURIComponent(nvSplit[0]);
value = decodeURIComponent(nvSplit[1]);
value = value.replace(/\//g, "%2f");
// If the current param is not the pos value, or pos doesnt exist in the medscape.ads.params object
if (name != "pos" || !(paramsObj[name])) {
// set current param name-value pair
paramsObj[name] = value;
// If the current param is the pos value and pos already has a value in the medscape.ads.params object
} else {
// Add current pos value to comma-delimited list of pos values
paramsObj[name] = paramsObj[name] + "," + value;
}
}
}
return true;
}
medscape.ads.params = paramsObj;
},
refresh: function(options) {
// Set default options, and let passed-in options override them
var o = $.extend({}, medscape.ads.refresh.defaults, options);
// medscape.ads.segnum set elsewhere, if needed, or default to 0
var transTileId = Math.round(99999999 * Math.random());
// getting the date, getting the seconds from epoch, slicing off the first two characters as we only want 11 here
var timestamp = new Date().getTime().toString().slice(2);
// making an 8 digit random number
var randomNumber = Math.random().toString().substr(2, 8);
// set the global variable to the 19 digit page view id
var s_pageview_id = timestamp + randomNumber;
// Grab the top divs for all possible ad elements on the page
$(o.selector).each(function() {
if ($(this).children().size() > 0) {
var ad, src;
var adifilabelid = $(this).attr('id');
$('#' + adifilabelid + ' .adlabelifi').removeClass('adlabelifi'); //remove 'Information from industry label' //
$('#' + adifilabelid + ' .adlabelblank').removeClass('adlabelblank'); //remove blank label //
// Remove all children of the original medscape iframe and possible expandable divs
var adFrame = $(this).children("[id*='ad1']");
$(this).children("*").not("[id*='ad1'], div[class*='adlabel']").remove();
$(this).children('[class*="adlabel"]').children("*").not("[id*='ad1']").remove();
adFrame.empty();
// Look for the existence of an ad element
ad = $(this).find("[id]");
// If no ad element is found in the current selector, it may be an interactive ad module
if (!ad[0]) {
// Look in the object to find any properties of the o.src object that match the current id
var adTag = o.src[$(this).attr("id")];
// Grab the src attribute of adTag iframe for manipulation
src = $(adTag).attr("src");
// If they're found, then it's an interactive ad module that needs an initial ad load
if (src) {
// Clean up messy & parameters in the http query string
src = src.replace(/amp;/g, "");
src = replaceAdParam(src, "transactionid", transTileId);
src = replaceAdParam(src, "tile", transTileId);
src = replaceAdParam(src, "pvid", s_pageview_id);
src = replaceAdParam(src, "ep", "0");
// replace and/or add params & filter for initial ad load
$.each(o.params, function(i, val) {
// Replace the param value if it exists
src = replaceAdParam(src, i, val);
// Add the param if it's not already there
if (src.indexOf(i + "%3D") < 0) {
src = src + "&" + i + "%3D" + val;
}
});
if ($.isFunction(o.filter)) {
src = o.filter(src);
}
// Update the adTag iframe's src value
$(adTag).attr("src", src);
// Laboriously convert the entire tag to a string, because IE sucks at createElement for iframes
adTag = '';
// Append the tag to the placeholder div
$(this).children("div.ad_placeholder").append(adTag);
return;
} else {
// no ad found, and no Interactive ad module vars so remove ad frame
$(this).parent().remove();
return;
}
} else {
src = ad.attr("src");
// ad element was found, but it has no src. Danger, Will Robinson! Dump out of ad refresh
if (!src) {
return;
}
src = replaceAdParam(src, "tile", transTileId);
src = replaceAdParam(src, "transactionid", transTileId);
src = replaceAdParam(src, "pvid", s_pageview_id);
src = replaceAdParam(src, "ep", "0");
// replace and/or add params & filter
$.each(o.params, function(i, val) {
src = replaceAdParam(src, i, val);
// Add the param if it's not already there
if (src.indexOf(i + "%3D") < 0) {
src = src + "&" + i + "%3D" + val;
}
});
if ($.isFunction(o.filter)) {
src = o.filter(src);
}
// clear the style tag on the iframe in case 3rd part people have added inline styles to it
$(ad).attr('style', '');
// Update the iframe
if (ad[0].contentWindow) {
// To avoid adding to the page history and messing up the back button,
// use location.replace instead of changing the src of the iframe
ad[0].contentWindow.location.replace(src);
} else {
ad.attr({
src: src
});
}
}
}
});
function replaceAdParam(srcStr, pName, pValue) {
var paramRegEx = new RegExp("\\b" + pName + "%3D[^\"']*");
srcStr = srcStr.replace(paramRegEx, pName + "%3D" + pValue);
return srcStr;
}
}
};
/* Blank defaults reset on a product level page, exmaple news article or ref article */
medscape.ads.refresh.defaults = {
selector: "",
src: {},
params: {}
};
$(function() {
medscape.ads.init();
});
/* /Header Dropdown Function*/
function hideTodayLayer() {
$("#todaylayer").hide();
}
/* Random List of li */
function showuniquelist(thelist, numselect) {
var listitems = new Array();
listitems = document.getElementById(thelist).getElementsByTagName('li');
var totallist = listitems.length;
var numofitems = listitems.length - 1;
if (totallist <= numselect) {} else {
var Count = 0;
var NumUnique = numselect;
var Current = new Array(NumUnique);
for (i = 0; Count < NumUnique; Count++) {
var Found = false;
var rndValue = get_random(numofitems);
for (j = 0; j < Current.length; j++) {
if (Current[j] == rndValue) {
Found = true;
break;
}
}
if (Found) {
Count--;
} else {
Current[Count] = rndValue;
}
}
for (i = 0; i < listitems.length; i++) {
listitems[i].style.display = "none";
}
for (yi = 0; yi <= numselect; yi++) {
listitems[yi].style.display = "block";
}
}
}
/* Utility Functions */
function get_random(numofitems) {
var MaxValue = numofitems;
var ranNum = Math.round(MaxValue * Math.random());
return ranNum;
}
function getElementClass(element) {
if (element.getAttribute("class")) {
return element.getAttribute("class");
} else if (element.getAttribute("className")) {
return element.getAttribute("className");
}
}
function setElementClass(element, classValue) {
if (element.setAttribute("class", classValue)) {
element.setAttribute("class", classValue);
} else if (element.setAttribute("className", classValue)) {
element.setAttribute("className", classValue);
}
}
function OpenPopup(newLoc, newHeight, newWidth) {
newWin = open("", newLoc, "scrollbars=yes,resizable=yes,height=" + newHeight + ",width=" + newWidth);
}
function resizeWin(newLoc, newHeight, newWidth) {
newWin = open("", newLoc, "scrollbars=yes,resizable=yes,height=" + newHeight + ",width=" + newWidth);
}
/* Utility Function Move Layers */
function movelayers(num) {
if (window.innerHeight) {
pos = window.pageYOffset
} else if (document.documentElement && document.documentElement.scrollTop) {
pos = document.documentElement.scrollTop
} else if (document.body) {
pos = document.body.scrollTop
}
if (pos < theTop) {
pos = theTop;
} else {
pos += 50;
}
if (pos == old) {
document.getElementById(num).style.top = (pos + 'px');
} else {
old = pos;
movelayers(num);
}
}
/* Layer and Src iframe loader */
function loadidetailiframe(idetailurl, detailiframewidth, detailiframeheight, detailiframetop, detailiframeleft) {
var newDiv2 = parent.document.createElement("div");
newDiv2.setAttribute("id", "whiteoutlayer");
newDiv2.innerHTML = " ";
var my_div2 = parent.document.getElementById("bodypadding");
parent.document.body.insertBefore(newDiv2, my_div2);
var framecover = document.getElementById("idetailiframewrapper");
setElementClass(framecover, 'active');
parent.document.getElementById("idetailiframe").src = idetailurl;
parent.document.getElementById("idetailwinbg").style.position = "absolute";
parent.document.getElementById("idetailwinbg").style.zIndex = 2000;
parent.document.location = "#";
var add24px = 24;
var add48px = 48;
var idetailwinbgwidth = (detailiframewidth * 1) + (add24px * 1);
var idetailwinbgheight = (detailiframeheight * 1) + (add48px * 1);
parent.document.getElementById("idetailwinbg").style.width = (idetailwinbgwidth + 'px');
parent.document.getElementById("idetailwinbg").style.height = (idetailwinbgheight + 'px');
parent.document.getElementById("idetailwinbg").style.top = detailiframetop;
parent.document.getElementById("idetailwinbg").style.left = detailiframeleft;
parent.document.getElementById("idetailiframe").style.width = (detailiframewidth + 'px');
parent.document.getElementById("idetailiframe").style.height = (detailiframeheight + 'px');
}
function removeidetailiframe() {
if ((window.pixnumtrack) && (pixnumtrack <= 6)) {
var oIframe = document.getElementById("idetailiframe");
var oDoc = oIframe.contentWindow || oIframe.contentDocument;
if (oDoc.document) {
oDoc = oDoc.document;
}
var timespentpxval = oDoc.getElementById("pxcntnum").value;
var rornval = oDoc.getElementById("rorn").value;
var cnttrack = "//bi.medscape.com/pi/1x1/bi_action_tracking.gif?company=0&department=0&series=0&promo_act=0&action=" + rornval + "_CLOSE&action_id=" + timespentpxval + "&ccid=&eguid=&is_test=0&" + new Date().getTime();
preload_image = new Image(1, 1);
preload_image.src = cnttrack;
}
if ($('#rollover_ad').length > 0) {
setTimeout("adRollTime=0", 500);
var rotrack = "//bi.medscape.com/pi/1x1/bi_action_tracking.gif?company=0&department=0&series=0&promo_act=0&action=ro-to-play&action_id=ro-close&ccid=&eguid=&is_test=&nocache=" + new Date().getTime();
preload_image = new Image(1, 1);
preload_image.src = rotrack;
}
parent.document.getElementById("idetailiframe").src = "//www.medscape.com/files/public/blank.html";
var framecover = document.getElementById("idetailiframewrapper");
setElementClass(framecover, 'inactive');
if (document.getElementById("whiteoutlayer")) {
var element = document.getElementById("whiteoutlayer");
while (element.firstChild) {
element.removeChild(element.firstChild);
}
document.getElementById("whiteoutlayer").id = "";
}
}
/* Remove OSUN Notice */
function removeosun(state) {
if (document.getElementById) {
var osunid = document.getElementById("medlayerad");
setElementClass(osunid, state);
}
}
/* NEW Remove OSUN Notice (generic to all new layer ads) */
function removeosun2(state, layid) {
if (document.getElementById) {
var osunid = document.getElementById(layid);
setElementClass(osunid, state);
}
}
function searchCp(site, callback) {
var cpSrchData = new Object();
cpSrchData.appname = "search";
cpSrchData.activityName = site;
cpSrchData.search = encodeURIComponent($('#searchInput').val());
if ($('meta[name=metasegvar]').length > 0) {
if (segVarParam("artid") != "0") {
cpSrchData.activityId = segVarParam("artid");
}
}
postCp(cpSrchData, callback);
}
function doSearch() {
var qaChk = (document.domain.match(/\.qa\d\d/) == null ? "" : document.domain.match(/\.qa\d\d/)[0]);
if (document.getElementById('searchInput').value == "Search Medscape") {
window.location.href = (window.location.protocol + '//search') + qaChk + '.medscape.com/search';
}
else {
window.location.href = (window.location.protocol + '//search') + qaChk + '.medscape.com/search?q=' + $('#searchInput').val();
}
}
function subsearchheadertrack() {
if (document.getElementById('searchdbvalue').value == "1") {
wmdTrack('hd-sr-srch');
searchCp("news", doSearch);
}
if (document.getElementById('searchdbvalue').value == "2") {
wmdTrack('hd-sr-srch');
searchCp("reference", doSearch);
}
if (document.getElementById('searchdbvalue').value == "3") {
wmdTrack('hd-sr-srch');
searchCp("education", doSearch);
}
if (document.getElementById('searchdbvalue').value == "4") {
wmdTrack('hd-sr-srch');
searchCp("medline", doSearch);
}
}
function togglesearchdbtext(searchdb, value) {
if (document.getElementById) {
var swapsearchdb = searchdb;
changeSeachDB('searchdbtext', swapsearchdb);
$("#searchdbvalue").val(value);
togglesearchdb('inactive');
$("#searchInput").focus();
}
}
function togglesearchdb(state) {
if (state == "active") {
$('#searchdblayer').show();
} else if (state == "inactive") {
$('#searchdblayer').hide();
}
}
function changeSeachDB(id, str) {
if (document.getElementById(id)) {
document.getElementById(id).innerHTML = str;
}
}
function addBrandAlert() {
if ($(".homestar").length != 0 && $(".medscape_today").length == 0 && $("#cardiology").length == 0) { // News homepages
if (window.location.hostname.indexOf('.org') === -1) {
var url = windowhost + "/noscan/public/brandalert/merge-desktop-l.json" //left col
$.ajax({
url: url,
type: "GET"
}).done(function(data) {
if (data.length != 0) {
var cpEventTrack;
if (data[0].activityId != "") {
cpEventTrack = '';
} else {
cpEventTrack = '';
}
if (data[0].hasOwnProperty("tiarray")) {
var fHeadti = data[0].tiarray[Math.round(Math.random() * (data[0].tiarray.length - 1))]
} else {
var fHeadti = data[0].ti;
}
if (data[0].hasOwnProperty("pub")) {
if (data[0]["pub"] !== "") {
var fPubLine = data[0]["pub"]
} else {
var fPubLine = data[0].pu
}
} else {
var fPubLine = data[0].pu
}
if (data[0].uri.indexOf('?') !== -1) {
var queryamp = "&";
} else { var queryamp = "?"; }
var bavpurl = data[0].uri.replace("browser", "headline");
if (data[0].dom.indexOf('wp') !== -1) {
if (data[0].dom.indexOf('staging') !== -1) {
var vpDom = "www.staging.medscape.com";
} else {
var vpDom = "www.medscape.com";
}
} else {
var vpDom = data[0].dom;
}
$('#middle .bucketL ul li:eq(0)').after('' + cpEventTrack + '
' + fHeadti + '' + fPubLine + ''+data[0].jc+'
');
if (data.length == 2) {
var cpEventTrack;
if (data[1].activityId != "") {
cpEventTrack = '';
} else {
cpEventTrack = '';
}
if (data[1].hasOwnProperty("tiarray")) {
var fHeadti = data[1].tiarray[Math.round(Math.random() * (data[1].tiarray.length - 1))]
} else {
var fHeadti = data[1].ti;
}
if (data[1].hasOwnProperty("pub")) {
if (data[1]["pub"] !== "") {
var fPubLine = data[1]["pub"]
} else {
var fPubLine = data[1].pu
}
} else {
var fPubLine = data[1].pu
}
if (data[1].uri.indexOf('?') !== -1) {
var queryamp = "&";
} else { var queryamp = "?"; }
var bavpurl = data[1].uri.replace("browser", "headline");
if (data[1].dom.indexOf('wp') !== -1) {
if (data[1].dom.indexOf('staging') !== -1) {
var vpDom = "www.staging.medscape.com";
} else {
var vpDom = "www.medscape.com";
}
} else {
var vpDom = data[1].dom;
}
$('#middle .bucketR ul li:eq(0)').after('' + cpEventTrack + '
' + fHeadti + '' + fPubLine + ''+data[1].jc+'
');
}
}
});
var url = windowhost + "/noscan/public/brandalert/merge-desktop-r.json" //right col
$.ajax({
url: url,
type: "GET"
}).done(function(data) {
if (data.length != 0) {
var cpEventTrack;
if (data[0].activityId != "") {
cpEventTrack = '';
} else {
cpEventTrack = '';
}
if (data[0].hasOwnProperty("tiarray")) {
var fHeadti = data[0].tiarray[Math.round(Math.random() * (data[0].tiarray.length - 1))]
} else {
var fHeadti = data[0].ti;
}
if (data[0].hasOwnProperty("pub")) {
if (data[0]["pub"] !== "") {
var fPubLine = data[0]["pub"]
} else {
var fPubLine = data[0].pu
}
} else {
var fPubLine = data[0].pu
}
if (data[0].uri.indexOf('?') !== -1) {
var queryamp = "&";
} else { var queryamp = "?"; }
var bavpurl = data[0].uri.replace("browser", "headline");
if (data[0].dom.indexOf('wp') !== -1) {
if (data[0].dom.indexOf('staging') !== -1) {
var vpDom = "www.staging.medscape.com";
} else {
var vpDom = "www.medscape.com";
}
} else {
var vpDom = data[0].dom;
}
$('.businessmedicine #right #specialtyNews').after('');
$('#right #perspective').after('');
}
});
}
}
if ($('.medscape_ref').length != 0 && $('.homestar').length != 0) { // Reference homepages
var url = windowhost + "/noscan/public/brandalert/merge-desktop-ref.json"
$.ajax({
url: url,
type: "GET"
}).done(function(data) {
if (data.length != 0) {
var cpEventTrack;
if (data[0].activityId != "") {
cpEventTrack = '';
} else {
cpEventTrack = '';
}
if (data[0].hasOwnProperty("tiarray")) {
var fHeadti = data[0].tiarray[Math.round(Math.random() * (data[0].tiarray.length - 1))]
} else {
var fHeadti = data[0].ti;
}
if (data[0].hasOwnProperty("pub")) {
if (data[0]["pub"] !== "") {
var fPubLine = data[0]["pub"]
} else {
var fPubLine = data[0].pu
}
} else {
var fPubLine = data[0].pu
}
if (data[0].uri.indexOf('?') !== -1) {
var queryamp = "&";
} else { var queryamp = "?"; }
var bavpurl = data[0].uri.replace("browser", "headline");
if (data[0].dom.indexOf('wp') !== -1) {
if (data[0].dom.indexOf('staging') !== -1) {
var vpDom = "www.staging.medscape.com";
} else {
var vpDom = "www.medscape.com";
}
} else {
var vpDom = data[0].dom;
}
var brandAlertTrack = "wmdTrack('feat_ifi')"
$('#featured .bucketContent ul.listLeft li:eq(1)').replaceWith('' + cpEventTrack + '
' + fHeadti + '' + fPubLine + ''+data[0].jc+'
');
}
});
}
if ($("#featurebarcontainer").length != 0 && trackurl.indexOf('reference') === -1) { //news article
//if ($.isEmptyObject(DFPTargetKeys.exclusionCategories)) {
var url = windowhost + "/noscan/public/brandalert/merge-desktop-news-article.json"
$.ajax({
url: url,
type: "GET"
}).done(function (data) {
if (data.length != 0) {
var cpEventTrack;
if (data[0].activityId != "") {
cpEventTrack = '';
} else {
cpEventTrack = '';
}
if (data[0].hasOwnProperty("tiarray")) {
var fHeadti = data[0].tiarray[Math.round(Math.random() * (data[0].tiarray.length - 1))]
} else {
var fHeadti = data[0].ti;
}
if (data[0].hasOwnProperty("pub")) {
if (data[0]["pub"] !== "") {
var fPubLine = data[0]["pub"]
} else {
var fPubLine = data[0].pu
}
} else {
var fPubLine = data[0].pu
}
if (data[0].uri.indexOf('?') !== -1) {
var queryamp = "&";
} else {
var queryamp = "?";
}
var bavpurl = data[0].uri.replace("browser", "headline");
$('#featurebarcontainer ul li:eq(3)').remove();
if (data[0].dom.indexOf('wp') !== -1) {
if (data[0].dom.indexOf('staging') !== -1) {
var vpDom = "www.staging.medscape.com";
} else {
var vpDom = "www.medscape.com";
}
} else {
var vpDom = data[0].dom;
}
$('#featurebarcontainer ul').prepend('' + cpEventTrack + '
' + fHeadti + '' + fPubLine + '' + data[0].jc + '
');
}
});
//}
}
}
// Virtual Page Tracking
function BItrack(thisURL) {
window.VPTrackFrame.getFile("desturl=" + trackurl + "%5f" + thisURL);
}
/* SWFObject v2.1 Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis*/
var swfobject = function() {
var b = "undefined",
Q = "object",
n = "Shockwave Flash",
p = "ShockwaveFlash.ShockwaveFlash",
P = "application/x-shockwave-flash",
m = "SWFObjectExprInst",
j = window,
K = document,
T = navigator,
o = [],
N = [],
i = [],
d = [],
J, Z = null,
M = null,
l = null,
e = false,
A = false;
var h = function() {
var v = typeof K.getElementById != b && typeof K.getElementsByTagName != b && typeof K.createElement != b,
AC = [0, 0, 0],
x = null;
if (typeof T.plugins != b && typeof T.plugins[n] == Q) {
x = T.plugins[n].description;
if (x && !(typeof T.mimeTypes != b && T.mimeTypes[P] && !T.mimeTypes[P].enabledPlugin)) {
x = x.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
AC[0] = parseInt(x.replace(/^(.*)\..*$/, "$1"), 10);
AC[1] = parseInt(x.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
AC[2] = /r/.test(x) ? parseInt(x.replace(/^.*r(.*)$/, "$1"), 10) : 0
}
} else {
if (typeof j.ActiveXObject != b) {
var y = null,
AB = false;
try {
y = new ActiveXObject(p + ".7")
} catch (t) {
try {
y = new ActiveXObject(p + ".6");
AC = [6, 0, 21];
y.AllowScriptAccess = "always"
} catch (t) {
if (AC[0] == 6) {
AB = true
}
}
if (!AB) {
try {
y = new ActiveXObject(p)
} catch (t) {}
}
}
if (!AB && y) {
try {
x = y.GetVariable("$version");
if (x) {
x = x.split(" ")[1].split(",");
AC = [parseInt(x[0], 10), parseInt(x[1], 10), parseInt(x[2], 10)]
}
} catch (t) {}
}
}
}
var AD = T.userAgent.toLowerCase(),
r = T.platform.toLowerCase(),
AA = /webkit/.test(AD) ? parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false,
q = false,
z = r ? /win/.test(r) : /win/.test(AD),
w = r ? /mac/.test(r) : /mac/.test(AD); /*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/
return {
w3cdom: v,
pv: AC,
webkit: AA,
ie: q,
win: z,
mac: w
}
}();
var L = function() {
if (!h.w3cdom) {
return
}
f(H);
if (h.ie && h.win) {
try {
K.write("