$(document).ready(function(){
	
	//$(".slideshow").cycle.defaults.timeout = 9000;
	//$(".slideshow").cycle('scrollLeft');
	
	/*
	$('slideshow').cycle({ 
    fx:     'scrollDown', 
    easing: 'bounceout', 
    delay:  -2000 
	});
	*/
	
	$(".slideshow").cycle({
		fx:     'scrollDown', 
    easing: 'bounceout', 
		timeout: 8000
    //delay:  5000 
	});
	
	$('#sputnik_carousel').sputnikcarousel();
	
/*	$('#accordion').accordion({
		active: true,
		autoheight: false,
		alwaysOpen: false,
		header: 'a.acc'
  });	*/

	$(".accPart").hide();
	/*$(".acc").click(function(){$(this + ".accPart").show()});*/

	$("#quote-form").hide();
	
	$(".databankbox").hide();
	
	$(".navigation-content div:last-child").css({borderBottom: "none"});

});//END document ready

function accSlide(accID){
	var acc_str = "#" + accID;
	$(".accPart:not("+acc_str+")").hide();
	$(acc_str).toggle();
	var acc_a_str = acc_str + "-a";
	$(".acc:not("+acc_a_str+")").removeClass("highlight");
	$(acc_a_str).toggleClass("highlight");
/*	$("#"+accID+":hidden").show();
	$("#"+accID+":visible").hide();*/
}

function showDrop(dropID){
	//$(".dropdown").hide();
	$("#"+dropID).show();
}

function toggleDrop(dropID){
	//$(".dropdown").hide();
	$("#"+dropID).toggle();
}

function hideDrop(){
	$(".dropdown").hide();
}

function mailto(emailAdressMixed) {
	var emailAdress = emailAdressMixed.replace(/\[at\]/g,"@");
	emailAdress = emailAdress.replace(/\[dot\]/g,".")
 	window.open('mailto:'+emailAdress); 
}

function remove_confirm(){
	var r = confirm("Bent u zeker dat u zichzelf wil verwijderen uit onze database?");
	if(r == true){
		window.location = "index.php?a=user/delete";
	}
}

var datum_id = 1;

function addDatum(){
		var htmlStr = "<div class=\"datumBox\" id=\"datum_"+ datum_id + "\"><input class=\"input-120\" type=\"text\" name=\"datumArr[" + datum_id + "]\" />\n<input class=\"input-50\" type=\"text\" name=\"startArr[" + datum_id + "]\" />\n<input class=\"input-50\" type=\"text\" name=\"eindArr[" + datum_id + "]\" /><a href=\"javascript:deleteDatum('datum_" + datum_id + "')\"> >> verwijder</a></div>";
		$('#datumContainer').append(htmlStr);
		datum_id ++;
}

function deleteDatum(div_id){
		$('#'+div_id).remove();
}

function getModSelectBox(itemId, relationTypeId, inputName){
	var requestString = "_lib/ajaxreq/fetchModSelectBox.php?itemId="+itemId+"&"+"relationTypeId="+relationTypeId+"&"+"inputName="+inputName;
	$.ajax({
  	url: requestString,
  	cache: false,
  	success: function(html){
    	$("#modSelectTarget").html(html);
  	}
	});
}

function addFavoriteMeth(itemId){
	var requestString = "/index.php?a=methodiekendatabank/bewaar/" + itemId;
	$.ajax({
  	url: requestString,
  	cache: false,
  	success: function(html){
			//alert(html);
    	$("#favoriteMethButton").html("<span>Bewaard in mijn favorieten</span>");
  	}
	});
}
