function getSubscriptions(obj, nodeType, elementType, attributeValue, returnValue){
    // SUBSCRIPTIONS
	var returnXML = "";
        var subs = getChildNodes(obj, nodeType, elementType, attributeValue, returnValue);
        var rss = subs.split("~");        
        //alert(returnXML);
        for(var r=0;r<rss.length;r++){
            if (document.getElementById(rss[r]) && document.getElementById(rss[r]).checked){
                returnXML += "<subscription>" + document.getElementById(rss[r]).value + "</subscription>";
            }    
        }
	
	return returnXML;
    
}

function getChildNodes(obj, nodeType, elementType, attributeValue, returnValue){
        var children = obj.childNodes;
        
        if (children.length != 0){
            for (var i=0;i<children.length;i++){
                
                if (children[i].nodeType == nodeType){
                    
                    if (children[i].childNodes.length != 0 && children[i].nodeName != elementType){
                        returnValue = getChildNodes(children[i], nodeType, elementType, attributeValue, returnValue);
                    }else{
                         
                        if (elementType != "undefined"){
                            
                            if (children[i].tagName == elementType){
                               
                                if (attributeValue != "undefined"){
                                    var att = children[i].attributes;
                                    
                                    for (var x=0;x<att.length;x++){
					//alert(returnValue);
                                        if (att[x].value == attributeValue){
                                        
                                            if (returnValue == ""){
                                                returnValue = children[i].id;
                                               
                                            }else{
                                                returnValue += "~" + children[i].id;  
                                            } 
                                           
                                        }
                                    }                            
                                }else{
                                    //return children[i];
                                }
                            }
                    
                        }
                     } 
                 }// if
               
               }//for loop
            }// if
         return returnValue;
    }