function CreateList(num) {
	for (i=1; i <= num; i++)
	{

		var actions = (i == 1) ? 'class="selected" id="first"' : '';

		var txt = '<a href="#" ' + actions + '></a>';

		$('idsteps').insert((new Element ("li").update(txt)));

	}
}

function prevStep(id, recs) {

	for(p=(recs-1); p >= 0; p--) {


		var li = $(id).childNodes[p];
		var sel = li.firstChild.className;

		if (sel == "selected")
		{
			li.firstChild.className = "";
			$(id).childNodes[p-1].firstChild.className = 'selected';


			if (sel == "selected" && (p-1) == (recs - (recs-(p-1)))) {

				var s = p;

				$('idarticle_title').innerHTML = "Regroupement de crédits " + s;
				$('idimg_text').innerHTML = "Text " + s + " text " + s + " text " + s + " text " + s + " text " + s + " text " + s + " text " + s + " text " + s + " text " + s + " text " + s + " text " + s;
			}

			if (p == (recs - 1))
			{
				$('idright_arrow').style.display = "";
			}

			if (p == 1)
			{
				$('idleft_arrow').style.visibility = "hidden";
			}

			return;
		}
	}
}

function nextStep(id, recs) {
	for (n=0; n < recs-1; n++)
	{
		var li = $(id).childNodes[n];
		var sel = li.firstChild.className;

		if (n == 0)
		{
			$('idleft_arrow').style.visibility = "visible";
		}

		if (sel == "selected")
		{
			li.firstChild.className = "";
			$(id).childNodes[n+1].firstChild.className = "selected";

			if (sel == "selected") {
				var s = n+2;
				$('idarticle_title').innerHTML = "Regroupement de crédits " + s;
				$('idimg_text').innerHTML = "Text " + s + " text " + s + " text " + s + " text " + s + " text " + s + " text " + s + " text " + s + " text " + s + " text " + s + " text " + s + " text " + s;
			}

			if (n == recs-2)
			{
				$('idright_arrow').style.display = "none";
			}
			else {
				break;
			}

		}



	}
}

function openForPrint(content){
	var options='scrollbars=yes,resizable=yes, width=700,height=540, left=0 ,top=0';
	imgWin=window.open('about:blank','',options);
	with (imgWin.document)
		{
			writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
			writeln('<html>\n<head>\n<title>Head title<\/title>');
			writeln('<\/head>\n<body onload="self.focus(); print();" >');

			writeln('<table  cellspacing="0" cellpadding="0" align="left" border="0" style="font-size:11px; font-family: tahoma, sans-serif; margin-top:10px;"><tr><td class="bord">');
			writeln('\t'+ content +'\n<\/td><\/tr><tr><td class="bord">');


			writeln('<p style="margin-top: 20px;">');
			writeln('<\/td><\/tr><\/table><br /><\/body>\n<\/html>');
			close();
		}//end with
}//end func


function showOrHide(id){
	var word = (!$(id).hasClassName("scroll")) ? 'addClassName' : 'removeClassName';
	$(id)[word]('scroll');
	$(id).scrollTop = 0;
	var msg = (word != 'addClassName') ? "Lire la suite" : "Fermer";
	$('idlire').update(msg);
	$$('a.mention')[0][word]('down_arrow');
}
