var currIntro = 0;


$(document).ready(function()
{
	/**
	 * Display confirmation dialog whenever link
	 * with className "confirm" is clicked
	 */
	$(".confirm").click(function(){
		return confirm("Do you really want to continue?");
	});

	$("#gallery").easySlider({
		prevText: "",
		nextText: "",
		speed: 400
	});

});



/**
 * Print email link (protection from spambots)
 * If javascript is disabled, nothing is visible
 *
 * @param string p1 Part 1 - this is username
 * @param string p2 Part 2 - this is domain and TLD
 */
function writemail(p1, p2)
{
	document.write("<a href='mailto:"+p1+"@"+p2+"'>"+p1+"@"+p2+"</a>");
}

/**
 *
 *
 *
 */
function nextIntro()
{
	alert(intros);
	currIntro++;




}

function refreshIntro()
{
	if (currIntro < 0)
	{
		currIntro = intros.length - 1;
	}

	if (currIntro >= intros.length)
	{
		//currIntro = intros.length - 1;
		currIntro = 0;
	}

	id = intros[currIntro];

	$(".tdc div").hide();
	$(".tdl div").hide();
	$(".tdr div").hide();

	if (typeof(intros[currIntro - 1]) != "undefined")
	{
		$("#tdl-"+intros[currIntro - 1]).show();
	}
	else
	{
		$("#tdl-"+intros[intros.length-1]).show();
	}

	$("#tdc-"+id).show();

	if (typeof(intros[currIntro + 1]) != "undefined")
	{
		$("#tdr-"+intros[currIntro + 1]).show();
	}
	else
	{
		$("#tdr-"+intros[0]).show();
	}
}