﻿function storeChecks(obj) {
    var theParent = obj.parentNode;
    callserver(theParent.className + "," + obj.checked);
}
        
function ReceiveServerData(arg, context) {
   //alert(arg);
}

function getParent(theChild, theTag) {
    var theParent = theChild.parentElement;
    var found = false;

    while ((theParent.tagName.toLowerCase() != theTag.toLowerCase()) && (theParent != null) && (theParent.tagName.toLowerCase() != "html")) {
        theParent = theParent.parentElement;

        if ((theParent.tagName.toLowerCase() == "html") || (theParent.tagName.toLowerCase() != theTag) || (theParent.tagName == null)) {
	        found = false;
        }
		
        if (theParent.tagName.toLowerCase() == theTag) {
	        found = true;
        }
    }
	
    if (found == true) {
        return theParent;		
    }
	
    else {
        return null;
    }
}