//  Output the image for the 'Add to Marked List' checkbox for a particular
//    record (identified by its numeric EEBO ID).
//
//  This control is implemented as an image which gets toggled between two
//    states (i.e. empty and ticked) when it is clicked.
//
//  Note that the image is always output onto the page in its unchecked
//    form: the function 'fnCheckForSelectedRecords' needs to be called
//    once the page has loaded to update each of the images associated
//    with a currently-selected record.
//
function write_markedlist_checkbox( dkvid,searchscreen )
{
	var myurl = window.location.href;
	
	if (myurl.indexOf("/deutsch/") != -1)
		var alttext="Datensatz in persönliche Liste aufnehmen";
	else
		var alttext="Add to Marked List";
	
	//alert (alttext);
	
	//  Form the HTML for the checkbox image
	var html = '<A NAME="ChDKV' + searchscreen + 'Marked" ' +
			   'HREF="javascript: addRecord( \'' + dkvid + '\', \'ChDKV' + searchscreen + 'Marked\')">' +
			   '<IMG SRC="/images/add_off.gif" ' +
			   'NAME="sel' + dkvid + '" ' +
			   'ALT= "' + alttext + '"' +
			   'WIDTH="14" HEIGHT="14" BORDER="0" >' +
			   '</A>' +
			   '<INPUT TYPE="hidden" name="DKVId" value="' + dkvid + '">';
	document.write( html );
}

function getLanguage()
{
	var myurl = window.location.href;
	if (myurl.indexOf("/english/") != -1) return "english";
	if (myurl.indexOf("/deutsch/") != -1) return "deutsch";
	return "";
}

function write_hits_entries(hits, entries)
{
	var output="";
	var lang = getLanguage();
	output+=hits;
	if(lang != "deutsch")
	{
		if(hits==1)
			output+=" hit (";
		else
			output+=" hits (";
		
		output+=entries;
		if(entries==1)
			output+=" entry)";
		else
			output+=" entries)";
	}
	else
	{
		if(hits==1)
			output+=" Treffer (";
		else
			output+=" Treffer (";
		
		output+=entries;
		if(entries==1)
			output+=" Eintrag)";
		else
			output+=" Eintr&auml\;ge)";
	}	
	
	document.write(output);
	
}

function write_on_zero_hits(hits, entries, output)
{
	if (hits == 0 && entries == 0)
	{
		if (output.indexOf("OPEN_COMMENT") != -1) document.write("<!--");
		if (output.indexOf("CLOSE_COMMENT") != -1) document.write("-->");
		
		//document.write(output);
	}
}

function write_marked_list_blurb(hits, entries,cookiename)
{	
	if (hits == 0 && entries == 0)
	{
		alert("NO HITS");
	}	
	var output="";

}	