/*

FILE:		icb.js

AUTHOR:		Alex Jonas

LAST UPDATED:	1/26/2006

DESCRIPTION:	JavaScript functions in support of the ICB Data Viewer at http://www.cidcm.umd.edu/icb/dataviewer/.

*/



var contextLabel = new Array;

contextLabel[0] = 'Crisis Summary';
contextLabel[1] = 'Protracted Conflict History';
contextLabel[2] = 'Crisis Overview';
contextLabel[3] = 'Crisis Trigger & Behavior';
contextLabel[4] = 'Crisis Characteristics';
contextLabel[5] = 'Geography';
contextLabel[6] = 'Great Power Involvement';
contextLabel[7] = 'Superpower Involvement';
contextLabel[8] = 'Global Organization Activity';
contextLabel[9] = 'Regional Organization Activity';
contextLabel[10] = 'Mediation';
contextLabel[11] = 'Crisis Outcomes';
contextLabel[12] = 'Search';

function unhighlightTocLinks() {

	for (var i = 1; i <= 12; i++) {

		var link = top.toc.document.getElementById( ('toc_link_' + i) );
		link.style.color = '#000066';
		link.style.fontWeight = 'normal';

	}

}

function highlightTocLink(num) {

	var link = top.toc.document.getElementById( ('toc_link_' + num) );
	link.style.color = '#000066';
	link.style.fontWeight = 'bold';

}

function select_crisis(crisisId,searchString) {

	if (crisisId != 0 ) {

		top.main.document.location='crisis_summary.asp?id=' + crisisId + '&searchTerm=' + searchString
		update_toc(crisisId,0);
		//create_toc(crisisId);
		//update_navigation(crisisId,0);


	} else {

		alert('Please select an actual crisis.');

	}

	top.controls.document.crisisSelect.id.options.selectedIndex=0;

}


function update_toc(crisisId,context) {

	top.toc.document.location = 'toc.asp?id=' + crisisId;
	update_navigation(crisisId,context);

}


function update_navigation(crisisId,context) {

	var url;
	var label;
	url = 'navigation.asp?id=';
	url += crisisId;
	url += '&context='
	url += context
	label = escape(contextLabel[context]);
	url += '&label=';
	url += label;

	top.navigation.document.location = url;

}

/*
function checkSisterWindow(id) {

	if (top.main.location.href != 'http://www.cidcm.umd.edu/icb/dataviewer/crisis_summary.asp?id=' + id) {

		top.main.location = ('http://www.cidcm.umd.edu/icb/dataviewer/crisis_summary.asp?id=' + id);
		top.toc.location = ('http://www.cidcm.umd.edu/icb/dataviewer/toc.asp?id=' + id);

	}

}

*/

function showDefinition(variableId, variableLevel, variableName) {

	var url;

	url = 'http://www.cidcm.umd.edu/icb/dataviewer/variable.asp?id=' + variableId + '&level=' + variableLevel + '&name=' + variableName;

	popWin(url);

}

function popWin(url) {

	var win = window.open(url,'','width=475,height=375,menubar,resizable,scrollbars,screenX=50,screenY=50,left=50,top=50');

}

function popHelpWin(url) {

	var win = window.open(url,'','width=513,height=392,menubar,resizable,screenX=60,screenY=60,left=60,top=60');

}

function setResizeOptions() {

	//alert('Hello, world!');

	var frm = new Array();

	frm[0] = 'controls';
	frm[1] = 'toc';
	frm[2] = 'corner';
	frm[3] = 'main';

	for(var i = 0; i <= (frm.length - 1); i++) {

		//alert(i);

		frame_object = top.document.getElementById(frm[i]);

		//alert(frame_object.noResize);

		frame_object.noResize = false;

		//alert(frame_object.noResize);

	}


}

function checkVariableSelect(num) {

	var formName;
	var valueToCheck;

	if (num == 1) {

		formName = 'selectSystemCode';

	} else if (num == 2) {

		formName = 'selectActorCode';

	}

	valueToCheck = eval('document.' + formName + '.id[document.' + formName + '.id.selectedIndex].value');

	if (valueToCheck == 0) {

		alert('Please select a codebook variable.');

		return false;

	} else {

		return true;

	}

	return false;

}

if (document.images) {

	// Define arrow_up.

	var arrow_up = new Image(9,5);

	arrow_up.src = 'http://www.cidcm.umd.edu/icb/dataviewer/images/arrow_toc_up.gif';
	arrow_up.alt = 'Hide list of variables';

	// Define arrow_down.

	var arrow_down = new Image(9,5);

	arrow_down.src = 'http://www.cidcm.umd.edu/icb/dataviewer/images/arrow_toc_down.gif';
	arrow_down.alt = 'Display list of variables';

}

function toggleVariableDisplay(num) {

	if (!document.getElementById) return;

	// Define elements.

	var element = document.getElementById( ('variables_' + num) );

	var arrow = document.getElementById( ('arrow_' + num) );

	// Toggle elements.

	if (element.style.display == 'none') {

		element.style.display = 'block';
		arrow.src = arrow_up.src;
		arrow.alt = arrow_up.alt;

	} else {

		element.style.display = 'none';
		arrow.src = arrow_down.src;
		arrow.alt = arrow_down.alt;

	}

	//var lastArrow = arrow.src + '\n\n' + arrow.alt;

}

function create_toc(crisno) {

	var toc = '';

	toc = toc + '<html>\n';
	toc = toc + '<head>\n';
	toc = toc + '<title>ICB Console Table of Contents</title>\n';
	toc = toc + '<link rel=\"stylesheet\" type=\"text/css\" href=\"icb.css\">\n';
	toc = toc + '<script language=\"JavaScript\" src=\"icb.js\"></script>\n';
	toc = toc + '</head>\n';
	toc = toc + '<body style=\"background-color: #CCD8C4;\">\n';

	if (!document.all) {

		toc = toc + '<br />\n';

	}

	toc = toc + '<!--  CRISIS SUMMARY  -->\n';

	toc = toc + '<div id=\"crisis_summary\">\n';
	toc = toc + '<table>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><a id=\"toc_link_1\" class=\"toc\" href=\"crisis_summary.asp?id=' + crisno + '\" target=\"main\" onClick=\"update_navigation(' + crisno + ',0);\">Crisis Summary</a></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<!--  PROTRACTED CONFLICT HISTORY  -->\n';

	toc = toc + '<div id=\"protracted_conflict_history\">\n';
	toc = toc + '<table>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><a id=\"toc_link_2\" class=\"toc\" href=\"protracted_conflict.asp?id=' + crisno + '\" target=\"main\" onClick=\"update_navigation(' + crisno + ',1);\">Protracted Conflict History</a></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<!--  EMPTY ROW  -->\n';

	toc = toc + '<div id=\"empty_row_01\">\n';
	toc = toc + '<table>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td>&nbsp;</td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<!--  CRISIS OVERVIEW  -->\n';

	toc = toc + '<div id=\"crisis_overview\">\n';
	toc = toc + '<table>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><a id=\"toc_link_3\" class=\"toc\" href=\"crisis_overview.asp?id=' + crisno + '\" target=\"main\" onClick=\"update_navigation(' + crisno + ',2);\">Crisis Overview</a></td>\n';
	toc = toc + '    <td valign=\"middle\"><small><a href=\"javascript:void(0);\" onClick=\"toggleVariableDisplay(1)\"><img id=\"arrow_1\" src=\"images/arrow_toc_down.gif\" alt=\"Display list of variables\" width=\"9\" height=\"5\" border=\"0\"></a></small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<div id=\"variables_1\" style=\"display: none;\">\n';
	toc = toc + '<table cellspacing=\"0\" cellpadding=\"4\" style=\"background-color: #FFFFFF;\">\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>System-Level</small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>Actor-Level</small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'TRIGDATE\');\">TRIGDATE</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'TERMDATE\');\">TERMDATE</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'SYSLEVSY\');\">SYSLEVSY</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'TRIGENT\');\">TRIGENT</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'BREAK\');\">BREAK</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GRAVCR\');\">GRAVCR</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'CRISMG\');\">CRISMG</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'VIOL\');\">VIOL</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GLOBACTM\');\">GLOBACTM</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'FOROUT\');\">FOROUT</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'SUBOUT\');\">SUBOUT</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'TRIGDATE\');\">TRIGDATE</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'TERMDATE\');\">TERMDATE</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<!--  CRISIS TRIGGER & BEHAVIOR  -->\n';

	toc = toc + '<div id=\"crisis_trigger_and_behavior\">\n';
	toc = toc + '<table>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><a id=\"toc_link_4\" class=\"toc\" href=\"trigger.asp?id=' + crisno + '\" target=\"main\" onClick=\"update_navigation(' + crisno + ',3);\">Crisis Trigger & Behavior</a></td>\n';
	toc = toc + '    <td valign=\"middle\"><small><a href=\"javascript:void(0);\" onClick=\"toggleVariableDisplay(2)\"><img id=\"arrow_2\" src=\"images/arrow_toc_down.gif\" alt=\"Display list of variables\" width=\"9\" height=\"5\" border=\"0\"></a></small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<div id=\"variables_2\" style=\"display: none;\">\n';
	toc = toc + '<table cellspacing=\"0\" cellpadding=\"4\" style=\"background-color: #FFFFFF;\">\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>System-Level</small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>Actor-Level</small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'TRIGDATE\');\">TRIGDATE</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'TERMDATE\');\">TERMDATE</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'SYSLEVSY\');\">SYSLEVSY</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'BREAK\');\">BREAK</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GRAVCR\');\">GRAVCR</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'CRISMG\');\">CRISMG</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'VIOL\');\">VIOL</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'TRIGENT\');\">TRIGENT</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'TRIGGR\');\">TRIGGR</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'MAJRES\');\">MAJRES</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'CRISMG\');\">CRISMG</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'CENVIO\');\">CENVIO</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'SEVVIO\');\">SEVVIO</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'VIOL\');\">VIOL</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<!--  CRISIS CHARACTERISTICS  -->\n';

	toc = toc + '<div id=\"crisis_characteristics\">\n';
	toc = toc + '<table>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><a id=\"toc_link_5\" class=\"toc\" href=\"characteristics.asp?id=' + crisno + '\" target=\"main\" onClick=\"update_navigation(' + crisno + ',4);\">Crisis Characteristics</a></td>\n';
	toc = toc + '    <td valign=\"middle\"><small><a href=\"javascript:void(0);\" onClick=\"toggleVariableDisplay(3)\"><img id=\"arrow_3\" src=\"images/arrow_toc_down.gif\" alt=\"Display list of variables\" width=\"9\" height=\"5\" border=\"0\"></a></small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<div id=\"variables_3\" style=\"display: none;\">\n';
	toc = toc + '<table cellspacing=\"0\" cellpadding=\"4\" style=\"background-color: #FFFFFF;\">\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>System-Level</small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>Actor-Level</small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'PERIOD\');\">PERIOD</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'SYSLEVSY\');\">SYSLEVSY</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'ETHNIC\');\">ETHNIC</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'POWDISSY\');\">POWDISSY</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'PROTRAC\');\">PROTRAC</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GRAVCR\');\">GRAVCR</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'IWCMB\');\">IWCMB</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'MEDIATE\');\">MEDIATE</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'GRAVTY\');\">GRAVTY</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'POWSTA\');\">POWSTA</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'POWDIS\');\">POWDIS</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'REGIME\');\">REGIME</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'AGE\');\">AGE</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'IWC\');\">IWC</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'TERRIT\');\">TERRIT</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<!--  GEOGRAPHY  -->\n';

	toc = toc + '<div id=\"geography\">\n';
	toc = toc + '<table>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><a id=\"toc_link_6\" class=\"toc\" href=\"geography.asp?id=' + crisno + '\" target=\"main\" onClick=\"update_navigation(' + crisno + ',5);\">Geography</a></td>\n';
	toc = toc + '    <td valign=\"middle\"><small><a href=\"javascript:void(0);\" onClick=\"toggleVariableDisplay(4)\"><img id=\"arrow_4\" src=\"images/arrow_toc_down.gif\" alt=\"Display list of variables\" width=\"9\" height=\"5\" border=\"0\"></a></small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<div id=\"variables_4\" style=\"display: none;\">\n';
	toc = toc + '<table cellspacing=\"0\" cellpadding=\"4\" style=\"background-color: #FFFFFF;\">\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>System-Level</small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>Actor-Level</small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GEOG\');\">GEOG</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GEOSTR\');\">GEOSTR</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GEOGREL\');\">GEOGREL</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'GEOG\');\">GEOG</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'ACTLOC\');\">ACTLOC</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<!--  GREAT POWER INVOLVEMENT  -->\n';

	toc = toc + '<div id=\"great_power_involvement\">\n';
	toc = toc + '<table>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><a id=\"toc_link_7\" class=\"toc\" href=\"great_power.asp?id=' + crisno + '\" target=\"main\" onClick=\"update_navigation(' + crisno + ',6);\">Great Power Involvement</a></td>\n';
	toc = toc + '    <td valign=\"middle\"><small><a href=\"javascript:void(0);\" onClick=\"toggleVariableDisplay(5)\"><img id=\"arrow_5\" src=\"images/arrow_toc_down.gif\" alt=\"Display list of variables\" width=\"9\" height=\"5\" border=\"0\"></a></a></small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<div id=\"variables_5\" style=\"display: none;\">\n';
	toc = toc + '<table cellspacing=\"0\" cellpadding=\"4\" style=\"background-color: #FFFFFF;\">\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>System-Level</small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>Actor-Level</small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GPINV\');\">GPINV</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GPINVTP\');\">GPINVTP</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GPPACETP\');\">GPPACETP</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GPEFCTTP\');\">GPEFCTTP</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GPEFACTP\');\">GPEFACTP</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>n/a</small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<!--  SUPER POWER INVOLVEMENT  -->\n';

	toc = toc + '<div id=\"super_power_involvement\">\n';
	toc = toc + '<table>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><a id=\"toc_link_8\" class=\"toc\" href=\"superpower.asp?id=' + crisno + '\" target=\"main\" onClick=\"update_navigation(' + crisno + ',7);\">Superpower Involvement</a></td>\n';
	toc = toc + '    <td valign=\"middle\"><small><a href=\"javascript:void(0);\" onClick=\"toggleVariableDisplay(6)\"><img id=\"arrow_6\" src=\"images/arrow_toc_down.gif\" alt=\"Display list of variables\" width=\"9\" height=\"5\" border=\"0\"></a></a></small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<div id=\"variables_6\" style=\"display: none;\">\n';
	toc = toc + '<table cellspacing=\"0\" cellpadding=\"4\" style=\"background-color: #FFFFFF;\">\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>System-Level</small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>Actor-Level</small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'USINV\');\">USINV</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'USEFCT\');\">USEFCT</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'USEFAC\');\">USEFAC</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'USPACE\');\">USPACE</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'SUINV\');\">SUINV</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'SUEFCT\');\">SUEFCT</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'SUEFAC\');\">SUEFAC</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'SUPACE\');\">SUPACE</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>\n';
	toc = toc + ' 	 <a href=\"javascript:showDefinition(\'\', \'2\', \'USINV\');\">USINV</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'USFAVR\');\">USFAVR</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'SUINV\');\">SUINV</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'SUFAVR\');\">SUFAVR</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<!--  GLOBAL ORGANIZATION ACTIVITY  -->\n';

	toc = toc + '<div id=\"global_organization_activity\">\n';
	toc = toc + '<table>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><a id=\"toc_link_9\" class=\"toc\" href=\"globalOrg.asp?id=' + crisno + '\" target=\"main\" onClick=\"update_navigation(' + crisno + ',8);\">Global Organization Activity</a></td>\n';
	toc = toc + '    <td valign=\"middle\"><small><a href=\"javascript:void(0);\" onClick=\"toggleVariableDisplay(7)\"><img id=\"arrow_7\" src=\"images/arrow_toc_down.gif\" alt=\"Display list of variables\" width=\"9\" height=\"5\" border=\"0\"></a></a></small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<div id=\"variables_7\" style=\"display: none;\">\n';
	toc = toc + '<table cellspacing=\"0\" cellpadding=\"4\" style=\"background-color: #FFFFFF;\">\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>System-Level</small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>Actor-Level</small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'SOGLACT\');\">SOGLACT</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GLOBORG\');\">GLOBORG</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GLOBACTM\');\">GLOBACTM</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GLOBEFAC\');\">GLOBEFAC</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GLOBEFCT\');\">GLOBEFCT</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'GLOBPACE\');\">GLOBPACE</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'GLOBFAVR\');\">GLOBFAVR</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'GLOBORG\');\">GLOBORG</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'GLOBACT\');\">GLOBACT</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<!--  REGIONAL ORGANIZATION ACTIVITY  -->\n';

	toc = toc + '<div id=\"regional_organization_activity\">\n';
	toc = toc + '<table>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><a id=\"toc_link_10\" class=\"toc\" href=\"regionalOrg.asp?id=' + crisno + '\" target=\"main\" onClick=\"update_navigation(' + crisno + ',9);\">Regional Organization Activity</a></td>\n';
	toc = toc + '    <td valign=\"middle\"><small><a href=\"javascript:void(0);\" onClick=\"toggleVariableDisplay(8)\"><img id=\"arrow_8\" src=\"images/arrow_toc_down.gif\" alt=\"Display list of variables\" width=\"9\" height=\"5\" border=\"0\"></a></a></small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<div id=\"variables_8\" style=\"display: none;\">\n';
	toc = toc + '<table cellspacing=\"0\" cellpadding=\"4\" style=\"background-color: #FFFFFF;\">\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>System-Level</small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>Actor-Level</small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'SORACT\');\">SORACT</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'REGORG\');\">REGORG</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'REGACTMB\');\">REGACTMB</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'ROEFAC\');\">ROEFAC</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'ROEFCT\');\">ROEFCT</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'ROBODY\');\">ROBODY</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'ROPACE\');\">ROPACE</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'ROFAVR\');\">ROFAVR</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'REGORG\');\">REGORG</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'REGACT\');\">REGACT</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<!--  CRISIS OUTCOMES  -->\n';

	toc = toc + '<div id=\"crisis_outcomes\">\n';
	toc = toc + '<table>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><a id=\"toc_link_11\" class=\"toc\" href=\"outcomes.asp?id=' + crisno + '\" target=\"main\" onClick=\"update_navigation(' + crisno + ',10);\">Crisis Outcomes</a></td>\n';
	toc = toc + '    <td valign=\"middle\"><small><a href=\"javascript:void(0);\" onClick=\"toggleVariableDisplay(9)\"><img id=\"arrow_9\" src=\"images/arrow_toc_down.gif\" alt=\"Display list of variables\" width=\"9\" height=\"5\" border=\"0\"></a></a></small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '<div id=\"variables_9\" style=\"display: none;\">\n';
	toc = toc + '<table cellspacing=\"0\" cellpadding=\"4\" style=\"background-color: #FFFFFF;\">\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>System-Level</small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>Actor-Level</small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '  <tr valign=\"top\">\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'SUBOUT\');\">SUBOUT</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'OUTESR\');\">OUTESR</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'BREXIT\');\">BREXIT</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'FOROUT\');\">FOROUT</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'1\', \'EXSAT\');\">EXSAT</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '    <td><small>&nbsp;&nbsp;</small></td>\n';
	toc = toc + '    <td><small>\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'OUTCOM\');\">OUTCOM</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'OUTFOR\');\">OUTFOR</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'OUTESR\');\">OUTESR</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'OUTEVL\');\">OUTEVL</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'TRGTERRA\');\">TRGTERRA</a><br />\n';
	toc = toc + '    <a href=\"javascript:showDefinition(\'\', \'2\', \'RESTERRA\');\">RESTERRA</a><br />\n';
	toc = toc + '    </small></td>\n';
	toc = toc + '  </tr>\n';
	toc = toc + '</table>\n';
	toc = toc + '</div>\n';

	toc = toc + '</body>\n';
	toc = toc + '</html>\n';

	top.toc.document.open();
	top.toc.document.write(toc);
	top.toc.document.close();

}
