﻿// JScript File

window.onerror = null;
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer >= 4);
 var IE4 = (bName == "Microsoft Internet Explorer" 
 && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" 
 && bVer < 4);
 var blink_speed=150;
 var i=0;
 
if (NS4 || IE4) 
{
 if (navigator.appName == "Netscape") 
 {
    layerStyleRef="layer.";
    layerRef="document.layers";
    styleSwitch="";
 }
 else
 {
    layerStyleRef="layer.style.";
    layerRef="document.all";
    styleSwitch=".style";
 }
}

//BLINKING
var t; 
var n = 0;
var gLayerName = '';
function Blink(layerName,nblinks,n)
{
 window.status = "n=" + n + " layerName=" + layerName + " nblinks=" + nblinks ;
 gLayerName = layerName;
 n++;
 if (NS4 || IE4) 
 { 
    if(n%2==0)
    {
        document.getElementById(layerName).style.visibility="visible";
    }
    else
    {
        document.getElementById(layerName).style.visibility="hidden";
    }
 } 
 if (n < nblinks || nblinks == 0)
 {
//    window.status = "Blink('"+ layerName + "'," + nblinks + ")";
    if (nblinks == 0) n -= 2;
    t = setTimeout("Blink('"+ layerName + "'," + nblinks + "," + n + ")",blink_speed);
 }   
 else
 {
    n = 0;
    stopBlink();   
 }
}
function doBlink() {
  // Blink, Blink, Blink...
  var blink = document.all.tags("BLINK")
  n++;
  if (n < 6)
    for (var i=0; i < blink.length; i++)
        blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
  else
  {
     n = 0;
     stopBlink();
  }
}

function startBlink() 
{
  // Make sure it is IE4
  if (document.all)
        t=setInterval("doBlink()",500)
}
function stopBlink()
{
  	clearTimeout(t);
  	if (gLayerName.length > 0)
        document.getElementById(gLayerName).style.visibility="visible";  	    
}
function DivInit(divName)
{
     div = document.getElementById(divName);
     div.style.width=0;
     div.style.height = 0;
     maxWidth = 560;
     maxHeight = 22;
     timeId = window.setTimeout('putEditDiv()',1);
}
function putEditDiv()
{
    var divwidth = div.style.width;
    var divheight = div.style.height;
    divwidth= parseInt(divwidth.substr(0,divwidth.length-2),10) + 20;
    divheight = parseInt(divheight.substr(0,divheight.length-2),10)+ 20;               
//            div.style.backgroundColor = 
    if (divheight >= maxHeight)
        divheight = maxHeight;
//            divtop = parseInt(divtop.substr(0,divtop.length-2),10) - 10;
//            divleft = parseInt(divleft.substr(0,divleft.length-2),10) - 10;
   if (divwidth <= maxWidth  )
   {
        div.style.width = divwidth;
        div.style.height = divheight;
        timeId = window.setTimeout('putEditDiv()',1);
   }
}        
