   var cc, cSelected='#a0a0ff', cFirst='#d0f0d0', cSecond='#e0e0f0';
   cFirst='#d0d0d0', cSecond='#d0d9d0';

function sel(obj)
{
    tbd=obj.parentNode;
       for (i=0; i < tbd.rows.length; i++) {
         tbd.rows[i].bgColor=clr();
       };
    obj.bgColor=cSelected;
    forma.row2.value=obj.cells[0].innerHTML;     /*alert(forma.row2.value);*/
    cc='';
}

function clr()
{ if (cc == cFirst)
      { cc = cSecond }
     else
      { cc = cFirst };
    return cc;
}

function tablepaint()
{
    tbd=document.getElementById('atbody')
    cc='';
       for (i=0; i < tbd.rows.length; i++) {
         tbd.rows[i].bgColor=clr();
       };  
       cc='';
}

function askConfirm( msg1 ) {
    return window.confirm (msg1)
}



/*
    xbDesignMode
    
    a JavaScript wrapper for browsers that support designMode

*/ 
 
function xbDesignMode(aIFrame){

  this.mEditorDocument = null;
  this.mIFrameElement = null;
  
  // argument is a string, therefore an ID
  if ( (typeof(aIFrame) == "string") && (document.getElementById(aIFrame).tagName.toLowerCase()=="iframe") ){
    this.mIFrameElement = document.getElementById(aIFrame);
  } else if( (typeof(aIFrame)=="object") && (aIFrame.tagName.toLowerCase() == "iframe") ){
    this.mIFrameElement = aIFrame;   
  } else {
    throw "Argument isn't an id of an iframe or an iframe reference";
  }
  
  if (this.mIFrameElement.contentDocument){  
    // Gecko
    this.mEditorDocument = this.mIFrameElement.contentDocument;
    this.mEditorDocument.designMode = "On";    
  } else {
    // IE
    this.mEditorDocument = this.mIFrameElement.contentWindow.document;
    this.mEditorDocument.designMode = "On";   
    // IE needs to reget the document element after designMode was set 
    this.mEditorDocument = this.mIFrameElement.contentWindow.document;
  }    
}

function SetContent(aIFrame,iContent){

  this.mEditorDocument = null;
  this.mIFrameElement = null;

  if ( (typeof(aIFrame) == "string") && (document.getElementById(aIFrame).tagName.toLowerCase()=="iframe") ){
    this.mIFrameElement = document.getElementById(aIFrame);
  } else if( (typeof(aIFrame)=="object") && (aIFrame.tagName.toLowerCase() == "iframe") ){
    this.mIFrameElement = aIFrame;   
  } else {
    throw "Argument isn't an id of an iframe or an iframe reference";
  }

  if (this.mIFrameElement.contentDocument){  
    // Gecko
    this.mEditorDocument = this.mIFrameElement.contentDocument.body.innerHTML=iContent;
  } else {
    // IE
    //this.mEditorDocument = 
     this.mIFrameElement.contentWindow.document.body.innerHTML=iContent;
  }    

}


function GetContent(aIFrame){

  this.mEditorDocument = null;
  this.mIFrameElement = null;

  if ( (typeof(aIFrame) == "string") && (document.getElementById(aIFrame).tagName.toLowerCase()=="iframe") ){
    this.mIFrameElement = document.getElementById(aIFrame);
  } else if( (typeof(aIFrame)=="object") && (aIFrame.tagName.toLowerCase() == "iframe") ){
    this.mIFrameElement = aIFrame;   
  } else {
    throw "Argument isn't an id of an iframe or an iframe reference";
  }

  if (this.mIFrameElement.contentDocument){  
    // Gecko
    this.mEditorDocument = this.mIFrameElement.contentDocument.body.innerHTML;
  } else {
    // IE
    this.mEditorDocument = this.mIFrameElement.contentWindow.document.body.innerHTML;
  }    

  return(this.mEditorDocument);    
}


xbDesignMode.prototype.execCommand = function (aCommandName, aParam){
  if (this.mEditorDocument)
    this.mEditorDocument.execCommand(aCommandName, false, aParam);
  else 
    throw "no mEditorDocument found";    
}

xbDesignMode.prototype.setCSSCreation = function (aUseCss){
  if (this.mEditorDocument)
    this.mEditorDocument.execCommand("useCSS", false, aUseCss);
  else 
    throw "no mEditorDocument found";  
    
}



/*
 moved here from the templates

*/

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

// popup function
function popup(theWin, theURL, scroll, x, y, xi, yi)
	{
	window.open(theURL, theWin, "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + scroll + ",resizable=no,width=" + x + ",height=" + y + ",left=" + xi + ",top=" + yi);
	}
	

