window.addEvent('domready', function (){ 

   var content = $('showcom');
   if (content) {
    var myFx = new Fx.Style('showcom', 'opacity').set(0);

    content.style.border="1px solid #000";
    content.style.background="#fff";
    content.style.position="absolute";
    content.style.top="350px";
    content.style.left="300px";
    content.style.width="400px";
    content.style.padding="10px";

    var close = new Element('img', { 'src':'/showcom/close.gif' }).injectInside(content);
    close.addEvent('click',hideCom);
    close.style.cursor='pointer';
    var showcom_content = new Element('div', { 'id':'showcom_content' }).injectAfter(close);

    $$('area').each( function(area) { 
      area.setStyle('cursor','pointer');
      area.addEvent('click',function() { showCom(area.alt); } );
    });

   }

});

function showCom(id) {

  var content = $('showcom_content');

  var updater = new Ajax('/showcom/html/'+id+'.html', {
    'update': content, 'method': 'get', 'onComplete':showCom_complete } ).request();

  return false;
}

function showCom_complete() {
  var myFx = new Fx.Style('showcom', 'opacity').start(0,1);
}

function hideCom() {
   var myFx = new Fx.Style('showcom', 'opacity').start(1,0);
   return false;
}
