  var abPlusDebugging = false;var abPlusDebugMsg = "";var abPlusLatestJsCallId = -1;abPlusHandleRedirect();// Custom eventsvar	onAbPlusCompletedLogin = new YAHOO.util.CustomEvent("onAbPlusCompletedLogin");var isAbPlusCompletedLogin = false;var	onAbCompletedLogin = new YAHOO.util.CustomEvent("onAbCompletedLogin");var isAbCompletedLogin = false;var	onAbPlusCoreComplete = new YAHOO.util.CustomEvent("onAbPlusCoreComplete");var isAbPlusCoreComplete = false;/* Logged in users accessing /plus should be redirected to /plus/mittplus(and vice versa) */function abPlusHandleRedirect() {	abPlusDebug("abPlusHandleRedirect:");	var sec = window.location.pathname.split('/').join('_').replace(/_$/g, '').replace(/^_/g, '');	if (sec == 'plus' || sec == 'plus_mittplus') {		if (abPlusIsLoggedIn()) {//			if (sec != 'plus_mittplus') {//				window.location.replace('/plus/mittplus');//			}		} else if (sec == 'plus_mittplus') {			window.location.replace('/plus');		}	}}/* Returns the unique section name based on the	se.aftonbladet.uniqueSectionName property	(falling back to pathname if that property is not set) */function abPlusCurrentSection() {	if (typeof se != 'undefined' && se.aftonbladet && se.aftonbladet.uniqueSectionName) {		return se.aftonbladet.uniqueSectionName;	} else {		return window.location.pathname.split('/').join('_').replace(/_$/g, '').replace(/^_/g, '');	}}/* Called by the plus top tool bar */function abPlusTopToolBar() {	abPlusDebug("abPlusTopToolBar:");	if (abPlusIsLoggedIn()) {		abPlusShowLoggedIn();		// Fire completed login event		onAbPlusCompletedLogin.fire();		isAbPlusCompletedLogin = true;	} else if (abIsLoggedIn()) {		abShowLoggedIn();		// Fire completed login event		onAbCompletedLogin.fire();		isAbCompletedLogin = true;	} else {		abPlusShowNotLoggedIn();	}}/* Called by the doLogin javascript */function abPlusReceiveRequest(sessionKey, loggedInUserData) {	abPlusDebug("abPlusReceiveRequest:");	abPlusUpdateCookies(sessionKey, loggedInUserData);	abPlusCreateCookie("abPlusAppCacheTag", '', true);	abPlusTopToolBar(true);}/* Updates the loggedInUserSessionKey and subscription status.	Needed mainly for strict Safari browsers. */function abPlusUpdateCookies(sessionKey, loggedInUserData) {	var loggedInUserSessionKeyC = abPlusReadCookie("loggedInUserSessionKey");	var loggedInUserDataC       = abPlusReadCookie("loggedInUserData");	if (sessionKey) {		if (loggedInUserSessionKeyC === null || loggedInUserSessionKeyC != sessionKey) {			abPlusCreateCookie("loggedInUserSessionKey", sessionKey);			abPlusDebug(" set loggedInUserSessionKey: " + sessionKey);		}		if (loggedInUserDataC === null) {			abPlusCreateCookie("loggedInUserData", loggedInUserData);			abPlusDebug(" set loggedInUserData: " + loggedInUserData);		}	}}/** * Checks that a user is logged in (not necessarily to Plus) * by checking her cookies only. */function abIsLoggedIn() {	return abPlusIsLoggedIn(!se.aftonbladet.plus.disableCommunity && true);}/** * Checks that a user is logged in and a plus member by checking * her cookies only. * @param {boolean} freeMemberOK if set to true, the user is not required * to be a plus member, but has to be an aftonbladet member */function abPlusIsLoggedIn(freeMemberOK) {	abPlusDebug("abPlusIsLoggedIn:");	var loggedInSessionKeyCookie= abPlusReadCookie("loggedInUserSessionKey");	var loggedInUserData = abPlusReadCookie("loggedInUserData");    if (loggedInSessionKeyCookie === null) {        return false;    } else if (!freeMemberOK && !abPlusIsPlusMember()) {		// There is a session and logged-in session but not a plus member		return false;	}    	// Logged in and plus member	return true;}/** * Check is the user is a plus member by checking her cookies only. * Supports both loggedInUserData and loggedInUserPlusSubscription cookie * styles. */function abPlusIsPlusMember() {	var loggedInUserData = abPlusReadCookie("loggedInUserData");	if (loggedInUserData === null) {		loggedInUserData = abPlusReadCookie("loggedInUserPlusSubscription");	}	return (loggedInUserData !== null &&		(loggedInUserData.indexOf("plusSubscription:true") >= 0 || loggedInUserData == 'true'));}/** * Check if the user is a snack member by checking her cookies only. */function abIsSnackMember() {	var loggedInUserData = abPlusReadCookie("loggedInUserData");	if (loggedInUserData === null) {		loggedInUserData = abPlusReadCookie("loggedInUserPlusSubscription");	}	return (loggedInUserData !== null &&		(loggedInUserData.indexOf("snackMember:true") >= 0 || loggedInUserData == 'true'));}/* Performs pre login actions. If the user is logging in	using the top toolbar and we are not generating for	framework, the returnPath is set to window.location.href. */function abPlusPreLogin(loginForm) {	if (loginForm && loginForm.returnPath &&		se && se.aftonbladet &&		(!se.aftonbladet.isGeneratingForFramework || se.aftonbladet.loginFormReturnPath)) {		var loginUrl = window.location.href;		loginUrl = loginUrl.replace(/\?teaser=true$/,'');		loginForm.returnPath.value = (se.aftonbladet.loginFormReturnPath ? se.aftonbladet.loginFormReturnPath : loginUrl);	}	return true;}/* Logs the user in to plus */function abPlusLogin(username, password, callback) {	YAHOO.util.Get.script("https://www.aftonbladet.se/jsp/login/doLogin.jsp?returnJs=true" +		(username ? '&username=' + escape(username) : '') +		(password ? '&password=' + escape(password) : '') +		(callback ? '&callback=' + escape(callback) : '')	);}/* Logs out the user out from both plus and snack */function abPlusLogout(){	abPlusDebug("abPlusLogout:");	abPlusShowWaiting();	// Reload/Redirect	var reload = function() {		if (abPlusCurrentSection() == 'plus_mittplus') {			window.location.replace('http://www.aftonbladet.se/plus/');		} else {			window.location.reload(true);		}	};	// Logout free member	var freeMemberLogout = function() {		abPlusRemoveCookies();		YAHOO.util.Get.script(se.aftonbladet.plus.communityBaseUrl + "/logout.action", { onSuccess: reload });	};	// Logout plus member	YAHOO.util.Get.script("http://wwwb.aftonbladet.se/jsp/login/doLogout.jsp?returnJs=true", { onSuccess: freeMemberLogout });}/* If cookies is not removed by server for some reason ex. safari user logging in on	domain other than www.aftonbladet.se */function abPlusRemoveCookies(){	abPlusDebug("abPlusRemoveCookies:");	if (abPlusReadCookie("loggedInUserSessionKey") !== null) {		abPlusCreateCookie("sessionKey", '', true);		abPlusCreateCookie("loggedInUserSessionKey", '', true);		abPlusCreateCookie("loggedInUserData", '', true);	}	abPlusCreateCookie("abPlusAppCacheTag", '', true);}/* Reads a cookie matching the given name.	Note that if the value is the string 'null',	null will be returned. */function abPlusReadCookie(name) {	var nameEQ = name + "=";	var ca = document.cookie.split(';');	for(var i=0;i < ca.length;i++) {		var c = ca[i];		while (c.charAt(0) == ' ') {			c = c.substring(1,c.length);		}		if (c.indexOf(nameEQ) === 0) {			var value = unescape(c.substring(nameEQ.length,c.length));			if (value.length > 0 && value != "null") {				return value;			} else {				return null;			}		}	}	return null;}/* Creates a cookie in the .aftonbladet.se domain	that expires in six hours (or given minutes). Note that if the	value is null or the string 'null' the cookie	will be removed. */function abPlusCreateCookie(name, value, remove, expiresMinutes) {	var path="/";	var minutes = 60 * 6;	if (expiresMinutes !== undefined) {		minutes = expiresMinutes;	}	var domain = ".aftonbladet.se";	if (value == 'null') {		remove = true;		value = '';	}	var date = new Date();	if (remove) {		date.setTime(date.getTime()-10000);	} else {		date.setTime(date.getTime()+(minutes*60*1000));	}	var expires = "; expires="+date.toGMTString();	document.cookie = name+"="+escape(value)+expires+"; path="+path+"; domain="+domain;}/* Shows the free members logged in toolbar */function abShowLoggedIn() {	abGetTopToolbarLoggedIn().style.display = 'block';	abPlusGetTopToolbarLoggedIn().style.display = 'none';	abPlusGetTopToolbarNotLoggedIn().style.display = 'none';	abPlusGetTopToolbarWaiting().style.display = 'none';	// Logged in name	var loggedInUserDataC = abPlusReadCookie("loggedInUserData");	if (loggedInUserDataC !== null) {		var userData = eval("("+ loggedInUserDataC +")");		if (userData && userData.fullName) {			var nameEl = document.getElementById('abTopToolbarLoggedInName');			if (nameEl !== null) {				nameEl.innerHTML = unescape(userData.fullName).replace(/\+/, ' ');			}		}	}	// Free plus tools	if (!se.aftonbladet.plus.disableCommunity) {		abShowFreePlusTools();	}	// Menu	var onMenuBarBeforeRender = function() {		var oSubmenuData = {			"mNav": [						{ text: "Snack", url: se.aftonbladet.plus.communityBaseUrl },						{ text: "Blogg", url: "http://blogg.aftonbladet.se" },						{ text: "Mitt Klipp", url: "http://mittklipp.aftonbladet.se" }					],			"mProfile": [						{ text: '<span style="font-weight:bold;">InstÃ¤llningar:</span>', url: "" },						{ text: "Mitt medlemskap", url: "http://wwwb.aftonbladet.se/jsp/mypage/plus/settings.jsp" },						{ text: "Min sida", url: se.aftonbladet.plus.communityBaseUrl + "/mySettings.action" }					]		};		this.getItem(1).cfg.setProperty("submenu", { id: "mNav", itemdata: oSubmenuData["mNav"] });		this.getItem(2).cfg.setProperty("submenu", { id: "mProfile", itemdata: oSubmenuData["mProfile"]});	};	var oMenuBar = new YAHOO.widget.MenuBar("abToolbarMenuContainer", {		autosubmenudisplay: false,		showdelay: 250,		hidedelay: 750,		lazyload: true,		submenualignment: ["tr","br"]	});	oMenuBar.beforeRenderEvent.subscribe(onMenuBarBeforeRender);	oMenuBar.render();}/* Shows the Plus logged in toolbar */function abPlusShowLoggedIn() {	abGetTopToolbarLoggedIn().style.display = 'none';	abPlusGetTopToolbarLoggedIn().style.display = 'block';	abPlusGetTopToolbarNotLoggedIn().style.display = 'none';	abPlusGetTopToolbarWaiting().style.display = 'none';}/* Shows the not logged in toolbar */function abPlusShowNotLoggedIn() {	abGetTopToolbarLoggedIn().style.display = 'none';	abPlusGetTopToolbarLoggedIn().style.display = 'none';	abPlusGetTopToolbarNotLoggedIn().style.display = 'block';	abPlusGetTopToolbarWaiting().style.display = 'none';}/* Shows the waiting toolbar */function abPlusShowWaiting() {	abGetTopToolbarLoggedIn().style.display = 'none';	abPlusGetTopToolbarLoggedIn().style.display = 'none';	abPlusGetTopToolbarNotLoggedIn().style.display = 'none';	abPlusGetTopToolbarWaiting().style.display = 'block';}/* Returns the toolbarcontainer */function abPlusTopToolbarContainer() {	return document.getElementById("abPlusTopToolbarContainer");}/* Returns the Plus logged in toolbar element */function abPlusGetTopToolbarLoggedIn() {	return document.getElementById("abPlusTopToolbarLoggedIn");}/* Returns the free member logged in toolbar element */function abGetTopToolbarLoggedIn() {	return document.getElementById("abTopToolbarLoggedIn");}/* Returns the not logged in toolbar element */function abPlusGetTopToolbarNotLoggedIn() {	return document.getElementById("abPlusTopToolbarNotLoggedIn");}/* Returns the waiting toolbar element */function abPlusGetTopToolbarWaiting() {	return document.getElementById("abPlusTopToolbarWaiting");}/* Logs debug messages in the YAHOO logger */function abPlusDebug(msg) {	if (abPlusDebugging) {		abPlusDebugMsg += msg + "\n";	}}/** * Updates the html/head element with a script element * pointing to the given src. */function abPlusIncludeJs(src) {	try {		abPlusLatestJsCallId = YAHOO.util.Get.script(src, { charset: 'utf-8' });	} catch(ignore) {		// Ignore errors	}}/** * Clear defaultvalue in inputfield *///function abPlusClearDefaultValue(el) {	if (el.defaultValue==el.value) {		el.value = "";	}}/** * Function to show or hide different containers * in abPlusPlusTools. * @param {string} contentPart the content part suffix to show/hide */function abPlusPlusToolsToogle(contentPart){	var isPlusMember = abPlusIsPlusMember();	if ((isPlusMember && contentPart == 4) ||		(!isPlusMember && (contentPart == 1 || contentPart == 2))) {		return;	}	var Dom = YAHOO.util.Dom;	var showHideEl = Dom.get('abPlusPlusToolsShowHide' + contentPart);	var contentEl  = Dom.get('abPlusPlusToolsContent' + contentPart);	if (contentPart == 1 && Dom.getStyle(contentEl, "display") == "none" && (typeof abPlusCore != "undefined")) {		abPlusCore._updatePlusToolsSavedArticles();	}	if (Dom.hasClass(showHideEl, 'abPlusPlusToolsShow')) {		Dom.replaceClass(showHideEl, 'abPlusPlusToolsShow', 'abPlusPlusToolsHide');		Dom.setStyle(contentEl, "display", "block");	} else {		Dom.replaceClass(showHideEl, 'abPlusPlusToolsHide', 'abPlusPlusToolsShow');		Dom.setStyle(contentEl, "display", "none");	}}/** * Hide or show the "new" plus tools. */function abPlusToolsToggle(){	var Dom = YAHOO.util.Dom;	var container = Dom.get('abPlusPlusTools');	if (Dom.hasClass(container, 'abPlusToolsExpanded')) {		Dom.removeClass(container, 'abPlusToolsExpanded');	} else {		Dom.addClass(container, 'abPlusToolsExpanded');		if (abPlusIsPlusMember()) {			abPlusCore._updatePlusToolsSavedArticles();		}	}}/** * Function for handling Enter key - submit in * password field */function abPlusCheckEnterKeySubmit(e) {	var chrCode = -1;	if (e && e.which) {		e = e ;		chrCode = e.which;	} else {		e = event;		chrCode = e.keyCode;	}	if (chrCode == 13) {		var input = window.event ? e.srcElement: e.target;		if (input) {			abPlusPreLogin(input.form);			input.form.submit();			return false;		} else {			return true;		}	} else {		return true;	}}/** * Shows the Plus tools (free member version) in the "pilram". */function abShowFreePlusTools() {	var plusTools = YAHOO.util.Dom.get('abPlusPlusTools');	if (plusTools) {		var container = YAHOO.util.Dom.get('abPilramContainer'); // Check that the pilram is not hidden		if (container && 'none' != YAHOO.util.Dom.getStyle(container, 'display')) {			var handleSuccess = function(obj) {				if (obj.responseText !== undefined) {					plusTools.innerHTML = obj.responseText;					abPostInitFreeTools();				}			};			var handleFailure = function(obj) {				;// Keep tools hidden.			};			var callback = {				success: handleSuccess,				failure: handleFailure,				timeout: 10000			};			try {				if (se.aftonbladet.plus.toolsLayout === 'wide') {					YAHOO.util.Connect.asyncRequest('GET', se.aftonbladet.plus.abseUrl+"/template/ver1-0/components/plus/newPlusTools.jsp?community=true", callback);				} else {					YAHOO.util.Connect.asyncRequest('GET', se.aftonbladet.plus.abseUrl+"/template/ver1-0/components/plus/plusTools.jsp?community=true", callback);				}			} catch(ignore) {				handleFailure();			}		}	} else {		YAHOO.util.Event.onAvailable("abPlusPlusTools", abShowFreePlusTools);	}}/** * Fetches free member data (such as unread message count * and groups) and displays it where applicable. */function abShowFreeMemberData(obj) {	if (YAHOO.lang.isObject(obj)) {		se.aftonbladet.plus.menuInfo = obj; // Store for use by other JS		var mc = "(" + (YAHOO.lang.isNumber(obj.messageCount) ? obj.messageCount : 0) + ")";		YAHOO.util.Dom.get('abMenuLabelMaila').innerHTML = mc;		var pptSumEl = YAHOO.util.Dom.get('abPlusPlusToolsLabel4Sum');		if (pptSumEl) {			pptSumEl.innerHTML = mc;			YAHOO.util.Dom.get('abPlusPlusToolsContentList4Member').innerHTML = mc;		}		abRenderMyGroupsTab(obj.groups);	} else {		var url = se.aftonbladet.plus.communityBaseUrl + "/menuInfo.action?callback=abShowFreeMemberData";		try {			YAHOO.util.Get.script(url);		} catch(ignore) {			// Ignore errors		}	}}/** * Fires after the free plus tools has loaded and * initializes CSS classes, etc. */function abPostInitFreeTools() {	var plusTools = YAHOO.util.Dom.get('abPlusPlusTools');	YAHOO.util.Dom.setStyle(plusTools, 'display', 'block');	YAHOO.util.Dom.addClass(plusTools, 'abPlusComTools');	abShowFreeMemberData();}/* * Renders the my groups tab of the plus/free tools navigation. */function abRenderMyGroupsTab(groups) {	var tab = YAHOO.util.Dom.get('abPlusPlusToolsContent7');	if (tab) {		// Remove old contents		var oldList = tab.getElementsByTagName('ul');		if (oldList.length > 0) {			tab.removeChild(oldList[0]);		}		var list = document.createElement('ul');		if (YAHOO.lang.isArray(groups) && groups.length > 0) {			// Groups			for (var i=0; i<groups.length; i++) {				var item = document.createElement('li');				item.className = 'abPlusLi' + (i % 2 == 0 ? 'Even' : 'Odd');				list.appendChild(item);				var a = document.createElement('a');				a.className = 'abPlusPlusToolsIconNone';				a.href = se.aftonbladet.plus.communityBaseUrl + '/groupHome.action?groupId=' + groups[i].id;				if (typeof a.textContent != 'undefined') a.textContent = groups[i].name; else a.innerText = groups[i].name;				a.title = 'Visa ' + groups[i].name;				item.appendChild(a);			}		} else {			var item = document.createElement('li');			item.className = 'abPlusLiInfo';			item.innerHTML = 'Du &auml;r inte medlem i n&aring;gon grupp &auml;n.<br/>' +				'H&auml;r ser du alla <a href="' + se.aftonbladet.plus.communityBaseUrl + '/listGroups.action" class="abPlusPlusToolsIconNone" style="margin:0; padding:0 !important; text-decoration:underline;">grupper</a>.';			list.appendChild(item);		}		tab.appendChild(list);	}} 
var AbTvUtils = function() {
	this.debug = false;
	this.currentClipParams = undefined;
	this.adPosBF10HasContent = false;
};

AbTvUtils.prototype = {

	/**
	 * Creates the flash content using whatever means are appropriate given the browser.
	 */
	makeFlash: function(file, divId, id, w, h, flashVars, wmode) {
		var height = h.toFixed(0);
		var so = new SWFObject(file, id, w, height, "9", "#FFFFFF", "high");
		// Check for Mac and don't use express install since there seems to be problems with it
		if (navigator.platform && (navigator.platform.toLowerCase().indexOf("mac") < 0)) {
			so.useExpressInstall(window.location.protocol + "//" + window.location.host + "/template/ver1-0/flash/expressinstall.swf");
		}
		so.addParam("allowFullScreen", "true");
		so.addParam("allowScriptAccess", "always");
		so.addParam("flashvars", flashVars);
		if (typeof wmode != "undefined") {
			so.addParam("wmode", wmode);
		}
		so.write(divId);
	},

	/**
	 * Setting the parameters for all other functions to use, called from flash.
	 */
	setTvArticleParams: function(articleId, isSatellite) {
		var linkBox = YAHOO.util.Dom.get("abTvCopylinkBox");
		if (linkBox) {
			linkBox.style.display = "";
		}
		var src = "/template/ver1-0/components/tv/getTvArticleParams.jsp?articleId="+articleId+"&isSatellite="+isSatellite;
		var script = document.createElement("script");
		script.type = "text/javascript";
		script.src = src;
		document.body.appendChild(script);
	},

	/**
	 * Will make appropriate calls to the various statistics engines. Insight and our own.
	 * And also set the right URL in the link box.
	 */
	reportClipPlaying: function(params) {
		this.debugAlert("reportClipPlaying: " + YAHOO.lang.dump(params));
		this.currentClipParams = params;
		if (window.document.abTvCopylinkBoxForm) {
			window.document.abTvCopylinkBoxForm.abTvCopylinkBoxURLText.value = params.url;
			window.document.abTvCopylinkBoxForm.abTvCopylinkBoxEmbedText.value = params.embedCode;
		}
		if (typeof abTvMarkClip == "function") {
			abTvMarkClip(params);
		}

		this.markStats("tv-stats", undefined, params.articleId);

		if (typeof abTvExternalStats == "function") {
            // Function located in http://www.aftonbladet.se/template/ver1-0/javascript/tv/playnetworks.js.
			abTvExternalStats(params);
		}
		if (typeof se.aftonbladet.tv != "undefined" && !params.satellite) {
			if (params.showArticleComments == "true") {
				se.aftonbladet.tv.articleComments.showComments(params.articleId);
			} else {
				se.aftonbladet.snack.articleId = params.articleId;
				se.aftonbladet.tv.articleComments.hideComments();
			}
			if (params.showBlogPosts == "true") {
				se.aftonbladet.tv.articleComments.showBlogPosts(params.articleId);
			} else {
				se.aftonbladet.tv.articleComments.hideBlogPosts();
			}
		}
	},

    /*
     * Function called by Flash player to report sections statistics, very much like function reportClipPlaying used for
     * reporting article statistic. Argument values are obtained by player by calling section XML,
     * e g http://www.aftonbladet.se/webbtv/noje/?service=tv
     *
     * @param sectionUrl the current section's URL, e g http://www.aftonbladet.se/webbtv/noje
     * @param sectionId the current section's id, e g 397
     * @param sectionUniqueName the current section's unique name, e g webbtv_noje
     * @param sectionName the current section's nice name, e g Tv:NÃ¶je
     */
    updateSectionStats: function(sectionId, sectionUrl, sectionUniqueName, sectionName) {
        this.debugAlert("updateSectionStats:\nsectionId [" + sectionId + "],\nsectionUrl [" + sectionUrl +
                        "],\nsectionUniqueName [" + sectionUniqueName + "],\nsectionName [" + sectionName + "]");

        this.updateEaeLogger(sectionUrl, sectionId, sectionName);
	    this.markStats("tv-stats", sectionId);
		if (typeof se.aftonbladet.uniqueSectionName != "undefined" && se.aftonbladet.uniqueSectionName.substring(6,0) == "webbtv") {
			/* Hopefully no satelite on webbtv-sections, update adareas */
			this.updateAdContent("abAdAreaTV10Frame", "abAdAreaTV10", sectionUniqueName, "TV10");
			this.updateAdContent("abAdArea_BF10Frame", "abAdArea_BF10", sectionUniqueName, "BF10");
		}

    },

    /*
     * Modified version of abTvMarkClip in order to allow for reporting section statistics. The modifications are as
     * follows:
     * - "objId" refers to the section id, not article id.
     * - "meta" is always "tv" (not "tv:plus") since sections are not locked.
     * - "url" refers to the section URL, not article URL.
     * - "title" refers to the section name, not article title.
     *
     * @see updateSectionStats
     */
    updateEaeLogger: function (sectionUrl, sectionId, sectionName) {
        // Section specific modifications compared to article statistics reporting:
        var eaeLoggerSrc = "http://wwwapp.aftonbladet.se/eae-logger/Logger?rt=1&objId=" + sectionId + "&url=" +
                           encodeURIComponent(sectionUrl) + "&type=section&pubId=1&ctxId=" + sectionId +
                           "&cat=&meta=tv&title=" + sectionName;
        var eaeLoggerImg = document.createElement("img");
        eaeLoggerImg.src = eaeLoggerSrc;
        eaeLoggerImg.border = "0";
        eaeLoggerImg.width = "1";
        eaeLoggerImg.height = "1";
        eaeLoggerImg.alt = "";
        document.body.appendChild(eaeLoggerImg);

        abTvUtils.debugAlert("updateEaeLogger:\neaeLoggerImg.src [" + eaeLoggerImg.src + "]");
    },

    /**
	 * Setting cookies for ad frequency control
	 * cookie = name of the cookie to set
	 * timout = time in minutes for the cookie to live
	 */
	setAdFrequencyCookie: function(cookie, timeout) {
		var OAS_rn = "001234567890"; OAS_rns = "1234567890";
		var OAS_rn = new String (Math.random()); OAS_rns = OAS_rn.substring (2, 11);
		var OAS_capURL = "http://ad.aftonbladet.se/RealMedia/ads/cap.cgi";
		var OAS_capCOOKIESTRING = "&c=" + cookie + "&e=" + timeout + "m&n=aftonbladet.se";
		var src = OAS_capURL + "?" + OAS_rns + OAS_capCOOKIESTRING;
		var img = document.createElement("img");
		img.src = src;
		img.width = "1";
		img.height = "1";
		img.alt = "";
		document.body.appendChild(img);
	},

	/**
	 * Returns the IE version of the current browser or 0 if the current browser is not IE.
	 * Used by the Flash Player to make adjustments to how they make javascript calls back to us.
	 */
	getIEVersion: function() {
		return typeof YAHOO.env.ua.ie != "undefined" ? YAHOO.env.ua.ie : 0;
	},

	/**
	 * If there is a current clip registered and the user confirms, add it to the front of
	 * the list of favorite clips and store that list in a cookie.
	 */
	addCurrentClipToFavorites: function() {
		if (this.currentClipParams !== undefined && confirm("Spara klippet som favorit?")) {
			var currentListOfClips = abGetCookie("abTvClipFavorites");
			var clipArr = YAHOO.lang.isString(currentListOfClips) ? currentListOfClips.split(";") : [];
			// Make sure the current clip ends up first in the list and
			// is not included again if it were already included.
			var newClipArr = [this.currentClipParams.articleId];
			for (var i = 0; newClipArr.length < 7 && i < clipArr.length; i = i + 1) { // Never more than 7 clips in the cookie.
				if (clipArr[i] != this.currentClipParams.articleId) {
					newClipArr[newClipArr.length] = clipArr[i];
				}
			}
			abSetCookie("abTvClipFavorites", newClipArr.join(";"), 365, ".aftonbladet.se");
		}
	},

	/**
	 * Returns urlBase with '&clipIds=' + abGetCookie("abTvClipFavorites") appended.
	 */
	getFavoriteClips: function(urlBase) {
		return urlBase + "&clipIds=" + abGetCookie("abTvClipFavorites");
	},

	/**
	 */
	tipAFriend: function() {
		if (typeof this.currentClipParams != "undefined" && typeof this.currentClipParams.tipAFriendUrl != "undefined" && YAHOO.lang.isString(this.currentClipParams.tipAFriendUrl)) {
			var url = this.currentClipParams.tipAFriendUrl;
			abWindowOpen(url, 343, 480, 1);
		}
	},

	/**
	 * Share clip on facebook; sends URL, title and ingress
	 */
	shareOnFacebook: function() {
		u = this.currentClipParams.url;
		t = this.currentClipParams.title;
		s = this.currentClipParams.subHeadline;
		i = this.currentClipParams.imageUrl;
		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');
	},

	/**
	 * Copies the content (innerHTML) of a frame with id sourceId to an element with id targetId.
	 */
	copyFrameContent: function(sourceId, targetId, adArea, postCopyHandler) {
		var frame = YAHOO.util.Dom.get(sourceId), target = YAHOO.util.Dom.get(targetId), bodyHTML;
		if (target && frame && frame.contentWindow.document.body.innerHTML) {
			bodyHTML = this.resolveFlashVars(frame.contentWindow.document.body.innerHTML);
			target.innerHTML = bodyHTML;
		}
		if (postCopyHandler === 'fixate.BF10.bottom1' && typeof se.aftonbladet.ads.fixate.BF10.bottom1 == "function") {
			se.aftonbladet.ads.fixate.BF10.bottom1("wide");
		}
	},

	/**
	 * This is a major hack!
	 * It is needed because, for some reason, the flashvars PARAM element is missing its value when we
	 * produce the OBJECT/EMBED combo to show flash. Of course this happens only in IE.
	 */
	resolveFlashVars: function(bodyHTML) {
		if (this.getIEVersion() > 0) {
			var embedFlashVars = this.extractFlashVarsFromEmbedElement(bodyHTML);
			if (embedFlashVars) {
				var paramFlashVarsRe = new RegExp('<PARAM NAME="FlashVars" VALUE="">', "i");
				return bodyHTML.replace(paramFlashVarsRe, '<PARAM NAME="FlashVars" VALUE="' + embedFlashVars + '">');
			}
		}
		return bodyHTML;
	},

	/**
	 * Extracts the flashvars attribute from the embed element. Really just uses a regular expression
	 * to retrieve the value of any attribute named flashvars.
	 */
	extractFlashVarsFromEmbedElement: function(bodyHTML) {
		var embedFlashVarsRe = new RegExp('\\s+flashvars\\s*=\\s*\\\"([^\\\"]+)\\\"\\s+', "i");
		var match = embedFlashVarsRe.exec(bodyHTML);
		return (match && match.length > 1) ? match[1] : null;
	},

	/**
	 * Creates or updates an iframe with id frameId. It is expected that when the iframe's content is loaded
	 * it issues a callback to copyFrameConent which copies the content to an element with id targetId.
	 */
	updateAdContent: function(frameId, targetId, sectionName, adArea) {
		var Dom = YAHOO.util.Dom, frame = Dom.get(frameId);
		if (!frame) {
			frame = document.createElement("iframe");
			frame.id = frameId;
			Dom.addClass(frame, "abTvHiddenFrame");
			document.body.appendChild(frame);
		}
		frame.src = "/template/ver1-0/components/tv/iframeAd.jsp?sectionName=" + sectionName + "&adArea=" + adArea + "&frameId=" + frameId + "&targetId=" + targetId;
	},

	/**
	 */
	calcStatsFrameId: function(prefix, sectionId, articleId) {
		if (!YAHOO.lang.isUndefined(articleId) && articleId > 0) {
			return prefix + "-art-" + articleId;
		} else if (!YAHOO.lang.isUndefined(sectionId) && sectionId > 0) {
			return prefix + "-sec-" + sectionId;
		} else {
			return prefix;
		}
	},

	/**
	 */
	calcStatsUrlParams: function(sectionId, articleId) {
		var params = "";
		if (!YAHOO.lang.isUndefined(articleId) && articleId > 0) {
			params += "articleId=" + articleId;
		}
		if (!YAHOO.lang.isUndefined(sectionId) && sectionId > 0) {
			params += (params.length > 0 ? "&" : "") + "sectionId=" + sectionId;
		}
		return params;
	},

	/**
	 * Creates or updates an iframe with id based on frameIdPrefix. The iframe's content is expected to be
	 * calls to all statistics engines of interest as implemented in iframeStats.jsp.
	 */
	markStats: function(frameIdPrefix, sectionId, articleId) {
		var frameId = this.calcStatsFrameId(frameIdPrefix, sectionId, articleId),
			urlParams = this.calcStatsUrlParams(sectionId, articleId),
			Dom = YAHOO.util.Dom, frame = Dom.get(frameId);
		if (!frame) {
			frame = document.createElement("iframe");
			frame.id = frameId;
			Dom.addClass(frame, "abTvHiddenFrame");
			document.body.appendChild(frame);
		}
		frame.src = "/template/ver1-0/components/tv/iframeStats.jsp?" + urlParams;
	},

	/**
	 */
	debugAlert: function(s) {
		if (this.debug) {
			alert(s);
		}
	}

};

abTvUtils = new AbTvUtils();
 /**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; /*
	******************************************************************************
	*             Id: $Id: wfnormal.js 5545 2007-08-06 12:50:50Z petsjo $
	*           File: $URL: http://productionb/svn/develop/trunk/Escenic/Publications/abse/template/ver1-0/ads/wfnormal.js $
	* Last edited by: $Author:petsjo $ $Date: 2007-08-06 14:50:50 +0200 (Mon, 06 Aug 2007) $
	*   Version     : $Revision: 5545 $
	******************************************************************************
	* Javscript utilities for ads on wireframe=normal
	******************************************************************************
*/
// REVENUE SCIENCE AD TAG CODE
// AdTech ad server
var rsi_segs = [];
var segs_beg=document.cookie.indexOf('rsi_segs=');
if(segs_beg>=0){
 segs_beg=document.cookie.indexOf('=',segs_beg)+1;
 if(segs_beg>0){
 var segs_end=document.cookie.indexOf(';',segs_beg);
 if(segs_end==-1)segs_end=document.cookie.length;
 rsi_segs=document.cookie.substring(segs_beg,segs_end).split('|');
}}
var segLen=20
var segQS="";
if (rsi_segs.length<segLen){segLen=rsi_segs.length}
for (var i=0;i<segLen;i++){
   segQS+=(rsi_segs[i]+"+")
}

/* --- WebTraffic code --- */
/* Formerly included as separate javascript-file called wtplace.js or wtalias.js */
if(typeof(top.location.href)!="undefined"){
	var kw=top.location.href.split('/');
}
if(kw.length > 3) {
	var wt_alias=kw[3];
} else {
	var wt_alias="main";
}

/* --- Create an e.aftonbladet.ads object to contain adscripts --- */
/* Create objecthierarchy */
if (typeof se == "undefined") {
	var se = new Object();
}
if (typeof se.aftonbladet == "undefined") {
	se.aftonbladet = new Object();
}
if (typeof se.aftonbladet.ads == "undefined") {
	se.aftonbladet.ads = new Object();
}



/* --- Utilites for frameads (BigBang) --- */
if (typeof se.aftonbladet.ads.fixed == "undefined") {
	se.aftonbladet.ads.fixed = new Object();
}

/* --- Main function to fix frameads (BigBang) --- */
se.aftonbladet.ads.fixed.main = function(version) {
//	alert('Running main..');
	// --Testing--			version = "fixedtv";

	var ns = se.aftonbladet.ads.fixed;
	ns.abCodeType = "fallback";
	ns.tvVersion = "none";
	ns.tvScrolltype = "fixed";
	ns.scrolltype = "fixed";

	/* Check version */
	if (version) {
		if (version == "tv" || version == "fixedtv") {
				ns.tvVersion = "tv";
			} else if (version == "scrolltv") {
				ns.tvVersion = "tv";
				ns.scrolltype = "scroll";
			} else if (version == "scroll") {
				ns.scrolltype = "scroll";
			} else {
				ns.scrolltype = "fixed";
			}
	}
	/* IE6 needs specialcode */
	if (ns.tvVersion != "none") {
		ns.ieScrollDivId = "abInnerBody";
	} else {
		ns.ieScrollDivId = "abMainSiteOuter";
	}

//	alert(abBrowser.agent + "\n" + abBrowser.name + "\n" + abBrowser.version);

	if (abBrowser && screen.width > 800) {
		if (abBrowserCheck('firefox','1')) { ns.abCodeType = "standard"; }
		else if (abBrowserCheck('netscape','7')) { ns.abCodeType = "standard"; }
		else if (abBrowserCheck('opera','9')) { ns.abCodeType = "standard"; }
		else if (abBrowserCheck('safari','2')) { ns.abCodeType = "standard"; }
		else if (abBrowserCheck('camino','1')) { ns.abCodeType = "standard"; }
		else if (abBrowserCheck('seamonkey','1')) { ns.abCodeType = "standard"; }
		else if (abBrowserCheck('msie','7') && document.compatMode && document.compatMode != "BackCompat") { ns.abCodeType = "standard"; }
		else if (abBrowserCheck('msie','5') && document.compatMode && document.compatMode != "BackCompat") { ns.abCodeType = "ie6"; }
	}
	/* --- If we are still using codeType fallback we can't use fixed positioning ... --- */
	if (ns.abCodeType == "fallback") {
		ns.tvScrolltype = "scroll";
		ns.scrolltype = "scroll";
	}

//	alert("ns.abCodeType = " + ns.abCodeType + "\nns.tvVersion = " + ns.tvVersion + "\nns.tvScrolltype = " + ns.tvScrolltype + "\nns.scrolltype = " + ns.scrolltype + "\nns.ieScrollDivId = " + ns.ieScrollDivId);

	/* --- Do we have a TV version? --- */
	if (ns.tvVersion && ns.tvVersion != "none") {
		/* Register onload-function */
		abRegisterOnloadFunction(ns.showTv);
	}

	/* --- If abCodeType is ie6 and we need to make something fixed we need to move the scrollbar ... --- */
	if (ns.abCodeType == "ie6" && (ns.scrolltype == "fixed" || (ns.tvVersion != "none" && ns.tvScrolltype == "fixed"))) {
		ns.ie6MoveScrollbar();
		if (ns.ieScrollbarMoved) {
			/* Register onload-function */
			abRegisterOnloadFunction(ns.onloadFixie6);
		}
	}

	/* --- And code for scroll/fallback and standard --- */
	if (ns.scrolltype == "scroll") {
		/* Register onload-function */
		abRegisterOnloadFunction(ns.onloadScroll);
	} else {
		if (ns.abCodeType == "standard") {
			/* Register onload-function */
			abRegisterOnloadFunction(ns.onloadFixed);
		}
	}

}

/* --- onload functions --- */
se.aftonbladet.ads.fixed.onloadFixed = function () {
//	alert('Running onloadFixed...');
	var ns = se.aftonbladet.ads.fixed;
	var T10 = document.getElementById("abAdArea_T10");
	var L10 = document.getElementById("abAdArea_L10");
	var R10 = document.getElementById("abAdArea_R10");
	var abMainSiteOuter = document.getElementById("abMainSiteOuter");
	T10.style.backgroundColor = "white";
	var topOffset = T10.offsetHeight;
	T10.style.position = "fixed";
	T10.style.left = "5px";
	L10.style.position = "fixed";
	L10.style.top = topOffset + "px";
	L10.style.left = "5px";
	abMainSiteOuter.style.marginTop = (topOffset + 4) + "px";
	abMainSiteOuter.style.marginLeft = (L10.offsetWidth + 4) + "px";
	R10.style.top = topOffset + "px";
	R10.style.position = "fixed";
	R10.style.left = (L10.offsetWidth + abMainSiteOuter.offsetWidth + 5) + "px";
	R10.style.width = "auto";
	/* Hide div with jobAds ... */
	var jobAds = document.getElementById("abAdPositionJobAd");
	if (jobAds) {
		jobAds.style.display = "none";
	}
}
se.aftonbladet.ads.fixed.onloadFixie6 = function () {
//	alert('Running onloadFixie6...');
	var ns = se.aftonbladet.ads.fixed;
	if (ns.scrolltype == "fixed") {
		if (ns.ieScrollDivId == "abMainSiteOuter") {
			var abMainSiteOuter = document.getElementById("abMainSiteOuter");
			abMainSiteOuter.style.width = (abMainSiteOuter.offsetWidth + 9) + "px";
		} else if (ns.ieScrollDivId == "abInnerBody") {
			ns.ie6Overlay("abAdArea_L10","abAdArea_FL10");
			ns.ie6Overlay("abAdArea_R10","abAdArea_FR10");
			ns.ie6Overlay("abAdArea_T10","abAdArea_FT10");
		}
	}
	var jobAds = document.getElementById("abAdPositionJobAd");
	if (jobAds) {
		jobAds.style.display = "none";
	}
	window.onresize = ns.ie6Resize;
	ns.ie6Resize();
}
se.aftonbladet.ads.fixed.onloadScroll = function () {
//	alert('Running onloadScroll...');
	var ns = se.aftonbladet.ads.fixed;
	var R10 = document.getElementById("abAdArea_R10");
	var abMainSiteOuter = document.getElementById("abMainSiteOuter");
	abMainSiteOuter.style.marginLeft = "4px";
	R10.style.marginLeft = "5px";
	R10.style.width = "auto";
	var jobAds = document.getElementById("abAdPositionJobAd");
	if (jobAds) {
		jobAds.style.display = "none";
	}
}

/* --- Fix ie6 move scrollbar --- */
se.aftonbladet.ads.fixed.ie6MoveScrollbar = function () {
	var ns = se.aftonbladet.ads.fixed;
	/* Add some styles */
	if (document.createStyleSheet) {
		document.body.setAttribute("scroll","no");
		with (document.createStyleSheet()) {
			addRule("#" + ns.ieScrollDivId,"clip:auto;");
			addRule("#" + ns.ieScrollDivId,"overflow:auto;");
			addRule("#" + ns.ieScrollDivId,"overflow-x:hidden;");
			addRule("#" + ns.ieScrollDivId,"position:relative;");
			addRule("#abAdPositionJobAd","display:none;");
			addRule("#abAdPositionJobAd","display:none;");
		}
		if (ns.ieScrollDivId == "abMainSiteOuter") {
			with (document.createStyleSheet()) {
				addRule("#abMainSiteOuter","margin-top:0px;");
				addRule("#abAdArea_R10","margin-left:0px;");
				addRule("#abAdArea_R10","width:auto;");
			}
			if (abBrowser && abBrowser.version < 6) {
				with (document.createStyleSheet()) {
					addRule("#abMainSiteOuter","height:96%;");
					addRule("#abAdArea_L10","width:35;");
				}
			}
		} else if (ns.ieScrollDivId == "abInnerBody") {
			with (document.createStyleSheet()) {
				addRule("#abInnerBody","width:99.9%;");
				addRule("#abMainSiteOuter","margin-left:4px;");
				addRule("#abAdArea_R10","margin-left:5px;");
				addRule("#abAdArea_FT10","padding-top: 12px;");
				addRule("#abAdArea_FT10","background-color: white;");
				addRule("#abAdArea_FT10","width:97%;");
				addRule("#abPilramContainer .tvdrop","display:none;");
			}
		}
		ns.ieScrollbarMoved = true;
		YAHOO.util.Event.onDOMReady(ns.ie6Resize);
	}
}

/* --- Fix ie6 resize --- */
se.aftonbladet.ads.fixed.ie6Resize = function () {
//	alert('Running ie6Resize...');
	var ns = se.aftonbladet.ads.fixed;
	var T10 = document.getElementById("abAdArea_T10");
	var scrollDiv = document.getElementById(ns.ieScrollDivId);
	var topHeight = T10.offsetHeight + 1;
	if (ns.ieScrollDivId == "abInnerBody" && window.parent.document.readyState && window.parent.document.readyState == "complete") {
		topHeight = 0;
		ns.ie6AdjustDivWidth("abAdArea_F50","412");
		ns.ie6AdjustDivWidth("abAdArea_FR10","250");
	}
	if (abBrowser.version < 6) {
		var abMainHeight = document.body.clientHeight - topHeight;
	} else {
		var abMainHeight = document.documentElement.clientHeight - topHeight;
	}
	scrollDiv.style.height = abMainHeight + "px";
}

/* --- Fix ie6 overlay a div with a fixed positioned copy --- */
se.aftonbladet.ads.fixed.ie6Overlay = function (orgDivId,overlayDivId,addToTop,addToLeft) {
	if (orgDivId && overlayDivId) {
		var d1 = document.getElementById(orgDivId);
		var d2 = document.getElementById(overlayDivId);
		addToTop = addToTop || 0;
		addToLeft = addToLeft || 0;
		if (d1 && d2) {
			var d1pos = se.aftonbladet.findElementPosition(d1);
			d1Top = d1pos[1] + addToTop;
			d1Left = d1pos[0] + addToLeft;
			d2.style.top = d1Top + "px";
			d2.style.left = d1Left + "px";
			d2.style.margin = "0 0 0 0";
			d2.style.padding = "0 0 0 0";
			var abMainSiteOuter = document.getElementById("abMainSiteOuter");
			if (abMainSiteOuter) {
				if (orgDivId == "abAdArea_T10") {
					abMainSiteOuter.style.marginTop = d1.offsetHeight + "px";
				}
				if (orgDivId == "abAdArea_L10") {
					abMainSiteOuter.style.marginLeft = (d1.offsetWidth + 4) + "px";
				}
			}
			d2.appendChild(d1);
			d2.style.display = "block";
		}
	}
}

/* --- Fix ie6 adjust width of an absolute positioned div to not obscure scrollbar --- */
se.aftonbladet.ads.fixed.ie6AdjustDivWidth = function (divId,maxWidth) {
//		alert("Runing ie6AdjustDivWidth ...");
		var d1 = document.getElementById(divId);
		if (d1) {
			var clientWidth = document.body.clientWidth - 18;
			var d1pos = se.aftonbladet.findElementPosition(d1);
			var d1Width = clientWidth - d1pos[0] ;
//		alert(d1.id + " " + d1.offsetWidth + " " + d1Width + " " + maxWidth);
			if (d1Width < maxWidth) {
				if (d1Width < 1) {
					d1.style.display = "none";
				} else {
					d1.style.width = d1Width + "px";
					if (d1.style.display != "block") {
						d1.style.display = "block";
					}
				}
			} else {
				if (d1.offsetWidth != maxWidth) {
						d1.style.width = maxWidth;
				}
				if (d1.style.display != "block") {
					d1.style.display = "block";
				}
			}
		}
}

/* --- Show tv div --- */
se.aftonbladet.ads.fixed.showTv = function () {
//	alert('Showing TV...');
	var ns = se.aftonbladet.ads.fixed;
	var F50 = document.getElementById("abAdArea_F50");
	if (F50) {
		if (ns.tvVersion == "tv") {
			/* Adjust some divs in abHeaderAdStreamer */
			var abAdArea_H22 = document.getElementById("abAdArea_H22");
			if (abAdArea_H22) {
				abAdArea_H22.style.display = "none";
			}
			var abAdArea_H24 = document.getElementById("abAdArea_H24");
			if (abAdArea_H24) {
				abAdArea_H24.style.width = "213px";
				abAdArea_H24.style.overflow = "hidden";
			}
			var abHeaderAdStreamer = document.getElementById("abHeaderAdStreamer");
			if (abHeaderAdStreamer) {
				abHeaderAdStreamer.style.width = "570px";
			}
			var abPilramContainer = document.getElementById("abPilramContainer");
			if (abPilramContainer) {
				abPilramContainer.style.paddingTop = "60px";
			}
		}
		if (ns.abCodeType == "standard") {
			F50.style.position = "fixed";
		} else if (ns.tvScrolltype == "scroll") {
			F50.style.position = "relative";
		}
		F50.style.left = "596px";
		var	t10Top = 12;
		F50.style.top = t10Top + "px";
		F50.style.display = "block";

		// Plus top toolbar specifics
		var abPlusTopToolbarNotLoggedInCenter = document.getElementById("abPlusTopToolbarNotLoggedInCenter");
		if (abPlusTopToolbarNotLoggedInCenter) {
			abPlusTopToolbarNotLoggedInCenter.style.width = "403px";
		}
		var abPlusToolbarNotLoggedInCenterRight = document.getElementById("abPlusToolbarNotLoggedInCenterRight");
		if (abPlusToolbarNotLoggedInCenterRight) {
			abPlusToolbarNotLoggedInCenterRight.style.display = "none";
		}
		var abPlusTopToolbarLoggedInCenter = document.getElementById("abPlusTopToolbarLoggedInCenter");
		if (abPlusTopToolbarLoggedInCenter) {
			abPlusTopToolbarLoggedInCenter.style.width = "489px";
		}
		var abPlusToolbarmenu = document.getElementById("abPlusToolbarmenu");
		if (abPlusToolbarmenu) {
			abPlusToolbarmenu.style.left = "337px";
		}
		var abPlusTopToolbarLoggedInUserName = document.getElementById("abPlusTopToolbarLoggedInUserName");
		if (abPlusTopToolbarLoggedInUserName) {
			abPlusTopToolbarLoggedInUserName.style.display = "none";
		}


	}
}


/* --- Utilites for fixating various adAreas --- */
if (typeof se.aftonbladet.ads.fixate == "undefined") {
	se.aftonbladet.ads.fixate = new Object();
}
if (typeof se.aftonbladet.ads.fixate.BF10 == "undefined") {
	se.aftonbladet.ads.fixate.BF10 = new Object();
}
se.aftonbladet.ads.fixate.BF10.bottom1 = function (version) {
	var Dom = YAHOO.util.Dom, closeDivImage, BF10 = Dom.get('abAdArea_BF10'), closeDiv = Dom.get("abAdArea_BF10_closer");
	if (BF10) {
		Dom.setStyle(BF10, "display", "none");
		Dom.setStyle(BF10, "position", "absolute");
		Dom.setStyle(BF10, "zIndex", "10");
		if (!closeDiv) {
			/* Create a div for closing the fixed ad */
			closeDiv = document.createElement('div');
			closeDiv.id = 'abAdArea_BF10_closer';
			Dom.setStyle(closeDiv, "float", "right");
			Dom.setStyle(closeDiv, "cursor", "pointer");
			closeDiv.onclick = function(){document.getElementById("abAdArea_BF10").style.display = "none"; return false;};

			closeDivImage = document.createElement('img');
			closeDivImage.src = '/template/ver1-0/gfx/ads/v1/close_button_se_dark.gif';
			closeDivImage.alt = 'Close';

			closeDiv.appendChild(closeDivImage);
			BF10.insertBefore(closeDiv, Dom.getChildren(BF10)[0])
		}
		Dom.setStyle("abInnerBody", "marginBottom", "50px");

		YAHOO.util.Event.onAvailable(version == "wideTv" ? "abMainContentContainer" : "abMainSiteOuter",
			function(){se.aftonbladet.ads.fixate.BF10.moveAdAreaToBottom1(version);});
	}
}

se.aftonbladet.ads.fixate.BF10.moveAdAreaToBottom1 = function (version) {
	var BF10 = document.getElementById('abAdArea_BF10');
	if (BF10) {
		/* Position the ad */
		BF10.style.bottom = '0';
		var leftOffset = 0;
		if (!document.getElementById('abLeftnavContainer')) {
			/* Wireframe without leftnav (hopefully...), we place it fixed at same x-position as 'abMainSiteOuter' */
			var leftPosRefDiv = document.getElementById('abMainSiteOuter');
			if (typeof leftPosRefDiv != 'undefined') {
				leftOffset = se.aftonbladet.findElementPosition(leftPosRefDiv)[0];
				BF10.style.left = leftOffset + 'px';
			}
		} else {
			/* Wireframe normal, let it be centered */
			BF10.style.marginLeft = 'auto';
			BF10.style.marginRight = 'auto';
			BF10.style.paddingLeft = '0';
		}
		/* Tv has  a slightly different design... */
		if (typeof se.aftonbladet.uniqueSectionName && se.aftonbladet.uniqueSectionName.substring(6,0) == "webbtv") {
			BF10.style.width = '990px';
			BF10.style.marginLeft = '4px';
			BF10.style.paddingLeft = '10px';
			BF10.style.overflow = 'hidden';
			BF10.style.backgroundColor = '#fff';
		} else {
			BF10.style.width = '980px';
		}
		/* Special for IE6 */
		if (abBrowserCheck('msie','6') && !abBrowserCheck('msie','7')) {
			/* Make it sort of fixed in IE6 */
			if (document.createStyleSheet) {
				with (document.createStyleSheet()) {
					addRule("#abAdArea_BF10","top: expression( ( -0 - abAdArea_BF10.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' )");
				}
				if (leftOffset != 0) {
					/* Adjust leftposition when in special wireframe */
					BF10.style.left = 0 + 'px';
				}
				/* Show it */
				BF10.style.display = 'block';
			}
		} else {
			/* Position and show in standard browsers */
			BF10.style.position = 'fixed';
			BF10.style.display = 'block';
		}
	}
}

/* --- Utilites for upward scroll ad (show ad area above ordinary content and scroll down) --- */
if (typeof se.aftonbladet.ads.upwardscroll == "undefined") {
	se.aftonbladet.ads.upwardscroll = new Object();
}

/* --- Status on the content that should be shown */
se.aftonbladet.ads.upwardscroll.display = false;

/* --- Main function to fix upward scroll ad --- */
se.aftonbladet.ads.upwardscroll.main = function(version) {

		var showthiselement=document.getElementById("abAdArea_F50");
		var showthiselementinner=document.getElementById("abAdArea_F50_inner");
		var scrolltoelement=document.getElementById("abAdArea_T10");
		var scrollposition = new Array();
		YAHOO.util.Dom.addClass("abAdArea_F50_inner", "abAdPositionBoxA");
		showthiselement.style.padding = "0 11px";
		showthiselement.style.position = "static";
		showthiselementinner.style.margin = "5px auto";
		showthiselementinner.style.width = "1250px";
		showthiselementinner.style.textAlign = "left";
		showthiselement.style.display = "block";
		scrollposition = se.aftonbladet.findElementPosition(scrolltoelement);
		window.scrollTo(0,scrollposition[1]);
		se.aftonbladet.ads.upwardscroll.display = true;

}



/* --- Utilites for sticky ads (scrolling ads) --- */

function ypChaser(sLayerId, iTopOffset, iSlideTime, iCeiling, iFloor) {
	this.chaserDiv = null;
	this.layerId = sLayerId;
	this.topOffset = iTopOffset;
	this.slideTime = iSlideTime;
	this.ceiling = iCeiling;
	this.floor = iFloor;
	this.parentId = "abFrameworkContainer";
	this.parentDiv = null;
	this.parentDivTopOffset = 0;
	ypChaser.registry[ypChaser.registry.length] = this;
}
ypChaser.isIE = window.clientInformation ? true : false;
ypChaser.isN4 = document.layers ? true : false;
ypChaser.isN6 = navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 5;
ypChaser.isO5 = navigator.userAgent.indexOf("Opera") != -1 && parseInt(navigator.appVersion) >= 4;
ypChaser.registry = new Array( );
ypChaser.callRate = 10;
window.setInterval("ypChaser.timer( )", ypChaser.callRate);
ypChaser.timer = function() {
	for (var i = 0; chObj = this.registry[i]; i++) {
		if (!chObj.chaserDiv) chObj.attemptLoad();
		if (chObj.chaserDiv) chObj.main();
	}
}
ypChaser.prototype.attemptLoad = function() {
	var chDiv = null;
	var paDiv = null;
	if (ypChaser.isN6 || ypChaser.isO5) {
		chDiv = document.getElementById(this.layerId);
		paDiv = document.getElementById(this.parentId);
	} else if (ypChaser.isIE) {
		chDiv = document.all[this.layerId];
		paDiv = document.all[this.parentId];
	} else if (ypChaser.isN4) {
		chDiv = document.layers[this.layerId];
		paDiv = document.layers[this.parentId];
	}
	if (chDiv && chDiv != null && paDiv && paDiv != null) {
		this.chaserDiv = chDiv;
		this.parentDiv = paDiv;
		this.initChaserDiv();
	}
}

ypChaser.prototype.initChaserDiv = function() {
	if (this.chaserDiv) {
		if (parseInt(this.ceiling) != this.ceiling-0) {
			this.setCeiling();
		}
		this.chaserDiv.style.position = "absolute";
		if (this.parentDiv) {
			this.parentDivTopOffset = this.parentDiv.offsetTop;
		}
	this.moveTo(this.ceiling + 10 - this.parentDivTopOffset);
	}
}
ypChaser.prototype.setCeiling = function() {
	var curtop = 0;
	var tempChaserDiv = this.chaserDiv;
	if (tempChaserDiv.offsetParent) {
		curtop = tempChaserDiv.offsetTop;
		while (tempChaserDiv = tempChaserDiv.offsetParent) {
			curtop += tempChaserDiv.offsetTop;
		}
	}
	this.ceiling = curtop;
}
ypChaser.prototype.main = function( ) {
	this.currentY = this.getCurrentY();
	var scrollTop = ypChaser.getWindowScroll();
	var newTargetY = scrollTop + this.topOffset;
	var floor = ypChaser.getDocumentHeight() - this.floor;
	newTargetY = Math.max( newTargetY, this.ceiling);
	if (!ypChaser.isO5) {
		newTargetY = Math.min(newTargetY, floor);
	}
	if ( this.currentY != newTargetY ) {
		if ( newTargetY != this.targetY ) {
			this.targetY = newTargetY;
			this.slideInit( );
		}
		this.slide( );
	}
}
ypChaser.prototype.slideInit = function( ) {
	this.A = (this.targetY - this.currentY) / this.slideTime / this.slideTime;
	this.startT = (new Date()).getTime();
	this.startP = this.getCurrentY();
	this.D = this.targetY - this.startP;
}
ypChaser.prototype.slide = function( ) {
	var elapsed = (new Date()).getTime() - this.startT;
	if (elapsed < this.slideTime) {
		this.moveTo(this.D - (Math.round(Math.pow(this.slideTime - elapsed, 2) * this.A)) + this.startP);
	}
}
ypChaser.prototype.moveTo = function(ny) {
	ny = ny - this.parentDivTopOffset;
	if (ypChaser.isN4) this.chaserDiv.top = ny;
	else this.chaserDiv.style.top = ny + "px";
}
ypChaser.prototype.getCurrentY = function() {
	var n = ypChaser.isN4 ? this.chaserDiv.top + this.parentDivTopOffset : parseInt(this.chaserDiv.style.top) + this.parentDivTopOffset;
	return isNaN(n) ? 0 : n;
}
ypChaser.getWindowScroll = function() {
	if (window.pageYOffset) {
		return window.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		return document.documentElement.scrollTop;
	} else if (document.body && document.body.scrollTop) {
		return document.body.scrollTop;
	} else {
		return 0;
	}
}
ypChaser.getDocumentHeight = function() {
	if (window.document.height) {
		return window.document.height;
	} else if (document.body.scrollHeight) {
		return Math.max(document.body.scrollHeight, document.body.offsetHeight);
	} else if (document.documentElement.scrollHeight) {
		return Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight);
	} else {
		return 5000;
	}
}
/* Start ypChaser on ad placement Sticky */
function abCreateYpChaserOnAdPosition1() {
	var abAdPlacementSticky = new ypChaser("abAdPlacementSticky", 25, 1500, null , 0);
	/* TODO: Remove abStickyR10_090 when we have changed alias-based Helios ad calls, using adareaV2.jsp */
	var abStickyR10_090 = new ypChaser("abAdPositionR10-090", 25, 1500, null , 0);
}
abRegisterOnloadFunction(abCreateYpChaserOnAdPosition1);


/* --- Stuff used in Helios/AdTech calls --- */
if (typeof window.abAdsHeliosAdGroupId == "undefined") {
	window.abAdsHeliosAdGroupId = Math.round(Math.random() * 1000000000);
}
if (typeof window.abAdsHeliosArticleKeywords == "undefined") {
	window.abAdsHeliosArticleKeywords = "";
}
if (typeof window.abAdsHeliosUtil == "undefined") {
	window.abAdsHeliosUtil = function() {
		var heliosObj = {};
		var groupId = Math.round(Math.random() * 1000000000);
		var weatherSymbols = {
			'1':'klart',
			'2':'klart',
			'3':'molnigt',
			'4':'molnigt',
			'5':'regn',
			'6':'regn',
			'7':'regn',
			'8':'sn%F6',
			'9':'regn',
			'10':'regn',
			'11':'regn',
			'12':'regn',
			'13':'sn%F6',
			'14':'sn%F6',
			'15':'molnigt',
			'16':'klart',
			'17':'klart',
			'18':'regn',
			'19':'sn%F6',
			'20':'klart',
			'21':'klart',
			'22':'molnigt',
			'23':'regn',
			'24':'regn',
			'25':'regn',
			'26':'sn%F6'
		};
		heliosObj.getArticleKeywords = function() {
			var kw = (typeof window.abAdsHeliosArticleKeywords !== 'undefined') ? window.abAdsHeliosArticleKeywords : '';
			if (typeof window.no_storm_AdInfo_WxSymbol === 'number' && weatherSymbols[window.no_storm_AdInfo_WxSymbol] !== '') {
				kw += ((kw !== '') ? '+' : 'XXXX') + 'ab_weather_' + weatherSymbols[window.no_storm_AdInfo_WxSymbol];
			}
			return kw;
		};
		heliosObj.getGroupId = function() {
			return groupId;
		};
		return heliosObj;
	}();
}


/* google adsense */

function google_ad_request_done(google_ads) {

var s = '';
var i;

if (google_ads.length == 0) {
return;
}


if (google_ads[0].type == "flash") {

   s += '<a href=\"' +
google_info.feedback_url + '\" class="googleAdsHeader">Google-annonser</a><br>' +
'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="' +
google_ad.image_width + '" HEIGHT="' +
google_ad.image_height + '"> <PARAM NAME="movie" VALUE="' +
google_ad.image_url + '">' +
'<PARAM NAME="quality" VALUE="high">' +
'<PARAM NAME="AllowScriptAccess" VALUE="never">' +
'<EMBED src="' +
google_ad.image_url + '" WIDTH="' +
google_ad.image_width + '" HEIGHT="' +
google_ad.image_height +
'" TYPE="application/x-shockwave-flash"' +
' AllowScriptAccess="never" ' +
' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';

} else if (google_ads[0].type == "image") {

   s += '<a href=\"' +
google_info.feedback_url + '\" class="googleAdsHeader">Google-annonser</a><br> <a href="' +
google_ads[0].url + '" target="_top" title="gï¿½ till ' +
google_ads[0].visible_url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
google_ads[0].visible_url + '\';return true"><img border="0" src="' +
google_ads[0].image_url + '"width="' +
google_ads[0].image_width + '"height="' +
google_ads[0].image_height + '"></a>';

} else if (google_ads[0].type == "html") {

s += google_ads[0].snippet;

} else {

if (google_ads.length == 1) {

   s += '<a href=\"' +
google_info.feedback_url + '\"  class="googleAdsHeader">Google-annons</a><div class="googleAdsItemBig"><a target="_blank" href="' +
google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'gï¿½ till ' +
google_ads[0].visible_url + '\';return true"> <span class="googleAdsItemHeader">' +
google_ads[0].line1 + '<br /></span></a> <span class="googleAdsItemText">' +
google_ads[0].line2 + ' ' +
google_ads[0].line3 + '<br /></span> <span class="googleAdsItemLink"><a href="' +
google_ads[0].url + '" target="_blank" onmouseout="window.status=\'\'" onmouseover="window.status=\'gï¿½ till ' +
google_ads[0].visible_url + '\';return true">' +
google_ads[0].visible_url + '</span></a></div>';

} else if (google_ads.length > 1) {

   s += '<a href=\"' + google_info.feedback_url + '\" class="googleAdsHeader">Google-annonser</a>'

for(i = 0; i < google_ads.length; ++i) {

s += '<div class="googleAdsItem"><a href="' +
google_ads[i].url + '" target="_blank" onmouseout="window.status=\'\'" onmouseover="window.status=\'gï¿½ till ' +
google_ads[i].visible_url + '\';return true"> <span class="googleAdsItemHeader">' +
google_ads[i].line1 + '<br /></span></a> <span class="googleAdsItemText">' +
google_ads[i].line2 + ' ' +
google_ads[i].line3 + '<br /></span> <span class="googleAdsItemLink"><a href="' +
google_ads[i].url + '" target="_blank" onmouseout="window.status=\'\'" onmouseover="window.status=\'gï¿½ till ' +
google_ads[i].visible_url + '\';return true">' +
google_ads[i].visible_url + '</span></a></div>';
}
}
    }

    document.write(s);
    return;
  } /*
	******************************************************************************
	* General javascript-code for Omniture SiteCatalyst statistics
	******************************************************************************
*/

/* --- Create an se.aftonbladet.stats object to contain statscripts --- */
/* Create objecthierarchy */
if (typeof se == "undefined") {
	var se = new Object();
}
if (typeof se.aftonbladet == "undefined") {
	se.aftonbladet = new Object();
}
if (typeof se.aftonbladet.stats == "undefined") {
	se.aftonbladet.stats = new Object();
}

/* Extra clicktagfunction */
se.aftonbladet.stats.linkTrack1 = function (obj,pageName,clickArea,linkTargetPage,extraData) {
	extraData = extraData ? extraData : '';
	/* Defaults */
	/* pageName is the name of the page where the link is placed, per default set to SiteCatalyst window.s.pageName */
	if (typeof pageName == "undefined" || pageName == "") {
		if (typeof window.s != "undefined" && typeof window.s.pageName != "undefined" && window.s.pageName != "") {
			pageName = window.s.pageName;
		} else {
			pageName = document.location;
		}
	}
	/* If clickArea (area on page where link is placed, for example "Meny") is empty we leave it empty */
	if (typeof clickArea == "undefined" || clickArea == "") {
		clickArea = "";
	}
	/* linkTargetPage is identifier of the page where the link leads to, per default set to its url */
	if (typeof linkTargetPage == "undefined" || linkTargetPage == "") {
		if (obj.href != null) {
			linkTargetPage = obj.href;
		} else {
			linkTargetPage = "";
		}
	}
	var currentSection = se.aftonbladet.mainSectionName?se.aftonbladet.mainSectionName:'ettan';
	//alert("obj = " + (typeof obj) + "\nsection = " + currentSection + "\npageName = " + pageName + "\nclickArea = " + clickArea + "\nlinkTargetPage = " + linkTargetPage + "\n");
	/* SiteCatalyst */
	var linkName = clickArea + " | " + linkTargetPage;
	window.s_objectID = linkName;
	if (typeof abSetCookie == 'function') {
		/* Save section and clicked link and save in a cookie that lives for 30 seconds, hopefully we have reached the target page in that time */
		abSetCookie("siteCatClickTrackString", currentSection + "$" + linkName + (extraData ? ("$" + extraData) : ""), 1/(24*60*2), '.aftonbladet.se');
		se.aftonbladet.stats.siteCatClickTrackStringSet = true;
//		alert(currentSection + "$" + linkName + "$" + extraData);
//		alert('cookie set!');
	}
}
se.aftonbladet.stats.linkTrackCustom = function (obj,pageName,clickArea,linkTargetPage,linkType) {
	/* Defaults */
	if (typeof pageName == "undefined" || pageName == "") {
		if (typeof window.s != "undefined" && typeof window.s.pageName != "undefined" && window.s.pageName != "") {
			pageName = window.s.pageName;
		} else {
			pageName = document.location;
		}
	}
	if (typeof clickArea == "undefined" || clickArea == "") {
		clickArea = "";
	}
	if (typeof linkTargetPage == "undefined" || linkTargetPage == "") {
		if (obj.href != null) {
			linkTargetPage = obj.href;
		} else {
			linkTargetPage = "";
		}
	}
	if (typeof linkType == "undefined" || linkType == "") {
		linkType = "o";
	}
	var linkTrackString1 = "ClickTrack " + pageName + ": " + clickArea + " => " + linkTargetPage;
	var linkTrackString2 = clickArea + " => " + linkTargetPage;
//	alert("obj = " + (typeof obj) + "\npageName = " + pageName + "\nclickArea = " + clickArea + "\nlinkTargetPage = " + linkTargetPage + "\nlinkType = " + linkType + "\nlinkTrackString1 = " + linkTrackString1 + "\nlinkTrackString2 = " + linkTrackString2 + "\n");
	/* SiteCatalyst */
	var s = s_gi('aftonbladetdev');
	s.linkTrackVars ='prop21,eVar23'; 
	s.linkTrackEvents ='None';
	s.prop21 = linkTrackString1;
	s.eVar23 = linkTrackString1;
	var lt=obj.href!=null?s.lt(obj.href):""; 
	if (lt=="") { s.tl(obj,linkType,linkTrackString2); } 
}


