  var newwindow;
  function walkthrough(movie,target)
  {
   newwindow=window.open(movie, target, 'width=800,height=574,status=no,menubar=no');
   if (window.focus) {
    newwindow.focus()
  }
  }
  
function openWindow(movie,target)
{
	newwindow=window.open(movie, target, 'width=580,height=405,status=no,menubar=no');
	if (window.focus) {
		newwindow.focus()
		}
}

// 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;

}

// * Dependencies * 

// this function requires the following snippets:

// JavaScript/readable_MM_functions/findObj

//

// Accepts a variable number of arguments, in triplets as follows:

// arg 1: simple name of a layer object, such as "Layer1"

// arg 2: ignored (for backward compatibility)

// arg 3: 'hide' or 'show'

// repeat...

//

// Example: showHideLayers(Layer1,'','show',Layer2,'','hide');

function showHideLayers()

{ 

  var i, visStr, obj, args = showHideLayers.arguments;

  for (i=0; i<(args.length-2); i+=3)

  {

    if ((obj = findObj(args[i])) != null)

    {

      visStr = args[i+2];

      if (obj.style)

      {

        obj = obj.style;

        if(visStr == 'show') visStr = 'block';

        else if(visStr == 'hide') visStr = 'none';

      }

      obj.display = visStr;

    }

  }

}

function enableValues(chkName)
{
    panelName = 'ctl00_ContentPlaceHolder1_';

    //ctl00_ContentPlaceHolder1_cbListFundosValor_1
    chkBox0 = document.getElementById(panelName + 'cbList' + chkName + 'Valor' + '_0');
    chkBox1 = document.getElementById(panelName + 'cbList' + chkName + 'Valor' + '_1');
    chkBox2 = document.getElementById(panelName + 'cbList' + chkName + 'Valor' + '_2');

    
    txtBox0 = document.getElementById(panelName + 'tb' + chkName + 'Diario');
    txtBox1 = document.getElementById(panelName + 'tb' + chkName + 'Mensal');
    txtBox2 = document.getElementById(panelName + 'tb' + chkName + 'Anual');

//    alert('txtBox0: ' + txtBox0);
    //alert(chkBox0);
    //alert(chkBox0.id);
    
    enableTextField(chkBox0, txtBox0);
    enableTextField(chkBox1, txtBox1);
    enableTextField(chkBox2, txtBox2);
}

function enableTextField(chk, txtBox)
{
    if (chk.checked) {   
        txtBox.disabled = false;
        
//        alert(txtBox + " » " + txtBox.value.length);
        
        if(txtBox.value.length == 0)
        {
            txtBox.focus();
        }
    }
    else
    {
        txtBox.value = "";
        txtBox.disabled = true;
    }
}

function enableTextFieldByTagID(chkName, txtName)
{

    chk = document.getElementById(chkName);
    txt = document.getElementById(txtName);
    if (chk.checked) {   
        txt.disabled = false;
        
//        alert(txtBox + " » " + txtBox.value.length);
        
        if(txt.value.length == 0)
        {
            txt.focus();
        }
    }
    else
    {
        txt.value = "";
        txt.disabled = true;
    }
}


function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
