
  /*
      © Алексей Забродин 2008 (drvhart@ya.ru)
      Скрипт для CMS Start
      Файл processor.js v1.0
  */
  
  var processor = {
  	  
  	  cache: new Array(),
  	  
  	  init: function()
  	  {
  	  	  var $ = processor;
  	  	  $.buildGallery();
  	  },
  	  buildGallery: function()
  	  {
  	  	  var $ = processor;
  	  	  var width = 0;
          var height = 0;
  	  	  var divs = document.getElementsByTagName('div');
  	  	  
          for(var i = 0; i < divs.length; i++)
          {
       	       if(divs[i].className == 'gallery')
       	       {
       	       	   var subDivs = divs[i].getElementsByTagName('div');
       	       	   
       	       	   for(var n = 0; n < subDivs.length; n++)
                   {
      	               if(subDivs[n].clientWidth > width)
      	               {
 	    	               width = subDivs[n].clientWidth;
      	               }
      	               if(subDivs[n].clientHeight > height)
      	               {
 	    	               height = subDivs[n].clientHeight;
      	               }
       	           }
       	
       	           for(var n = 0; n < subDivs.length; n++)
                   {
        	           subDivs[n].style.width = width + 'px';
        	           subDivs[n].style.height = height + 'px';
       	           }
       	       }
	      }
	      
	      
  	  }
  }
  
  if(typeof document.attachEvent != 'undefined')
  {
     attachEvent('onload', processor.init);
  }
  else
  {
     addEventListener('load', processor.init, false);
  }
