<commit_before>// from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html

function addEvent( obj, type, fn )
{
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}

function removeEvent( obj, type, fn )
{
	if (obj.removeEventListener)
		obj.removeEventListener( type, fn, false );
	else if (obj.detachEvent)
	{
		obj.detachEvent( "on"+type, obj[type+fn] );
		obj[type+fn] = null;
		obj["e"+type+fn] = null;
	}
}

function toggleDivs(source,destination){
   document.getElementById(source).style.display = 'none';
   document.getElementById(destination).style.display = 'block';
}

function disableEnterKey(e)
{
    var keyCode;

    if(window.event) {
        keyCode = window.event.keyCode;     //IE
    } else {
        keyCode = e.which;     //firefox

    }

    return (keyCode != 13);
}

function toggleHidden(elementId) {
    var element = document.getElementById(elementId);
    var display = element.style.display;
     if(display=='none') {
		toggleOpen(element, elementId);
     } else {
		toggleClose(element, elementId);
     }
}

function toggleClose(element, elementId) {
	element.style.display = 'none';
    document.getElementById(elementId + 'Toggle').src = 'images/undisclosed.gif';
}

function toggleOpen(element, elementId) {
	element.style.display = 'block';
	document.getElementById(elementId + 'Toggle').src = 'images/disclosed.gif';
}

function toggleAll(count, prefix, display, extraField) {
	for (i = 0; i < count; i++) {
		var elementId = prefix + i;
		var element = document.getElementById(elementId);
		if (element != null) {    		
			if(display=='expand') {
				toggleOpen(element, elementId);
			} else {
				toggleClose(element, elementId);
			}
     	}
     }
     if (extraField != null  && (element = document.getElementById(extraField)) != null) {
      		if(display=='expand') {
				toggleOpen(element, extraField);
			} else {
				toggleClose(element, extraField);
			}		
     }
}

function swapStyles(elementId,style1,style2,checkbox){
	if($(checkbox)!=null && !$(checkbox).checked){
	if($(elementId).className == style1) {
		$(elementId).className = style2;
	} else {
		$(elementId).className = style1;
	}
    }
}<commit_msg>It seems some of the functions used from prototype.js have not finished loading when we get to this file, causing javascript errors. Had to not use scriptaculous.<commit_after>// from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html

function addEvent( obj, type, fn )
{
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}

function removeEvent( obj, type, fn )
{
	if (obj.removeEventListener)
		obj.removeEventListener( type, fn, false );
	else if (obj.detachEvent)
	{
		obj.detachEvent( "on"+type, obj[type+fn] );
		obj[type+fn] = null;
		obj["e"+type+fn] = null;
	}
}

function toggleDivs(source,destination){
   document.getElementById(source).style.display = 'none';
   document.getElementById(destination).style.display = 'block';
}

function disableEnterKey(e)
{
    var keyCode;

    if(window.event) {
        keyCode = window.event.keyCode;     //IE
    } else {
        keyCode = e.which;     //firefox

    }

    return (keyCode != 13);
}

function toggleHidden(elementId) {
    var element = document.getElementById(elementId);
    var display = element.style.display;
     if(display=='none') {
		toggleOpen(element, elementId);
     } else {
		toggleClose(element, elementId);
     }
}

function toggleClose(element, elementId) {
	element.style.display = 'none';
    document.getElementById(elementId + 'Toggle').src = 'images/undisclosed.gif';
}

function toggleOpen(element, elementId) {
	element.style.display = 'block';
	document.getElementById(elementId + 'Toggle').src = 'images/disclosed.gif';
}

function toggleAll(count, prefix, display, extraField) {
	for (i = 0; i < count; i++) {
		var elementId = prefix + i;
		var element = document.getElementById(elementId);
		if (element != null) {    		
			if(display=='expand') {
				toggleOpen(element, elementId);
			} else {
				toggleClose(element, elementId);
			}
     	}
     }
     if (extraField != null  && (element = document.getElementById(extraField)) != null) {
      		if(display=='expand') {
				toggleOpen(element, extraField);
			} else {
				toggleClose(element, extraField);
			}		
     }
}

function swapStyles(elementId,style1,style2,checkbox){
	if(document.getElementById(checkbox)!=null && !document.getElementById(checkbox).checked){
  	  if(document.getElementById(elementId).className == style1) {
		  document.getElementById(elementId).className = style2;
	  } else {
		  document.getElementById(elementId).className = style1;
	  }
    }
}
{'fraction_non_alphanumeric': 0.1509058331674298, 'fraction_numerical': 0.005972526378658172, 'mean_word_length': 3.816874400767018, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2975547', 'n_tokens_mistral': 1738, 'n_tokens_neox': 1630, 'n_words': 322}