
if (document.getElementById)
	{
	var tempo36;
	var iHtmlScript;
	var fromPub = 0;
	var anim02_OffSetyPub=0;
	var HauteurPub = 0;
	var place = fromPub;
	var xpub = 4;
	var ypub = 4;
	}


var calque;
var coorx;
var coory;
var overClassName;

function ie() {
	var f=window.event;   
	coory = f.y;
	coorx = f.x;      
}
function Init() {	
	document.onmousemove=ie;       
}
function voir (nom,src,posX, posY) {
	document.images[nom].src=src;
	calque = document.getElementById("menu1").style;
	calque.visibility = 'visible';
	if (posX==null) {
		posX = 0;
	}
	else {
		posX = coory + posX + document.body.scrollTop;
	}
	if (posY==null) {
dfdocument.images;
		posY = 0;
	}
	else {
		posY = coorx + posY;
	}
	calque.top	= posX;
	calque.left = posY;
}
function cache () {
	calque = document.getElementById("menu1").style;
	calque.visibility = 'hidden';
}

function openAttach(StrElement, StrKey, strPrefixe, strSubmit) {
	hauteur  = 400;
	largeur  = 400;
	var winl = 40;
	var wint = 40;
	winprops = 'height='+hauteur+',width='+largeur+',top='+wint+',left='+winl+',scrollbars=0,resizable=0';
	window.open(strPrefixe + "/Membres/Upload_SelectFile.aspx?Element=" + StrElement + "&Key=" + StrKey + "&submit=" + strSubmit, "popup", winprops);
}

function suppLien(StrElement) {
	window.document.forms["form_modif"].elements["Supp" + StrElement].value = "1";
	window.document.forms["form_modif"].elements[StrElement].value = "";
}

function changePays(listePays, strPrefixe, type) {
	if (type=="R") {
		window.open (strPrefixe + "/AlimPaysRegion.asp?Pays_Id=" +  listePays.item(listePays.selectedIndex).value, "detail");
	}
	if (type=="D") {
		window.open (strPrefixe + "/AlimPaysDept.asp?Pays_Id=" +  listePays.item(listePays.selectedIndex).value, "detail");
	}
}

function Highlight(e) {
    overClassName = e.className;
    e.className = "highlight";
}

function Unhighlight(e) {
    e.className = overClassName;

}

function OpenWindow(url, target, width, height, top, left, scrollbars) {

	window.open(url,target,'width=' + width + ',height=' + height + ',left=' + left + ',top='+ top + ',toolbar=no,location=no,status=no,menubar=no,resizable=no,scrollbars=' + scrollbars );
	return false;

}

function moverain(){
	for(move = 0; move < drops; move++){
		xx[move]+=movex;  yy[move]+=mv[move];
		hmm = Math.round(Math.random()*1);
		if(xx[move] < 0){
			xx[move] = maxx+10;
		}
		if(yy[move] > maxy){
			yy[move] = 10;
		}
		drop[move].left = xx[move]
		drop[move].top = yy[move]+document.body.scrollTop;
	}
	setTimeout('moverain()','1')
}

function BeginSnowRain() {
	if(snow){sym = snowsym; speed=1; angle=10; drops=howmany}
	else{sym = rainsym; speed=50; drops=howmany; angle=6}
	movex = -speed/angle; movey = speed; count = 0;


	if (document.all){
		drop = new Array(); xx = new Array(); yy = new Array(); mv = new Array()
		ly = "document.all[\'"; st = "\'].style"
		for(make = 0; make < drops; make++){
			document.write('<div id="drop'+make+'" class=drop>'+sym+'</div>');
			drop[make] = eval(ly+'drop'+make+st);
			maxx = document.body.clientWidth-40
			maxy = document.body.clientHeight-40
			xx[make] = Math.random()*maxx;
			yy[make] = -100-Math.random()*maxy;
			drop[make].left = xx[make]
			drop[make].top = yy[make]
			mv[make] = (Math.random()*5)+speed/4;
			drop[make].fontSize = (Math.random()*10)+5;
			if(snow){
				col = 'white'
			}
			else {
				col = 'blue'
			}
			drop[make].color = col;
		}
		window.onload=moverain
	}
}

function ShowTTip(value) {
	try {
		if (value!='') {
			toolTip.style.top  = window.event.clientY +  window.event.offsetY;
			toolTip.style.left = window.event.clientX + window.event.offsetX;

			toolTip.innerHTML = value;
			toolTip.style.visibility='visible';
		}
	}
	catch (error) {
	}
	
}

function HideTTip() {
	try {
		toolTip.style.visibility='hidden';
	}
	catch (error) {
	}

}		


function getSizeImage(img) {
	var ech = 1
	var nbrWidth = img.width;
	var nbrHeight = img.height;
	var echWidth = 500 / nbrWidth;

	if (echWidth<1) {
		ech = echWidth
	}
	
	img.width = nbrWidth * ech;
	img.height = nbrHeight * ech;

}

function anim02_RandomDep()
	{
	numimagePub= Math.round(Math.random()*8);
	numimagePub ++;
	return(numimagePub);
	}

function anim02_VolimPub()
	{
	if(document.all)
		{
		EcranlargPub = document.body.clientWidth// -iVolePub.width;
		EcranhautPub = document.body.clientHeight//-iVolePub.height;	
		}
	else
		{
		EcranlargPub = screen.width-100;
		EcranhautPub = screen.height-100;
		}
	if (document.getElementById)
		{
		if (place > EcranlargPub)
			xpub = (-(anim02_RandomDep()));
		if (place < fromPub)
			xpub = anim02_RandomDep();
		document.getElementById("pubBulle").style.left = (place += xpub);
		document.getElementById("pubBulle").style.top = (HauteurPub += ypub);
		if (HauteurPub>EcranhautPub)
			ypub = (-(anim02_RandomDep()));
		if (HauteurPub<0)
			ypub = anim02_RandomDep();
		tempo36 = setTimeout('anim02_VolimPub()', 50);
		}
	}

function anim02_OffSet()
	{
	if (navigator.appName=="Microsoft Internet Explorer")
   		anim02_OffSetyPub = document.body.scrollTop;
	}

function anim02_StopVol()
	{
	clearTimeout(tempo36);
	}
function anim02_StartVol()
	{
	tempo36 = setTimeout('anim02_VolimPub()', 50);
	}

function anim02_Show()
{
	if (document.getElementById)
	{
//		document.write('<DIV ID="pubBulle" STYLE="position:absolute; top:200px; left:-100px; z-indexpub:10"><A HREF="www.yahoo.fr" target="_blank"><IMG SRC="' + iVolePub.src + '" BORDER=0 HSPACE=0></A></DIV>');
		document.write('<DIV ID="pubBulle" STYLE="position:absolute; top:200px; left:-100px; z-indexpub:10">'+ iHtmlScript +'</DIV>');
	}
}


function GetLinkValues()
{
	if (SigForm.LstLiens.options.selectedIndex>=0) {

		var index    = SigForm.LstLiens.options.selectedIndex;
		var item	 = 0
		var strLiens = SigForm.StrLiens.value + ";";
		var strLien  = ""
		var strUrl   = ""
		for(i=strLiens.indexOf(";"); strLiens.indexOf(";")>0; i=strLiens.indexOf(";")) {
			if ((item/2) == index) {
				strLien  = strLiens.substr(0, i)
			}
			if (((item-1)/2) == index) {
				strUrl = strLiens.substr(0, i)
			}
			item++;
			strLiens = strLiens.substr(i+1);
		}
		SigForm.StrLien.value = strLien  ;
		SigForm.StrUrl.value = strUrl  ;
	}
}

function SetLinkValues()
{

	if (SigForm.LstLiens.options.selectedIndex>=0) {

		var index    = SigForm.LstLiens.options.selectedIndex;
		var item	   = 0;
		var strLiens = SigForm.StrLiens.value + ";";
		var strRes   = "";
		var i        = 0;
	
		for(i=strLiens.indexOf(";"); strLiens.indexOf(";")>0; i=strLiens.indexOf(";")) {
			if ((item/2) == index) {
				strRes += SigForm.StrLien.value + ";";
			}
			else if (((item-1)/2) == index) {
				strRes += SigForm.StrUrl.value + ";";
			}
			else {
				strRes += strLiens.substr(0, i+1);
			}
			item++;
			strLiens = strLiens.substr(i+1);
		}
		SigForm.StrLiens.value = strRes.substr(0, strRes.length-1);
		SigForm.LstLiens.options[SigForm.LstLiens.options.selectedIndex].text = SigForm.StrLien.value;
	}
}

function SuppLien()
{

	if (SigForm.LstLiens.options.selectedIndex>=0) {

		var index    = SigForm.LstLiens.options.selectedIndex;
		var strLiens = SigForm.StrLiens.value + ";";
		var item	   = 0;
		var strRes   = "";
		var i        = 0;
		
		for(i=strLiens.indexOf(";"); strLiens.indexOf(";")>0; i=strLiens.indexOf(";")) {
			if (((item/2) != index) && (((item-1)/2) != index)) {
				strRes += strLiens.substr(0, i+1);
			}
			item++;
			strLiens = strLiens.substr(i+1);
		}
		SigForm.StrLiens.value = strRes.substr(0, strRes.length-1);
		SigForm.LstLiens.remove(index);
		SigForm.StrLien.value = "";
		SigForm.StrUrl.value = "";
	}
}

function AddLien() 
{

	var index    = SigForm.LstLiens.options.selectedIndex;
	var item	   = 0;
	var strLiens = SigForm.StrLiens.value + ";";
	var strRes   = "";
	var i        = 0;
	var strLien  = "Nouveau lien"
	


	
	if (index>=0) {

		for(i=strLiens.indexOf(";"); strLiens.indexOf(";")>0; i=strLiens.indexOf(";")) {
			if ((item/2) == index) {
				strRes +=  strLien  + ";" + strLien + ";"
			}
			strRes += strLiens.substr(0, i+1);
			item++;
			strLiens = strLiens.substr(i+1);
		}
	}
	else {
		strRes = strLiens  + strLien  + ";" + strLien + ";";
	} 
	
	if (strRes.indexOf(";")==0) {
		strRes = strRes.substr(1);
	}
	
	SigForm.StrLiens.value = strRes.substr(0, strRes.length-1);
	opt = new Option(strLien, "", "", false, false);
	SigForm.LstLiens.add(opt,index);
	SigForm.LstLiens.options.selectedIndex = index;
	GetLinkValues();
}

function FormOnKeyDown() {


	try {
		
		var intCodeButton = event.keyCode;
			
		// Appui sur la touche Entrée
		if (intCodeButton==13) {
			if (l_strValidationObject!="") {
				window.document.getElementById(l_strValidationObject).click();
				event.cancelBubble=true;
				event.returnValue = false;
			}
		}

		// Appui sur la touche Escape
		if (intCodeButton==27) {
			if (l_strAnnulationObject!="") {
				if (event.srcElement.value=="") {
					window.document.getElementById(l_strAnnulationObject).click();
				}
				else
				{
					event.srcElement.value = "";
				}
			}
		}
		// Appui sur la touche Ctrl-H ou ctrl-h
		if (intCodeButton==72) {
			if (event.ctrlKey) {
				window.parent.document.getElementById("HyperLinkHelp").click();
				event.cancelBubble=true;
				event.returnValue = false;
			}
		}
		
	}
	
	catch (error) {
	}

}
