var workshops = ['July 18-20 in Berkeley, CA'];
var patterns  = ['July 21-22 in Berkeley, CA'];

/*public*/ function nextWorkshop() 		{ return workshops[0]; }
/*public*/ function nextPatterns()		{ return patterns [0]; }

/* workshop_info( text_before, text_after ). Args are optional */
/*public*/ function workshop_info()
{	
	var before = (arguments.length >= 1) ? arguments[0] : "" ;
	var after  = (arguments.length >= 2) ? arguments[1] : "" ;
	print_workshop_info(before,after,workshops);
}

/*public*/ function patterns_info()
{	var before = (arguments.length >= 1) ? arguments[0] : "" ;
	var after  = (arguments.length >= 2) ? arguments[1] : "" ;
	print_workshop_info(before,after,patterns);
}

/*private*/ function print_workshop_info( before, after, dates )
{	
	for( var i = 0; i < dates.length; ++i )	
	{	document.write( (before + dates[i] + after) );
		if( i != (dates.length-1) )
			document.write("<br>");
	}
}

// text-outline: 4px 4px white;			Not supported by any browsers, yet
// text-shadow:0px 0px 4px #ffffff;		Works okay, but doesn't look great
// 8b0000 is darkred
// 710000 is darker
// 610000 is even darker

/*private*/ function printClassLogo( title, subtitle, link )
{
	var hOffset = - Math.floor(Math.random()*100 ) % 40;
	var vOffset = - Math.floor(Math.random()*1000) % 175;

	// image is 452x328
	var element =
		"<a href='" + link + "' style='text-decoration: none;'>\n" +
			"<div style='width:4in; height: 100px; background-color: #fff0c0;' " +
						"onmouseover='style.backgroundColor=\"#ffcc66\";' " +
						"onmouseout='style.backgroundColor=\"#fff0c0\";' >\n" +
				"<div style='width:4in; " +
							"height:100px; " +
							"border:1px solid darkred; " +
							"background:url(/images/uml.background.xparent.png);" +
							"background-position: " + hOffset + "px " + vOffset + "px; " +
							"filter:alpha(opacity=50); " +
							"opacity:0.50;" +
							"'>\n" +
				"</div>\n" +
				"<div style='font-family:verdana, arial, helvetica, san-serif;" +
							"font-weight:bold;" +
							"color:#710000;" +
							"position:relative;" +
							"top:-50pt;" +
							"left:.1in;' >\n" +
						"<div style='font-size:26pt;'>"	+ title		+ "</div>\n" +
						"<div style='font:14pt;'>"		+ subtitle	+ "</div>\n" +
				"</div>\n" +
			"</div>\n" +
		"</a>\n" ;

	document.write( element );
}

/*public*/ function printWorkshopLogo()
{	printClassLogo( "Agile OO-Design", "With UML", "/training/oo.workshop.html" );
}

/*public*/ function printPatternsLogo()
{ 	printClassLogo( "Agile Architecture", "OO Structure &amp; Design Patterns for Agile Projects", "/training/oo.patterns.html" );
}

/*public*/ function insertSpeakingAtLinks()
{
	// "<a target='_blank' href='http://www.software-architect.co.uk/'>" +

	document.write
	(	"<div style=float:right;'>" +
			"<a target='_blank' href='http://www.devweek.com/'>" +
				"<div style='width:1.5in;'>"+
				"<span style='margin: 10pt 0pt 0pt 2em; font-size:8pt; color:#68a9df;'>" + "I'm speaking at" + "</span>" +
				"<img src=\"/images/DevWeek12.jpg\"" +
						" style='width:1.5in;'"+
						" onmouseover='style.opacity=\".85\"'" +
						" onmouseout='style.opacity=\"1.0\"'" +
				"></img><br>" +
				"</div>"+
			"</a>" +
		"</div>"
	);
}

