function deleteCartProduct(id, artikel)
{
	 $.ajax({
	  cache: false,
	  url: "some3.php",
	  data: "artikel="+id,
	  success: function(html){
		$("#row"+id).remove();
	  }
	});
}
function changeAmount(id, amount, artikel)
{
	
	$("#load"+id).html('<img src="i/ajax-loader.gif" />');
	//alert(amount);
	var str = amount;
 	if(amount < 1)
	{
		alert('U kan geen aantal kleiner dan 1 opgeven');
		$("#load"+id).html('<img src="i/ajax_error.png" />');
	}
	else if(str.indexOf(',') > -1 || str.indexOf('.') > -1)
	{
		alert('U kunt geen . of , in het aantal gebruiken');
		$("#load"+id).html('<img src="i/ajax_error.png" />');
	}
	else
	{
		amount = parseInt(amount);
		$.ajax({
		  cache: false,
		  url: "some2.php",
		  data: "amount="+amount+"&artikel="+artikel,
		  success: function(html2){
			if(html2 == false)
			{
				$.ajax({
				  cache: false,
				  url: "some.php",
				  data: "id="+id+"&amount="+amount+"&artikel="+artikel,
				  success: function(html){
					$("#tot"+id).html(html);
					$("#alert"+id).hide();
					$("#alert"+id).html();
					$("#load"+id).html('<img src="i/ajax_complete.png" />');
				  }
				});
			}
			else
			{
				$("#alert"+id).show();
				$("#alert"+id).html(html2);
				$("#load"+id).html('<img src="i/ajax_error.png" />');
			}
		  }
		});
		
	}
}
$(function(){
	$('img.captify').captify({
		// all of these options are... optional
		// ---
		// speed of the mouseover effect
		speedOver: 'fast',
		// speed of the mouseout effect
		speedOut: 'normal',
		// how long to delay the hiding of the caption after mouseout (ms)
		hideDelay: 500,	
		// 'fade', 'slide', 'always-on'
		animation: 'always-on',		
		// text/html to be placed at the beginning of every caption
		prefix: '',		
		// opacity of the caption on mouse over
		opacity: '0.5',					
		// the name of the CSS class to apply to the caption box
		className: 'caption-bottom',	
		// position of the caption (top or bottom)
		position: 'bottom',
		// caption span % of the image
		spanWidth: '100%'
	});
});

function addOfferte(aantal, id)
{
	if(busy != true)
	{
		var busy = true;
		$('#offerte').attr('disabled', true);
		$('#ofLabel').addClass('disabled');
		if(aantal < 1)
		{
			
			$('#ofFeed').removeClass('good');
			$('#ofFeed').addClass('error');
			$('#ofFB').html('Vul a.u.b. een aantal groter dan 0 in.');
			$('#ofFeed').show();
			var t = setTimeout("$('#ofFeed').hide();busy=false;$('#offerte').attr('disabled', false);$('#ofLabel').removeClass('disabled');", 3000);
		}
		else	
		{
				$.ajax({
				  type: 'POST',
				  cache: false,
				  url: "index.php?page=17",
				  data: "aantal="+aantal+"&product="+id,
				  success: function(html){
					if(html == 3)
					{
						$('#ofFB').html('U heeft al 5 producten geselecteerd.');
						$('#ofFeed').removeClass('good');
						$('#ofFeed').addClass('error');
					}
					else if(html == true)
					{	
						$('#ofFB').html('Product is toegevoegd.');
						$('#ofFeed').removeClass('error');
						$('#ofFeed').addClass('good');
					}
					else
					{
						$('#ofFB').html('Er is iets misgegaan.');
						$('#ofFeed').removeClass('good');
						$('#ofFeed').addClass('error');
					}
					$('#ofFeed').show();
		var t = setTimeout("$('#ofFeed').hide();busy=false;$('#offerte').attr('disabled', false);$('#ofLabel').removeClass('disabled');", 3000);	
				  }
				});						
		}
		
	}
}

showDetails = function(id1){
	if(id1 == 'downloads')
	{
		id2 = 'technisch';	
		id3 = 'omschrijving';
	}else if(id1 == 'technisch')
	{
		id2 = 'downloads';	
		id3 = 'omschrijving';
	}
	else if(id1 == 'omschrijving')
	{
		id2 = 'downloads';	
		id3 = 'technisch';
	}
	
	$("#"+id2).hide(10,function () {
    	$("#"+id3).hide(10,function () {
			$("#"+id1).show(10);
  	})});

}
function Search(term)
{
	var intIndexOfMatch = term.indexOf(" ");
    
    while (intIndexOfMatch != -1){
   
    term = term.replace(" ", "|");
    
    intIndexOfMatch = term.indexOf(" ");
    }
	var intIndexOfMatch = term.indexOf("/");
    
    while (intIndexOfMatch != -1){
   
    term = term.replace("/", "|slash|");
    
    intIndexOfMatch = term.indexOf("/");
    }
	window.location = 'http://www.smeertechniek.nl/zoeken/'+term;
	//window.location = 'http://192.168.1.60/orders/smeertechniek/zoeken/'+term;
}
function switchFileType(type, id, fileIn)
{

	$('#fileHolder').html('<div class="blokje" style="background:#dadada;"><img src="i/ajaxLoader.gif" /></div>');
	$('#fileHolder').load('switchType.php?type='+type+'&id='+id+'&fileIn='+fileIn);
}

<!-- Lightbox -->
$(function() {
	$('a[rel=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
});

function OKSearch(inField, e, term) {
    var charCode;
    
    if(e && e.which){
        charCode = e.which;
    }else if(window.event){
        e = window.event;
        charCode = e.keyCode;
    }

    if(charCode == 13) {
       Search(term);
    }
}
