/* SVN FILE: $Id: bakery.js 665 2008-05-22 16:02:23Z gwoo $ */
/**
 *
 * CakePHP Bakery
 *
 * Copyright 2006-2008, Cake Software Foundation, Inc.
 * 1785 E. Sahara Avenue, Suite 490-204
 * Las Vegas, Nevada 89104
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright			Copyright 2006-2008, Cake Software Foundation, Inc.
 * @link					http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
 * @package				bakery.webroot
 * @subpackage		js
 * @version				$Revision: 665 $
 * @modifiedby		$LastChangedBy: gwoo $
 * @lastmodified	$Date: 2008-05-22 11:02:23 -0500 (Thu, 22 May 2008) $
 * @license				http://www.opensource.org/licenses/mit-license.php The MIT License
 */
var Gui={
    Tortilla:{
        init:function(selectors){
            $A(selectors).each(function(selector){
                $$(selector).each(function(element){Gui.Tortilla.addCorners(element);})
            });
        },
        addCorners:function(element){
            $A(['top_left','top_right','bottom_left','bottom_right']).each( function(className){element.addClassName('tortillated');element.appendChild(Gui.Tortilla.newCorner(className))});
        },
        newCorner:function(className){
            corner=document.createElement('div');
            corner.className+=className+' corner';
            return corner;
        }
    }
}
document.observe("dom:loaded", function() {
    Gui.Tortilla.init(['.article','.input','.optional','.required', '.parent', '.info','#tabs','#tags','#admin_menu','#flashMessage']);
});