stdBrowser = (document.getElementById) ? true : false
var saveStyleAttr = "";
//var watchListArray;
var actionId;
var pageSerial;

function changeAttribute (idFieldName, styleAttrPair) {
  saveStyleAttr = document.getElementById(idFieldName).style.cssText;
  document.getElementById(idFieldName).style.cssText += ";" + styleAttrPair;
}

function unChangeAttribute (idFieldName) {
  document.getElementById(idFieldName).style.cssText = saveStyleAttr;
}

function getValue(idField) {
  var type = idField.type;
  if (type.indexOf('select') != -1)
    return (idField.options[idField.selectedIndex]).value
  else 
    return idField.value;
}

function putValue(idField, value) {
  var type = idField.type;
  if (type.indexOf('select') != -1) {
    for (var i=0; i<idField.options.length; i++)
      if (idField.options[i].value == value) idField.selectedIndex = i;
  } else 
    idField.value = value;
}

function popUp(evt,currElem) {
  popUpWin = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem)
  if (document.all) {
    popUpWin.pixelTop = parseInt(evt.y) + 15 + getScrollTop(window);
    popUpWin.pixelLeft = Math.max(2,parseInt(evt.x)-125);
  }
  else {
    if (stdBrowser) {
      popUpWin.top = parseInt(evt.pageY)+2 + "px"
      popUpWin.left = Math.max(2,parseInt(evt.pageX)-125) + "px"
    }
    else {
      popUpWin.top = parseInt(evt.pageY)+2
      popUpWin.left = Math.max(2,parseInt(evt.pageX)-125)
    }
  }
  popUpWin.visibility = "visible"
}

function popDown(currElem) {
  popUpWin = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem)
  popUpWin.visibility = "hidden"
}

function getScrollTop(win) {
  var scrollTop = 0;
  if (win.pageYOffset) {
     scrollTop = win.pageYOffset;
  }
  else if (win.document.documentElement && win.document.documentElement.scrollTop) {
     scrollTop = win.document.body.scrollTop;
  }
  else if (win.document.body) {
     scrollTop = win.document.body.scrollTop;
  }
  return scrollTop;
}

var httpWrite,httpUpdate,isWorking=false,idField,idColor,focusId,timer;
var fireFox = navigator.userAgent.indexOf('Firefox') != -1;


function doOnLoad (_pageYOffset) {
//  watchListArray = document.getElementById("watchList").value.split(",");
//  actionId = watchListArray[0];
//  pageSerial = watchListArray[1];
//alert ("actionId = " + actionId + "\npageSerial =" + pageSerial); 
  window.scrollBy(0, _pageYOffset);
//  if (watchListArray.length > 2) asynchUpdate();
  fadeInit();
}

function fadeInit() {
  for (var i=0; i<fadeId.length; i++) {
     widget = document.getElementById(fadeId[i]);
     if (widget != null) {
       widget.style.filter="alpha(opacity=0)";
       setTimeout("fadeWidget("+i+",0)",startFade[i]);
       if (eraseFade[i] != 0) setTimeout ("fadeEnd("+i+")",eraseFade[i]);
    }
  }
}

function fadeEnd(id) {
  document.getElementById(fadeId[id]).innerText="";
}

function fadeWidget (id,opacity) { 
  opacity += 5; // increase color darkness
  document.getElementById(fadeId[id]).style.filter="alpha(opacity="+opacity+")";
  if (opacity != 100)  setTimeout("fadeWidget("+id+","+opacity+")",50);
}

var fadeId=[];
var startFade=[];
var eraseFade=[];

function newWindow(url,args) {
  window.open (url,args);
  return;
}

function newWindow(url) {
  window.open (url);
  return;
}


