function Set_Cookie( name, value, expires, path, domain, secure )
{
	// set time, it's in milliseconds
	// code http://techpatterns.com/downloads/javascript_cookies.php
	var today = new Date();
	today.setTime( today.getTime() );
	
	/*
	if the expires variable is set, make the correct
	expires time, the current script below will set
	it for x number of days, to make it for hours,
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires )
	{
	expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	
	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
	( ( path ) ? ";path=" + path : "" ) +
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );

}

function Set_Cookie2( name, value, expires, path, domain, secure )
{
	// set time, it's in milliseconds
	// code http://techpatterns.com/downloads/javascript_cookies.php
	var today = new Date();
	today.setTime( today.getTime() );
	
	/*
	if the expires variable is set, make the correct
	expires time, the current script below will set
	it for x number of days, to make it for hours,
	delete * 24, for minutes, delete * 60 * 24
	*/
	//if ( expires )
	//{
var exp = new Date();     //set new date object
exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 30));
	document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + exp.toGMTString()); 
	


	alert(Get_Cookie('devise'))
}
// this function gets the cookie, if it exists
// don't use this, it's weak and does not handle some cases
// correctly, this is just to maintain legacy information
function Get_Cookie( name ) {

var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}
		
		// this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function hideDiv() { 

	if (document.getElementById) { // DOM3 = IE5, NS6 
	document.getElementById('hideshow').style.visibility = 'hidden'; 
	} 
	else { 
	if (document.layers) { // Netscape 4 
	document.hideshow.visibility = 'hidden'; 
	} 
	else { // IE 4 
	document.all.hideshow.style.visibility = 'hidden'; 
	} 
	} 
}
 
function showDiv() { 
	if (document.getElementById) { // DOM3 = IE5, NS6 
	document.getElementById('hideshow').style.visibility = 'visible'; 
	} 
	else { 
	if (document.layers) { // Netscape 4 
	document.hideshow.visibility = 'visible'; 
	} 
	else { // IE 4 
	document.all.hideshow.style.visibility = 'visible'; 
	} 
	} 
} 
function fermer_session()
{
	showHint("script/fermer_session.asp","c=bidon","bidon",0)

}
function ouvrir_session()
{
	// j'ai un problem lors de la suppression du cookies session
	
	showHint("script/ouvrir_session.asp","c=bidon","bidon",0)

}
// call dans cadre_login.asp
function aller_verifier_login()
{
	
	user_couriel =document.frm1.user_couriel.value
	user_password =document.frm1.user_password.value
	keep_info =""
	if (document.frm1.keep_info.checked==true) 
	{keep_info="ok" ;}
	
	query = "user_couriel=" + user_couriel + "&user_password=" + user_password + "&keep_info=" + keep_info
	ajaxSpace("verif_code.asp",query,"section_1",0)
	return false;
}
function sendPasse(courriel)
{

	ajaxSpace("script/sendPasse.asp","courriel=" + courriel,"section_2",0)
	
}
function changer_langue(langue)
{
	// j'ai un problem lors de la suppression du cookies session
	//showHint(page,str,divid,minimum)
	showHint("change_langue.asp","langue_site=" + langue ,"bidon",0)

}
function openPop(URL,largeur,hauteur,titre)
{
	NoCache=Math.random()
	
	// centrer la fenêtre
	if (typeof hauteur == 'undefined'){hauteur=650}
	if (typeof largeur == 'undefined'){largeur=650}
	
	largeurGrande2=screen.width
	hauteurGrande2 =screen.height
	
	posLeft = (largeurGrande2 / 2)-(largeur / 2)
	posTop = (hauteurGrande2 / 2)-(hauteur / 2)
	
	
	var winpop;
	winpop = window.open(URL,'A','toolbar=0,location=0,resizable=1,menubar=0,status=0,scrollbars=1,width='+largeur+',height='+hauteur+',top='+posTop+',left='+posLeft);	
	
	if (window.focus) {winpop.focus()}

	

}

