function renderCheckBox( name, value, text, selValues )
{
	document.write( '<input type="checkbox" name="'+name+'" value="'+value+'"' );
	if( isIdInString( value, selValues ) )
		document.write( " checked" );
	document.write( '><span id="'+name+value+'">'+text+"</span>&nbsp;&nbsp;" );
}

function renderRadio( name, value, text, selValue )
{
	document.write( '<input type="radio" name="'+name+'" value="'+value+'"' );
	if( value == selValue )
		document.write( " checked" );
	document.write( '>'+text+"&nbsp;&nbsp;" );
}

function isIdInString( id,ids )
{
	var arr,i;
	arr = ids.split(",");
	for( i=0;i<arr.length; i++ )
	{
		if( id == arr[i] )
			return true;
	}
	return false;
}


function genZipLink( courseId, filename, entrypage, disptext  )
{
	var re,zippath;
	zippath=filename.replace( ".", "_" );
	
	document.write(
		'<a href="../filelib/course/' 
		+ courseId + '/' 
		+ zippath + '/' 
		+ entrypage 
		+ '" target="_blank">'
		+ disptext
		+ '</a>'
	 );
	
}
		
