function showResult(answerId, lang) {
	var resultText = "";
	var errorText = "";
	
	if (lang && lang=='en') {
		errorText = "Please choose an answer.";
		if(document.quiz.answer[answerId].checked) {
			resultText = "Answer "+(answerId+1)+" is correct.";
		} else {
			resultText = "A near miss. Answer "+(answerId+1)+" is correct.";
		}
	} else {
		errorText = unescape("Bitte w%E4hlen Sie eine Antwort.");
		if(document.quiz.answer[answerId].checked) {
			resultText = "Stimmt, Antwort "+(answerId+1)+".";
		} else {
			resultText = "Knapp daneben, Antwort "+(answerId+1)+" ist richtig.";
		}
	}

	if (checkRadioButtons()){
		document.getElementById('result').innerHTML = resultText;
	} else {
		document.getElementById('error').style.display = "block";
		document.getElementById('error').innerHTML = errorText;
	}	
}

function checkRadioButtons() {
	var isChecked = false;
	
	for (var i=0; i < document.quiz.answer.length; i++){
		if (document.quiz.answer[i].checked == true) {
			isChecked = true;
		}
	}
    return isChecked;
}


function getWinHeight(win)
{
    if(!win) win = window;
    var s = new Object();
    if(typeof win.innerHeight != 'undefined')
    {
        s.height = win.innerHeight;
    }
    else
    {
         var obj = getBody(win);
         s.height = parseInt(obj.clientHeight);
    }
    return s.height;
}

////////////////////////////////////////////////////////////
// Der IE hat 2 verschiedene Objekte f�r den strict und quirks Mode.
function getBody(w)
{
    return (w.document.compatMode && w.document.compatMode == "CSS1Compat") ? w.document.documentElement : w.document.body || null;
}  

var flashContent = false;
var magicMoments = false;
var bottom_text_img = '/de/img/general/bottom-text.gif';
var bottom_text_link = 'www.schott.com/hometech/german/products/robax/index.html';
	
function checkAndResize(lang){
	var winHeight = getWinHeight();
	var contentHeight = 0;
	
	if(magicMoments) {
		document.getElementById('contentOuterDiv').style.height = winHeight-123+"px";
		document.getElementById('contentOuterDiv').style.overflow = 'hidden';
	} else {
		if(flashContent) {
			contentHeight = document.getElementById('contentOuterDiv').offsetTop + 284;
		} else {
			contentHeight = document.getElementById('contentOuterDiv').offsetTop + document.getElementById('footerSpacer').offsetTop-178;
		}
	}
	
	if(document.getElementById('backgroundImg')) {
		if(winHeight > contentHeight+224 ){
			document.getElementById('backgroundImg').style.height = winHeight-152+30+"px";
			document.getElementById('backgroundImg').style.overflow = 'hidden';
		}else{
			document.getElementById('backgroundImg').style.height = contentHeight+150+"px";
			document.getElementById('backgroundImg').style.overflow = 'hidden';
		}
	}
	
	
	
	if (lang=='en') {
		bottom_text_img = '/en/img/general/bottom-text.gif';
	  bottom_text_link = 'www.schott.com/hometech/english/products/robax/index.html';
	} else
	if (lang=='dk') {
		bottom_text_img = '/dk/img/general/bottom-text.gif';
	  bottom_text_link = 'www.schott.com/hometech/english/products/robax/index.html';
	} else
	if (lang=='es') {
		bottom_text_img = '/es/img/general/bottom-text.gif';
	  bottom_text_link = 'www.schott.com/hometech/english/products/robax/index.html';
	} else
	if (lang=='fr') {
		bottom_text_img = '/fr/img/general/bottom-text.gif';
	  bottom_text_link = 'www.schott.com/hometech/english/products/robax/index.html';
	} else
	if (lang=='it') {
		bottom_text_img = '/it/img/general/bottom-text.gif';
	  bottom_text_link = 'www.schott.com/italian/index.html';
	}
	if ($('#backgroundImg').children().length==1) {
		$('#backgroundImg').append('<div style="position: absolute; bottom: 9px; left: 8px; width: 160px; height: 12px; z-index: 100; color: #fff;"><a href="http://'+bottom_text_link+'" title="'+bottom_text_link+'" target="_blank"><img src="'+bottom_text_img+'" alt="" title="" width="160" height="12" /></a></div>');
	}
	
}

function checkFlashHeight() {
	document.write('');
	
	document.getElementById('contentOuterDiv').style.height = document.getElementById('windowHeight').offsetHeight - 123 + "px";
	document.getElementById('contentOuterDiv').style.overflow = "hidden";
}

function hideBgSizedImage() {
	document.getElementById('backgroundImg').style.display = 'none';
}
function openPage(url) {
	window.location.href=url;
}

var bookmarkingTitle = "";
var bookmarkingText = document.title;

function getBookmarkingTitle() {
	if(typeof(bookmarkingText) != 'undefined' && bookmarkingText != null && bookmarkingText != "") {
		bookmarkingTitle = bookmarkingText;
	} else if(typeof(attributeTitle) != 'undefined' && attributeTitle != null && attributeTitle != ""){
		bookmarkingTitle = attributeTitle;
	}
	return bookmarkingTitle;
}


