function doExpand( menuClass ) {
	
	if ( $( '#' + menuClass ).is( ':hidden' ) ) {
		
		$( '#' + menuClass ).slideDown( 'slow' );
		
		$.ajax( {
				url:		url + 'ajax/menu/',
				type:		'post',
				data:		'open=' + menuClass,
				cache:		false
		} );
		
	} else {
		
		$( '#' + menuClass ).slideUp( 'slow' );
		
		$.ajax( {
				url:		url + 'ajax/menu/',
				type:		'post',
				data:		'close=' + menuClass,
				cache:		false
		} );
		
	}
	
}

function doQuestion( question, url ) {
	
	if ( confirm( question ) ) {
		
		window.location = url;
		
	} else {
		
		return false;
		
	}
	
}

function confBut( ) {
	
		if ( confirm( 'Weet je het zeker?' ) ) {
				
				return true;
				
		}
		
		return false;
		
}

function changeText( oElement, sText ) {
		
		if ( oElement.value == '' ) {
				
				oElement.value = sText;
				
		} else if ( oElement.value == sText ) {
				
				oElement.value = '';
				
		} else {
				
				return false;
				
		}
		
}

function deleteAnswer( answer_id ) {
		
		$( '#' + answer_id ).fadeOut( 'slow', function( ) {
				
				oParent					= document.getElementById( 'answerList' );
				oChild					= document.getElementById( answer_id );
				oParent.removeChild		( oChild );
				
		} );
		
}

var countDivs = 0;
var newID = 10000;

function addAnswer( ) {
		
		oParent					= document.getElementById( 'answerList' );
		oChild					= document.createElement( 'div' );
		oChild.setAttribute		( 'id', 'answer_gen_' + countDivs );
		oChild.setAttribute		( 'style', 'display: none;' );
		oChild.innerHTML		= '<label>Antwoord:</label><br /><input type="radio" name="correct" value="' + newID + '" style="width: 10px; margin-right: 10px;" <input type="text" name="answer[' + newID + ']" value="" class="required" style="width: 635px;" /> <a href="#" onclick="javascript:deleteAnswer( \'answer_gen_' + countDivs + '\' ); return false;"><img src="http://yueli.yorku.ca/img/red-cross.png" style="width: 28px; padding-left: 8px;" /></a><br style="clear: both;" />';
		oParent.appendChild( oChild );
		
		$( '#' + 'answer_gen_' + countDivs ).fadeIn( 'slow' );
		countDivs++;
		newID++;
		
}

function getCheckedValue( radioObj ) {
	
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
	
}

function setChecked( frm ) {
	
	checked = getCheckedValue( document.forms[ 'frmExamn' ].elements[ 'examn' ] );
	
	if ( checked == '' ) {
		alert( 'Selecteer eerst een examen' );
		return false;
	} else {
		document.forms[ frm ].examn.value = checked;
		return true;
	}
	
}

function changeBorder( examn_image ) {
	
	document.getElementById( 'image_1' ).style.border		= '';
	document.getElementById( 'image_2' ).style.border		= '';
	document.getElementById( examn_image ).style.border		= '2px #30CFF4 dashed';
	
}