
/* These functions will output either an <a HREF link or just a URL.  

IN
	domain & suffix are optional.

These have a null title="" because otherwise Firefox shows 'valid link' tooltip when you hoover, we want only the rolltip to appear.
<script type='text/javascript' language='javascript'></script>
*/
function hrefLinkOutWithRollover(domain, suffix, filepath, anchortext, rollover) {
	var firstpart = 'http://' + domain + '.' + suffix;
	if ((domain=='') || (suffix=='')) firstpart = '';
	document.write ( '<a href=\'' + firstpart + filepath + '\'' + 'onMouseOver="showRollTip(\'' + rollover + '\',event)" onMouseOut="hideRollTip()" title="" >' + anchortext + '</a>');
} 
function hrefLinkOutWithRolloverNoAnchorText(domain, suffix, filepath, rollover) {
	var firstpart = 'http://' + domain + '.' + suffix;
	if ((domain=='') || (suffix=='')) firstpart = '';
	document.write ( '<a href=\'' + firstpart + filepath + '\'' + 'onMouseOver="showRollTip(\'' + rollover + '\',event)" onMouseOut="hideRollTip()" title="" >');
}
function hrefImageLinkOutWithRolloverNoAnchorText(domain, suffix, filepath, rollover, http) {
	var firstpart = http + domain + '.' + suffix;
	if ((domain=='') || (suffix=='')) firstpart = '';
	document.write ( '<a href=\'' + firstpart + filepath + '\'' + 'class=\'imagelink\'' + 'onMouseOver="showRollTip(\'' + rollover + '\',event)" onMouseOut="hideRollTip()" title="" >');
}
function hrefLinkOut(domain, suffix, filepath, anchortext) {
	var firstpart = 'http://' + domain + '.' + suffix;
	if ((domain=='') || (suffix=='')) firstpart = '';
	document.write ( '<a href=\'' + firstpart + filepath + '\' >' + anchortext + '</a>');
}
function hrefLinkOutURLOnly(domain, suffix, filepath, anchortext) {
	var firstpart = 'http://' + domain + '.' + suffix;
	if ((domain=='') || (suffix=='')) firstpart = '';
	document.write ( firstpart + filepath);
}
 

<!-- ---------------- FUNCTIONS TO TOGGLE BLOCK DISPLAY ON / OFF ---------------------------- -->
<!-- function to toggle display of a section of html on/off -->
function kadabra(zap) {
	if (document.getElementById) {
		var abra = document.getElementById(zap).style;
		if (abra.display == "block") {
			abra.display = "none";
		} else {
			abra.display = "block";
		}
		return false;
	} else {
	return true;
	}
}

/* functions to force display of a section of html on/off */
function display_alwayson(zap) {
	var abra = document.getElementById(zap).style;
	abra.display = "block";
	return true;
}
function display_alwaysoff(zap) {
	var abra = document.getElementById(zap).style;
	abra.display = "none";
	return true;
}


/* borrowed from www.fivethirtyeight.com 
How to use:
<div id="post-6772257152721931648"><p>Our blah blah...<span style="display: none;" id="fullpost">IPSUM Gloria maxima the programma do done it. </span></p> 
	<span id="showlink"><p><a href="javascript:void(0);" onclick='javascript:showFull("post-6772257152721931648");'>There's More...</a></p></span>
</div>
*/
function showFull(id) {
	var post = document.getElementById(id);
        var spans = post.getElementsByTagName('span');
        for (var i = 0; i < spans.length; i++) {
             if (spans[i].id == "fullpost") {
                 spans[i].style.display = 'inline';
             }
             if (spans[i].id == "showlink")
                 spans[i].style.display = 'none';
        }
}



/*************************************************************************
  This code is from Dynamic Web Coding at dyn-web.com
  Copyright 2002-5 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/
/* this code is duplicated in file "rolltip_lib2.js" for use by Richard internal to K&S, and in "lp_lib.js" for use external LPs by Rob -- the 2nd lib has more code */
function showRollTip(msg, e) {
  if ( typeof RollTip == "undefined" || !RollTip.ready ) return;
  RollTip.reveal(msg, e);
}

function hideRollTip() {
  if ( typeof RollTip == "undefined" || !RollTip.ready ) return;
  RollTip.conceal();
}



/* function to toggle display of a section of html on/off 
  Used in Robert's main 'Try Your Own Account' include (kw_table_of_links_toinclude2.htm)
*/
function switchpanels(zap) {
	var abra = document.getElementById("morepanel-1").style;    abra.display = "none";
	/* turn off all 5 */
	abra = document.getElementById("morepanel-2").style;    abra.display = "none";
	abra = document.getElementById("morepanel-3").style;    abra.display = "none";
	abra = document.getElementById("morepanel-4").style;    abra.display = "none";
	abra = document.getElementById("morepanel-5").style;    abra.display = "none";
	/* turn on the passed panel name */
	abra = document.getElementById(zap).style;    abra.display = "block";
	return false;
}
/* the following version works very well also - as you click each link it's panel gets turns on, adding to what's already been turn on.  Quite cool.
function switchpanels(zap) {
	if (document.getElementById) {
		var abra = document.getElementById(zap).style;
		if (abra.display == "block") {
			abra.display = "none";
	} else {
		abra.display = "block";
	}
	return false;
	} else {
	return true;
	}
}
*/


