function loadProduct( productID ){
	//product bestaat, dus ophalen
	if( productID ){
		$.ajax({
			type: 'POST',
			url: AbsPath + 'includes/SpecialPages/Product/Ajax.php',
			data: 'productID=' + productID,
			dataType: 'json',
		    async: false,
			success: function(data) {
				$('#Producten').append(data.HTML);
				showProduct( productID );
			},				
		    error: function(xhr, status, errorThrown){
		        alert('Er is een fout opgetreden tijdens het doorgeven van deze actie!');           
		    }
		});
	} 
}

function hideProduct( productID ){
	//hide div 
	$("#Product"+productID).hide();
	$("#WhiteLayer").hide();
}

function showProduct( productID ){
	//show div 
	var productDiv = $('#Product' + productID);
	var ScrollTop = $(window).scrollTop();
	productDiv.css({
		top: 0,
		marginTop: (35 + ScrollTop) + 'px'
	});
	productDiv.show();
	$("#WhiteLayer").show();
}

function toggleProduct( productID ){
	//controle of productID is meegegeven  z
	if( productID ) { //true
		//controle of product div bestaat (in html)
		//console.log(document.getElementById('#Product' + productID));
		if( document.getElementById( 'Product' + productID ) ) { //true
			//console.log('Komt erin');
			//block en hide div element
			showProduct( productID ); 
		} else {
			//console.log('Komt er niet in');
			//div laden/opbouwen met inhoud
			loadProduct( productID );
			// <a onclick="myFun(this, id);"
			// myfunc(this, id){ a =
		}
	} else {
		//geen productID gegeven, alert
	}
	
}
function clickTab(tabElement, id, contentName){
	tab = $(tabElement);
	divProductID = 'Product'+id;
	
	// hideTabs
	tabs = $('div#'+divProductID+' a.ProdTab');
	tabs.addClass('Inactive');
	tabs.removeClass('Active');
	
	// hideTabsContent
	tabs = $('div#'+divProductID+' div.ProdContent');
	tabs.addClass('Inactive');
	tabs.removeClass('Active');	
		
	// showTab
	tab.addClass('Active');
	tab.removeClass('Inactive');

	// showTabContent
	element = 'div#'+divProductID+' div.Prod'+contentName;
	
	tabcontent = $(element);	
	tabcontent.addClass('Active');
	tabcontent.removeClass('Inactive');
}
// $('a.ProdTab').click(function(){
					

function showTab(tab){
	tab.hasClass('Active');
	divFadeOut.switchClass('Active', 'Inactive', 1);
	alert(tab);	
} 
