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);
var OldColor;

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];
        }
}

function lightCell(cell)
{
 OldColor = cell.style.backgroundColor;
 cell.style.backgroundColor = '#ff9900';
// cell.parentNode.cells[0].style.backgroundColor = '#ff9900';
}

function darkCell(cell)
{
 cell.style.backgroundColor = OldColor;
// cell.parentNode.cells[0].style.backgroundColor = OldColor;
}


function lightHeaderCell(cell,tableId)
{
 var i;

 i = (cell.cellIndex - cell.cellIndex % 2) / 2;
 //alert(i);

 headerCell = document.getElementById(tableId).rows[0].cells[i];
 headerCell.style.backgroundImage = 'url(i/bg_features_on.gif)';
 headerCell.style.color = "#404040";
 cell.style.color = "#1861BC";
}

function darkHeaderCell(cell)
{
 headerCell.style.backgroundImage = 'url(i/bg_features.gif)';
 headerCell.style.color = "#fff";
 cell.style.color = "#4b4b4b";
}

function onPageLoadTableEventAdd(tableId)
 {
  var table = document.getElementById(tableId);

  for (i = 1;i < table.rows.length;i++)
   {
    var row = table.rows[i];
    for (j = 0;j < row.cells.length;j++)
     {
      var c = row.cells[j];
      c.onmouseover = function () { lightHeaderCell(this,tableId); };
      c.onmouseout = function ()  { darkHeaderCell(this); };
     }
   }
 }

function onPageLoad()
 {
  onPageLoadTableEventAdd('FeatureTable');
  onPageLoadTableEventAdd('FeatureTable2');
 }

var OldName = 'Mail';

function onFeatureClick(Name)
 {
  $(OldName + '_content').style.display = 'none';
  $(OldName + '_header').style.backgroundImage = 'url(i/feat_off.gif)';
  //$(OldName + '_header').style.color           = "#ffffff";
  $(OldName + '_header').childNodes[0].style.color = "#ffffff";

  $(Name + '_content').style.display    = 'block';
  $(Name + '_header').style.backgroundImage = 'url(i/feat_on.gif)';
  //$(Name + '_header').style.color           = "#3574C3";
  $(Name + '_header').childNodes[0].style.color = "#3574C3";
  OldName = Name;
 }

function OnOrderClick(RightId,
                      LeftId)
 {
  RightArr = new Array('order_web','order_web_2','order_web_3');
  LeftArr  = new Array('web_hosting','reseller','vps');

  for (i in RightArr)
   {
    if (RightId == RightArr[i]) $(RightArr[i]).style.display = 'block';
    else                        $(RightArr[i]).style.display = 'none';
   }

  for (i in LeftArr)
   {
    //alert('url(i/' + LeftArr[i] + '_off.gif)');
    if (LeftId == 'col_' + LeftArr[i]) $('col_' + LeftArr[i]).style.backgroundImage = 'url(i/' + LeftArr[i] + '_on.gif)';
    else                               $('col_' + LeftArr[i]).style.backgroundImage = 'url(i/' + LeftArr[i] + '_of.gif)';
   }
 }