function newShout(){
	$("#shoutText").fadeOut(400,function() { 
		$("#shoutNew").fadeIn(400);
	})
}

function closeNewShout(){
	$("#shoutNew").fadeOut(400,function() { 
		$("#shoutText").fadeIn(400,function() { 
			$("#shoutform").html("Din besked");
		})
	})
}

function newShoutSubmit(URL){
	var countTegn = $("#shoutform").val().length;
	if($("#shoutform").val() === "Din besked"){
		$("#shoutFejlSubmit1").fadeOut(400);
		$("#shoutFejlSubmit3").fadeOut(400);
		$("#shoutFejlSubmit2").fadeIn(400);
	}else if(countTegn > 100){
		$("#shoutFejlSubmit3").fadeOut(400);
		$("#shoutFejlSubmit2").fadeOut(400);
		$("#shoutFejlSubmit1").fadeIn(400);
	}else{
		$("#shoutNew").fadeOut(400,function() { 
			var shoutTekst = $("#shoutform").val();
			var shoutUrl = URL+"/res/sendshout.php?tekst="+escape(shoutTekst);
			$("#shoutNew").load(shoutUrl);
		}).fadeIn(400);
	}
}

function visOpretDiv(){
	$("#opretbillede").fadeOut(500,function() { 
		$("#opretdiv").fadeIn(400);
	})
}

function blinkIt() {
 if (!document.all) return;
 else {
   for(i=0;i<document.all.tags('blink').length;i++){
      s=document.all.tags('blink')[i];
      s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
   }
 }
}

function ansoegVen(venneID,URL){
	$("#venResponse").fadeOut(500,function(){
		var venURL = URL+"/res/ansoegven.php?ven="+escape(venneID);
		$("#venResponse").load(venURL,function(){
			$("#venResponse").fadeIn();
		});
	});
}

function tilfoejFavorit(brugerID,URL){
	$("#tfavorit").fadeOut(500);
	var favURL = URL+"/res/tilfoejfavorit.php?bruger="+escape(brugerID);
	$("#tfavoritres").load(favURL);
}

function showBilledeDiv(id,URL){
	$("#billedeThumbs").fadeOut(300,function(){
		var artUrl = URL+"/res/showartjob.php?id="+escape(id);
		$("#billedeDiv").load(artUrl,function(){
			$("#billedeDiv").fadeIn();
		});
	});
}

function visBillede(id,URL){
	$("#thumbsdesc").fadeOut(300,function(){
		var picUrl = URL+"/res/showpic.php?id="+escape(id);
		$("#imgdiv").load(picUrl,function(){
			$("#imgdiv").fadeIn();
		});
	});
}

function showArkiv(id,URL){
	$("#billedeThumbs").fadeOut(300,function(){
		var artUrl = URL+"/res/showarkiv.php?id="+escape(id);
		$("#billedeDiv").load(artUrl,function(){
			$("#billedeDiv").fadeIn();
		});
	});
}

function showThumbs(){
	$("#imgdiv").fadeOut(300,function(){
		$("#thumbsdesc").fadeIn();
	});
}

function showArtThumbs(){
	$("#billedeDiv").fadeOut(300,function(){
		$("#billedeThumbs").fadeIn();
	});
}

$(document).ready(function(){
  setInterval('blinkIt()',400);
  $('.lightbox').lightBox();
});
