// Popup Browser Window
function openWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

// Blurring links:
function blurLink(theObject)	{ //
	if (theObject.blur)	{
		theObject.blur();
	}
}

// CryptMail
function mailto (s)	
{
	document.location.href =  "mailto:" + unCryptMail(s);
}

function unCryptMail (r)  
{
	r = unescape (r);
	var l = r.length;
	var o = "";
	for (i = 0; i < l; i++)
	{
		o += String.fromCharCode (r.charCodeAt (i) - 1);
	}
	return o; 
}

function cryptMail (r) 
{
	var l = r.length;
	var o = "";
	for (i = 0; i < l; i++)
	{
		o += String.fromCharCode (r.charCodeAt (i) + 1);
	}
	return escape (o);
}

jQuery(document).ready(function() {
	jQuery('#multipleChoiceTest').submit(function() {
		var $=jQuery,
			form=$(this),
			numQuestions = form.find('ol > li').length,
			numChecked = form.find('input:radio:checked').length;
			
		if (numChecked < numQuestions) {
			alert('Bitte markieren Sie zu jeder Frage eine Antwort');
			return false;
		} else {
			return true;
		}
	});
});