
// =====================================       colection version 1.0

//return: object of given id
function zm_findObjById(strID) {
	if (is.dom && document.getElementById(strID))
		return document.getElementById(strID)
	if (is.ie4 && document.all(strID))
		return document.all(strID)
	return false
}


//============================================    
//									Macromedia
//============================================
// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}


// ===================================== 

//action -> laisvas parametru skaicius, trecias ir toliau param. yra elementu ID stringai, keiciamos jų savybių reikšmės
//prop:		element property, pvz.: "style.display"
//value:		value of that property, pvz.: "none"
//father:	free number of parameters: strings, elements ID
function PropChangeArgs(prop,value) {
	var obj
	var args = PropChangeArgs.arguments
	
	for (var i=2; i<args.length; i++) 
	{
		if (!zm_findObjById(args[i])) continue
		if (is.dom)
			eval("document.getElementById(\'" + args[i] + "\')." + prop + "=\'" + value + "\'")
		if (is.ie4)
			eval("document.all(\'" + args[i] + "\')." + prop + "=\'" + value + "\'")
	}
}


//action -> set all element's in array property to value
//prop:		element property, pvz.: "style.display"
//value:	value of that property, pvz.: "none"
//idsArray:	array of elements ID strings
function PropChangeArray(prop,value,idsArray) {
	var obj
	
	for (var i=0; i<idsArray.length; i++) 
	{
		if (!zm_findObjById(idsArray[i])) continue
		if (is.dom)
			eval("document.getElementById(\'" + idsArray[i] + "\')." + prop + "=\'" + value + "\'")
		if (is.ie4)
			eval("document.all(\'" + idsArray[i] + "\')." + prop + "=\'" + value + "\'")
	}
}

// ===================================================

