var ADUNIT_provider = (function() { var prefix = '/22932857709/' var ad_units = [ { name : 'jumbo' ,url : 'Globes_Desktop/Globes_Desktop_ROS_970x250_#' ,sizes : [[970, 90], [1280, 300], [1280, 250], [1280, 248], [1164, 300], [970, 300], [970, 250]] ,order : 100 ,id : 'div-gpt-ad-201208131558-1' ,categories : [ {name : 'article_SpecialProject' , url : 'Globes_Desktop_Sponsored_Articles/Globes_Desktop_Sponsored_Articles_970x250_#' , sizes : [[970,90],[970,250]]} ,{name : 'article' , url : 'Globes_Desktop/Globes_Desktop_Article_970x250_#' , sizes : [[970, 250], [1280, 119], [970, 300], [1280, 300], [970, 90], [1164, 300], [1280, 248], [1280, 250]] } ,{name : 'hp' , url : 'Globes_Desktop/Globes_Desktop_HP_970x250_#' } ,{name : 'portal' , url : 'Globes_Desktop/Globes_Desktop_Portal_970x250_#' , sizes : [[970, 90], [970, 300], [970, 250]] } ,{name : 'SpecialProject' , url : null , sizes : [[970,90],[1,1],[970,250]] } ] },{ name : 'r300x600' ,url : 'Globes_Desktop/Globes_Desktop_HP_300x600_1' ,sizes : [[1,600],[120,600],[160,600],[300,600]] ,fbbs : [1520,1600,1880] ,style : 'position:fixed;top:195px;right:0px' },{ name : 'slide' ,url : 'globes_desktop_special/globes_desktop_special_ros_950x400_interstitial' ,sizes : [[1,1],[950,400],[970,250]] ,order : 101 ,style : 'height:1px' ,categories : [ {name : 'article_SpecialProject' , url : null } ,{name : 'SpecialProject' , url : null } ,{name : 'article' , url : 'globes_desktop_special/globes_desktop_special_article_950x400_interstitial' } ,{name : 'hp' , url : null } ,{name : 'portal' , url : 'globes_desktop_special/globes_desktop_special_portal_950x400_interstitial' } ] },{ name : 'spot' ,refresh : 1 ,url : 'Globes_Desktop/Globes_Desktop_ROS_300x250_#' ,sizes : [[300,250],[250,250]] ,style : 'width:300px;height:280px' ,categories : [ {name:'article',sizes:[320,250]} ] },{ name : 'cube' ,url : 'Globes_Desktop/Globes_Desktop_ROS_300x250_#' ,sizes : [[300,250],[250,250]] ,style : 'width:300px;height:280px' ,categories : [ { name:'article' , sizes:[320,250] } ,{ name:'hp' , sizes:[320,250] , url : null} ] },{ name : 'king' ,url : 'Globes_Mobileweb/Globes_Mobileweb_ROS_320x170_#' ,sizes : ['fluid',[1,1],[320,170],[360,360]] ,style : '-width:100%;text-align: center' ,categories : [ {name : 'article_SpecialProject' , url : 'Globes_Mobileweb_Sponsored_Articles/Globes_Mobileweb_Sponsored_Articles_320x170_1' } ,{name : 'article' , url : 'Globes_Mobileweb/Globes_Mobileweb_Article_320x170_1' } ,{name : 'hp' , url : 'Globes_Mobileweb/Globes_Mobileweb_HP_320x170_1' } ,{name : 'portal' , url : 'Globes_Mobileweb/Globes_Mobileweb_Portal_320x170_1' , style : 'position:relative;top:63px' } ,{name : 'SpecialProject' , url : null } ] },{ name : 'sticky' ,url : 'Globes_Mobileweb/Globes_Mobileweb_ROS_320x50_Sticky' ,sizes : ['fluid',[320,50]] ,style : 'right:0;left:0;margin:0 auto;position:fixed;bottom:0px;background-color:white;z-index: 1111' ,categories : [ {name : 'article_SpecialProject' , url : 'Globes_Mobileweb_Sponsored_Articles/Globes_Mobileweb_Sponsored_Articles_320x50_Sticky' } ,{name : 'article' , url : 'Globes_Mobileweb/Globes_Mobileweb_Article_320x50_Sticky' , style : 'right:0;left:0;margin:0 auto;position:fixed;bottom:56px' } ,{name : 'hp' , url : 'Globes_Mobileweb/Globes_Mobileweb_HP_320x50_Sticky' , style : 'right:0;left:0;margin:0 auto;position:fixed;bottom:0px;background-color:white;z-index: 1111' } ,{name : 'portal' , url : 'Globes_Mobileweb/Globes_Mobileweb_Portal_320x50_Sticky' } ,{name : 'SpecialProject' , url : 'Globes_Mobileweb_Sponsored_Articles/Globes_Mobileweb_Sponsored_Articles_320x50_Sticky'} ] } ] function get_adunit(adunit_name,adunit_category,adunit_index) { // adunit.category.index var unitsA = ad_units.filter(au => au.name == adunit_name) if (unitsA.length == 0) {return null} var adunit = unitsA[0] var categoriesA = (adunit.categories || []).filter(c => c.name == adunit_category) var category = categoriesA.length > 0 ? categoriesA[0] : {} var url = typeof(category.url) == 'undefined' ? adunit.url : category.url adunit.index = adunit.index || 1 if (url != null) { if (adunit_index > 0) { url = prefix + url.replace(/#/,adunit_index) if (adunit_index > adunit.index) {adunit.index = adunit_index} } else { url = prefix + url.replace(/#/,adunit.index) } } var r = {url : url} r.local = '.' + adunit_name + '.' + adunit_category + '.' + adunit_index r.calculated_local = '.' + adunit_name + '.' + adunit_category + '.' + adunit.index adunit.index = adunit.index + 1 for(var k in adunit) { if (k == 'name' || k == 'url' || k == 'categories' || k == 'index') {continue} r[k] = adunit[k] } for(var k in category) { if (k == 'name' || k == 'url') {continue} r[k] = category[k] } return r } return { get_adunit : function(adunit_name,adunit_category,adunit_index) {return get_adunit(adunit_name,adunit_category,adunit_index)} } })() //alert(JSON.stringify(dfp_globes.get_adunit('spot','','')))