// declare variables
var strInsightOasSection;
var strInsightOasSubSection1;
var strInsightOasSubSection2;
var strInsightOasExtraTag;
var strSitePublication;
var strSiteExtraSifoTag;
var strArticlePublication;
var strOasExtra;

// set section variable to site publication
strInsightOasSection = strSitePublication;
strOasExtra = strSiteExtraSifoTag;

// empty variables
if (strInsightOasSubSection1 == undefined)	{strInsightOasSubSection1 = '';}
if (strInsightOasSubSection2 == undefined)	{strInsightOasSubSection2 = '';}
if (strInsightOasExtraTag == undefined)	{strInsightOasExtraTag = '';}
if (strArticlePublication == undefined)	{strArticlePublication = '';}
if (strOasExtra == undefined) {strOasExtra = '';}

// if executed on idgse site, add group variable to extratag
if(strInsightOasSection == "idgse" || strInsightOasSection == "ram") {
	strInsightOasExtraTag += "&Grupp1=idgse";
}


// if viewing article from different site
if((strArticlePublication != '') && (strInsightOasSection != strArticlePublication)) {
	
	// set section to article owner to make the hit theirs
	strInsightOasSection = strArticlePublication;

	// set subsection1 to mark article
	strInsightOasSubSection1 = "Artiklar_" + strArticlePublication;
}

// if we lack a subsection, make it identical to section value
if(strInsightOasSubSection1 == '') {
	strInsightOasSubSection1 = strInsightOasSection;
}

/// ============ THE FOLLOWING PART IS FROM SIFO ============= 
//configuration
//OAS_url = 'http://sifomedia.idg.se/RealMedia/ads/';
//OAS_sitepage = window.location.hostname + window.location.pathname;
OAS_sitepage = 'idg';
OAS_listpos = 'TopRight';
OAS_query = '';

    //begin OAS Analytics
    var d=document;
    var OAS_rdl = '';
    var OAS_CA = 'N';
    var OAS_taxonomy = '&Sajt=' + OAS_sitepage + '&Sektion=' + strInsightOasSection + '&Undersektion1=' + strInsightOasSubSection1 + strInsightOasExtraTag + strOasExtra;

    if((d.referrer)&&(d.referrer!="[unknown origin]")) {
    	if(d.referrer.indexOf("?") == -1) {
    		OAS_rdl += '&tax23_RefDocLoc='+d.referrer.toString();
    	} else {
    		var rdl=d.referrer;
				var rdl1=rdl.indexOf("?");
    		var rdl2=rdl.substring(0,rdl1);
    		OAS_rdl += '&tax23_RefDocLoc='+rdl2;
    	}
    }

    function cookie_check(ifd,ife) {
    	var s=ife.indexOf(ifd);
    	if(s==-1) return "";
			s+=ifd.length;
    	var e=ife.indexOf(";",s);
    	if(e==-1) e=ife.length;
    	return ife.substring(s,e);
    }

    function write_cookie() {
    	var d=new Date();
    	var m=d.getTime();
    	document.cookie="OAS_SC1="+m.toString()+";path=/;";
    	var v=cookie_check("OAS_SC1=",document.cookie);
    	if(v!=m.toString())return false;
    	d.setTime(m+3600000);
    	return true;
    }

    if(write_cookie())OAS_CA="Y";

    //end OAS Analytics

OAS_query += 'XE' + OAS_taxonomy + OAS_rdl + "&if_nt_CookieAccept=" + OAS_CA + '&XE';

OAS_target = '_top';
//end of configuration

OAS_rn = new String (Math.random()); OAS_RNS = OAS_rn.substring (2, 11);


OAS_version = 11;
if (navigator.userAgent.indexOf('Mozilla/3') != -1 || navigator.userAgent.indexOf('Mozilla/4.0 WebTV') != -1)
  document.write('<A HREF="http://sifomedia.idg.se/1c/' + OAS_sitepage + '/1' + OAS_RNS + '@' + OAS_listpos + '!' + pos + '?' + OAS_query + '" TARGET=' + OAS_target + '>');
if (OAS_version >= 11)
  document.write('<SCRIPT LANGUAGE=JavaScript1.1 SRC="http://sifomedia.idg.se/3/' + OAS_sitepage + '/1' + OAS_RNS + '@' + OAS_listpos + '?' + OAS_query +'"><\/SCRIPT>');

document.write('');

// ============ THE PART FROM SIFO ENDS HERE ============= 
