
$rdata['Style'] = $rdata['Style'] ? $rdata['Style'] : 2;
$style = sc_query('
	SELECT 
		 Size1_Name
		,Size1_Class
		,Size2_Name
		,Size2_Class
		,Size3_Name
		,Size3_Class
		,Size4_Name
		,Size4_Class
		,Allow_Custom_Sizes
	FROM
		Slideshow_Styles
	WHERE
		record_number = "'.$rdata['Style'].'"
		AND Sizes_Enabled = 1
');

if (!empty($style)) {
	if ($style['Size1_Name'] && $style['Size1_Class']) {
		$size_choice = htmlspecialchars($style['Size1_Name']);
		if ($style['Size1_Class'] == 'ss_small') {
			$options['<img onclick="document.getElementById(\'Size1\').checked=true; document.getElementById(\'Size1\').onclick()"  class="image_size_small" src="images/cart/image_small.png" alt="'.$size_choice.'" title="'.$size_choice.'" />'] = htmlspecialchars($style['Size1_Class']);
		} else {
			$options[$size_choice] = htmlspecialchars($style['Size1_Class']);
		}
	}
	if ($style['Size2_Name'] && $style['Size2_Class']) {
		$size_choice = htmlspecialchars($style['Size2_Name']);
		if ($style['Size2_Class'] == 'ss_medium') {
			$options['<img onclick="document.getElementById(\'Size2\').checked=true; document.getElementById(\'Size2\').onclick()"  class="image_size_medium" src="images/cart/image_medium.png" alt="'.$size_choice.'" title="'.$size_choice.'" />'] = htmlspecialchars($style['Size2_Class']);
		} else {
			$options[$size_choice] = htmlspecialchars($style['Size2_Class']);
		}
	}
	if ($style['Size3_Name'] && $style['Size3_Class']) {
		$size_choice = htmlspecialchars($style['Size3_Name']);
		if ($style['Size3_Class'] == 'ss_large') {
			$options['<img onclick="document.getElementById(\'Size3\').checked=true; document.getElementById(\'Size3\').onclick()"  class="image_size_large" src="images/cart/image_large.png" alt="'.$size_choice.'" title="'.$size_choice.'" />'] = htmlspecialchars($style['Size3_Class']);
		} else {
			$options[$size_choice] = htmlspecialchars($style['Size3_Class']);
		}
	}
	if ($style['Size4_Name'] && $style['Size4_Class']) {
		$size_choice = htmlspecialchars($style['Size4_Name']);
		if ($style['Size4_Class'] == 'ss_xlarge') {
			$options['<img onclick="document.getElementById(\'Size4\').checked=true; document.getElementById(\'Size4\').onclick()"  class="image_size_xlarge" src="images/cart/image_xlarge.png" alt="'.$size_choice.'" title="'.$size_choice.'" />'] = htmlspecialchars($style['Size4_Class']);
		} else {
			$options[$size_choice] = htmlspecialchars($style['Size4_Class']);
		}
	}

	if ($style['Allow_Custom_Sizes']) $options['Custom...'] = 'custom';
}
