jQuery(document).ready(function(){var skyscraper=jQuery(".skyscraperWrapper");
if(skyscraper.length>0){skyscraper.css("position","fixed");
}});

var strInsightOasSection;
var strInsightOasSubSection1;
var strInsightOasSubSection2;
var strInsightOasExtraTag;
var strSitePublication;
var strSiteExtraSifoTag;
var strArticlePublication;
var strOasExtra;
strInsightOasSection=strSitePublication;
strOasExtra=strSiteExtraSifoTag;
if(strInsightOasSubSection1==undefined){strInsightOasSubSection1="";
}if(strInsightOasSubSection2==undefined){strInsightOasSubSection2="";
}if(strInsightOasExtraTag==undefined){strInsightOasExtraTag="";
}if(strArticlePublication==undefined){strArticlePublication="";
}if(strOasExtra==undefined){strOasExtra="";
}if(typeof(autoReloaded)=="undefined"){var autoReloaded=false;
}if(strInsightOasSection=="idgse"||strInsightOasSection=="ram"){strInsightOasExtraTag+="&Grupp1=idgse";
}if((strArticlePublication!="")&&(strInsightOasSection!=strArticlePublication)){strInsightOasSection=strArticlePublication;
strInsightOasSubSection1="Artiklar_"+strArticlePublication;
}if(strInsightOasSubSection1==""){strInsightOasSubSection1=strInsightOasSection;
}OAS_sitepage="idg";
OAS_listpos="TopRight";
OAS_query="";
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";
}OAS_query+="XE"+OAS_taxonomy+OAS_rdl+"&if_nt_CookieAccept="+OAS_CA+"&XE";
OAS_target="_top";
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)&&!autoReloaded){document.write('<A HREF="http://sifomedia.idg.se/1c/'+OAS_sitepage+"/1"+OAS_RNS+"@"+OAS_listpos+"!"+pos+"?"+OAS_query.replace(/(<([^>]+)>)/ig,"")+'" TARGET='+OAS_target+">");
}if((OAS_version>=11)&&!autoReloaded){document.write('<SCRIPT LANGUAGE=JavaScript1.1 SRC="'+encodeURI("http://sifomedia.idg.se/3/"+OAS_sitepage+"/1"+OAS_RNS+"@"+OAS_listpos+"?"+OAS_query.replace(/(<([^>]+)>)/ig,""))+'"></SCRIPT>');
}document.write("");

var siteURL=document.location.href;
var siteName=siteURL.split(".idg.se")[0];
var mobileTitle=siteName.split("//")[1];
if(!(typeof(disqus_identifier)=="undefined")){if(siteName=="http://www"){mobileURL="http://mobil.idg.se/article.asp?ID="+disqus_identifier;
}else{mobileURL="http://mobil."+mobileTitle+".idg.se/article.asp?ID="+disqus_identifier;
}if(document.getElementById("mobLink")){document.getElementById("mobLink").href=mobileURL;
}if(document.getElementById("iPhoneMobLink")){document.getElementById("iPhoneMobLink").href=mobileURL;
}if(document.getElementById("androidMobLink")){document.getElementById("androidMobLink").href=mobileURL;
}}
var isOpera,isIE=false;
if(typeof(window.opera)!="undefined"){isOpera=true;
}if(!isOpera&&navigator.userAgent.indexOf("Internet Explorer")){isIE=true;
}function registerAndConnectSubscription(returnurl){var returnUrlParam=returnurl!=""?"&returnurl="+returnurl:"";
if(isOpera){window.location="/account/login?tab=registration&continue=subscription"+returnUrlParam;
}else{if(isIE){var referLink=document.createElement("a");
referLink.href="/account/login?tab=registration&continue=subscription"+returnUrlParam;
referLink.setAttribute("target","idglogin");
document.body.appendChild(referLink);
var loginWin=window.open("/account/login?tab=registration&continue=subscription"+returnUrlParam,"idglogin","width=700,height=600,top=100,left=100,scrollbars=1");
loginWin.focus();
referLink.click();
}else{var loginWin=window.open("/account/login?tab=registration&continue=subscription"+returnUrlParam,"idglogin","width=700,height=600,top=100,left=100,scrollbars=1");
loginWin.focus();
}}}function updateLoginStatus(){jQuery.ajaxSetup({beforeSend:function(jqXHR){jqXHR.overrideMimeType("text/xml; charset=iso-8859-1");
jqXHR.setRequestHeader("Accept","text/xml; charset=iso-8859-1");
},timeout:5000,contentType:"text/xml; charset=iso-8859-1",dataType:"html",mimeType:"text/xml; charset=iso-8859-1",processData:false});
jQuery.ajax({url:"/account/status",cache:false,dataType:"xml",contentType:"text/xml; charset=ISO-8859-1",success:function(data){if(jQuery(data).find("user status").text()=="offline"){jQuery(".loginContainerOffline").show();
idgLock.setLocks();
}else{if(jQuery(data).find("user status").text()=="online"){jQuery(".loginUsername").text(jQuery(data).find("user firstName").text()+" "+jQuery(data).find("user lastName").text());
idgLock.setLocks(jQuery(data).find("user attributes"));
idgLock.showHtmlBlocks();
idgLock.addPermsToWrapper();
}}}});
}function reloadPage(){var url=document.location.href;
url=url.replace("#","");
if(url.indexOf("rnd=")==-1){if(url.indexOf("?")==-1){url=url+"?rnd="+new Date().getTime();
}}window.location=url;
}jQuery(document).ready(function(){if(document.cookie.indexOf("autologin")!=-1&&document.cookie.indexOf("autologindone")==-1){jQuery.ajax({url:"/account/autologin",cache:false,success:function(data){updateLoginStatus();
reloadPage();
}});
}else{updateLoginStatus();
}idgLib.setClickListner("loginLogin",function(){return idgLib.doLogin({type:"provider",provider:1,},reloadPage);
});
idgLib.setClickListner("loginLoginCheckSubscription",function(){return idgLib.doLogin({type:"checksubscription"},reloadPage);
});
idgLib.setClickListner("loginLoginRegisterAndConnectSubscription",function(){return idgLib.doLogin({type:"registerandconnectsubscription"},reloadPage);
});
idgLib.setClickListner("loginConnectSubscription",function(){return idgLib.editProfile({type:"connectsubscription"},reloadPage);
});
idgLib.setClickListner("loginEditprofile",function(){return idgLib.editProfile({},reloadPage);
});
idgLib.setClickListner("loginLogout",function(){return idgLib.doLogout(1);
});
});

(function(){var po=document.createElement("script");
po.type="text/javascript";
po.async=true;
po.src="https://apis.google.com/js/plusone.js";
var s=document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(po,s);
})();

function getValueOfUrlParam(param){param=param.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");
var r1="[\\?&]"+param+"=([^&#]*)";
var r2=new RegExp(r1);
var r3=r2.exec(window.location.href);
if(r3===null){return null;
}else{return r3[1];
}}(function(){var ismobile,currentUrl,divItem,linkData,textValue,siteWrapper;
ismobile=navigator.userAgent.match(/(.*)(android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|plucker|pocket|psp|symbian|treo|vodafone|wap|windows (ce|phone)|xda|xiino)(.*)/i);
if(ismobile&&getValueOfUrlParam("mv")!="pass"){siteWrapper=document.getElementById("wrapper");
textValue="Gå till mobilsajten";
currentUrl=[location.protocol,"//",location.host,location.pathname].join("");
divItem=document.createElement("div");
divItem.setAttribute("id","regularMobileSurf");
divItem.style.display="block";
linkData=document.createElement("a");
linkData.setAttribute("href",currentUrl+"?mv=on");
linkData.setAttribute("id","mobLink");
linkData.innerText=textValue;
linkData.textContent=textValue;
var strhref=window.location.href;
var pattern=/computersweden/;
if(strhref.match(pattern)!=null){divItem.setAttribute("style","margin-top: 200px;");
nav=document.getElementById("divNavigationContainer");
nav.setAttribute("style","padding-top: 0px; background: url('http://cs.idg.se/polopoly_fs/1.435494!menu-bg.jpg') repeat-x scroll 0 0px transparent;");
}divItem.appendChild(linkData);
siteWrapper.insertBefore(divItem,siteWrapper.firstChild);
}}());

