if (typeof se == "undefined") { var se = new Object(); } if (typeof se.aftonbladet == "undefined") { se.aftonbladet = new Object(); } se.aftonbladet.findElementPosition = function(object) { var curleft = curtop = 0; if (object.offsetParent) { curleft = object.offsetLeft curtop = object.offsetTop while (object = object.offsetParent) { curleft += object.offsetLeft curtop += object.offsetTop } } return [curleft,curtop]; } var abOnloadFunctions = new Array(); function abRegisterOnloadFunction(func) { abOnloadFunctions[abOnloadFunctions.length] = func; } function abInitializePage() { for (var i = 0; i < abOnloadFunctions.length; i++) { abOnloadFunctions[i](); } } if (typeof se.aftonbladet.localbox == "undefined") { se.aftonbladet.localbox = new Object(); } se.aftonbladet.localbox.getUrl = function(source) { if (typeof (source) == "undefined") {source = "ab";} var basePath = "/template/siddata/"; var partner = ""; var url = ""; var sesamCities = new Array("boras","falun","gavle","goteborg","helsingborg","jonkoping","kalmar","karlstad","linkoping","lulea","malmo","norrkoping","orebro","ostersund","sodertalje","stockholm","sundsvall","umea","uppsala","vasteras"); if (source == "sesam" && typeof (abLokaltInitRegion) != "undefined") { for (var i = 0; i < sesamCities.length; i++) { if (sesamCities[i] == abLokaltInitRegion) { partner = "sesamLokalruta" + sesamCities[i].substring(0,1).toUpperCase() + sesamCities[i].substring(1); } } } if (partner != "") { url = basePath + "?partner=" + partner; } return url; } se.aftonbladet.fillElementFromUrl = function(elementId,url) { if (elementId && elementId != "" && url && url != "") { var callback = { success: function(o){ YAHOO.util.Dom.get(elementId).innerHTML = o.responseText; }, failure: function(o){ // Just don't show anything. } }; YAHOO.util.Connect.asyncRequest('GET',url, callback); } } function abInitializeAds() {} abRegisterOnloadFunction(abInitializeAds); function abKontakt(name,server,subject) { var adr = 'mai'; adr = adr + 'lto' + ':' + name; adr = adr + '@' ; if (server && server != "") { adr = adr + server; } else { adr = adr + 'aftonbladet'; adr = adr + '.se'; } if (subject && subject != "") { adr = adr + '?subject=' + subject; } document.location = adr; } function kontakt(name,server,subject) { abKontakt(name,server,subject) } function AB_Kontakt(name,server,subject) { abKontakt(name,server,subject) } function abRosta(thisform,width,height) { if (thisform) { if (width != "" && height != "") { var winparams = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height; rostaWin = window.open ('','rostaWin',winparams); thisform.target = 'rostaWin'; thisform.submit(); } else { thisform.target = '_self'; thisform.submit(); } } } function abRostResultat(frageID,width,height) { if (frageID != "") { //url = "/vss/special/storfragan/visa/0,1937," + frageID + ",00.html"; url = "http://aftonbladet.se/vss/special/storfragan/visa/0,1937," + frageID + ",00.html"; if (width != "" && height != "") { var winparams = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height msgWindow=window.open (url,"displayWindow",winparams); } else { document.location = url; } } } function abWindowOpen(url,width,height,type,windowName) { if (!url) { return false; } if (location.href.indexOf ("http://aftonbladet.se")==-1 && location.href.indexOf ("www.aftonbladet.se")==-1 && location.href.indexOf ("production.aftonbladet.se")==-1 && url.indexOf("http") == -1 && location.href.indexOf("abse") == -1 ) { url = "http://www.aftonbladet.se" + url; } if (!width) { width = '300'; } if (!height) { height = '300'; } if (!type) { type = '3'; } windowName = windowName || 'msgWindow' if (type == '1') { params = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + width + ',height=' + height; } else if (type == '2') { params = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=' + width + ',height=' + height; } else if (type == '3') { params = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + width + ',height=' + height; } else if (type == '4') { params = 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=' + width + ',height=' + height; } else if (type == '5') { params = 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' + width + ',height=' + height; } else { params = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + width + ',height=' + height; } msgWindow = window.open(url,windowName,params); msgWindow.focus(); return false; } function openSite(url,width,height) {abWindowOpen(url,width,height,'3')} function windowOpen(url,width,height,type) {abWindowOpen(url,width,height,type);} function AB_WindowOpen(url,width,height,type) {abWindowOpen(url,width,height,type);} function abGetCookie(nameOfCookie) { if (document.cookie.length > 0){ var begin = document.cookie.indexOf(nameOfCookie+"="); if (begin != -1){ begin += nameOfCookie.length+1; var end = document.cookie.indexOf(";", begin); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(begin, end)); } } return null; } function abSetCookie(nameOfCookie, value, expiredays, domain) { var ExpireDate = new Date (); ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000)); document.cookie = nameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString()) + ";path=/" + ((domain) ? "; domain=" + domain : ""); } function abToggleDisplay(elementid) { var uf = document.getElementById(elementid); if (uf) { if (uf.style.display == "none") { uf.style.display = "block"; } else { uf.style.display = "none"; } } return; } function abInitializeFontSize() { var sparadStorlek = abGetCookie('abBasicFontSize'); if (sparadStorlek) { abUpdateDocumentFontSize(sparadStorlek); } } function abChangeFontSize(nyStorlek) { abUpdateDocumentFontSize(nyStorlek); abSetCookie('abBasicFontSize',nyStorlek,1000); } function abUpdateDocumentFontSize(storlek) { var documentFontSize = "100%"; var abTextSizeImage = "_S.gif?4"; if (storlek == "S") { documentFontSize = "100%"; abTextSizeImage = "_S.gif?4"; } if (storlek == "M") { documentFontSize = "120%"; abTextSizeImage ="_M.gif?4"; } if (storlek == "L") { documentFontSize = "133%"; abTextSizeImage ="_L.gif?4"; } var artArea = document.getElementById("abMainArticle"); if (artArea) { artArea.style.fontSize = documentFontSize; } var txtImage1 = document.getElementById("abTextSizeImage1"); if (txtImage1) { var mySplitResult = txtImage1.src.split("_"); txtImage1.src = mySplitResult[0] + abTextSizeImage; } } function abBrowserExtractVersion(str) { var version = new String(''); var dotted = false; for(var i=0; i < str.length; i++) { if (!isNaN(parseInt(str.charAt(i)))) { version = version + str.charAt(i); } else if (str.charAt(i) == ".") { if (!dotted) { version = version + '.'; dotted = true; } } else if (version != "") { break; } } if (version == "") { version = 0; } return version; } function abBrowser() { /* --- Satt default pa tillgangliga egenskaper--- */ this.agent = navigator.userAgent.toLowerCase(); this.name = 'unknown'; this.engine = 'unknown'; this.version = '0'; this.platform = 'unknown'; /* --- Browser --- */ if (this.agent.indexOf('safari') != -1) { this.name = 'safari'; this.engine = 'khtml'; this.version = abBrowserExtractVersion(this.agent.substr(this.agent.indexOf('safari') + 7)); this.platform = 'macosx'; } else if (this.agent.indexOf('opera') != -1) { this.name = 'opera'; this.engine = 'opera'; this.version = abBrowserExtractVersion(this.agent.substr(this.agent.indexOf('opera') + 6)); } else if (this.agent.indexOf('firefox') != -1) { this.name = 'firefox'; this.engine = 'gecko'; this.version = abBrowserExtractVersion(this.agent.substr(this.agent.indexOf('firefox') + 8)); } else if (this.agent.indexOf('netscape') != -1) { this.name = 'netscape'; this.engine = 'gecko'; this.version = abBrowserExtractVersion(this.agent.substr(this.agent.indexOf('netscape') + 9)); } else if (this.agent.indexOf('msie') != -1) { this.name = 'msie'; this.engine = 'msie'; this.version = abBrowserExtractVersion(this.agent.substr(this.agent.indexOf('msie') + 5)); } else if (this.agent.indexOf('camino') != -1) { this.name = 'camino'; this.engine = 'camino'; this.version = abBrowserExtractVersion(this.agent.substr(this.agent.indexOf('camino') + 7)); } else if (this.agent.indexOf('seamonkey') != -1) { this.name = 'seamonkey'; this.engine = 'gecko'; this.version = abBrowserExtractVersion(this.agent.substr(this.agent.indexOf('seamonkey/') + 3)); } else if (this.agent.indexOf('gecko') != -1 && this.agent.indexOf('rv:') != -1 && this.agent.indexOf('mozilla') != -1) { this.name = 'mozilla'; this.engine = 'gecko'; this.version = abBrowserExtractVersion(this.agent.substr(this.agent.indexOf('rv:') + 3)); } /* --- Engine --- */ if (this.engine == "unknown") { if (this.agent.indexOf('khtml') != -1) { this.engine = 'khtml'; } else if (this.agent.indexOf('gecko') != -1) { this.engine = 'gecko'; } } /* --- Platform --- */ if (this.platform == "unknown") { if (this.agent.indexOf('linux') != -1) { this.platform = 'linux'; } else if (this.agent.indexOf('mac os x') != -1 || this.agent.indexOf('mac_powerpc') != -1) { this.platform = 'macosx'; } else if (this.agent.indexOf('windows') != -1) { this.platform = 'windows'; } } } /* --- Skapa ett browserobjekt --- */ var abBrowser = new abBrowser(); /* --- Kolla browser/version, returnerar "true" om browser stammer och version ar minst "version" annars "false" --- */ function abBrowserCheck(browser,version) { var trueOrFalse = false; if (typeof(abBrowser) != 'undefined') { if (abBrowser.name && abBrowser.name == browser && abBrowser.version && abBrowser.version >= version) { trueOrFalse = true; } } return trueOrFalse; } function abCheckSmallScreenClient () { if (screen.width < 490) { document.write("
Till mobilversion av Aftonbladet
"); } } function abSesamSearchEmptyDefaultText(theTextField) { if (theTextField.value == 'Skriv in ditt sökord här' || theTextField.value == 'Sök på Aftonbladet') { theTextField.value = ''; theTextField.style.color = '#000'; } return true; } if (typeof se.aftonbladet.plus == "undefined") { se.aftonbladet.plus = new Object(); } se.aftonbladet.plus.baseUrl = "http://wwwapp.aftonbladet.se"; se.aftonbladet.plus.abseUrl = "http://www.aftonbladet.se"; se.aftonbladet.plus.communityBaseUrl = "http://snack.aftonbladet.se"; se.aftonbladet.plus.defaultSelectedSections = ["plus_nyheter","plus_sportbladet","plus_nojesbladet"]; // "External" utility functions function abMspClick(T, C, U, L) { var targetUrl = 'http://www.myspace.com/Modules/PostTo/Pages/?' + 't=' + encodeURIComponent(T) + '&c=' + encodeURIComponent(C) + '&u=' + encodeURIComponent(U) + '&l=' + L; abWindowOpen(targetUrl); } function abFbsClick(u, t, s, i) { window.open('http://www.facebook.com/sharer.php?s=100&p[title]='+encodeURIComponent(t)+'&p[images][0]='+encodeURIComponent(i)+'&p[medium]=102&p[summary]='+encodeURIComponent(s)+'&p[url]='+encodeURIComponent(u), 'sharer', 'toolbar=0,status=0,width=626,height=436'); } function abLeftNavigationToggle(id) { var D = YAHOO.util.Dom; var el = D.get(id); var className = 'leftNavigationHiddenSubmenu'; if(D.hasClass(el,className)) { D.removeClass(el, className); } else { D.addClass(el, className); } } function abArticleToplistUpdateFooter(list,type, id, quantity) { var splittedList = list.split(/,|\s+/); if(type=='hour'||type=='day') { for(var i=0; i