function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
			
		}
	}
	return "";
	radioObj[i].checked=true;
}

var flashFile = 'http://news.com.com/html/ne/podcasts/daily_podcast.xml';
var flashLayout = 0;
var flashBack = 'f5f5f5';
var flashFront = '111111';
var flashSize = 400;
var flashShuffle = 0;
var flashAutostart = 0;

function updateMe(){


	flashFile = document.playerform.file.value;
	flashLayout = getCheckedValue(document.forms['playerform'].elements['layout']);
	flashBack = document.playerform.backcolor.value;
	document.getElementById('backcolorBlock').style.backgroundColor = '#'+flashBack;
	flashFront = document.playerform.frontcolor.value;
	document.getElementById('frontcolorBlock').style.backgroundColor = '#'+flashFront;
	flashSize = document.playerform.debug1.value;
	if (document.playerform.shuffle.checked){
	flashShuffle = document.playerform.shuffle.value;}else{flashShuffle = 0;}
	if (document.playerform.autostart.checked){
	flashAutostart = document.playerform.autostart.value;}else{flashAutostart = 0;}
	

	var flashvars = 'file='+flashFile+'&size='+flashSize+'&layout='+flashLayout+'&backcolor='+flashBack+'&frontcolor='+flashFront+'&shuflle='+flashShuffle+'&autostart='+flashAutostart;
	new Ajax.Updater('code','displayCode.php?'+flashvars);
	
	if(flashLayout == 1){
	
		new Ajax.Updater('previewArea','displayVert.php?'+flashvars);
		

	var slide = new Control.Slider('handle1', 'track1', {

							range: $R(300, 500),
				sliderValue: $('size-select').value, // won't work if set to 0 due to a bug(?) in script.aculo.us
				onSlide: function(v) { 
				$('debug1').value = Math.round(v); 
				$('size-select').value = Math.round(v);
				$('vertPreview').style.height = Math.round(v) + "px"; 
				

				},
				onChange: function(v) { $('debug1').value = Math.round(v); $('size-select').value = Math.round(v); }
			});
	
		
				
	} else {
		


new Ajax.Updater('previewArea', 'displayHoriz.php?'+flashvars);

$('controlContainer').style.marginLeft = "0px";
var slide = new Control.Slider('handle1', 'track1', {

				range: $R(300, 500),
				sliderValue: $('size-select').value, // won't work if set to 0 due to a bug(?) in script.aculo.us
				onSlide: function(v) { 
				$('debug1').value = Math.round(v); 
				$('size-select').value = Math.round(v);
				$('playerPreview').style.width = Math.round(v) + "px"; 
				
				},
				onChange: function(v) { $('debug1').value = Math.round(v); $('size-select').value = Math.round(v); }
});
	
	
	}
	new Ajax.Updater('code', 'displayCode.php?'+flashvars);
	
}
