function SIR() { //v3.0
  var i,x,a=document.SIR_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function PI() { //v3.0
  var d=document; if(d.images){ if(!d.PI_p) d.PI_p=new Array();
    var i,j=d.PI_p.length,a=PI.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.PI_p[j]=new Image; d.PI_p[j++].src=a[i];}}
}

function FO(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=FO(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function SI() { //v3.0
  var i,j=0,x,a=SI.arguments; document.SIR_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=FO(a[i]))!=null){document.SIR_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var OldColors = new Array(15);

function lightRow(cell)
{
  for(i=0;i<cell.parentNode.cells.length;i++)
  {
    OldColors[i] = cell.parentNode.cells[i].style.backgroundColor;
    cell.parentNode.cells[i].style.backgroundColor = '#ff9900';
  }
}

function darkRow(cell)
{
  for(i=0;i<cell.parentNode.cells.length;i++)
  {
    cell.parentNode.cells[i].style.backgroundColor = OldColors[i];
  }
}

var FirstNodeText;
var FirstNodeValue;

function OnPersonTypeChange(id)
{
 if(document.all)
 {
   if(id==0)
   {
     if(FirstNodeValue && document.getElementById("Period").options[0].value != FirstNodeValue)
     {
       var NewOption = document.createElement("OPTION");
       var NewNode = document.getElementById("Period").insertBefore(NewOption,document.getElementById("Period").options[0]);
       NewNode.text = FirstNodeText;
       NewNode.value = FirstNodeValue;
       document.getElementById("Period").options[0].selected = true;
     }
   }
   else
   {
     if(document.getElementById("Period").options[0].value < 3)
     {
       if(document.getElementById("Period").options[0].selected)
       {
         FirstNodeText  = document.getElementById("Period").options[0].text;
         FirstNodeValue = document.getElementById("Period").options[0].value;
         document.getElementById("Period").options[0] = null;
         document.getElementById("Period").options[0].selected = true;
       }
     }
   }
 }else{
   if(id==0)
   {
     document.getElementById("Period").options[0].disabled = false;
   }
   else
   {
     if(document.getElementById("Period").options[0].value == 1)
     {
       if(document.getElementById("Period").options[0].selected)
       {
         document.getElementById("Period").options[1].selected = true;
       }
       document.getElementById("Period").options[0].disabled = true;
     }
   }
 }
}

