
//******************************************************************************
    //  Cookie Functions -- "Night of the Living Cookie" Version (25-Jul-96)
    //  Written by:  Bill Dortch, hIdaho Design <bdortch@hidaho.com>
    
    
    //  "Internal" function to return the decoded value of a cookie
    function getCookieVal (offset) {
      var endstr = document.cookie.indexOf (";", offset);
      if (endstr == -1)
        endstr = document.cookie.length;
      return unescape(document.cookie.substring(offset, endstr));
    }
    
    
    //  Function to return the value of the cookie specified by "name".
    //    name -    String object containing the cookie name.
    //    returns - String object containing the cookie value,
    //              or null if the cookie does not exist.
    //
    function GetCookie (name) {
      var arg = name + "=";
      var alen = arg.length;
      var clen = document.cookie.length;
      var i = 0;
      while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg)
          return getCookieVal (j);
    	i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break; 
      }
      return null;
    }
    
    
    //  Function to create or update a cookie.
    //    name - String object containing the cookie name.
    //    value - String object containing the cookie value.  May contain
    //         any valid string characters.
    //    [expires] - Date object containing the expiration data of the cookie.  If
    //         omitted or null, expires the cookie at the end of the current session.
    //    [path] - String object indicating the path for which the cookie is valid.
    //         If omitted or null, uses the path of the calling document.
    //    [domain] - String object indicating the domain for which the cookie is
    //         valid. If omitted or null, uses the domain of the calling document.
    //    [secure] - Boolean (true/false) value indicating whether cookie
    //         transmission requires a secure channel (HTTPS).  
    //
    //  The first two parameters are required.  The others, if supplied, must
    //  be passed in the order listed above.  To omit an unused optional field,
    //  use null as a place holder.  For example, to call SetCookie using name,
    //  value and path, you would code:
    //
    //      SetCookie ("myCookieName", "myCookieValue", null, "/");
    //
    //  Note that trailing omitted parameters do not require a placeholder.
    //
    //  To set a secure cookie for path "/myPath", that expires after the
    //  current session, you might code:
    //
    //      SetCookie (myCookieVar, cookieValueVar, null, "/myPath", null, true);
    //
    
    function SetCookie (name,value,expires,path,domain,secure) {
      document.cookie = name + "=" + value+
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
    }
    
    
    //  Function to delete a cookie. (Sets expiration date to start of epoch)
    //    name -   String object containing the cookie name
    //    path -   String object containing the path of the cookie to delete.
    //             This MUST be the same as the path used to create the cookie, or
    //             null/omitted if no path was specified when creating the cookie.
    //    domain - String object containing the domain of the cookie to delete.
    //             This MUST be the same as the domain used to create the cookie, or
    //             null/omitted if no domain was specified when creating the cookie.
    //
    function DeleteCookie (name,path,domain) {
      if (GetCookie(name)) {
        document.cookie = name + "=" +
          ((path) ? "; path=" + path : "") +
          ((domain) ? "; domain=" + domain : "") +
          "; expires=Thu, 01-Jan-70 00:00:01 GMT";
      }
    }
  

function definirCookie()
{
var coo=document.cookie;
var along=coo.split(";");
var eff=along[0].split("=");
if (along.length>19){ if (confirm('Vous ne pouvez pas enregistrer plus de 20 grilles !\nLa grille '+eff[0]+' sera effacée;'))
					{DeleteCookie (eff[0]);}
					else {return;}}

var maintenant = new Date();
var fin_cookie = new Date(maintenant.getTime() +(365*24*60*60*1000));

var gr=new String();
for(i=0; i<a; i++){for (j=0; j<b; j++){if (window.document.change[b*i+j].value==''){gr+='?';}
					else {gr+=window.document.change[b*i+j].value;}	

					}
					}
SetCookie(num_cookie,gr,fin_cookie);
if (document.cookie) {alert('La grille a été sauvegardée');}
else {alert('Votre navigateur n\'accepte pas les cookies !\nAucune sauvegarde ne peut être réalisée.');}
}

function lireCookie()
{
	if (document.cookie) {
var lit=GetCookie(num_cookie);
for(i=0; i<a; i++){for (j=0; j<b; j++){if(lit.charAt(b*i+j)=='?') {window.document.change[b*i+j].value='';} 					
					else {window.document.change[b*i+j].value=lit.charAt(b*i+j);}	
				}
				}

}}


function imprime(titre,romain,grille,definitions_horizontales,definitions_verticales,grille)
{
a=grille.length;
b=grille[0].length;
impr=open("","imprimer","scrollbars=yes,toolbar=yes,menubar=yes,status=yes,resizable=yes,top=50,left=50,width=800,height=450");
impr.document.writeln("<html>");
impr.document.writeln("<head>");
impr.document.writeln("<meta http-equiv=\"content-type\" content=\"text/html;charset=ISO-8859-1\">");
impr.document.writeln("<style type=\"text/css\">");
impr.document.writeln("<!--p.def {font-family: Arial,serif; font-size:13px;  margin: 10px 10px 0px 0px } -->");
impr.document.writeln("</style>");
impr.document.writeln("</head>");
impr.document.writeln("<body>");


impr.document.write("<font face=\"Arial\"><h3>");
impr.document.write(titre);
impr.document.write("</h3></font>");
	// Problème *****************
impr.document.write("<table border=0 width=100% cellpadding=0 cellspacing=0 style=\"border-collapse: collapse\" bordercolor=#000000><tr><td valign=top><p style=\"margin-left: 10;\">");

// Grille*******************
impr.document.write("<table border=0  cellpadding=0 cellspacing=0 style=\"float: right; text-align:justify; border-collapse: collapse\" bordercolor=#000000>");
impr.document.write("<tr><td width=25 height=25 valign=middle align=center  style=\"border-style: solid; border-width: 0;\"> </td>");
for (j=0; j<b; j++) {
impr.document.write("<td width=25 style=\"font-family: Arial; color:\#000000; font-size: 8pt;\" height=25 valign=middle align=center  style=\"border-style: solid; border-width: 0;\"> ");	
impr.document.write(j+1);
impr.document.writeln("</td>");
}
impr.document.writeln("<td width=10 height=25 valign=middle align=center  style=\"border-style: solid; border-width: 0;\"> </td>");
impr.document.writeln("</tr>");
for (i=0; i<a; i++) {
impr.document.write("<tr><td width=25 height=25 valign=middle align=center  style=\"font-family: Arial; font-size: 8pt; border-style: solid; border-width: 0;\">");
impr.document.write(romain[i]);
impr.document.writeln("  </td>");
for(j=0; j<b; j++) {
	if(grille[i][j]!='.' && grille[i][j]!='&'){ind+=1;
	impr.document.write("<td width=25 height=25 valign=middle align=center  style=\"border-style: solid; border-width: 1;\">");
	impr.document.write("<p style=\"margin-top:0; margin-bottom:-1\"></p>");
	impr.document.writeln("</td>");
	}
	if (grille[i][j]=='.') {impr.document.write("<td  valign=middle align=center bgcolor=#000000 style=\"border-style: solid; border-width: 1;\">");
		impr.document.writeln("<img src='noir.gif' height=26 width=26 ></td>"); }
	if (grille[i][j]=='&') {impr.document.write("<td  valign=middle align=center bgcolor=#ffffff style=\"border-style: solid; border-width: 0;\">");
		impr.document.writeln("</td>"); }
	
 }

impr.document.writeln("<td width=10 height=25 valign=middle align=center  style=\"border-style:solid; border-width:0;\"> </td>");

impr.document.writeln("</tr>");}
impr.document.write("<tr><td height=5 colspan=");
impr.document.write(b+1);
impr.document.writeln("></td></tr>");

impr.document.writeln("</table><p class=\"def\">");
impr.document.writeln("<b><span style=\"vertical-align:-5\">Horizontalement.</span><br><span style=\"vertical-align:+2\"><span style=\"font-size:1\"></span></span>");
var position=0;
impr.document.write("</b>");
for(i=0; i<def_hor.length; i++){
	impr.document.write("<b> ");
	impr.document.write(romain[position]);
	impr.document.write(".</b>&nbsp;");
	impr.document.writeln(def_hor[i]);
	position+=1;
}

impr.document.writeln("<span style='vertical-align:-8'><br></span><b><span style='vertical-align:-5'>Verticalement.</span><br><span style='vertical-align:+2'><span style='font-size:1'></span></span>");
var position2=1;
impr.document.write("</b>");
for(i=0; i<def_ver.length; i++){
	impr.document.write("<b> ");
	impr.document.write(position2);
	impr.document.write(".</b>&nbsp;");
	impr.document.writeln(def_ver[i]);
	position2+=1;
}

impr.document.writeln("<br> </td></tr></table></body></html>");
impr.document.close();

}
function donner_sol()
{for(i=0; i<a; i++){for (j=0; j<b; j++){window.document.change[b*i+j].style.background=couleur_case; var t=j+b*i; grille[i][j]=donnee.charAt(t);
if (grille[i][j]!='.') {if (ou[b*i+j]!='1' && ou[b*i+j]!='2'){window.document.change[b*i+j].value=grille[i][j]; window.document.change[b*i+j].style.color=couleur_texte_grille;}
			if (ou[b*i+j]=='1') {window.document.change[b*i+j].value=grille[i][j]; window.document.change[b*i+j].style.color='#990000'; window.document.change[b*i+j].className='deux';}
			if (ou[b*i+j]=='2') {window.document.change[b*i+j].value=grille[i][j]; window.document.change[b*i+j].style.color='#009900'; window.document.change[b*i+j].className='deux';}
			}
}}
}


function purge()
{for(i=0; i<a; i++){for (j=0; j<b; j++){window.document.change[b*i+j].style.background=couleur_case; var t=j+b*i; grille[i][j]=donnee.charAt(t);
if (window.document.change[b*i+j].value!=grille[i][j] && window.document.change[b*i+j].value!='') {window.document.change[b*i+j].value='';}
}}
window.document.change[b*curseur[0]+curseur[1]].value=window.document.change[b*curseur[0]+curseur[1]].value;
}

function efface()
{for (i=0; i<a; i++){for (j=0; j<b; j++) {window.document.change[b*i+j].value=''; window.document.change[b*i+j].className='un';}}
window.document.change.a00.focus();
DeleteCookie (num_cookie);
}

function efface_mot()
{if (ordre_tab==1) {
var avant=0; var apres=0;
for (k=1; k<curseur[1]+1; k++) {if(grille[curseur[0]][curseur[1]-k]!='.' && grille[curseur[0]][curseur[1]-k]!='&'){avant+=1; } else{break;}};
for (k=1; k<b-curseur[1]; k++) {if(grille[curseur[0]][curseur[1]+k]!='.' && grille[curseur[0]][curseur[1]+k]!='&'){apres+=1; } else{break;}};
for (i=1; i<avant+1; i++) {window.document.change[curseur[0]*b+curseur[1]-i].style.color=couleur_texte_grille;window.document.change[curseur[0]*b+curseur[1]-i].value='';}
for (i=1; i<apres+1; i++) {window.document.change[curseur[0]*b+curseur[1]+i].style.color=couleur_texte_grille;window.document.change[curseur[0]*b+curseur[1]+i].value='';}}

if (ordre_tab==0) {
var dessus=0; var dessous=0;
for (k=1; k<curseur[0]+1; k++) {if(grille[curseur[0]-k][curseur[1]]!='.'  && grille[curseur[0]-k][curseur[1]]!='&'){dessus+=1; } else{break;}};
for (k=1; k<a-curseur[0]; k++) {if(grille[curseur[0]+k][curseur[1]]!='.' && grille[curseur[0]+k][curseur[1]]!='&'){dessous+=1; } else{break;}};
for (i=1; i<dessus+1; i++) {window.document.change[curseur[0]*b+curseur[1]-b*i].style.color=couleur_texte_grille;window.document.change[curseur[0]*b+curseur[1]-b*i].value='';}
for (i=1; i<dessous+1; i++) {window.document.change[curseur[0]*b+curseur[1]+i*b].style.color=couleur_texte_grille;window.document.change[curseur[0]*b+curseur[1]+i*b].value='';}}
window.document.change[curseur[0]*b+curseur[1]].style.color=couleur_texte_grille;window.document.change[curseur[0]*b+curseur[1]].value='';
}


var ordre_tab=1;
var nombre_lettres=0;
function ordre_tabulation()
{
if (ordre_tab==0) {ordre_tab=1; mot(); }
else {ordre_tab=0; mot(); }
window.document.change[(curseur[0]*b+curseur[1])%(a*b)].focus();
}

function mot()
{

for(i=0; i<a; i++){	
for (j=0; j<b; j++){window.document.change[b*i+j].style.background=couleur_case;}}
window.document.change[curseur[0]*b+curseur[1]].style.background=couleur_curseur;
if (ordre_tab==1) {
	for(i=0;i<a; i++){document.getElementById('def_'+i).style.color='#000000';document.getElementById('def_'+i).className='un';}
for(i=0;i<b; i++){document.getElementById('def_ver'+i).style.color='#000000';document.getElementById('def_ver'+i).className='un';}
var avant=0; var apres=0;
for (k=1; k<curseur[1]+1; k++) {if(grille[curseur[0]][curseur[1]-k]!='.' && grille[curseur[0]][curseur[1]-k]!='&'){avant+=1; } else{break;}};
for (k=1; k<b-curseur[1]; k++) {if(grille[curseur[0]][curseur[1]+k]!='.' && grille[curseur[0]][curseur[1]+k]!='&'){apres+=1; } else{break;}};

for (i=1; i<avant+1; i++) {window.document.change[curseur[0]*b+curseur[1]-i].style.color=couleur_texte_grille;window.document.change[curseur[0]*b+curseur[1]-i].style.background=couleur_mot;}
for (i=1; i<apres+1; i++) {window.document.change[curseur[0]*b+curseur[1]+i].style.color=couleur_texte_grille;window.document.change[curseur[0]*b+curseur[1]+i].style.background=couleur_mot;}}
document.getElementById('def_'+curseur[0]).className='deux'; document.getElementById('def_'+curseur[0]).style.color='#990000'; 
document.getElementById('def_ver'+curseur[1]).className='deux'; document.getElementById('def_ver'+curseur[1]).style.color='#009900';
if (ordre_tab==0) {
	for(i=0;i<a; i++){document.getElementById('def_'+i).style.color='#000000';document.getElementById('def_'+i).className='un';}
for(i=0;i<b; i++){document.getElementById('def_ver'+i).style.color='#000000';document.getElementById('def_ver'+i).className='un';}
var dessus=0; var dessous=0;
for (k=1; k<curseur[0]+1; k++) {if(grille[curseur[0]-k][curseur[1]]!='.' && grille[curseur[0]-k][curseur[1]]!='&'){dessus+=1; } else{break;}};
for (k=1; k<a-curseur[0]; k++) {if(grille[curseur[0]+k][curseur[1]]!='.' && grille[curseur[0]+k][curseur[1]]!='&'){dessous+=1; } else{break;}};
for (i=1; i<dessus+1; i++) {window.document.change[curseur[0]*b+curseur[1]-b*i].style.color=couleur_texte_grille;window.document.change[curseur[0]*b+curseur[1]-b*i].style.background=couleur_mot;}
for (i=1; i<dessous+1; i++) {window.document.change[curseur[0]*b+curseur[1]+i*b].style.color=couleur_texte_grille;window.document.change[curseur[0]*b+curseur[1]+i*b].style.background=couleur_mot;}
document.getElementById('def_ver'+curseur[1]).className='deux'; document.getElementById('def_ver'+curseur[1]).style.color='#990000';
document.getElementById('def_'+curseur[0]).className='deux';  document.getElementById('def_'+curseur[0]).style.color='#009900';
}

}

function donne_mot()
{
for(i=0; i<a; i++){for (j=0; j<b; j++){window.document.change[b*i+j].style.background=couleur_case;}}
window.document.change[curseur[0]*b+curseur[1]].style.background=couleur_curseur;
if (ordre_tab==1) {
var avant=0; var apres=0;
for (k=1; k<curseur[1]+1; k++) {if(grille[curseur[0]][curseur[1]-k]!='.' && grille[curseur[0]][curseur[1]-k]!='&'){avant+=1; } else{break;}};
for (k=1; k<b-curseur[1]; k++) {if(grille[curseur[0]][curseur[1]+k]!='.' && grille[curseur[0]][curseur[1]+k]!='&'){apres+=1; } else{break;}};

for (i=1; i<avant+1; i++) {window.document.change[curseur[0]*b+curseur[1]-i].style.background=couleur_mot; window.document.change[curseur[0]*b+curseur[1]-i].value=grille[curseur[0]][[curseur[1]-i]];}
for (i=1; i<apres+1; i++) {window.document.change[curseur[0]*b+curseur[1]+i].style.background=couleur_mot;window.document.change[curseur[0]*b+curseur[1]+i].value=grille[curseur[0]][[curseur[1]+i]];}
window.document.change[curseur[0]*b+curseur[1]].value=grille[curseur[0]][[curseur[1]]]}

if (ordre_tab==0) {
var dessus=0; var dessous=0;
for (k=1; k<curseur[0]+1; k++) {if(grille[curseur[0]-k][curseur[1]]!='.' && grille[curseur[0]-k][curseur[1]]!='&'){dessus+=1; } else{break;}};
for (k=1; k<a-curseur[0]; k++) {if(grille[curseur[0]+k][curseur[1]]!='.' && grille[curseur[0]+k][curseur[1]]!='&'){dessous+=1; } else{break;}};
for (i=1; i<dessus+1; i++) {window.document.change[curseur[0]*b+curseur[1]-b*i].style.background=couleur_mot;window.document.change[curseur[0]*b+curseur[1]-b*i].value=grille[curseur[0]-i][curseur[1]];}
for (i=1; i<dessous+1; i++) {window.document.change[curseur[0]*b+curseur[1]+i*b].style.background=couleur_mot;window.document.change[curseur[0]*b+curseur[1]+b*i].value=grille[curseur[0]+i][curseur[1]];}
window.document.change[curseur[0]*b+curseur[1]].value=grille[curseur[0]][[curseur[1]]];}
}

function donne_lettre()
{window.document.change[curseur[0]*b+curseur[1]].value=grille[curseur[0]][[curseur[1]]];}

var nav;
function init()
{
if (document.layers){ nav="NE";}
if (document.getElementById){nav="NE6";}
if (document.all){nav="IE";}
return(nav);
}

function fin()
{ 
var ch=""; 
ch+='<Table bgcolor='+couleur_fond_felicite+'  width=150 height=100  border=1  bordercolor='+couleur_cadre_felicite+' cellpadding=0 cellspacing=0>';
ch+='<tr height=40 ><td align="center" style="border: 0px solid '+couleur_texte_felicite+';">';
ch+='<font face="Arial" size=2>';
ch+='Félicitations !</FONT></td></TR></table>';
if (nav=="IE") {his.innerHTML=ch;} 
if (nav=="NE6") {document.getElementById('his').innerHTML =ch;}
document.getElementById("his").style.visibility="visible";
}



function ordre()
{ 
var nombre_justes=0;
window.document.change[curseur[0]*b+curseur[1]].value=window.document.change[curseur[0]*b+curseur[1]].value.toUpperCase();
for(i=0; i<a; i++){for (j=0; j<b; j++){ if (window.document.change[b*i+j].value==grille[i][j]) {nombre_justes+=1; }}}
if (nombre_justes==nombre_lettres) {init(); fin(); nombre_justes=0; return}
if (ordre_tab==1) 
{
if (curseur[1]!=b-1) {
	if (grille[curseur[0]][(curseur[1]+1)%b]!='.' ){window.document.change[(curseur[0]*b+curseur[1]+1)%(a*b)].focus();}
	if (grille[curseur[0]][(curseur[1]+1)%b]=='.' ){window.document.change[curseur[0]*b+curseur[1]].value=window.document.change[curseur[0]*b+curseur[1]].value.toUpperCase();}
	}
}
if (ordre_tab==0) 
{
if (curseur[0]!=a-1) {
	if (grille[(curseur[0]+1)%a][curseur[1]]!='.' ){window.document.change[(curseur[0]*b+curseur[1]+b)%(a*b)].focus();}
	if (grille[(curseur[0]+1)%a][curseur[1]]=='.' ){window.document.change[curseur[0]*b+curseur[1]].value=window.document.change[curseur[0]*b+curseur[1]].value.toUpperCase();}
	}
}
}
var def_hor=new Array();
def_hor[0]=new String();
var def_ver=new Array();
def_ver[0]=new String();
function ouvre()
{
var tampon=0; var tampon2=0;
for(i=0; i<definitions_horizontales.length; i++){
	if (definitions_horizontales.charAt(i)!='/') {def_hor[tampon]+=definitions_horizontales.charAt(i); }
	else {def_hor[tampon+1]=new String(); tampon+=1; }
	}
for(i=0; i<definitions_verticales.length; i++){
	if (definitions_verticales.charAt(i)!='/') {def_ver[tampon2]+=definitions_verticales.charAt(i); }
	else {def_ver[tampon2+1]=new String(); tampon2+=1; }
	}


for(i=0; i<solution.length; i++) {if (solution.charAt(i)!='.' && solution.charAt(i)!=','){nombre_lettres+=1;}}
for (i=0; i<a; i++) {grille[i]=new Array(); for(j=0; j<b; j++) {grille[i][j]='';}}

solution=solution.toUpperCase();
for(j=0; j<solution.length; j++) {if (solution.charAt(j)!=','){donnee+=solution.charAt(j);};}

for(i=0; i<a; i++){for (j=0; j<b; j++){var t=j+b*i; grille[i][j]=donnee.charAt(t);}}

a=grille.length;
b=grille[0].length;



window.document.write("<form name='change'>");

	// Problème *****************
window.document.write("<p style=\"margin-left:20;\" ><table border='1' bordercolor=\"#990000\" width='630px' style='color: ");
window.document.write(couleur_texte);
window.document.write(";' cellpadding='0' cellspacing='0'  style='border-collapse: collapse' bordercolor='#000000' ><tr><td valign='top'><p style='margin-right: 10;'>");

// Grile*******************
window.document.write("<table border='0' cellpadding='0' cellspacing='0' style='float: right; margin-bottom: 15; margin-top: 15; margin-left: 15; border-collapse: collapse' bordercolor='#000000'>");
window.document.write("<tr><td width='25' height='25' valign='middle' align='center'  style='border-style: solid; border-width: 0;'>&nbsp;</td>");
for (j=0; j<b; j++) {
window.document.write("<td width='25' style='font-family: Arial; color: ");
window.document.write(couleur_texte);
window.document.write("; font-size: 8pt;' height='25' valign='middle' align='center'  style='border-style: solid; border-width: 0;'>&nbsp;");	
window.document.write(j+1);
window.document.write("</td>");
}
window.document.write("<td width='10' height='25' valign='middle' align='center'  style='border-style: solid; border-width: 0;'>&nbsp;</td>");

window.document.write("</tr>");

for (i=0; i<a; i++) {
window.document.write("<tr><td width='25' height='25' valign='middle' align='right'  style='font-family: Arial; color: ");
window.document.write(couleur_texte);
window.document.write("; font-size: 8pt; border-style: solid; border-width: 0;'>");
window.document.write(romain[i]);
window.document.write("&nbsp;&nbsp;</td>");
for(j=0; j<b; j++) {
	if(grille[i][j]!='.' && grille[i][j]!='&'){ind+=1;
	window.document.write("<td width='25' height='25' valign='middle' align='center'  style=\"border-style:solid; border-width:1px\">");
	window.document.write("<p style=\"margin-top:0;\"><input type='text' class='un' tabindex='-1' name='a");
	window.document.write(i);
	window.document.write(j);
	window.document.write("' ");
	window.document.write(" size='5' style='height:25; width:25; text-align:center;  font-family: Arial;  font-size: 10pt; border-style: solid; border-width: 0; padding-left: 4; padding-right: 4; padding-top: 5; padding-bottom:0; text-align:center' value='' maxlength='1' onfocus='javascript: this.style.background=\"");
	window.document.write(couleur_curseur);
	window.document.write("\";  curseur[0]=");
	window.document.write(i);
	window.document.write("; curseur[1]=");
	window.document.write(j);
	window.document.write("; position=");
	window.document.write(ind);
	window.document.write("; this.style.color=\"");
	window.document.write(couleur_texte_curseur);
	window.document.write("\"; this.value=this.value.toUpperCase(); this.select(); mot();' onBlur='javascript:this.style.color=\"");
	window.document.write(couleur_texte_grille);
	window.document.write("\"' ondblclick='javascript:ordre_tabulation(); this.style.background=\"");
	window.document.write(couleur_curseur);
	window.document.write("\"' onChange='javascript:this.style.color=\"");
	window.document.write(couleur_texte_grille);
	window.document.write("\"; ' onKeyup='javascript:ordre();'></p>");
	window.document.write("</td>");
	}
	if (grille[i][j]=='.') {window.document.write("<td  valign='middle' align='center' bgcolor=#000000 style=\"border-style:solid; border-width:1px;\">");
	window.document.write("<input type='hidden' name='a");
	window.document.write(i);
	window.document.write(j);
	window.document.write("' size='1' tabindex=-1 style='height:25; width:25;  background-color:#000000; font-family: Arial; font-size: 8pt; border-style: solid; border-width: 0; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1; text-align:center' value='' maxlength='1'>");

	window.document.write("<img src='noir.gif' height='25' width='25' ></td>"); }
	if (grille[i][j]=='&') {window.document.write("<td  valign='middle' align='center' bgcolor=#ffffff style=\"border-style:solid; border-width:0px;\">");
	window.document.write("<input type='hidden' name='a");
	window.document.write(i);
	window.document.write(j);
	window.document.write("' size='1' tabindex=-1 style='height:25; width:25;  background-color:#ffffff; font-family: Arial; font-size: 8pt; border-style: solid; border-width: 0; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1; text-align:center' value='' maxlength='1'>");

	window.document.write("</td>"); }
 }
window.document.write("<td width='10' height='25' valign='middle' align='center'  style='border-style: solid; border-width: 0;'>&nbsp;</td>");


window.document.write("</tr>");}

window.document.write("</table><p style='font-family: Arial; text-align:justify; font-size: 10pt; margin-top:15px; margin-right:10px; margin-left:10px;'>");
window.document.write("<b><span style='vertical-align:-5'>Horizontalement.</span><br><span style='vertical-align:+2'><span style='font-size:1'></span></span>");
var position=0;
window.document.write("</b>");
for(i=0; i<def_hor.length; i++){
	window.document.write("<span style=\"color:#000000;\" class=\"un\"  id=\"def_");
	window.document.write(i);
	window.document.write("\">"); 
	window.document.write("<b> ");
	window.document.write(romain[position]);
	window.document.write(".</b>&nbsp;");
	window.document.write(def_hor[i]);
	window.document.write("</span>"); 
	position+=1;
}

window.document.write("<span style='vertical-align:-8'><br></span><b><span style='vertical-align:-5'>Verticalement.</span><br><span style='vertical-align:+2'><span style='font-size:1'></span></span>");
var position2=1;
window.document.write("</b>");
for(i=0; i<def_ver.length; i++){
	window.document.write("<span class=\"un\" style=\"color:#000000;\" id=\"def_ver");
	window.document.write(i);
	window.document.write("\">"); 
	window.document.write("<b> ");
	window.document.write(position2);
	window.document.write(".</b>&nbsp;");
	window.document.write(def_ver[i]);
	window.document.write("</span>"); 
	position2+=1;
}

window.document.write("<br>&nbsp;</td></tr></table>");
window.document.write("</form>");
window.document.write("<br>");
window.document.write("<div id=\"his\" style=\"position:absolute;  left:50px; top:200px; visibility:hidden;\" onClick=\"javascript:document.getElementById('his').style.visibility='hidden';\"></div>"); 

}
