function CDSsetAName(id) {
    if( ! document.getElementById ) return;
    var id2=id.match(/[^\/]*$/);
    if( id2 && id2!=id ){
       id="CDSitem_"+id2; 
      /* 
var elt=document.createElement("input");
elt.setAttribute("type","hidden");
elt.setAttribute("value",id);
var t=document.getElementById('CDShead');
t.appendChild(elt);
     */
    }
    var elt=document.getElementById(id);
    if( !elt ) return;
    if( !elt.className ) return;
    elt.className='itemcrt CDSbgcol1 CDScol2';
}

function CDSload(id, method){
    if( ! document.getElementById ) return;
    
    var elt=document.getElementById(id);
    if( !elt ) return;
    if( !elt.className ) return;
    if( elt.className.match(/.*itemcrt.*/) ||  elt.className=='itemcrt2') return;
    if( elt.className.match(/.*itemcrt.*/) ||  method=='itemcrt2' ){
    var l=document.getElementsByTagName("DIV");
    var i;
    for(i=0;i<l.length;i++){
        if( l[i].id!=id && l[i].id.match(/^item_.*/) ){
        l[i].className='itemout CDSbgcol3 CDScol5';
        }
    }
    elt.className=method+' CDSbgcol1 CDScol2';
    }
    if( method=='itemout' ) elt.className=method+' CDSbgcol3 CDScol5';
    if( method=='itemover' ) elt.className=method+' CDSbgcol4 CDScol1';

    l=elt.getElementsByTagName("A");
    for(i=0;i<l.length;i++){
        if( method=='itemout' )  l[i].className='CDScol5';
        else if( method=='itemover' ) l[i].className='CDScol1';
    }
}

function CDSgo(url){
   if( !url.match(/^http:.*/) ) url="http://"+url;

   if( !document.getElementById)
      window.open(url, 'vizier'); 
   window.open(url, '_top');
} 

function CDSportal(e,id){
  var keynum;
  if( !document.getElementById ) { alert("not availbale"); return false; }
  if(window.event) // IE
     keynum = e.keyCode;
  else if(e.which) // Netscape/Firefox/Opera
     keynum = e.which;
  
  keychar = String.fromCharCode(keynum);
  var elt=document.getElementById(id);
  if( !elt) return false;
  if( keynum==8 ) { elt.setAttribute("value", ""); return false; }
  if( keynum==13 ) {alert("PORTAL not yet available.."); return true; }
  if( keynum<32 || keynum>126 ) { return false; }
  var s=elt.getAttribute("value");
  if( !s ) s="";
  elt.setAttribute("value",s+keychar);
  return false;
}


function CDSshowhead(){
  if( !document.getElementById ) return;
  var head=document.getElementById("CDSmenuappli");
  if( !head ) return;
  head.style.display="block";

  head=document.getElementById("CDSnomenuappli");
  if( !head ) return;
  head.style.display="none";

  var core=document.getElementById("CDScore");
  if( !core ) return;
  core.className="withmenu";
}

function CDShidehead(){
  if( !document.getElementById ) return;
  var head=document.getElementById("CDSmenuappli");
  if( !head ) return;
  head.style.display="none";
 
  head=document.getElementById("CDSnomenuappli");
  if( !head ) return;
  head.style.display="block";

  var core=document.getElementById("CDScore");
  if( !core ) return;
  core.className="full";
}
