function printEmail(vastaanottaja, domain, tyyli) {
  var style = (tyyli=="") ? " " : " class=\""+tyyli+"\" "; 
  var at    = "@";
  document.write("<a"+style+"href=\"mailto:"+vastaanottaja+""+at+""+domain+"\">"+vastaanottaja+""+at+""+domain+"</a>");
}

$(document).ready(function(){

  function popup(url) {
    window.open( url, "myWindow", 
                      'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,height=600,width=845' )
  }

   // Add fancybox to additional thumbnails
   $("#thumbs .thumb").fancybox(); 

  $("#nettiauto a").click(function() {
    popup(this.href);
    return false;
  });

});

function hoverOn(element) {
  document.images[element].src = "/img/linkit/" + element + "2.jpg";
}

function hoverOff(element) {
  document.images[element].src = "/img/linkit/" + element + ".jpg";
}

sfHover = function() {
	var sfEls = document.getElementById("linkit").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
// if ie6 then add the funtion for dropdown menu
if (window.attachEvent) window.attachEvent("onload", sfHover);
