function InitArchive()
{
  $('.virtual_layer_select').change(function() {
    var oNode = $(this);
    
    var aNode = oNode.attr('id').match(/^(.*)-select$/);
    var oLayer = $('#' + aNode[1] + '-layer');
    oLayer.animate({ opacity: 0.3 }, 200 );
    
    var aNodeValue = [];
    
    if(oNode.val())
      aNodeValue = oNode.val().split('-');
    else
    {
      aNodeValue[0] = 0;
      aNodeValue[1] = 0;
    }
    
    var sUrl = window.location.pathname + '?' + aNode[1] + '-y=' + aNodeValue[0] + '&' + aNode[1] + '-w=' + aNodeValue[1];
    
    $.get(sUrl, function(sResponse){
      var sPattern = '<blockquote id="' + aNode[1] + '-layer" class="virtual_layer">([^%]*?)</blockquote>';
      var aResponse = sResponse.match(sPattern);
      oLayer.html(aResponse[1]);
      oLayer.animate({ opacity: 1 }, 200 );
    });
  });
}

$(document).ready(function() { InitArchive(); });


