var timer = 8000;
var relimages = Math.ceil(Math.random()*5);
   $(function() {

  $('table#project-table td a').hover(function () {
  $(this).parents('tr').children('td').children('a').addClass("activ");
  }, function () {
   $(this).parents('tr').children('td').children('a').removeClass("activ");
  });
  
  });	
  
  $(function() {  
$("a[href*='mailto:']").each(function(){
     var mail = $(this).parent().html().replace(/\(z\)/g, '@').replace(/\%28z\%29/g, '@');
$(this).parent().html(mail);
});

});	


$(window).load(function() {
  $('div.slide_action a').hide();
	$('div.slide_action a[rel~="'+relimages+'"]').fadeIn("slow").addClass("visible");
});

$(function() {
var interval;
  interval = setInterval(function() {
	    var relnew = $('div.slide_action a[class~="visible"]').attr("rel");
      $("div.slide_action a").stop(true, true).fadeOut("slow").removeClass("visible");
      var relnewint = parseInt(relnew);
        if(relnewint == 5){
          relnewint = 1;
          $('div.slide_action a[rel~="'+relnewint+'"]').stop(true,true).fadeIn("slow").addClass("visible");
        }
        else{
          relnewint++;
          $('div.slide_action a[rel~="'+relnewint+'"]').stop(true,true).fadeIn("slow").addClass("visible");
        }
   
  }, timer);  
}); 

$(document).ready(function(){
    $('a.back-project').click(function(){
        history.back();
        return false;
    });
});
