﻿// JScript File
function findParent(obj, tagname)
{
    while(obj && obj.tagName != tagname)
    {
        obj = obj.parentNode;   
    }
    
    return (obj && obj.tagName == tagname)? obj : null;

}

