
function style2_sep_init() {
	tble_id = "style2_content_table";
	tble = document.getElementById(tble_id);

	if (tble != null) {
		midl_id = "style2_content_sep_middle";
		midl = document.getElementById(midl_id);
		
		var new_height = tble.offsetHeight - 128;
		
		if (new_height < 10) {
			new_height = 10;
		}
		
		if (midl != null) {
			midl.style.height = new_height + "px";
			
		
		}
	}
	
}


var sample_items = new Array();
var sample_controls = new Array();
var sample_types = new Array();

var current_sample = null;

var active_control_left = "<span class=\"samples_controls_highlight\">[</span>&nbsp;";
var active_control_right = "&nbsp;<span class=\"samples_controls_highlight\">]</span>";

function prev_sample() {
	if (current_sample > 0) {
		show_sample(current_sample - 1);
	
	}

}

function next_sample() {
	if (current_sample < (sample_items.length - 1)) {
		
		show_next_sample = (current_sample * 1) + 1;	// force to int
		
		show_sample(show_next_sample);
	
	}

}


function show_sample(show_sample) {
	if (sample_types[current_sample] == "video") {
		video_div_id = "samples_video_" + sample_items[current_sample];
		video_div = document.getElementById(video_div_id);
		
		if (video_div != null) {
			video_div.innerHTML = null;
		
		}
		
		video_still_id = "samples_video_still_" + sample_items[current_sample];
		video_still = document.getElementById(video_still_id);
		
		if (video_still != null) {
			video_still.style.display = "block";
		
		}
		
	} else if (sample_types[current_sample] == "radio") {
		player_div_id = "samples_radio_" + sample_items[current_sample];
		player_div = document.getElementById(player_div_id);

		if (player_div != null) {
			player_div.innerHTML = null;
			player_div.style.display = "none";

		}

		active_img_id = "samples_radio_img_" + sample_items[current_sample];
		active_img_div = document.getElementById(active_img_id);

		if (active_img_div != null) {
			active_img_div.style.display = "none";
		}
		
		play_img_id = "samples_radio_play_img_" + sample_items[current_sample];
		play_img_div = document.getElementById(play_img_id);

		if (play_img_div != null) {
			play_img_div.style.display = "block";
		}

	
	}

	current_id = "samples_main_content_item_" + sample_items[current_sample];
	current_div = document.getElementById(current_id);
	
	if (current_div != null) {
		current_div.style.display = "none";
	
	}
	
	current_control_id = "samples_controls_item_" + sample_items[current_sample];
	current_control_div = document.getElementById(current_control_id);
	
	if (current_control_div != null) {
		current_control_div.innerHTML = sample_controls[current_sample];
	
	}
	
	show_id = "samples_main_content_item_" + sample_items[show_sample];
	show_div = document.getElementById(show_id);
	
	if (show_div != null) {
		show_div.style.display = "block";
	
	}
	
	show_control_id = "samples_controls_item_" + sample_items[show_sample];
	show_control_div = document.getElementById(show_control_id);
	
	if (show_control_div != null) {
		show_control_div.innerHTML = active_control_left + sample_controls[show_sample] + active_control_right;
	
	}
	
	current_sample = show_sample;

}


function sample_start_video(sample_id, var_id) {

	still_id = "samples_video_still_" + sample_id;
	still_div = document.getElementById(still_id);
	
	if (still_div != null) {
		still_div.style.display = "none";
	}

	//s1.write("samples_video_" + sample_id);
	cmd = "s" + var_id + ".write('samples_video_" + sample_id + "')";
	eval(cmd);
}


function sample_start_radio(sample_id, var_id) {
	play_img_id = "samples_radio_play_img_" + sample_id;
	play_img_div = document.getElementById(play_img_id);
	
	if (play_img_div != null) {
		play_img_div.style.display = "none";
	}
	
	active_img_id = "samples_radio_img_" + sample_id;
	active_img_div = document.getElementById(active_img_id);
	
	if (active_img_div != null) {
		active_img_div.style.display = "block";
	}
	
	player_div_id = "samples_radio_" + sample_id;
	player_div = document.getElementById(player_div_id);
	
	if (player_div != null) {
		player_div.style.display = "block";
	
		cmd = "s" + var_id + ".write('" + player_div_id + "')";
		eval(cmd);
	
	}
	
	
	
	
	

}