rem: var checkedFlag = false; 
context: function saveEngines( aSelectElement ){  var category = aSelectElement.options[ aSelectElement.selectedIndex ].getAttribute("id");  if( category )    category = "NC:SearchCategory?category=" + category;  else    category = "NC:SearchEngineRoot";	var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();	if (rdf)   rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);	if (rdf)	{		var localStore = rdf.GetDataSource("rdf:local-store");    if( !localStore )      return false;   	var treeNode = document.getElementById("searchengines");    var numChildren = treeNode.childNodes.length;  	for (var x = 0; x<numChildren; x++)   	{    	if (treeNode.childNodes[x].tagName == "treechildren")  	  {  			var treeChildrenNode = treeNode.childNodes[x];   			break;    	} 		}    if( !treeChildrenNode )      return false;    var checkedProperty = rdf.GetResource( "http://home.netscape.com/NC-rdf#checked", true );    var categorySRC = rdf.GetResource( category, true );    var checkedFlag = false;    for (var x = 0; x < treeChildrenNode.childNodes.length; x++)    {      var treeItem = treeChildrenNode.childNodes[x];      if( !treeItem )      	continue;      checkedFlag = false;      var checkbox = treeItem.firstChild.firstChild.firstChild;      if( checkbox.checked || checkbox.getAttribute("checked") == "1" )         checkedFlag = true;      var engineURI = treeItem.getAttribute("id");      var engineSRC = rdf.GetResource(engineURI, true);      if( checkedFlag )        localStore.Assert( categorySRC, checkedProperty, engineSRC, true );      else        localStore.Unassert( categorySRC, checkedProperty, engineSRC, true );    }    flushableStore = localStore.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);    if (flushableStore)      flushableStore.Flush();  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/7bfd3719dc9d969efb74cd4fbaf3b0f83bc95387/search-panel.js/clean/suite/common/search/search-panel.js