$(document).ready(function(){
	$("span.mailcph").each(function(){
  	var spt = "#" + $(this).attr("id");
  //	var spt = $('span.mailcph');
  	var at = / at /;
  	var dot = / dot /g;
  	var addr = $(spt).text().replace(at,"@").replace(dot,".");
  	$(spt).after('<a href="mailto:'+addr+'" title="Send e-mail" class="mailcph">'+ addr +'</a>')
  	.hover(function(){window.status="Send message!";}, function(){window.status="";});
  	$(spt).remove();
	});
	var mkontakt = $('span#mailkontakt');
	var at = '@';
	var dot = '.';
	var addr = 'info'+at+'postcph'+dot+'com';
	$(mkontakt).after('<a href="mailto:'+addr+'" title="Send e-mail">'+$(mkontakt).text()+'</a>')
	.hover(function(){window.status="Send message!";}, function(){window.status="";});
	$(mkontakt).remove();

	$(".rgb-fader").css("z-index","2");
	$(".rgb-fader").hide();
	$("#logogradient").css("z-index","2");
	$("#logogradient").hide();

	$("#header").mouseenter(function(){
		$("#logogradient").fadeIn("normal");
	});

	$("#header").mouseleave(function(){
		$("#logogradient").fadeOut("slow");
	});
	
	$("#se").click(function(){window.location='http://cph.podhandle.dk/'});
	$("#nu").click(function(){window.location='content/'});
	$("#os").click(function(){window.location='house/'});
	
	$("#se").mouseenter(function(){
		$("#se .rgbheader").hide("");
		$("#se .rgb-fader").fadeIn("fast");
		$("#se .rgb-text").css({"visibility":"visible"});
	});
	$("#se").mouseleave(function(){
		$("#se .rgbheader").fadeIn("slow");
		$("#se .rgb-fader").fadeOut("slow");
		$("#se .rgb-text").css({"visibility":"hidden"});
	});

	$("#nu").mouseenter(function(){
		$("#nu .rgbheader").hide("");
		$("#nu .rgb-fader").fadeIn("fast");
		$("#nu .rgb-text").css({"visibility":"visible"});
	});
	$("#nu").mouseleave(function(){
		$("#nu .rgbheader").fadeIn("slow");
		$("#nu .rgb-fader").fadeOut("slow");
		$("#nu .rgb-text").css({"visibility":"hidden"});
	});
	
	$("#os").mouseenter(function(){
		$("#os .rgbheader").hide("");
		$("#os .rgb-fader").fadeIn("fast");
		$("#os .rgb-text").css({"visibility":"visible"});
	});
	$("#os").mouseleave(function(){
		$("#os .rgbheader").fadeIn("slow");
		$("#os .rgb-fader").fadeOut("slow");
		$("#os .rgb-text").css({"visibility":"hidden"});
	});

	$("#subse").mouseenter(function(){
		$("#subse .rgb-fader").fadeIn("fast");
		$("#subse a").css("color","#900");
	});
	$("#subse").mouseleave(function(){
		$("#subse .rgb-fader").fadeOut("slow");
		$("#subse a").css("color","#fff");
	});
	$("#subnu").mouseenter(function(){
		$("#subnu .rgb-fader").fadeIn("fast");
		$("#subnu a").css("color","#090");
	});
	$("#subnu").mouseleave(function(){
		$("#subnu .rgb-fader").fadeOut("slow");
		$("#subnu a").css("color","#fff");
	});
	$("#subos").mouseenter(function(){
		$("#subos .rgb-fader").fadeIn("fast");
		$("#subos a").css("color","#009");
	});
	$("#subos").mouseleave(function(){
		$("#subos .rgb-fader").fadeOut("slow");
		$("#subos a").css("color","#fff");
	});
	
  $('#slide1').innerfade({ speed: 4000, timeout: 7000, type: 'sequence', containerheight: '341px' });
  $('#slide2').innerfade({ speed: 4000, timeout: 8000, type: 'sequence', containerheight: '211px' });
});

