// JavaScript Document
//
// javascript library by john houck . com
// last mod: 2008.2.1
//

function expand(ID, txt) {
	document.getElementById('item'+ID).style.display = 'block';
    document.getElementById('expander'+ID).innerHTML = '<a href="javascript:collapse('+ID+', \''+txt+'\')" title="Collapse">'+txt+' -</a>';
	
	//if (ID == 2) {
	//	setCookie("1");	
	//}
}

function collapse(ID, txt) {
	var frm = document.getElementById("notes");
    document.getElementById('item'+ID).style.display = 'none';
    document.getElementById('expander'+ID).innerHTML = '<a href="javascript:expand('+ID+', \''+txt+'\')" title="Expand">'+txt+' +</a>';
	
	//if (ID == 2) {
	//	setCookie("0");	
	//}
}


//
// popup window with specified width and height
//
function popup(url, w, h) {
  var day = new Date();
  var id = day.getTime();
  var screenLeft = (screen.width) ? (screen.width - w)/2 : 0;
  var screenTop = (screen.height) ? (screen.height - h)/2 : 0;
  eval("page" + id + " = window.open(url, '"+id+"','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+w+",height="+h+",left="+screenLeft+",top="+screenTop+"');");
  
  return false;
}


/* Unobtrusive Flash Objects (UFO) v3.20 <http://www.bobbyvandersluis.com/ufo/>
	Copyright 2005, 2006 Bobby van der Sluis
	This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/

function createCSS(selector, declaration) {
	// test for IE
	var ua = navigator.userAgent.toLowerCase();
	var isIE = (/msie/.test(ua)) && !(/opera/.test(ua)) && (/win/.test(ua));

	// create the style node for all browsers
	var style_node = document.createElement("style");
	style_node.setAttribute("type", "text/css");
	style_node.setAttribute("media", "screen"); 

	// append a rule for good browsers
	if (!isIE) style_node.appendChild(document.createTextNode(selector + " {" + declaration + "}"));

	// append the style node
	document.getElementsByTagName("head")[0].appendChild(style_node);

	// use alternative methods for IE
	if (isIE && document.styleSheets && document.styleSheets.length > 0) {
		var last_style_node = document.styleSheets[document.styleSheets.length - 1];
		if (typeof(last_style_node.addRule) == "object") last_style_node.addRule(selector, declaration);
	}
}