window.onload=function(){
  var div_color=document.getElementById('color');
  if(div_color){
    var href=div_color.getElementsByTagName('A');
    for(var i=0;href[i];i++){
      href[i].onclick=function(){
       if(this.parentNode.className!='name'){
        if(this.className!='all'&&this.parentNode==div_color){
          var div=document.getElementById('color_div');
          div.innerHTML='';
          document.getElementById('color_div').className='';
          var img=document.createElement('img');
          var span=document.createElement('span');
          img.src=this.href;
          span.innerHTML=this.innerHTML;
          div.appendChild(span);
          div.appendChild(img);
        }
        else if(this.className=='all'){
          var screen_width=screen.availWidth;
          var screen_height=screen.availHeight;
          var my_width=660;
          var my_height=450;
          var my_left=(screen_width-my_width)/2;
          var my_top=(screen_height-my_height)/2;
          var parameters='width='+my_width+',height='+my_height+',top='+my_top+',left='+my_left+',scrollbars=1';
          var w=window.open(this.href,'',parameters);
        }
        return false;
       }
      }
    }
  }
  var menu=document.getElementById('top');
  if(menu){
    var menu_li=menu.getElementsByTagName('LI');
    for(var i=0;menu_li[i];i++){
      menu_li[i].onmouseover=function(){this.className+=' on';}
      menu_li[i].onmouseout=function(){this.className=this.className.replace(/\s*on\b/,'');}
    }
  }
}