// JavaScript Document
// 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;
}

function CheckAll( cForm , indValue , cPattern ) {
	objForm = findObj( cForm ) ;
	for ( i=0 ; i < objForm.length ; i++ ) {
		cString = new String( objForm[i].name );
		if ( cString.indexOf( cPattern ) > -1 ) {
			objForm[i].checked = indValue ;
		}
	}
}

function Toogle( cObj ) {
	obj =  findObj( cObj ) ;		
	if ( obj.style.display == "" ) {
		obj.style.display = "none" ;
	} else {
		obj.style.display = "" ;			
	}
}

function TM_back()  {
	var tm_curr = document.URL;
	if ( tm_curr.indexOf('#') == -1 ) {
		history.back();
	} else {
		history.go(-2);
	}
}