DROP TABLE IF EXISTS `site_core_layouts`;
CREATE TABLE IF NOT EXISTS `site_core_layouts` (
  `layout_id` int(11) NOT NULL AUTO_INCREMENT,
  `layout_parent` int(11) NOT NULL,
  `layout_order` int(11) NOT NULL,
  `layout_name` varchar(255) NOT NULL,
  `layout_generic` int(1) NOT NULL,
  `layout_columns` int(2) NOT NULL,
  `layout_c1` int(2) NOT NULL,
  `layout_c2` int(2) NOT NULL,
  `layout_c3` int(2) NOT NULL,
  `layout_c4` int(2) NOT NULL,
  `layout_c5` int(2) NOT NULL,
  `layout_c6` int(2) NOT NULL,
  `layout_template` varchar(255) NOT NULL,
  `layout_system` int(1) NOT NULL,
 `layout_parallax` INT( 1 ) NOT NULL ,
 `layout_parallax_widgets` INT( 1 ) NOT NULL ,
 `layout_parallax_height` INT( 5 ) NOT NULL ,
 `layout_parallax_height_real` INT( 5 ) NOT NULL ,
 `layout_parallax_mode` VARCHAR( 20 ) NOT NULL ,
 `layout_parallax_scroll` VARCHAR( 10 ) NOT NULL ,
 `layout_parallax_direction` VARCHAR( 10 ) NOT NULL ,
 `layout_parallax_easing` VARCHAR( 20 ) NOT NULL ,
 `layout_parallax_speed` INT( 5 ) NOT NULL ,
 `layout_parallax_image` INT( 1 ) NOT NULL ,
 `layout_parallax_video` INT( 1 ) NOT NULL ,
 `layout_parallax_video_file` VARCHAR( 255 ) NOT NULL ,
 `layout_parallax_html` TEXT NOT NULL ,
 `layout_parallax_resource` INT( 1 ) NOT NULL,
 `layout_parallax_fixed` INT( 1 ) NOT NULL,
  PRIMARY KEY (`layout_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


ALTER TABLE  `site_core_layouts` ADD  `layout_c1_sm` INT( 2 ) NOT NULL AFTER  `layout_c1` , ADD  `layout_c1_xs` INT( 2 ) NOT NULL AFTER  `layout_c1_sm`;
ALTER TABLE  `site_core_layouts` ADD  `layout_c2_sm` INT( 2 ) NOT NULL AFTER  `layout_c2` , ADD  `layout_c2_xs` INT( 2 ) NOT NULL AFTER  `layout_c2_sm`;
ALTER TABLE  `site_core_layouts` ADD  `layout_c3_sm` INT( 2 ) NOT NULL AFTER  `layout_c3` , ADD  `layout_c3_xs` INT( 2 ) NOT NULL AFTER  `layout_c3_sm`;
ALTER TABLE  `site_core_layouts` ADD  `layout_c4_sm` INT( 2 ) NOT NULL AFTER  `layout_c4` , ADD  `layout_c4_xs` INT( 2 ) NOT NULL AFTER  `layout_c4_sm`;
ALTER TABLE  `site_core_layouts` ADD  `layout_c5_sm` INT( 2 ) NOT NULL AFTER  `layout_c5` , ADD  `layout_c5_xs` INT( 2 ) NOT NULL AFTER  `layout_c5_sm`;
ALTER TABLE  `site_core_layouts` ADD  `layout_c6_sm` INT( 2 ) NOT NULL AFTER  `layout_c6` , ADD  `layout_c6_xs` INT( 2 ) NOT NULL AFTER  `layout_c6_sm`;

ALTER TABLE `site_core_layouts`  
ADD `layout_bg` INT(1) NOT NULL,  
ADD `layout_bg_image` INT(1) NOT NULL,  
ADD `layout_bg_inverted` INT(1) NOT NULL,  
ADD `layout_bg_posx` VARCHAR(10) NOT NULL,  
ADD `layout_bg_posy` VARCHAR(10) NOT NULL,  
ADD `layout_bg_color` VARCHAR(10) NOT NULL,  
ADD `layout_bg_alpha` FLOAT NOT NULL DEFAULT '1';

ALTER TABLE `site_core_layouts`  
ADD `layout_bg_fixed` INT(1) NOT NULL,  
ADD `layout_bg_repeat` VARCHAR(20) NOT NULL,  
ADD `layout_bg_size` VARCHAR(20) NOT NULL; 

DROP TABLE IF EXISTS `site_core_layouts_items`;
CREATE TABLE IF NOT EXISTS `site_core_layouts_items` (
  `layitem_id` int(11) NOT NULL AUTO_INCREMENT,
  `layitem_order` int(11) NOT NULL,
  `layitem_layout` int(11) NOT NULL,
  `layitem_widget` int(11) NOT NULL,
  `layitem_column` int(11) NOT NULL,
  PRIMARY KEY (`layitem_id`),
  KEY `layitem_order` (`layitem_order`,`layitem_layout`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;


INSERT INTO `site_core_layouts` (`layout_id`, `layout_parent`, `layout_order`, `layout_name`, `layout_generic`, `layout_columns`, `layout_c1`, `layout_c1_sm`, `layout_c1_xs`, `layout_c2`, `layout_c2_sm`, `layout_c2_xs`, `layout_c3`, `layout_c3_sm`, `layout_c3_xs`, `layout_c4`, `layout_c4_sm`, `layout_c4_xs`, `layout_c5`, `layout_c5_sm`, `layout_c5_xs`, `layout_c6`, `layout_c6_sm`, `layout_c6_xs`, `layout_template`, `layout_system`, `layout_parallax`, `layout_parallax_widgets`, `layout_parallax_height`, `layout_parallax_height_real`, `layout_parallax_mode`, `layout_parallax_scroll`, `layout_parallax_direction`, `layout_parallax_easing`, `layout_parallax_speed`, `layout_parallax_image`, `layout_parallax_video`, `layout_parallax_video_file`, `layout_parallax_html`, `layout_parallax_resource`, `layout_parallax_fixed`, `layout_bg`, `layout_bg_image`, `layout_bg_inverted`, `layout_bg_posx`, `layout_bg_posy`, `layout_bg_color`, `layout_bg_alpha`, `layout_bg_fixed`, `layout_bg_repeat`, `layout_bg_size`) VALUES
(1,	0,	2,	'Generic - Public Module',	1,	2,	9,	0,	0,	3,	0,	0,	1,	0,	0,	1,	0,	0,	1,	0,	0,	1,	0,	0,	'1',	1,	0,	0,	0,	0,	'',	'',	'',	'',	0,	0,	0,	'',	'',	0,	0,	0,	0,	0,	'',	'',	'',	1,	0,	'',	''),
(2,	0,	1,	'Generic - Footer',	0,	4,	3,	0,	0,	3,	0,	0,	3,	0,	0,	3,	0,	0,	1,	0,	0,	1,	0,	0,	'2',	1,	0,	0,	0,	0,	'',	'',	'',	'',	0,	0,	0,	'',	'',	0,	0,	0,	0,	0,	'',	'',	'',	1,	0,	'',	''),
(4,	3,	4,	'',	0,	2,	3,	0,	0,	9,	0,	0,	1,	0,	0,	1,	0,	0,	1,	0,	0,	1,	0,	0,	'content.white',	0,	0,	0,	0,	0,	'',	'',	'',	'',	0,	0,	0,	'',	'',	0,	0,	0,	0,	0,	'',	'',	'',	1,	0,	'',	''),
(5,	1,	5,	'',	0,	1,	12,	0,	0,	1,	0,	0,	1,	0,	0,	1,	0,	0,	1,	0,	0,	1,	0,	0,	'content.white',	0,	0,	0,	0,	0,	'',	'',	'',	'',	0,	0,	0,	'',	'',	0,	0,	0,	0,	0,	'',	'',	'',	1,	0,	'',	''),
(6,	0,	0,	'Generic - Full Width',	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	'1',	0,	0,	0,	0,	0,	'',	'',	'',	'',	0,	0,	0,	'',	'',	0,	0,	0,	0,	0,	'',	'',	'',	1,	0,	'',	''),
(7,	6,	7,	'',	0,	1,	12,	0,	0,	1,	0,	0,	1,	0,	0,	1,	0,	0,	1,	0,	0,	1,	0,	0,	'content-fluid.transparent',	0,	0,	0,	0,	500,	'scroll',	'normal',	'normal',	'easeIn',	0,	0,	0,	'',	'',	0,	0,	1,	0,	0,	'center',	'center',	'#FFFFFF',	1,	0,	'no-repeat',	'cover');

INSERT INTO `site_core_layouts_items` (`layitem_id`, `layitem_order`, `layitem_layout`, `layitem_widget`, `layitem_column`) VALUES
(2,	2,	5,	-1,	1),
(4,	4,	7,	-1,	1);
