var active = null;

function setActions(elem, id, url, duration, price, exam) {
	if (active)
		$(active).className = '';
	active = elem;
	$(active).className = 'active';
	$('btn-info').href = url;
	$('btn-order').href = $('url').value + 'checkout/cart/add/product/' + id;
	$('btn-contact').href = $('url').value + 'contacts?productId=' + id;
	$('product-duration').innerHTML = duration;
	$('product-price').innerHTML = price;
	$('product-exam').innerHTML = exam;
	$('cursusinfo').style.display = 'block';
}

function setProduct(elem, id, price) {
	if (active) {
		if (!(active % 2))
			$('row-' + active).className = 'grey';
		else
			$('row-' + active).className = '';
	}
	active = elem;
	if (!(active % 2))
		$('row-' + active).className = 'active';
	else
		$('row-' + active).className = 'active grey';
	$('productId').value = id;
	$('btn-contact').href = $('url').value + 'contacts?productId=' + id;
	$('product-price').innerHTML = price;
	$('productOptions').style.display = 'block';
}

function orderProduct(submit) {
	if (active || submit == 1) {
		var qty = $('qty').value;
		var goTo = $('url').value + 'checkout/cart/add/product/' + $('productId').value + '/qty/' + qty;
		location.href = goTo;
	} else {
		alert('Selecteer een datum en locatie');
	}
}
function bookmarkPage(url) {
	var title = "New Horizons";
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) {
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) {
		return true;
	}
}