//070411 Joacim Boive - created library 070104-4function autoload(){	// quit if this function has already been called	if (arguments.callee.done) return;	// flag this function so we don't do the same thing twice	arguments.callee.done = true;	//List any additional functions that should fire on window.onload.	//newFunction();		try{			getRandMainBanner();		}catch(e){			try{				getRandBanner();				}catch(e){								}		}			try{		spins();	}catch(e){		//this page doesn't have any spins.	}	checklinks();	jajja();	//countquest();}function jajja(){	var img = new Image();	img.src = "http://wp.statistik.jajja.com/wp_stat.php?pid=19319001&page=" + escape(document.location.href) + "&referer=" + escape(document.referrer);}function spins(){	var head=document.getElementsByTagName("head")[0];	var printOutStr1, printOutStr2;	var resultStr = new Array();	var results = 0;	content = document.getElementById('contentDiv');		tableStr1 = '' + 	'<table width="155" cellspacing="0" border="0" cellpadding="3">' +	'<tr valign="top">' +	'<td class="spinnTitle">';	    	tableStr2 = '</td></tr></table>';	     	tableStr3 = '';	    	var hr = '<table width="155" cellspacing="0" border="0" cellpadding="0">' + 	'<tr><td bgColor="cccccc"><img src="/icons/ecblank.gif" height="1" width="1"></td></tr>' + 	'<tr><td><img src="/icons/ecblank.gif" height="12" width="1"></td></tr>' + 	'</table>';	    	printOutStr1 ='writeout(\'' + tableStr3 + '\');';	printOutStr2 ='writeout(\'' + hr + '\');';		for(var x=0; x<jsLibs.length; x++){		if(jsLibs[x]!=""){			var scr=document.createElement("script");			scr.setAttribute('src', jsLibs[x]);			head.appendChild(scr);		}else{			x=jsLibs.length;		}	}		document.getElementById('loading').innerHTML='';}function writeout(txt) {        if(ns) {		                resultTxt += txt;        } else {		content.innerHTML += txt;        }}function getRandMainBanner(){	if(sourceImg==''){		return false;	}		var arrImg=new Array();	var y=0;	var cookie=readCookie('agriaRandBanner_main1');	var imgcookie=readCookie('agriaRandBanner_main1_img');	var urlcookie=readCookie('agriaRandBanner_main1_url');		if(urlcookie!=null && urlcookie!='undefined'){		if(urlcookie!=window.location.href){ //Store the current URL so we know where we are.			cookie=null;		}	}		if(imgcookie!=null && imgcookie!='undefined'){		var currentImg=unescape(imgcookie); //Store the last shown image if any, so they don't repeat.	}		if(cookie==null){ //Store all available banners, except for the last shown.		for(var x=0; x<sourceImg.length; x++){			if(sourceImg[x]!=''){				if(sourceImg[x]!=currentImg){					arrImg[y]=sourceImg[x];					y++;				}			}		}				y>0 ? sourceImg=arrImg : arrImg=sourceImg;			}else{		arrImg=unescape(cookie).split("#");		for(var x=0; x<arrImg.length; x++){			if(arrImg[x]==currentImg){ //Remove the last shown banner from the list.				x=arrImg.length;				arrImg.splice(x, 1);			}		}	}		var holder=document.getElementById("banner_main1"); //Get where to put the banner.	var nr=Math.floor(Math.random()*(arrImg.length)); 	var img=arrImg[nr];			holder.innerHTML=img;				try{		if(arrImg.length==1){			arrImg=sourceImg; //We've reached the end of the list of banners, so restart.						if(sourceImg.length>1){ //Only remove the last shown banner if we have more then one to show.				if(currentImg!=""){									for(var x=0; x<arrImg.length; x++){						if(arrImg[x]==currentImg){ //Remove the currently displayed image from the source.							x=arrImg.length;							arrImg.splice(x, 1)						}					}				}			}		}else{			arrImg.splice(nr, 1); //Remove the currently displayed banner from the list.		}	}catch(e){		arrImg=sourceImg	}		arrImg.length==0 ? arrImg=sourceImg : ""; //backup		//Update the cookies with the new information.	createCookie("agriaRandBanner_main1", escape(arrImg.join('#')));	createCookie("agriaRandBanner_main1_img", escape(img));	createCookie('agriaRandBanner_main1_url', window.location.href);}function checklinks(){	var re=/\u00A4/g;	var getChar="\u00A4"; 	var lnk=/http:/gi;	if(navigator.product == 'Gecko'){		re=/%A4/g;		getChar="%A4";	}	for (var i=0; i<document.links.length; i++) {	 	var link=document.links[i].href;		var index=link.indexOf(getChar);			if(index>0){   			link=link.replace(re, ":");			link=link.substr(link.lastIndexOf('/',index)+1);			link=link.replace(lnk, "http://");			document.links[i].href=link;		}	}  }function openFlash(link,varHeight,varWidth) {	var MM_contentVersion = 5;	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;	if ( plugin ) {		var words = navigator.plugins["Shockwave Flash"].description.split(" ");			for (var i = 0; i < words.length; ++i) {			if (isNaN(parseInt(words[i])))				continue;				var MM_PluginVersion = words[i]; 			}			var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;	}	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE") != -1 && (navigator.appVersion.indexOf("Win") != -1)) {		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag		document.write('on error resume next \n');		document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');		document.write('</SCR' + 'IPT\> \n');	}	if ( MM_FlashCanPlay ) {		var x = window.open(link,'newwin','toolbar=no,scrollbars=no,resizable=no,directories=no,menubar=no,'+varHeight+','+varWidth)	}	else {		var x =  window.open('/Agria/dominofl.nsf/svarstxt_ejFlash?ReadForm','newwin','toolbar=no,scrollbars=no,resizable=no,directories=no,menubar=no,height=350,width=550');	}}function openCopyrightWindow(){	window.open("/inter/text.nsf/id/283","Utskrift","height=400,width=550,scrollbars");}function openCookieWindow(){	window.open("/inter/text.nsf/id/284","Utskrift","height=300,width=550,scrollbars");}//This needs to be at the bottom of the lib so that everything else has loaded!//For mozilla browsers, so script doesn't have to w8 for images to load and can start processing instantly.if (document.addEventListener) {	document.addEventListener("DOMContentLoaded", autoload, false);}//For all other browsers. (Non IE/Mozilla)window.onload=autoload;
