﻿
    function changeVal(imagename, valuebox, newvalue, questionnumber) {

        document.getElementById('Q' + questionnumber + 'box1').src = '../images/box.gif';
        document.getElementById('Q' + questionnumber + 'box2').src = '../images/box.gif';
        document.getElementById('Q' + questionnumber + 'box3').src = '../images/box.gif';
        document.getElementById('Q' + questionnumber + 'box4').src = '../images/box.gif';
        document.getElementById('Q' + questionnumber + 'box5').src = '../images/box.gif';
        document.getElementById('Q' + questionnumber + 'box6').src = '../images/box.gif';
        document.getElementById('Q' + questionnumber + 'box7').src = '../images/box.gif';
        document.getElementById(imagename).src = '../images/ticked.gif';
        document.getElementById(valuebox).value = newvalue;
    }

    function submitForm()
    {
	    document.frmsave.submit();
    }
    function preSubmitForm()
    {
	    window.onbeforeunload = null;
    }

    function dropMenu(currElem) 
    {
        document.getElementById(currElem).style.visibility = "visible";
    }

    function returnMenu(currElem) 
    {
	    document.getElementById(currElem).style.visibility = "hidden";
    }

    function Resize()
    {
        /*
        
        var viewportwidth;
        var viewportheight;
     
        // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
     
         if (typeof window.innerWidth != 'undefined')
        {
        viewportwidth = window.innerWidth,
        viewportheight = window.innerHeight
        }
         
        // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

         else if (typeof document.documentElement != 'undefined'
        && typeof document.documentElement.clientWidth !=
        'undefined' && document.documentElement.clientWidth != 0)
        {
        viewportwidth = document.documentElement.clientWidth,
        viewportheight = document.documentElement.clientHeight
        }
     
     // older versions of IE
     
     else
        {
        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
        viewportheight = document.getElementsByTagName('body')[0].clientHeight
        }

     var mp2jcontentwrap = document.getElementById("mp2jcontentwrap");
        if (viewportheight < 10000) {

         mp2jcontentwrap.style.height = (viewportheight - 182) + 'px';
        mp2jcontentwrap.style.overflow = "auto";
        }
        else 
        {
        mp2jcontentwrap.style.overflow = "visible";
        }
        window.defaultStatus = (viewportheight - 182) + 'px';
          
     
        var nextbutton = document.getElementById("nextbutton");
        if (nextbutton != null)
        {
        if (viewportheight > 700)
        {
        //position on the bottom
        nextbutton.style.bottom = '2px';
        nextbutton.style.top = '';
        }
        else
        {
        nextbutton.style.bottom = '';
        nextbutton.style.top = '700px';
        }
        }
        */
 
    }

