// V1.00 called when drop-down associated with clip list changes 
function switchclip(sel){
	var pid = sel.getAttribute('pid');
	pid = pid.replace(/.*!/,"");   // remove duplicate prefix
	if ( document.getElementById('cliplist_' + pid) )	// have we a list of clips
		{
		var selected = sel.selectedIndex + 1;	
		var activeid = '';
		var selectedid = 'c--' + selected + '_' + pid;
		if ( document.getElementById(selectedid) )	// if a clip exists for this choice then enable it
			{
			document.getElementById(selectedid).style.visibility='visible';
			document.getElementById(selectedid).style.display='block';
			activeid = selectedid;
			}
		if ( activeid )					// if we've enabled a clip then hide all others
			{
			for ( var i=0; i<sel.options.length; i++ )
				{
				var divid = 'c--' + (i + 1) + '_' + pid;
				if ( document.getElementById(divid) && ( divid != activeid) )
					{
					document.getElementById(divid).style.visibility='hidden';
					document.getElementById(divid).style.display='none';
					}
				}
			}
			
		}
}

// called on page load in case we're refreshing page (IE presets drop-downs to previous value)
function presetclips(){
	var sels = document.getElementsByTagName('select');
	for (var i=0; i<sels.length; i++ )
		{
		if ( sels[i].getAttribute('pid') )
			{
			switchclip(sels[i]);
			}
		}
}		
