var good;
function checkEmailAddress(field) {
// the following expression must be all on one line...
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.biz)|(\.int)|(\.arpa)|(\.aero)|(\.name)|(\.coop)|(\.pro)|(\.museum)|(\.info)|(\..{2,2}))$)\b/gi);
if (goodEmail){
   good = true
} else {
   alert('Tyvärr, mejl-adressen verkar inte vara korrekt.')
   field.focus()
   field.select()
   good = false
   }
}
function mailThisUrl(){
u = window.location;
m = "Jag tänkte det här kan intressera dig...";
   good = false
   checkEmailAddress(document.eMailer.address)
   if (good){
      // the following expression must be all on one line...
      window.location = "mailto:"+document.eMailer.address.value+"?subject="+m+"&body="+document.title+" "+u;
   }
}

// topbanner
function topbanner(z){
ran = parseInt(Math.random()*100);

//<!-- blienvinnare.com-->
if (ran <= 20){document.write('<img src="http://imp.double.se/imp.gif?a194p80g1561" width="0" height="0" alt=""><a href="http://www.double.se/reports/click.php?a=194&amp;p=80&amp;g=1561" target="_blank"><img src="http://www.blienvinnare.com/images/double_banners/468x60_2.gif" width="468" height="60" border="0" alt=""></a>');}
//<!-- gratissidan.com -->
else if (ran <= 40){document.write('<img src="http://www.double.se/reports/imp.php?a=194&p=140&g=2096" width="0" height="0"><a target="_blank" href="http://www.double.se/reports/click.php?a=194&p=140&g=2096"><img src="http://www.gratissidan.com/_graphics/ads/468x60_2.gif" width="468" height="60" border="0"></a>');}
//<!-- busring.se-->
else if (ran <= 60){document.write('<img src="http://imp.double.se/imp.gif?a194p73g738" width="0" height="0" alt=""><a href="http://www.double.se/reports/click.php?a=194&amp;p=73&amp;g=738" target="_blank"><img src="http://www.busring.se/banner/busring-468x60-2.gif" width="468" height="60" border="0" alt=""></a>');}
//<!-- talskrivarna.com-->
else if (ran <= 80){document.write('<img src="http://imp.double.se/imp.gif?a194p85g895" width="0" height="0" alt=""><a href="http://www.double.se/reports/click.php?a=194&amp;p=85&amp;g=895" target="_blank"><img src="http://www.talskrivarna.com/banner/talskrivarna_468x60.gif" width="468" height="60" border="0" alt=""></a>');}
//<!-- gratis-shopping.com -->
else {document.write('<img src="http://www.double.se/reports/imp.php?a=194&p=95&g=1655" width="0" height="0"><a target="_blank" href="http://www.double.se/reports/click.php?a=194&p=95&g=1655"><img src="http://www.gratis-shopping.com/banner_gif_still_468x60.gif" width="468" height="60" border="0"></a>');}
//if(parseInt(screen.availWidth) <= 899 || z == 'y'){
}


function showSth(sth){

with (new Date()) {
var cValue = valueOf();
}
if (sth == 'topplist'){
var cname = "showTopplist";
var cTid = 1;
}else if (sth == 'utbytet'){
var cname = "showUtbytet";
var cTid = 3;
}
var visad = GetCookie(cname)+cTid*3600000;

if(visad >= cValue){ 
if(sth == 'utbytet'){
// Start JW-BANNEREXCHANGE kod (468x60) 
document.write('<scr'+'ipt language="java'+'script"'
+' src="http://www.joakimweb.se/tjanster/ShowBanner.asp?size=3&user=100341"></script>');
}
return; 
} 
document.cookie= cname +"=" + cValue + "; expires= " + getFuture(cTid).toGMTString() + "; path=/";

if (sth == 'topplist'){
document.write('<!-- topplista.se -->'
+'<a href="http://www.topplista.se/in.php?id=33" target="_blank">'
+'<img src="http://www.topplista.se/button.php?u=33" width=88 height=31 border="0">');
document.write('<br><!-- humorsajtens topplista -->'
+'<a href="http://www.humorsajten.com/scripts/atsphp/in.php?id=42" target="_blank">'
+'<img src="http://www.humorsajten.com/scripts/atsphp/button.php?id=42"  width=88 height=31 border="0"></a>');
document.write('<br><!-- topplista.se -->'
+'<A HREF="http://www.topplista.se/in.php?id=123an" target="_blank">'
+'<IMG SRC="http://www.topplista.se/button.php?u=123an" alt="" width=88 height=31 border="0"></a>');
}else if (sth == 'utbytet'){
document.write('<!-- Utbytet.com - Gratis reklam -->'
+'<iframe src="http://www.perfica.se/utbytet.com/utbytet.php?id=10122" name="utbytet" width="468" '
+'marginwidth="0" height="79" marginheight="0" scrolling="no"></iframe>');
}	
	
function getFuture(f){
var d = new Date();
d.setTime(d.getTime() + (3600000 * f));
return d;
}
function GetCookie (name) {
  var search = name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { 
      offset += search.length
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}
}
// showButton();
// showButton slut

