
	var timeout	= 500;
	var closetimer	= 0;
	var ddmenuitem	= 0;
	
	// open hidden layer
	function mopen(id)
	{	
		// cancel close timer
		mcancelclosetime();
	
		// close old layer
		if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
	
		// get new layer and show it
		ddmenuitem = document.getElementById(id);
		ddmenuitem.style.visibility = 'visible';
	
	}
	// close showed layer
	function mclose()
	{
		if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
	}
	
	// go close timer
	function mclosetime()
	{
		closetimer = window.setTimeout(mclose, timeout);
	}
	
	// cancel close timer
	function mcancelclosetime()
	{
		if(closetimer)
		{
			window.clearTimeout(closetimer);
			closetimer = null;
		}
	}
	
	// close layer when click-out
	document.onclick = mclose;

	function QuizButtonClicked(theElement)
    {
        var theForm = theElement.form;
        var z = 0;
        var p = 0;
        var a = 0;
        var s = 0;
	    for (z = 0; z < theForm.length; z++) {
	        if (theForm[z].type == 'checkbox' && theForm[z].checked == true) {
                if (theForm[z].value == 'P') {
                    p++;
                } else if (theForm[z].value == 'A') {
                    a++;
                } else if (theForm[z].value == 'S') {
                    s++;
                }
            }
        }
        
        if (p > a && p > s) {
            alert('Pushing')
        } else if (a > p && a > s) {
            alert('Attuning')
        } else if (s > a && s > p) {
            alert('Soothing')
        } else if (p == a && p > s) {
            alert('Equally Pushing and Attuning')
        } else if (p == s && p > a) {
            alert('Equally Pushing and Soothing')
        } else if (s == a && s > p) {
            alert('Equally Attuning and Soothing')
        } else if (p == a && p == s) {
            alert('Equally Pushing, Attuning and Soothing')
        }
    }
