function check_chaines ()
{
	var Chaines_Internaute;
	var Chaines;
	var i,j,notskip;
	var buf_chaines;
	var SendCookie = false; 
	var MyDate = new Date(2032,01,01);
	var expires = 'expires=' + MyDate.toGMTString();
	var path = 'path=/' ;
	var domaine = 'dommain=' + HTTP_HOST ;
	var MyCookie = '' ;

	noskip = false;
	buf_chaines = '';
	SendCookie = false;
	
	cookies = document.cookie.split(/; /) ;
	
	for (i=0 ; i< cookies.length;i++ ) 
	{
		cookies[i] = cookies[i].split(/=/);
		cookies[i][1] = unescape(cookies[i][1]);
	}
	
	for (k=0 ; k< cookies.length;k++ ) {
		if( cookies[k][0] == 'Chaines_Internaute' ) {
			Chaines_Internaute = cookies[k][1].split(/,/);
			Chaines = Chaines_Client.split(/,/) ;
			
			for (i=0 ; i< Chaines_Internaute.length || Chaines_Internaute.length == 0;i++ ) {
				for (j=0; j < Chaines.length;j++)
					if ( Chaines_Internaute[i] == Chaines[j] )
						notskip = true;
				
				if (notskip) {
					if ( buf_chaines.length == 0)	buf_chaines = Chaines_Internaute[i];
					else	buf_chaines = buf_chaines + ',' + Chaines_Internaute[i];
					notskip = false;
				}
				else
					SendCookie = true;
			}
		
			if (SendCookie) {
				SendCookie = false;
		        MyCookie = "Chaines_Internaute="+ escape(buf_chaines) ;
		        MyCookie = MyCookie +";"+path ;
		        MyCookie = MyCookie +";"+expires ;
				//alert ( MyCookie.length  ) ;
		        document.cookie = MyCookie ;
		        document.location='index.php?refresh=Chaines_Internaute';
		        break;
			}
		}
	}
}

