function showRegisterDiv() { 
  $("#frontcontent").fadeOut("slow"); 
  $("#blankcontent").fadeIn(2000); 
}

function showLoginBar(){
	if ($("#loginBar").is(":hidden")) {
    $("#loginBar").slideDown(500);
  } else {
    $("#loginBar").slideUp(200);
  }
}	

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500,left = 470,top = 200');");
}

function reklamer_initCallback(carousel)
{
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
    jQuery('#reklamer').jcarousel({
        auto: 4,
        wrap: 'last',
        initCallback: reklamer_initCallback
    });
});

function visAnnonce(annonceDiv,annonceUrl){
  $("#"+annonceDiv).fadeOut("slow");
  $("#annonceInfo"+annonceDiv).fadeOut("slow");
  window.open(annonceUrl);
  return false;
}

function visAnnonceInfo(divId,point){
	if(document.getElementById("annonceInfo"+divId).style.display!='block'){
		$("#annonceInfo"+divId).slideDown(400);
		$("#point"+divId).fadeOut(400,function() { 
	  	$("#point"+divId).html("Luk infoboks"); 
	  }).fadeIn(400); 	
	}else{
		$("#annonceInfo"+divId).slideUp(400);
		$("#point"+divId).fadeOut(400,function() { 
	  	$("#point"+divId).html(point+" point"); 
	  }).fadeIn(400); 	
	}
	return false;
}

function skiftProduktBillede(URL,produkt,farve){
	document.getElementById("ipodimg").src = URL+'/images/ipods/'+produkt+'/'+farve+'.jpg';
	if(farve == "graa"){
		farvetekst = "grå";
	}else if (farve == "sort"){
		farvetekst = "sort";
	}else if (farve == "lilla"){
		farvetekst = "lilla";
	}else if (farve == "blaa"){
		farvetekst = "blå";
	}else if (farve == "groen"){
		farvetekst = "grøn";
	}else if (farve == "gul"){
		farvetekst = "gul";
	}else if (farve == "orange"){
		farvetekst = "orange";
	}else if (farve == "roed"){
		farvetekst = "rød";
	}else{
		farvetekst = "pink";
	}
	document.getElementById("ipodFarve").innerHTML = farvetekst;
}

function skiftHukommelse(vaerdi){
	document.getElementById("ipodLager").innerHTML = vaerdi;
	document.getElementById("ipodPris1").style.display='none';
	document.getElementById("ipodPris2").style.display='none';
	document.getElementById("ipodPris8").style.display='none';
	document.getElementById("ipodPris16").style.display='none';
	document.getElementById("ipodPris32").style.display='none';
	document.getElementById("ipodPris"+vaerdi).style.display='inline';
}

function postnrTilBy(postnr) {
	if(pn["p" + postnr]){
		document.getElementById('profilby').value = pn["p" + postnr];
	}
}