
function showHide ( item ) {
	if ( $(item) )
	{
		var curItem = $(item);
		if (curItem.style.display == "none") 
		{
			curItem.style.display = "block";
						
			if ( !(navigator.appVersion.indexOf("MSIE")>0 && item == "sendAFriend") ) 
			{
				curItem.slide('hide').slide('in');
			}
		}
		else 
		{
			if ( !(navigator.appVersion.indexOf("MSIE")>0 && item == "sendAFriend") ) 
			{
				curItem.slide('toggle');
			}
			else
			{
				curItem.style.display = "none";
			}
		}
	}
}



function getLocations( item )
{
	if ( !$(item) ) return false;
	
	var form 	= $(item);
	if ( form.opleiding_cursus != undefined ) {
		var locatie	= form.opleiding_cursus.value;
	} else {
		var locatie = "";
	}
	
	//make the ajax call, replace text
	var req = new Request({
			method	: 'post',
			url		: '/includes/Ajax/getLocations.php',
			data	: { 'getLocations' : 'getLoc', 'opleiding_locatie' : locatie },
			onComplete	: function(response) { 
				$('opleiding_locatie_holder').innerHTML = response;
			}
		}).send();
	
	return false;
}



function setPayment ( who ) {
	// alert(who.value);
	if (who.value == 0) {
		$('payment').style.display = "none";
	} else {
		$('payment').style.display = "block";
	}
}




function sendToAFriend( item )
{
	if ( !$(item) ) return false;
	
	var form 		= $(item);
	var sendafriend	= form.sendafriend.value;
	var naam		= form.naam.value;
	var mailFrom	= form.mailFrom.value;
	var mailTo		= form.mailTo.value;
	var securityImageValue = form.securityImageValue.value;
	
	//make the ajax call, replace text
	var req = new Request({
			method	: 'post',
			url		: '/includes/Ajax/sendToAFriend.php',
			data	: { 'sendafriend' : sendafriend, 'mailFrom' : mailFrom, 'naam' : naam, 'mailTo' : mailTo, 'securityImageValue' : securityImageValue},
			onComplete	: function(response) { 
				$('sendAFriend').innerHTML = response;
			}
		}).send();
	
	return false;
}
