/* ouverture de fenêtre */
function openWindow(url, name, w, h, r, s, m, left, top) {
	popupWin = window.open(url, name, 'width=' + w + ',height=' + h + ',resizable=' + r + s + ',menubar=' + m + ',left=' + left + ',top=' + top);
}
// parameters available:
//      resizable (r),  location (l), directories (d), menubar (m)
//      status (st), toolbar (t), scrollbars (s), copyhistory (c)
/* fin de : ouverture de fenêtre */



/* swap menus */
if (document.images) {
	var menu1 = new Image();
	menu1.src = "/images/index/";
	var menu1_over = new Image();
	menu1_over.src = "/images/index/";
}

/* pour tous les swap 
attendue : nom de l image && nom de l image par defaut (qui restera OVER) */
function swapOver(imgName, defautImgName){
	if (document.images && defautImgName != imgName){
		document.images[imgIndex].src = eval(imgName + '_over.src');
	}
}
function swapOut(imgName, defautImgName){
	if (document.images && defautImgName != imgName){
		document.images[imgIndex].src = eval(imgName + '.src');
	}
}

/**
  * Function to open a CMS page into a pop-up
  * 
  * @param String href, location of page to open
  * @param integer id, page ID, for naming pop-up
  * @param integer width, pop-up width
  * @param integer height, pop-up height
  * @return window
  */
function CMS_openPopUpPage(href, id, width, height)
{
	if (href != "" && id > 0) {
		pagePopupWin = window.open(href, 'CMS_page_'+id, 'width='+width+',height='+height+',resizable=yes,menubar=no,left=0,top=0');
	}
}

/**
  * Function to open a CMS page into a pop-up
  * 
  * @param String href, location of page to open
  * @return auto-sized window
  */
function CMS_openPopUpImage(href)
{
	if (href != "") {
		pagePopupWin = window.open(href+'&popup=true', "popup", "width=20,height=20,resizable=yes,menubar=no,toolbar=no,scrollbars=yes,status=no,left=0,top=0");
	}
}

/** 
  * Opens pop up window with term definition in french
  *
  * @param integer _id, the ID of desired glossary Term
  * @param String _lang the current language codename for interface
  */
function openGlossary(_id)
{
	//Close any opened definition window
	if (typeof(glossaire)!='undefined'){
		glossaire.close();
	}
	openWindow('/pop_definition.php?id='+_id+'&lang=fr', 'glossaire', 400, 300, 'no', 'yes', 'no', 40, 40);
}