﻿function getAbsoluteLeft(o) {
	var oLeft = o.offsetLeft        
	while(o.offsetParent!=null) 
	{  
		oParent = o.offsetParent;
		oLeft += oParent.offsetLeft;
		o = oParent;
	}
	return oLeft
}

function retAvail()
{
    var o = document.getElementById("");
}

function cntin(o)
{
     if (o.value == '' || isNaN(o.value)) 
    {
        if (parseInt(o.parentNode.previousSibling.innerText,10) < avail) 
            o.value = parseInt(o.parentNode.previousSibling.innerText,10);
        else
            o.value = avail;
    } 
    else 
    { 
        total = total - parseInt(o.value,10); 
    }
}

function cntout(o)
{
    if (o.value == '' || isNaN(o.value)) 
    {
        o.value = 0;
        total = total + parseInt(o.value,10); 
        avail = max - total;
    }
    else if (total + parseInt(o.value,10) > max) 
    {
        alert('Sorry, you have exceeded your maximum question count.'); 
        o.value = max-total; 
        total = max; 
        avail = 0;
    } 
    else 
    { 
        total = total + parseInt(o.value,10); 
        avail = max - total;
    }
}
