<?php

function section($atts, $content = null) {
    extract(shortcode_atts(array(
        'id' => '',
        'formate' => '',
        'class' => '',
        'bgimage' => '',
        'bgcolor' => ''
                    ), $atts));

    $section_return = '';
    $result = '';
    if ($formate == 'Simple-Section') {
        $result .= '<section id="' . esc_attr($id) . '" class="section padding ' . esc_attr($class) . '" style="background-color:'. esc_attr($bgcolor) .';"> <div class="container">';
        $result .= do_shortcode($content);
        $result .= '</div></section><div class="clear">';
    } elseif ($formate == 'Without-Padding-Section') {
        $result .= '<section id="'.esc_attr($id).'" class="section  '.esc_attr($class).'"><div class="container">';
        $result .= do_shortcode($content);
        $result .= '</div></section><div class="clear">';
    } elseif ($formate == 'Parallax-Section') {
        $result .= '<section id="'.esc_attr($id).'" class="section padding parallax '.esc_attr($class).'" style="background-image: url('.esc_url($bgimage).');"><div class="container">';
        $result .= do_shortcode($content);
        $result .= '</div></section><div class="clear">';
    } elseif ($formate == 'Without-Padding-Section2') {
        $result .= '<section id="'.esc_attr($id).'" class="section '. esc_attr($class) .'">';
        $result .= do_shortcode($content);
        $result .= '</section><div class="clear">';
	}
    return $section_return .= force_balance_tags($result);
}

add_shortcode("rms-section", "section");
