$(document).ready(function(){
	$("#productdetail .content").hide();
	$("#productdetail ul.tabs li:first").addClass("active").show();
	$("#productdetail .content:first").show(); 


	$("#productdetail ul.tabs li").click(function() {

		$("#productdetail ul.tabs li").removeClass("active");
		$(this).addClass("active");
		$("#productdetail .content").hide();

		var activeTab = $(this).find("a").attr("href");
		$(activeTab).fadeIn('slow');
		return false;
	});
//	$(function() {
		$('#typewaarde').buttonset().find('input').show().css({ 'position': 'absolute', 'left': '-999em' });
//	});

	$("#vk_coupon_make_btn").click(function() {

		$("#ck_coupon_count").load('/coupon_action.php', 'webshop_id='+ document.forms['productdetail'].shop.value+'&aantal='+$("#vk_coupon_extra").val()
						/*
							, function(responseText, textStatus) {alert('terug: '+responseText);}
						*/
		);
	});

	$("#vk_coupon_erase_link").click(function() {
		var cbox= confirm('Weet u zeker dat u alle uitgegeven codes wilt verwijderen? Deze kunnen niet hersteld worden.');
		if(cbox==true) {
			$("#ck_coupon_count").load('/coupon_action.php', 'webshop_id='+ document.forms['productdetail'].shop.value+'&aantal=erase');
		}
	});

});

function confirm_goto(question, url) {
	var cbox= confirm(question);
	if(cbox==true) {
		window.location=url;
	}
}

function verzendkostensoort(optionvalue,id)
{
	if(optionvalue == 0){
		$('div.s'+id).fadeIn('slow');
	}
	if(optionvalue == 1){
	   $('div.s'+id).fadeOut('slow');
	}
}

function verzendkostengroep(optionvalue,id)
{
	if(optionvalue == 0){
		$('div.g'+id).fadeIn('slow');
	}
	if(optionvalue == 1){
	   $('div.g'+id).fadeOut('slow');
	}
}

function set_style(field) {		
	document.getElementById(field).className = "focused";
}

function remove_style(field) {		
	document.getElementById(field).className = "";
}
function toggleUp(obje){
	$('#'+obje).slideUp("slow");
}
function toggleDown(obje){
	$('#'+obje).slideDown("slow");
}