<!--
function xiti_med(type,section,page,x1,x2,x3,x4,x5)
{
	xt_img = new Image();
	xt_ajout = (type=="F") ? "" : (type=="M") ? "&a="+x1+"&m1="+x2+"&m2="+x3+"&m3="+x4+"&m4="+x5 : "&clic="+x1;
	Xt_im = xitihitter+'?s='+xtsite+'&s2='+section;
	Xt_im += '&p='+page+xt_ajout+'&hl=' + xtdate.getHours() + 'x' + xtdate.getMinutes() + 'x' + xtdate.getSeconds();
	if(parseFloat(navigator.appVersion)>=4)
	{Xt_im += '&r=' + xts.width + 'x' + xts.height + 'x' + xts.pixelDepth + 'x' + xts.colorDepth;}
	xt_img.src = Xt_im;
	if ((x2 != null)&&(x2!=undefined)&&(type=="C"))
	{ if ((x3=='')||(x3==null)) { document.location = x2} else {xfen = window.open(x2,'xfen',''); xfen.focus();}}
	else
	{return;}
}

function popup(url)
{
	var pop=window.open(url, 'home', 'toolbar=no,status=no,width=850,height=650,resizable=yes, scrolling=yes,scrollbars=yes');
	pop.focus();
}

function pop(burl,bname,bwidth,bheight)
{
	var pop=window.open(burl, bname, 'toolbar=no,status=no,scrolling=yes,scrollbars=yes,width=' + bwidth + ',height=' + bheight);
	pop.focus();
}

function popEdit(burl,bname,bwidth,bheight)
{
	var pop=window.open(burl, bname, 'toolbar=no,status=no,scrolling=yes,scrollbars=yes,resizable=yes,width=' + bwidth + ',height=' + bheight);
	pop.focus();
}

function poppi(burl,bname,bwidth,bheight)
{
	var pop=window.open(burl, bname, 'toolbar=no,menubar=yes,status=no,scrolling=yes,scrollbars=yes,width=' + bwidth + ',height=' + bheight);
	pop.focus();
}

function popsquare(burl,bname,bwidth,bheight)
{
	var pop=window.open(burl, bname, 'toolbar=no,menubar=no,status=no,scrolling=no,scrollbars=no,width=' + bwidth + ',height=' + bheight);
	pop.focus();
}

function popGS(burl)
{
	var pop=window.open(burl, 'ApplyOnline', 'top=25,left=25, width=750, height=550, toolbar=0, location=0, directories=0,status=0, menubar=0, resizable=0');
	pop.focus();
}

function changeUrl(url)
{
	if (url!="") window.location=url;
}

function onChangeLogin()
{
	document.entry.login.value = document.entry.login.value.toLowerCase();
}

function go_storefavlanguage(url, slang)
{
	var str = "";

	if ( slang == "de" ) str = "Möchten Sie diese Sprache als Standard beibehalten?";
	if ( slang == "en" ) str = "Do you want to store it as your default language?";
	if ( slang == "fr" ) str = "Souhaitez-vous garder cette langue comme langue par défaut ?";
	if ( slang == "nl" ) str = "Wenst u de volgende keer automatisch op te starten in het Nederlands?";
	if ( slang == "zh" ) str = "您是否希望以設定的語言顯示網頁？";

	var where_to = confirm( str );
	if (where_to == true)
	{
		if ( -1 != url.indexOf("?") )
		{
			url = url + "&storecookiefavlng=true";
		}
		else
		{
			url = url + "?storecookiefavlng=true";
		}
	}

	window.location=url;
}

function go_select(guid,pnum)
{
	changeUrl(pv_AP+'/layout.jsp?cnts='+guid+'&strSelectView=CONTENT-SELECT&strPageView='+pnum);
}

function go_zoom(guid,pnum)
{
	popup(pv_AP+'/slide_zoom.jsp?cnt='+guid+'&strPageView='+pnum);
}

function go_video(guid,pnum)
{
	popup(pv_AP+'/slide_video.jsp?cnt='+guid+'&strPageView='+pnum);
}

function go_download(guid,pnum)
{
	popup(pv_AP+'/slide_download.jsp?cnt='+guid+'&strPageView='+pnum);
}

function go(url)
{
  var strWarning = g_AlertExitCorp;

  if (url!="")
  {
	if (confirm(strWarning))
	{
		iurl = pv_AP+"/externalcall.jsp?"
		iurl = iurl + "ulg=" + pv_ULG;
		iurl = iurl + "&turl=" + escape(url);

		if (g_doXiti)
		{
			xiti_med('C',g_XitiS2,url, 'S');
		}
	window.open(iurl,'extLink','')
	}
  }
}

function go_out(url)
{
  var strWarning = g_AlertExitCorp;

  if (url!="")
  {
	if (confirm(strWarning))
	{
		iurl = pv_AP+"/externalcall.jsp?"
		iurl = iurl + "ulg=" + pv_ULG;
		iurl = iurl + "&turl=" + escape(url);

		if (g_doXiti)
		{
			xiti_slot_external(url, g_XitiPageString);
		}
	window.open(iurl,'extLink','')
	}
  }
}

function go_filiales(url)
{
  var strWarning = g_AlertExitLocal;

  if (url!="")
  {
	if (confirm(strWarning))
	{
		iurl = pv_AP+"/externalcall.jsp?"
		iurl = iurl + "ulg=" + pv_ULG;
		iurl = iurl + "&turl=" + escape(url);
		if (g_doXiti)
		{
			xiti_med('C',g_XitiS2,url, 'S');
		}
	window.open(iurl,'extLink','')
	}
  }
}

function go_corporate(url)
{
  var strWarning = g_AlertExitToCorporate;

  if (url!="")
  {
	if (confirm(strWarning))
	{
		iurl = pv_AP+"/externalcall.jsp?"
		iurl = iurl + "ulg=" + pv_ULG;
		iurl = iurl + "&turl=" + escape(url);
		if (g_doXiti)
		{
			xiti_med('C',g_XitiS2,url, 'S');
		}
	window.open(iurl,'extLink','')
	}
  }
}

//used in slot_permcon.inc
function go_in(url, cntId, catId, pageName)
{
  var strWarning = g_AlertExitLocal;

  if (url!="")
  {
	if (confirm(strWarning))
	{
		iurl = pv_AP+"/externalcall.jsp?";
		iurl = iurl + "ulg=" + pv_ULG;
		iurl = iurl + "&cntid=" + escape(cntId);
		iurl = iurl + "&catid=" + escape(catId);
		iurl = iurl + "&pagename=" + escape(pageName);
		iurl = iurl + "&turl=" + escape(url);

		if (g_doXiti)
		{
			xiti_slot_external(url, g_XitiPageString);
		}

	window.open(iurl,'extLink','');
	}
  }
}

function go_noalert(url)
{
  if (url!="")
  {
		iurl = pv_AP+"/externalcall.jsp?"
		iurl = iurl + "ulg=" + pv_ULG;
		iurl = iurl + "&turl=" + escape(url);

		if (g_doXiti)
		{
			xiti_med('C',g_XitiS2,url, 'S');
		}
	window.open(iurl,'extLink','')
  }
}

function go_without_alert(url, cntId, catId, pageName)
{
  if (url!="")
  {
		iurl = pv_AP+"/externalcall.jsp?"
		iurl = iurl + "ulg=" + pv_ULG;
		iurl = iurl + "&cntid=" + escape(cntId);
		iurl = iurl + "&catid=" + escape(catId);
		iurl = iurl + "&pagename=" + escape(pageName);
		iurl = iurl + "&turl=" + escape(url);

		if (g_doXiti)
		{
			xiti_slot_external(url, g_XitiPageString);
		}
	window.open(iurl,'extLink','')
  }
}

function checkNumericalValue(value){
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	
	if (anum.test(value))
	{
		testresult = true
	}
	else
	{
		alert("Entrez uniquement des chiffres")
		testresult = false
	}
return (testresult)
}

// transfers selected items from panel 1 to panel 2, thus adding documents to the selection
function add()
{
	var i, l1, l2;

	l1 = document.reg.docsAvailable.length;

	for (i=0; i<l1; i++)
	{
		if (document.reg.docsAvailable.options[i].selected == true)
		{
			l2 = document.reg.docsSelected.length;
			document.reg.docsSelected.options[l2] = new Option(document.reg.docsAvailable.options[i].text);
		}
	}

	for ( i = (l1 -1); i>=0; i--)
	{
    	if (document.reg.docsAvailable.options[i].selected == true )
    	{
        	document.reg.docsAvailable.options[i] = null;
        }
	}
}

// transfers selected items from panel 2 to panel 1, thus removing documents from the selection
function del()
{
	var i, l1, l2;

	l1 = document.reg.docsSelected.length;

	for (i=0; i<l1; i++)
	{
		if (document.reg.docsSelected.options[i].selected == true)
		{
			if (document.reg.docsSelected.options[i].value != '#')
			{
				l2 = document.reg.docsAvailable.length;
				document.reg.docsAvailable.options[l2] = new Option(document.reg.docsSelected.options[i].text);
			}
		}
	}

	for ( i = (l1 -1); i>=0; i--)
	{
    	if (document.reg.docsSelected.options[i].selected == true )
    	{
			if (document.reg.docsSelected.options[i].value != '#')
			{
           		document.reg.docsSelected.options[i] = null;
       	 	}
		}
	}
}

// checks the mandatory field for the selector and tranfers data
function makeDocumentSelector( sDocType, bMandatory )
{
	bReturned = false;
	document.reg.docs.value = "";
	
	// DOCUMENTSSELECTOR :: MULTIPLE selects display
	if ( sDocType == "DocumentsSelector" )
	{
		// MULTIPLE selects display
		if ( document.reg.docsSelected != undefined )
		{
			var l2 = document.reg.docsSelected.length;
			var doc;

			for (i=0; i<l2; i++)
			{
				if (document.reg.docsSelected.options[i].value != '#')
				{
					doc = document.reg.docsSelected.options[i].text;
					document.reg.docs.value += doc;

					if (i < (l2-1))	document.reg.docs.value += "|";
					
					bReturned = true;
				}
			}
		}	
	}
	
	// DOCUMENTSSELECTOR2 :: QUANTITY display
	if ( sDocType == "DocumentsSelector2" )
	{
		// Settings
		var iCnt = 1;
		var sTempCount;
		var sTempDocument;
		var iIntValue;	
		while ( iCnt )
		{
			sTempCount 	  = eval("document.reg.counter_" + iCnt);
			sTempDocument = eval("document.reg.document_" + iCnt);
	
			if ( sTempCount != undefined )
			{
				iIntValue = parseInt(sTempCount.value);
			
				if ( (!isNaN(iIntValue) ) && (iIntValue>0) ) 
				{
					if ( bReturned ) document.reg.docs.value += "|";
					
					document.reg.docs.value += parseInt(sTempCount.value) + " " + sTempDocument.value;
					
					bReturned = true;
				}
			}
			else break;
		
			iCnt++;
		}
	}
	
	// Not mandatory ?
	if ( !bMandatory ) bReturned = true;
	
	return bReturned;
}



//-------------------------------------------------------------------------------


//--------------------------------------------------------------
// xiti oriented functions to count slot clics in case of :
// - download of a document like the display of a pdf
// - navigation to another page of the current site
// - navigation to a page out of the current site
//--------------------------------------------------------------

function xiti_slot_download(slot_name, current_page, media_title, media_addr)
{
	clic_type = 'T';

	info = xiti_clic(clic_type, slot_name, "", current_page, media_title, true);

	xiti_med('C', g_XitiS2, info, clic_type);

	window.open(media_addr,'download','');
}

function xiti_slot_navigation(url, current_page, slot_name)
{
	clic_type = 'N';

	info = xiti_clic(clic_type, slot_name, "", current_page, "", true);

	xiti_med('C', g_XitiS2, info, clic_type);

	window.location=url;
}

function xiti_slot_external(url, current_page)
{
	clic_type = 'S';

	info = xiti_clic(clic_type, "", url, current_page, "", true);

	xiti_med('C', g_XitiS2, info, clic_type);
}

function xiti_clic(clic_type, slot_name, target_addr, current_page, media_title, isSlot)
{
	info_string = "";

	if (isSlot)
	{
		if (clic_type == 'S')
		{
			info_string = "slot_\\";
		}
		else
		{
			info_string = slot_name + "\\";
		}
	}

	if (clic_type == 'S')
	{
		if (target_addr != null)
		{
			info_string = info_string + target_addr;
		}
		info_string = info_string +  "\\";
	}

	if (current_page != null)
	{
		info_string = info_string + current_page;
	}


	if (clic_type == 'T')
	{
		info_string = info_string +  "\\";
		if (media_title != null)
		{
			info_string = info_string + media_title;
		}
	}
//	alert(info_string);
	return(info_string);

}

//--------------------------------------------------------------
// xiti oriented functions to count download in
// a non slot context
//--------------------------------------------------------------
function xiti_download(current_page, media_title, media_addr)
{
	clic_type = 'T';

	info = xiti_clic(clic_type, "", "", current_page, media_title, false);

	xiti_med('C', g_XitiS2, info, clic_type);

	window.open(media_addr,'download','');
}

function checkSearchValue( sDefaultSearch, sMessage )
{
	var oForm  = document.doSearch;
	var sValue = oForm.Search.value;
	
	if (sValue == sDefaultSearch || sValue.replace(/ /g, "") == "") alert( sMessage );
	else oForm.submit();
}


//-->
