/*
function Get_object_absolute_position( obj_html_tag )
function Get_object_absolute_coords( obj_html_tag )
function Set_object_opacity( obj_object, n_opacity )
function Check_text( obj_input, n_min_length, str_error_message, b_ignore, b_display_alert )
function AddToFavorite( str_url, str_description )
function Reset_quick_search()
function Display_MDI_frame( str_frame_id, obj_label )
function Display_MDI_page( str_title, str_url, n_width, n_height, str_PID )
function Hide_MDI_frame()
function Hide_MDI_page()
function window_resize_MDI()
function Display_MDI_frame_splash( str_frame_id, n_width, n_height )
function Display_MDI_frame_XY( str_frame_id, n_X, n_Y )
function Resize_MDI_shadow()
function Set_MDI_frame( str_frame_id, n_left, n_top, n_width, n_height )
function Fade_MDI_frame( n_opacity_start, n_opacity_end, n_step, n_timer )
function Fade_object( str_object_id, n_opacity_start, n_opacity_end, n_step, n_timer, n_object_opacity )
function MDI_frame_mouse( b_mouseover, str_frame_id, n_timeout, obj_label )
function MDI_frame_mouse_timer( str_frame_id, n_X, n_Y )
function Combos_visibility( b_visible, obj_frame )
function PrintIframe( str_iframe_id )
function Get_element_style( obj_tag, str_style_name )
function IsEmail( str_email )
function GetScrollLeft()
function GetScrollTop()
function Set_object_class( obj_element, str_new_class )
function Check_image_size( obj_image, n_width_max, n_height_max )
function PutCookie( str_name, str_value, n_days )
function GetCookie( str_name )
function DelCookie( str_name )
function Initialize_MDI_frame( str_id_of_displayer, str_id_mdi_displayed )
function autoGrow( objTextarea )
function Trim( str_expression )
function UCase( str_expression )
function LCase( str_expression )
function Move_frame_to_center( str_frame_id )
function Search_parent_tag( obj_child, str_parent_tag_name )
function CreateAttribute( str_name, str_value )
function Dragable_object( obj_object )
function Echo( str_message, b_view_html )
function PrintJob()
function Check_window_popup_for_print()
function SendToFriendPopup( str_url )
function Checkbox_onClick( str_type_id, str_sub_type_id, str_join_sub_type_id )
function Disabled_frame( obj_to_hide )
function Enabled_frame()
function Set_object_sail( obj_frame, str_frame_id, b_sailed, n_sail_opacity )
function Set_tab( n_tab, n_tabs_length )
function Val( str_expression )
function Initialize_frame_buttons_link()
function Get_form_query_string( obj_form, b_dont_get_empty_values )
function Top_banner_animation( str_image_file_name )
function ToolTipText( obj_event, str_text, n_width, n_shift_left, n_shift_top )
function ToolTipText_advanced( obj_event, str_text, n_width, n_shift_left, n_shift_top, str_tooltiptext_id )
function ToolTipText_CMS( obj_event, str_cms_page_name, n_width, n_shift_left, n_shift_top )
function ToolTipText_CMS_advanced( obj_event, str_script_name, str_params, n_width, n_shift_left, n_shift_top, str_tooltiptext_id )
function ToolTipText_hide( str_tooltiptext_id )
function UMT( str_expr, n_shift )
function Display_bubble( n_left, n_top, str_text, n_width )
function Display_bubble_over_object( str_element_id, str_text, n_shift_left, n_shift_top, n_late, n_width )
function Hide_bubble( b_fade )
function Get_element_id( obj_element )
function addJobToFavorite( obj_href, n_posting_id, b_display_bubble, b_big_size, obj_event )
function update_Icon( str_datas )
function update_Icon_late( obj_href )
function Get_max_ZIndex()
function ToNumeric( str_expression )
function ScrSbmt( str_default_element_id, str_scr_element_id )
function ScrSbmtRvrs( str_default_element_id, str_scr_element_id )
function txt_date_OnBlur( obj_input )
function Replace( str_expression, str_find, str_replace )
function HTMLEncode( str_HTML_expression )
function HTMLDecode( str_HTML_expression )
function Blink_input_object( str_obj_input, n_blink_count, n_interval, str_BgColor, b_state, b_focus )
*/
var m_str_DICO_close = "";
var m_str_DICO_new_window = "";
var m_str_DICO_copy_url = "";
var m_str_DICO_modify = "";
var m_str_DICO_server_connection_failure = "";
var m_str_DICO_retry = "";
var m_str_DICO_reload = "";

var m_str_active_MDI_frame_id = "";
//var m_n_MDI_frame_opacity = -1;
var m_str_MDI_frame_mouseover_frame_id = "";
var m_b_combo_invisibility = false;

var m_str_global_ressources;

function Get_object_absolute_position( obj_html_tag )
{
	var obj_parent = obj_html_tag.offsetParent;
	var n_loop = 0;
	var n_offSet_left = obj_html_tag.offsetLeft;
	var n_offSet_top = obj_html_tag.offsetTop;

	while(obj_parent.tagName != null && obj_parent.tagName != "BODY" && n_loop < 100)
	{
		n_offSet_left += obj_parent.offsetLeft;
		n_offSet_top += obj_parent.offsetTop;
		if(obj_parent.offsetParent)
		{
			obj_parent = obj_parent.offsetParent;
		}
		else
		{
			obj_parent = null;
			break;
		}
		n_loop++;
	}
	if(obj_parent)
	{
		n_offSet_left += obj_parent.offsetLeft;
		n_offSet_top += obj_parent.offsetTop;
	}
	return(n_offSet_left + ";" + n_offSet_top);
}

function Get_object_absolute_coords( obj_html_tag )
{
	var obj_coords = new Object();
	var n_top = 0;
	var n_left = 0;
	var obj_parent;
	
	if (obj_html_tag) { obj_html_tag.parentNode; }
	
	while(obj_parent)
	{
		if(obj_parent.style.overflow == "auto" || obj_parent.style.overflow == "scroll")
		{
			n_top -= obj_parent.scrollTop;
			n_left -= obj_parent.scrollLeft;
		}
		obj_parent = (obj_parent.tagName == "BODY") ? null : obj_parent.parentNode;
	}
	
	while(obj_html_tag)
	{
		n_top += obj_html_tag.offsetTop;
		n_left += obj_html_tag.offsetLeft;
		obj_html_tag = obj_html_tag.offsetParent;
	}
	obj_coords.left = n_left;
	obj_coords.top = n_top;
	return(obj_coords);
}

function Set_object_opacity( obj_object, n_opacity )
{
	var err;
    if(navigator.appName.indexOf("Netscape") != -1 && parseInt(navigator.appVersion) >=5)
	{
		try
		{
			obj_object.style.MozOpacity = n_opacity / 100;
			obj_object.style.KhtmlOpacity = n_opacity / 100;
		}
		catch(err) {}
	}
	else if(navigator.appName == "Microsoft Internet Explorer")
	{
		try
		{
			obj_object.filters.alpha.opacity = n_opacity;
		}
		catch(err) {}
	}
	else
	{
		try
		{
			obj_object.style.Opacity = n_opacity / 100;
			obj_object.style.opacity = n_opacity / 100;
		}
		catch(err) {}
	}
}

function Check_text( obj_input, n_min_length, str_error_message, b_ignore, b_display_alert )
{
	var b_result = true;
	if(!b_ignore)
	{
		b_result = (obj_input.value.length >= n_min_length);
		if(obj_input.name.search("mail") > 0)
		{
			b_result = IsEmail(obj_input.value);
		}

		if(!b_result)
		{
			if(b_display_alert)
			{
				alert(str_error_message);
				obj_input.focus();
			}
		}
	}
	return(b_result);
}

function AddToFavorite( str_url, str_description )
{
	var b_result = true;
	try
	{
		if(window.sidebar)
		{
			// Mozilla Firefox Bookmark	
			window.sidebar.addPanel(str_description, str_url,"");
		}
		else if(window.external)
		{
			// IE Favorite
			window.external.AddFavorite(str_url, str_description);
		}
	}
	catch(err)
	{
		b_result = false;
	}
	if(!b_result)
	{
		alert("Can't add to favorites");
	}
}

function Reset_quick_search()
{
	var obj_form_quick_search = document.getElementById("obj_form_quick_search");
	obj_form_quick_search.Types.value = "";
	obj_form_quick_search.Loc.value = "";
	obj_form_quick_search.Key.value = "";
}

function Display_MDI_frame( str_frame_id, obj_label )
{
	var str_list_coords = Get_object_absolute_position(obj_label).split(";");
	m_str_MDI_frame_mouseover_frame_id = "";
	Display_MDI_frame_XY(str_frame_id, parseInt(str_list_coords[0]), parseInt(str_list_coords[1]));
}

function Open_MDI_page_in_new_window( str_url )
{
	str_url = str_url.replace("&gui=0", "");
	str_url = str_url.replace("&Gui=0", "");
	str_url = str_url.replace("&NoGui=1", "");
	str_url = str_url.replace(".nogui", "");
	if(str_url.indexOf("?") > 0)
	{
		str_url += "&gui=1";
	}
	window.open(str_url);
}

function Display_MDI_page( str_title, str_url, n_width, n_height, str_PID )
{
	var obj_frame_mdi = document.getElementById("frame_mdi");
	var str_HTML = "";
	document.documentElement.style.overflow = "hidden";
	document.body.style.marginRight = "17px";

	obj_frame_mdi.style.display = "block";
	obj_frame_mdi.style.padding = "8px";
	obj_frame_mdi.style.width = n_width + "px";
	obj_frame_mdi.style.height = n_height + "px";
	
	str_HTML = "<div id=frame_header_iframe_mdi>";
	str_HTML += "<table><tr>";
	str_HTML += "<td><span>" + str_title + "</SPAN></td>";
	str_HTML += "<td align=right>";
	str_HTML += "<table class=C_FRAME_BUTTONS_LINKS><tr>";
	//str_HTML += "<BUTTON ONCLICK=\"document.getElementById('iframe_mdi').src='" + str_url + "';\" STYLE=\"WIDTH: 24px;\"><IMG SRC=\"/images2/reload-12x12.gif\"></BUTTON>";
	str_HTML += "<td><a href=\"javascript:\" onclick=\"document.getElementById('iframe_mdi').src='" + str_url + "';return(false);\" style=\"width: 20px;\"><span class=C_ICON_RELOAD_16x16></span></a></td>";
	//str_HTML += "<BUTTON ONCLICK=\"PrintIframe('iframe_mdi');\" STYLE=\"WIDTH: 24px;\"><IMG SRC=\"/images2/printer-12x12.gif\"></BUTTON>";
	str_HTML += "<td><a href=\"javascript:\" onclick=\"PrintIframe('iframe_mdi');return(false);\"><span class=C_ICON_PRINT_16x16></span></a></td>";
	if(str_PID != "" && str_PID != null && m_str_DICO_modify != "")
	{
		//str_HTML += "<BUTTON ONCLICK=\"top.location='/accountpro/PRO_posting_edit.asp?PID=" + str_PID + "';\" STYLE=\"WIDTH: 80px;\"><IMG SRC=\"/images2/pen-12x12.gif\"> " + m_str_DICO_modify + "</BUTTON>";
		str_HTML += "<td><a href=\"javascript:\" onclick=\"top.location='/accountpro/PRO_posting_edit.asp?PID=" + str_PID + "';return(false);\" style=\"width: 80px;\"><span class=C_ICON_PEN_16x16></span> " + m_str_DICO_modify + "</a></td>";
	  	if(window.navigator.appName == "Microsoft Internet Explorer")
	  	{
			//str_HTML += "<BUTTON ONCLICK=\"window.clipboardData.clearData();window.clipboardData.setData('text', '" + str_url + "');\" STYLE=\"WIDTH: 100px;\"><IMG SRC=\"/images2/copy-12x12.gif\"> " + m_str_DICO_copy_url + "</BUTTON>";
			str_HTML += "<td><a href=\"javascript:\" onclick=\"window.clipboardData.clearData();window.clipboardData.setData('text', '" + str_url + "');return(false);\" STYLE=\"width: 100px;\"><span class=C_ICON_COPY_16x16></span> " + m_str_DICO_copy_url + "</a></td>";
		}
	}
	//str_HTML += "<BUTTON ONCLICK=\"window.open('" + str_url.replace("&gui=0", "").replace("&NoGui=1", "") + "');\" STYLE=\"WIDTH: 124px;\"><IMG SRC=\"/images2/window-normal.gif\"> " + m_str_DICO_new_window + "</BUTTON>";
	str_HTML += "<td><a href=\"javascript:\" onclick=\"Open_MDI_page_in_new_window('" + str_url + "');return(false);\" STYLE=\"width: 124px;\"><span class=C_ICON_NORMAL_SIZE_12x12></span> " + m_str_DICO_new_window + "</a></td>";
	//str_HTML += "<BUTTON ONCLICK=\"Hide_MDI_page();\"><IMG SRC=\"/images2/close-12x12.gif\"> " + m_str_DICO_close + "</BUTTON>";
	str_HTML += "<td><a href=\"javascript:\" onclick=\"Hide_MDI_page();return(false);\" style=\"width: 64px;\"><span class=C_ICON_CLOSE_BLUE_12x12></span> " + m_str_DICO_close + "</a></td>";
	str_HTML += "</tr></table>";
	str_HTML += "</td>";
	str_HTML += "</tr></table>";
	str_HTML += "</div>";
	str_HTML += "<iframe id=iframe_mdi name=iframe_mdi src=\"" + str_url + "\" scrolling=yes frameborder=no style=\"border: 0px; width: " + n_width + "px; height: " + n_height + "px;\"></iframe>"
	
	obj_frame_mdi.innerHTML = str_HTML;
	Display_MDI_frame_XY("frame_mdi", n_width, n_height);
	window.onresize = window_resize_MDI;
	window_resize_MDI();
	Combos_visibility(false);
	//setTimeout("document.ondblclick = Hide_MDI_page;", 400);
}

function Hide_MDI_frame()
{
	Combos_visibility(true);
	if(m_str_active_MDI_frame_id != "")
	{
		document.getElementById("frame_mdi_shadow").style.visibility = "hidden";
		document.getElementById(m_str_active_MDI_frame_id).style.visibility = "hidden";
		m_str_active_MDI_frame_id = "";
	}
	//m_n_MDI_frame_opacity = -1;
}

function Hide_MDI_page()
{
	window.onresize = null;
	document.onclick = null;
	document.ondblclick = null;
	Combos_visibility(true);
	document.getElementById("frame_mdi_shadow").style.display = "none";
	document.documentElement.style.overflow = "";
	document.body.style.marginRight = "";
	Fade_MDI_frame(100, 0, -15, 20);
}

function window_resize_MDI()
{
	var frame_shadow = document.getElementById("frame_mdi_shadow");
	var frame_mdi = document.getElementById("frame_mdi");
	var obj_iframe = frame_mdi.getElementsByTagName("iframe")[0];;
	var n_width = frame_mdi.clientWidth;
	var n_height = frame_mdi.clientHeight;
	var n_left;
	var n_top;
	var n_default_width = frame_mdi.getAttribute("DefaultWidth");
	var n_default_height = frame_mdi.getAttribute("DefaultHeight");
	var str_iframe_mdi_src = frame_mdi.getAttribute("iframesource");
	var n_frame_mdi_padding_x = (frame_mdi.style.paddingLeft.replace("px", "") * 1) + (frame_mdi.style.paddingRight.replace("px", "") * 1);
	var n_frame_mdi_padding_y = (frame_mdi.style.paddingTop.replace("px", "") * 1) + (frame_mdi.style.paddingBottom.replace("px", "") * 1);

	if(obj_iframe)
	{
		if(str_iframe_mdi_src != obj_iframe.src)
		{
			n_default_width = "";
			n_default_height = "";
			str_iframe_mdi_src = obj_iframe.src;
			frame_mdi.setAttribute("iframesource", str_iframe_mdi_src);
			//alert(obj_iframe.src + "\n" + str_iframe_mdi_src);
		}

		if(n_default_width == "" || n_default_width == null) { frame_mdi.setAttribute("DefaultWidth", n_width); n_default_width = n_width; }
		if(n_default_height == "" || n_default_height == null) { frame_mdi.setAttribute("DefaultHeight", n_height); n_default_height = n_height; }
		
		if((1 * n_default_width) + 16 > document.documentElement.clientWidth)
		{
			n_width = document.documentElement.clientWidth - 16 - 16;
		}
		else if(n_default_width != n_width)
		{
			n_width = n_default_width;
		}
		if((1 * n_default_height) + 16 > document.documentElement.clientHeight)
		{
			n_height = document.documentElement.clientHeight - 16;
		}
		else if(n_default_height != n_height)
		{
			n_height = n_default_height - n_frame_mdi_padding_y;
		}

		n_left = (GetScrollLeft() + ((document.documentElement.clientWidth - n_width) / 2));
		n_top = (GetScrollTop() + ((document.documentElement.clientHeight - n_height) / 2));
		if(n_left < GetScrollLeft() + 8) { n_left = GetScrollLeft() + 8; }
		if(n_top < GetScrollTop() + 8) { n_top = GetScrollTop() + 8; }


		frame_mdi.style.width = (n_width - n_frame_mdi_padding_x) + "px";
		//frame_mdi.style.height = (n_height - n_frame_mdi_padding_y) + "px";
		obj_iframe.style.width = (n_width - n_frame_mdi_padding_x) + "px";
		obj_iframe.style.height = (n_height - n_frame_mdi_padding_y - 26) + "px";
		//obj_iframe.style.display = "none";

		frame_shadow.style.left = (n_left - 8) + "px";
		frame_shadow.style.top = (n_top - 8) + "px";
		frame_shadow.style.width = (n_width + 16) + "px";
		frame_shadow.style.height = (n_height + 16) + "px";
		frame_mdi.style.left = n_left + "px";
		frame_mdi.style.top = n_top + "px";
	}
}

function Display_MDI_frame_splash( str_frame_id, n_width, n_height )
{
	var obj_frame_mdi_frame = document.getElementById(str_frame_id);
	var n_left;
	var n_top;
	var b_resize_frame = (n_width >= 0) || (n_height >= 0);

	obj_frame_mdi_frame.style.position = "absolute";
	obj_frame_mdi_frame.style.display = "block";

	n_width = (n_width != -1) ? n_width : obj_frame_mdi_frame.clientWidth;
	n_height = (n_height != -1) ? n_height : obj_frame_mdi_frame.clientHeight
	n_left = GetScrollLeft() + (document.documentElement.clientWidth - n_width) / 2;
	n_top = GetScrollTop() + (document.documentElement.clientHeight - n_height) / 2;

	if(b_resize_frame)
	{
		obj_frame_mdi_frame.style.width = n_width + "px";
		obj_frame_mdi_frame.style.height = n_height + "px";
	}

	Hide_MDI_frame();
	m_str_active_MDI_frame_id = str_frame_id;
	document.getElementsByTagName("body")[0].appendChild(obj_frame_mdi_frame);
	Set_MDI_frame(str_frame_id, n_left, n_top, n_width, n_height);
	Set_object_opacity(document.getElementById(str_frame_id), 100);
}

function Display_MDI_frame_XY( str_frame_id, n_X, n_Y )
{
	var obj_frame_mdi_frame = document.getElementById(str_frame_id);
	var n_width = obj_frame_mdi_frame.clientWidth;
	var n_height = obj_frame_mdi_frame.clientHeight;
	var n_left = n_X - (n_width / 2);
	var n_top = n_Y + 16;

	if((n_left + obj_frame_mdi_frame.offsetWidth + 16) > (GetScrollLeft() + document.documentElement.clientWidth))
	{
		n_left = GetScrollLeft() + document.documentElement.clientWidth - obj_frame_mdi_frame.offsetWidth - 16;
	}

	if(n_left < 0) { n_left = 0; }
	if(n_top < 0) { n_top = 0; }

	Hide_MDI_frame();
	Set_MDI_frame(str_frame_id, n_left, n_top, n_width, n_height);
	if(n_width == 0)
	{
		setTimeout("Resize_MDI_shadow();", 200);
	}
	m_str_active_MDI_frame_id = str_frame_id;
	Fade_MDI_frame(0, 100, 15, 20);
}

function Resize_MDI_shadow()
{
	var obj_frame_mdi_shadow = document.getElementById("frame_mdi_shadow");
	var obj_frame_mdi_frame = document.getElementById(m_str_active_MDI_frame_id);
	var n_width = obj_frame_mdi_frame.clientWidth;
	var n_height = obj_frame_mdi_frame.clientHeight;
	var n_left;
	obj_frame_mdi_shadow.style.width = (n_width + 16) + "px";
	obj_frame_mdi_shadow.style.height = (n_height + 16) + "px";
	
	if((obj_frame_mdi_frame.offsetLeft + obj_frame_mdi_frame.offsetWidth + 16) > (GetScrollLeft() + document.documentElement.clientWidth))
	{
		n_left = GetScrollLeft() + document.documentElement.clientWidth - obj_frame_mdi_frame.offsetWidth - 16;
		obj_frame_mdi_frame.style.left = n_left + "px";
		obj_frame_mdi_shadow.style.left = (n_left - 8) + "px";
	}
	
}

function Set_MDI_frame( str_frame_id, n_left, n_top, n_width, n_height )
{
	var obj_frame_mdi_shadow = document.getElementById("frame_mdi_shadow");
	var obj_frame_mdi_frame = document.getElementById(str_frame_id);
	
	obj_frame_mdi_shadow.style.left = (n_left) + "px";
	obj_frame_mdi_shadow.style.top = (n_top) + "px";
	obj_frame_mdi_frame.style.left = (n_left + 8) + "px";
	obj_frame_mdi_frame.style.top = (n_top + 8) + "px";

	obj_frame_mdi_shadow.style.width = (n_width + 16) + "px";
	obj_frame_mdi_shadow.style.height = (n_height + 16) + "px";

	obj_frame_mdi_shadow.style.visibility = "visible";
	obj_frame_mdi_frame.style.visibility = "visible";
	obj_frame_mdi_shadow.style.display = "block";
	obj_frame_mdi_frame.style.display = "block";
}

function Fade_MDI_frame( n_opacity_start, n_opacity_end, n_step, n_timer )
{
	switch(n_opacity_end)
	{
		case 100:	document.getElementById(m_str_active_MDI_frame_id).style.display = "block";	break;
		case 0:		document.getElementById(m_str_active_MDI_frame_id).style.display = "none"; break;
		default:	Fade_object(m_str_active_MDI_frame_id, n_opacity_start, n_opacity_end, n_step, n_timer, -1); break;
	}
}

var m_b_fade_allowed = true;

function Fade_object( str_object_id, n_opacity_start, n_opacity_end, n_step, n_timer, n_object_opacity )
{
	var obj_object = document.getElementById(str_object_id);

	if(!m_b_fade_allowed) { return; }

	if(n_object_opacity == -1)
	{
		n_object_opacity = n_opacity_start;
	}
	else
	{
		n_object_opacity += n_step;
	}
	if(((n_step > 0) && (n_object_opacity >= n_opacity_end)) || ((n_step < 0) && (n_object_opacity <= n_opacity_end)))
	{
		n_object_opacity = n_opacity_end;
		n_step = 0;
	}
	//window.status = n_object_opacity + " -- " + Math.abs(n_object_opacity) + " / " + Math.abs(n_opacity_end);
	
	if(str_object_id != "")
	{
		if(obj_object)
		{
			Set_object_opacity(obj_object, n_object_opacity);
			if(n_step != 0)
			{
				setTimeout("Fade_object('" + str_object_id + "'," + n_opacity_start + "," + n_opacity_end + "," + n_step + "," + n_timer + "," + n_object_opacity + ")", n_timer);
			}
			else
			{
				if(n_object_opacity <= 0)
				{
					obj_object.style.display = "none";
				}
				n_object_opacity = -1;
			}
		}
		else
		{
			str_object_id = "";
		}
	}
}

function MDI_frame_mouse( b_mouseover, str_frame_id, n_timeout, obj_label )
{
	var str_list_coords = Get_object_absolute_position(obj_label).split(";");
	if(b_mouseover)
	{
		m_str_MDI_frame_mouseover_frame_id = str_frame_id;
		setTimeout("MDI_frame_mouse_timer('" + str_frame_id + "'," + str_list_coords[0] + "," + str_list_coords[1] + ");", n_timeout);
	}
	else
	{
		if(str_frame_id == m_str_MDI_frame_mouseover_frame_id)
		{
			m_str_MDI_frame_mouseover_frame_id = "";
		}
 	}
}

function MDI_frame_mouse_timer( str_frame_id, n_X, n_Y )
{
	if(str_frame_id == m_str_MDI_frame_mouseover_frame_id)
	{
		Display_MDI_frame_XY(m_str_MDI_frame_mouseover_frame_id, n_X, n_Y);
		m_str_MDI_frame_mouseover_frame_id = "";
	}
}

function Combos_visibility( b_visible, obj_frame )
{
	var obj_selects;
	var i;
	var obj_IMG;
	var obj_frame_container;
	var obj_select;
	var obj_parent;
	
  	if(window.navigator.appName == "Microsoft Internet Explorer")
	{
		if(window.navigator.appVersion.search("6.0") > 0)
		{
			obj_selects = (obj_frame) ? obj_frame.getElementsByTagName("select") : document.getElementsByTagName("select");
			if(!b_visible && m_b_combo_invisibility)
			{
				Combos_visibility(true);
			}
			m_b_combo_invisibility = !b_visible;
			for(i=0; i<obj_selects.length;i++)
			{
				if(obj_selects[i])
				{
					obj_frame_container = obj_selects[i].parentNode;
					if(b_visible)
					{
						if(document.getElementById("virtual_select_" + i))
						{
							obj_parent = document.getElementById("virtual_select_" + i).parentNode;
							obj_parent.removeChild(document.getElementById("virtual_select_" + i));
						}
					}
					else
					{
						obj_IMG = document.createElement("img");
						obj_IMG.className = "C_VIRTUAL_SELECT";
						obj_IMG.id = "virtual_select_" + i;
						if(obj_selects[i].clientWidth > 38)
						{
							obj_IMG.style.width = (obj_selects[i].clientWidth - 38) + "px";
						}
						obj_IMG.style.height = "0px";
						obj_IMG.style.marginTop = Get_element_style(obj_selects[i], "marginLeft");
						obj_IMG.style.marginRight = Get_element_style(obj_selects[i], "marginRight");
						obj_IMG.style.marginBottom = Get_element_style(obj_selects[i], "marginBottom");
						obj_IMG.style.marginLeft = Get_element_style(obj_selects[i], "marginLeft");
						obj_IMG.src = "about:blank";
						obj_frame_container.insertBefore(obj_IMG, obj_selects[i]);
					}
				}
				obj_selects[i].style.display = b_visible ? "" : "none";
			}
		}
	}
}

var m_obj_window_popup;

function PrintIframe( str_iframe_id )
{
	var obj_iframe = document.getElementById(str_iframe_id);
	//var obj_body = obj_iframe.contentWindow.document.body;
	//var str_HTML = new String(obj_body.innerHTML);
	//var b_frameset_detected = (str_HTML.toUpperCase().indexOf("<FRAME") >= 0);
	// A GERER SI b_frameset_detected ! ...

    m_obj_window_popup = window.open();
    m_obj_window_popup.document.location = obj_iframe.src;
	setTimeout("Check_window_popup_for_print();", 500);
}

function Get_element_style( obj_tag, str_style_name )
{
	var str_result = "";
	
	if(obj_tag.currentStyle)
	{
		str_result = obj_tag.currentStyle[str_style_name];
	}
	else if(window.getComputedStyle)
	{
		str_result = document.defaultView.getComputedStyle(obj_tag, null).getPropertyValue(str_style_name);
	}
	return(str_result);
}

function IsEmail( str_email )
{
	var obj_RegExp = /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,4}$/;
	//var obj_RegExp = /^(([^<>()[\]\\.,;:\s@""]+(\.[^<>()[\]\\.,;:\s@""]+)*)|("".+""))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
	// Les 2 RegExp marchent mais le premier semble plus simple...
	return(obj_RegExp.exec(str_email.toLowerCase()) != null)
}

function GetScrollLeft()
{
	return(window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft);
}
function GetScrollTop()
{
	return(window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop);
}

function GetWindowWidth()
{
	return(window.innerWidth || document.body.clientWidth || document.documentElement.clientWidth || document.body.offsetWidth);
}

function GetWindowHeight()
{
	//return(window.innerHeight || document.body.clientHeight || document.documentElement.clientHeight || document.body.offsetHeight);
	var n_height = window.innerHeight;

	if(!n_height)
	{
		n_height = screen.height - 160;
	}
	return(n_height);
}

function Set_object_class( obj_element, str_new_class )
{
	if(obj_element.className != str_new_class)
	{
		obj_element.className = str_new_class;
	}
}

function Check_image_size( obj_image, n_width_max, n_height_max )
{
	var n_width;
	var n_height;
	
	n_width = obj_image.width;
	n_height = obj_image.height;

	if( obj_image.width > n_width_max )
	{
		obj_image.width = n_width_max;
		if( obj_image.height > n_height_max )
		{
			obj_image.height = n_height_max;
			obj_image.width = n_width * n_height_max / n_height;
		}
	}
	else
	{
		if( obj_image.height > n_height_max )
		{
			obj_image.height = n_height_max;
			if( obj_image.width > n_width_max )
			{
				obj_image.width = n_width_max;
				obj_image.height = n_height * n_width_max / n_width;
			}
		}
	}
}

function PutCookie( str_name, str_value, n_days )
{
	if(n_days)
	{
		var obj_date = new Date();
		obj_date.setTime(obj_date.getTime() + (n_days * 24 * 60 * 60 * 1000));
		var str_expires = "; expires=" + obj_date.toGMTString();
	}
	else
	{
		var str_expires = "";
	}
	document.cookie = str_name + "=" + str_value + str_expires + "; path=/";
}

function GetCookie( str_name )
{
	var str_name_EQ = str_name + "=";
	var obj_list_cookies = document.cookie.split(";");
	for(var i=0; i < obj_list_cookies.length; i++)
	{
		var str_cookie = obj_list_cookies[i];
		while(str_cookie.charAt(0) == " ")
		{
			str_cookie = str_cookie.substring(1, str_cookie.length);
			if(str_cookie.indexOf(str_name_EQ) == 0)
			{
				return(str_cookie.substring(str_name_EQ.length, str_cookie.length));
			}
		}
	}
	return(null);
}

function DelCookie( str_name )
{
	PutCookie(str_name, "", -1);
}

function Initialize_MDI_frame( str_id_of_displayer, str_id_mdi_displayed, b_onclick )
{
	var str_javascript_addon = "";
	var obj_displayer = document.getElementById(str_id_of_displayer);
	var obj_mdi_displayed = document.getElementById(str_id_mdi_displayed);

	if(obj_displayer)
	{
		document.getElementsByTagName("body")[0].appendChild(obj_mdi_displayed);

		obj_displayer.style.cursor = "pointer";
		obj_displayer.onmouseover = new Function("MDI_frame_mouse(true,'" + str_id_mdi_displayed + "',1000,this);");
		obj_displayer.onmouseout = new Function("MDI_frame_mouse(false,'" + str_id_mdi_displayed + "',0,this);");
		
		if(b_onclick)
		{
			switch(str_id_mdi_displayed)
			{
				case "frame_mdi_search_by_reference":	str_javascript_addon = "document.getElementById('obj_form_search_by_reference').PID.focus();";	break;
				case "frame_mdi_search_by_employer":	str_javascript_addon = "Combos_visibility();";	break;
				case "frame_mdi_banner_subtitle":		str_javascript_addon = "Combos_visibility();";	break;
			}
			obj_displayer.onclick = new Function("Display_MDI_frame('" + str_id_mdi_displayed + "',this);" + str_javascript_addon + "return(false);");
		}
		obj_mdi_displayed.onmousedown = new Function("document.getElementsByTagName('html')[0].onmousedown = null;");
		obj_mdi_displayed.onmouseout = new Function("document.getElementsByTagName('html')[0].onmousedown = Hide_MDI_frame;");
	}
}

//var str_fisrt_width
function autoGrow( objTextarea )
{
	var objDiv = document.createElement("div");
	//var t = document.createElement("textarea");
	var str_html = objTextarea.value;
//	var objDebug = document.createElement("div");

	/*var tVal = t.value;			
	t.style.height = '0px';
	t.value = "W\nW\nW";
	var H3 = t.scrollHeight;
	t.value = "W\nW\nW\nW";
	var H4 = t.scrollHeight;
	var H = H4 - H3 + 1;*/

	//if (str_fisrt_width == null) str_fisrt_width = objTextarea.offsetWidth
		
	str_html = str_html.replace(/>/g, "&gt;");
	str_html = str_html.replace(/</g, "&lt;");
	str_html = str_html.replace(/\r\n/, '<br />');
	str_html = str_html.replace(/(\r\n|[\r\n])/g, "<br />");
	str_html = str_html.replace(/(\t|[\t])/g, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");

	objDiv.innerHTML = "&nbsp;" + str_html;

	objTextarea.parentNode.appendChild(objDiv);

	//objDebug.innerHTML =str_fisrt_width;
	//objTextarea.parentNode.appendChild(objDebug);
	
	//objTextarea.style.width = "10px";
	//objTextarea.parentNode.style.width = "10px";
	objTextarea.style.height = (objDiv.offsetHeight + 24) + "px";
	objTextarea.parentNode.removeChild(objDiv);
}

function Trim( str_expression )
{
  str_expression = str_expression.replace(/^\s+/g, "");
  return(str_expression.replace(/\s+$/g, ""));
}

function UCase( str_expression )
{
	return(str_expression.toUpperCase());
}

function LCase( str_expression )
{
	return(str_expression.toLowerCase());
}

function Move_frame_to_center( str_frame_id )
{
	var obj_frame = document.getElementById(str_frame_id);
	
	if(obj_frame.offsetWidth > 0)
	{
		document.getElementsByTagName("body")[0].appendChild(obj_frame);
		obj_frame.style.position = "absolute";
		obj_frame.style.margin = "0px";
		obj_frame.style.left = Math.round(((document.documentElement.clientWidth - obj_frame.offsetWidth) / 2)) + "px";
		obj_frame.style.top = Math.round((((document.documentElement.clientHeight / 2) - obj_frame.offsetHeight) / 2)) + "px";
	}
	else
	{
		setTimeout("Move_frame_to_center('" + str_frame_id + "');", 1000);
	}
}

function Search_parent_tag( obj_child, str_parent_tag_name )
{
	var obj_parent = obj_child.parentNode;
	var n_loop = 0;
	while(obj_parent.tagName.toLowerCase() != str_parent_tag_name.toLowerCase() && n_loop < 100)
	{
		obj_parent = obj_parent.parentNode;
		n_loop++;
	}
	return(obj_parent);
}

function CreateAttribute( str_name, str_value )
{
	var obj_attribute = document.createAttribute(str_name);
	obj_attribute.value = str_value;
	return(obj_attribute);
}

function Dragable_object( obj_object, n_top_bar_height )
{
	var obj_coords = Get_object_absolute_coords(obj_object);
	
	if(n_top_bar_height)
	{
		obj_object.setAttribute("topbarheight", n_top_bar_height);
	}
	if(obj_object.style.position != "absolute")
	{
		obj_object.style.position = "absolute";
		//obj_object.style.width = obj_object.clientWidth + "px";
		//obj_object.style.height = obj_object.clientHeight + "px";
	}
	obj_object.style.zIndex = Get_max_ZIndex() + 1;
	obj_object.onmousedown = function( event )
	{
		var obj_event = event ? event : window.event;
		var n_top_bar_height = this.getAttribute("topbarheight");
		if(!n_top_bar_height)
		{
			n_top_bar_height = 0;
		}
		if(n_top_bar_height == 0 || ((obj_event.clientY - this.offsetTop) <= n_top_bar_height))
		{
			this.setAttribute("dragleft", obj_event.clientX);
			this.setAttribute("dragtop", obj_event.clientY);
			Set_object_opacity(this, 40);
			return(false);
		}
	}
	obj_object.onmousemove = function( event )
	{
		var obj_event = event ? event : window.event;
		if(this.getAttribute("dragleft"))
		{
			this.style.left = (this.offsetLeft + (obj_event.clientX - this.getAttribute("dragleft"))) + "px";
			this.style.top = (this.offsetTop + (obj_event.clientY - this.getAttribute("dragtop"))) + "px";
			this.setAttribute("dragleft", obj_event.clientX);
			this.setAttribute("dragtop", obj_event.clientY);
			return(false);
		}
	}
	obj_object.onmouseup = function( event )
	{
		this.setAttribute("dragleft", "");
		this.setAttribute("dragtop", "");
		Set_object_opacity(this, 95);
		return(false);
	}
	//obj_object.onmouseout = obj_object.onmouseup;
	obj_object.onselectstart = new Function ("return(false);");
}
function EchoClear()
{
	var obj_frame_echo = document.getElementById("frame_echo");
	if(obj_frame_echo)
	{
		obj_frame_echo.innerHTML = "";
	}
}
function Echo( str_message, b_view_html )
{
	var obj_frame_echo = document.getElementById("frame_echo");
	var obj_div_message = document.createElement("div");

	if(!obj_frame_echo)
	{
		obj_frame_echo = document.createElement("div");
		obj_frame_echo.setAttributeNode(CreateAttribute("id", "frame_echo"));
		document.getElementsByTagName("body")[0].appendChild(obj_frame_echo);
		obj_frame_echo.style.position = "absolute";
		obj_frame_echo.style.left = "10px";
		obj_frame_echo.style.right = "10px";
		obj_frame_echo.style.top = "10px";
		obj_frame_echo.style.border = "1px solid #00CC00";
		obj_frame_echo.style.padding = "4px";
		obj_frame_echo.style.color = "#00CC00";
		obj_frame_echo.style.backgroundColor = "#000000";
		obj_frame_echo.style.width = "320px";
  		if(window.navigator.appName == "Microsoft Internet Explorer" && window.navigator.appVersion.search("6.0") > 0)
		{
			obj_frame_echo.style.height = "480px";
		}
		else
		{
			//obj_frame_echo.style.minHeight = "240px";
			obj_frame_echo.style.maxHeight = "480px";
		}
		obj_frame_echo.style.overflowY = "scroll";
		obj_frame_echo.style.overflowX = "scroll";
		obj_frame_echo.style.fontSize = "12px";
		obj_frame_echo.style.scrollbarBaseColor = "#006600";
		obj_frame_echo.onmouseover = new Function("Set_object_opacity(this, 100);");
		obj_frame_echo.onmouseout = new Function("Set_object_opacity(this, 90);");
		//obj_frame_echo.ondblclick = function() { this.style.display = "none"; }
		obj_frame_echo.ondblclick = function() { this.onmousedown = null; }
		Dragable_object(obj_frame_echo);
		Set_object_opacity(obj_frame_echo, 90);
	}
	
	if(b_view_html)
	{
		obj_div_message.appendChild(document.createTextNode(str_message));
	}
	else
	{
		obj_div_message.innerHTML = str_message;
	}
	//obj_div_message.appendChild(document.createElement("hr"));
	obj_div_message.style.fontFamily = "Courier New";
	obj_div_message.style.color = "#00CC00";

	obj_frame_echo.appendChild(obj_div_message);
	obj_frame_echo.scrollTop = obj_frame_echo.clientHeight;
}

function PrintJob()
{
    try
    {
        if(document.location != top.document.location)
        {
            m_obj_window_popup = window.open();
            m_obj_window_popup.document.location = document.location;
            setTimeout("Check_window_popup_for_print();", 500);
        }
        else
        {
            window.print();
        }
    }
    catch (err)
    {
        window.print();
    }
}
function Check_window_popup_for_print()
{
	var n_div_count = 0;
	
	try
	{
		n_div_count = m_obj_window_popup.document.getElementsByTagName("div").length;
	}
	catch(err) {}
	
	if(n_div_count < 2)
	{
		setTimeout("Check_window_popup_for_print();", 100);
	}
	else
	{
		setTimeout("m_obj_window_popup.print();setTimeout('m_obj_window_popup.close();', 1000);", 100);
	}
}

function SendToFriendPopup( str_url )
{
    var obj_window = window.open(str_url, "_blank", "toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=950,height=500");
    obj_window.focus();
}

function Checkbox_onClick( str_type_id, str_sub_type_id, str_join_sub_type_id )
{
	var i;
	var str_list_sub_type_id = new Array();
	str_list_sub_type_id = str_join_sub_type_id.split(",");
	for(i=0; i<str_list_sub_type_id.length; i++)
	{
		if(str_list_sub_type_id[i] != "")
		{
			document.getElementById("JobType" + str_list_sub_type_id[i]).checked = false;
		}
	}
	document.getElementById("JobType" + str_type_id).checked = !document.getElementById("JobType" + str_type_id).checked;
	document.getElementById(str_sub_type_id).style.display = document.getElementById("JobType" + str_type_id).checked ? "block" : "none";
	if(document.getElementById("JobType" + str_type_id).checked)
	{
		document.getElementById("JobTypeExpend" + str_type_id).src = "/images/treeview-expended.gif";
	}
	else
	{
		document.getElementById("JobTypeExpend" + str_type_id).src = "/images/treeview-colapsed.gif";
	}
}

var m_disabled_obj_list = new Array();
function Disabled_frame( obj_to_hide )
{
	var obj_loading_disabled;
	var obj_div_disabled;
	var obj_coords = Get_object_absolute_coords(obj_to_hide);
	if(obj_to_hide)
	{
		m_disabled_obj_list.push(obj_to_hide);
		
		if  (obj_to_hide.offsetHeight > 60)
		{
			obj_loading_disabled = document.createElement("img");
			obj_loading_disabled.src = "/images2/loading-16x16.gif";
			obj_loading_disabled.className = "C_DISABLED_LOADING";
			obj_loading_disabled.id = "disable_frame_loading_img_" + m_disabled_obj_list.length;
			obj_loading_disabled.style.top = obj_coords.top + "px";
			obj_loading_disabled.style.left = obj_coords.left + "px";

			obj_loading_disabled.style.marginTop = obj_to_hide.offsetHeight / 2 - 16 + "px";
			obj_loading_disabled.style.marginLeft = obj_to_hide.offsetWidth / 2 - 16 + "px";
		
			document.getElementsByTagName("body")[0].appendChild(obj_loading_disabled);
		}
		obj_div_disabled = document.createElement("div");
		obj_div_disabled.className = "C_DISABLED_DIV";
		obj_div_disabled.id = "disable_frame_div_shadow_" + m_disabled_obj_list.length;
		obj_div_disabled.style.top = obj_coords.top + "px";
		obj_div_disabled.style.left = obj_coords.left + "px";
		
		obj_div_disabled.style.height = obj_to_hide.offsetHeight + "px";
		obj_div_disabled.style.width = obj_to_hide.offsetWidth + "px";

		document.getElementsByTagName("body")[0].appendChild(obj_div_disabled);
		
		Set_object_opacity(obj_to_hide, 30);
		Set_object_opacity(obj_div_disabled, 10);
	}
}

function Enabled_frame()
{
	var i;
	for (i=0; i<m_disabled_obj_list.length; i++)
	{
		Set_object_opacity(m_disabled_obj_list[i], 100);
		document.getElementById("disable_frame_loading_img");
		try { document.getElementsByTagName("body")[0].removeChild(document.getElementById("disable_frame_loading_img_" + (i + 1))); } catch (Error){}
		document.getElementsByTagName("body")[0].removeChild(document.getElementById("disable_frame_div_shadow_" + (i + 1)));
	}

	m_disabled_obj_list = new Array();
}

function Set_object_sail( obj_frame, str_frame_id, b_sailed, n_sail_opacity )
{
	var obj_sail = document.getElementById(str_frame_id);
	var obj_coords = Get_object_absolute_coords(obj_frame);
	
	if(!obj_sail)
	{
		obj_sail = document.createElement("div");
		obj_sail.setAttributeNode(CreateAttribute("id", str_frame_id));
		//obj_sail.setAttributeNode(CreateAttribute("frameoverid", obj_frame.id));
		document.getElementsByTagName("body")[0].appendChild(obj_sail);
		obj_sail.className = "C_FRAME_SAIL";
	}
	if(b_sailed)
	{	
		obj_sail.style.left = obj_coords.left + "px";
		obj_sail.style.top = obj_coords.top + "px";
		obj_sail.style.width = obj_frame.clientWidth + "px";
		obj_sail.style.height = obj_frame.clientHeight + "px";
		obj_sail.style.display = "block";
		Set_object_opacity(obj_sail, 100 - n_sail_opacity);
	}
	else
	{
		obj_sail.style.display = "none";
	}
}

function Set_tab( n_tab, n_tabs_length )
{
	var obj_tab;

	if(n_tab < 0) { n_tab = 0; }
	if(n_tab > n_tabs_length) { n_tab = n_tabs_length; }

	for (i=0; i<n_tabs_length; i++)
	{
		try {
			document.getElementById("tab_" + i).className = "";
			document.getElementById("frame_tab_" + i).style.display = "none";
		} catch (Error){}
	}
	
	document.getElementById("tab_" + n_tab).className = "C_TAB_ON";
	document.getElementById("frame_tab_" + n_tab).style.display = "block";

	return(true);
}

function Val( str_expression )
{
	var n_result = 0;
	var str_string = new String();
	
	try
	{
		if(str_expression != "")
		{
			str_string = str_expression;
			str_string = str_string.replace("'", "");
			while(str_string.substr(0, 2) == "00" || (str_string.substr(0, 1) == "0" && str_string.length > 1))
			{
				str_string = str_string.substring(1);
			}
			n_result = (str_string.indexOf(".") >= 0) ? eval(str_string + "0") : eval(str_string + ".0");
		}
	}
	catch(err) { }
	return(n_result);
}

function Initialize_frame_buttons_link()
{	
	var i,j;
	var obj_divs = document.getElementsByTagName("*");
	
	for (i=0; i < obj_divs.length; i++)
	{
		if (obj_divs[i].className.indexOf("C_FRAME_BUTTONS_LINKS") >= 0)
		{
			obj_anchors = obj_divs[i].getElementsByTagName("a");
			for (j=0; j<obj_anchors.length; j++)
			{
				var str_overicon	= obj_anchors[j].getAttribute("overicon");
				var str_highlight	= obj_anchors[j].getAttribute("highlight");
				var obj_span		= obj_anchors[j].getElementsByTagName("span")[0];
				
				if (str_highlight == "1")
				{
					obj_anchors[j].className = Trim(obj_anchors[j].className + " C_FRAME_BUTTONS_LINKS_SELECTED");
				}
											
				if (obj_span)
				{
					if (str_highlight == "1")
					{
						obj_span.className = str_overicon;
					}
					else if ((str_overicon != "") && str_overicon)
					{
						obj_anchors[j].onmouseout = new Function("this.getElementsByTagName('span')[0].className = '" + obj_span.className + "';");
						obj_anchors[j].onmouseover = new Function("this.getElementsByTagName('span')[0].className = '" + str_overicon + "';");
					}							
				}
			}
		}
	}
}

function Get_form_query_string( obj_form, b_dont_get_empty_values )
{
	var obj_params = new Array;
	var obj_elements = obj_form.getElementsByTagName("*");
	var i, j;

	for(i=0; i<obj_elements.length; i++)
	{
		if(obj_elements[i].name)
		{
			if((obj_elements[i].type != "checkbox" && obj_elements[i].type != "radio") || obj_elements[i].checked)
			{
				if (obj_elements[i].type == "select-multiple")
				{
					for (j = 0; j < obj_elements[i].options.length; j++)
					{
						if (obj_elements[i].options[j].selected)
						{
							obj_params.push(obj_elements[i].name + "=" + escape(obj_elements[i].options[j].value));
						}
					}					
				}
				else
				{
					if (!(b_dont_get_empty_values) || ((obj_elements[i].value != "") && (b_dont_get_empty_values)))
					{
						obj_params.push(obj_elements[i].name + "=" + escape(obj_elements[i].value));
					}
				}
			}
		}
	}
	return(obj_params.join("&").replace(/\+/g, "%2B").replace(/\//g, "%2F"));
}

var m_obj_top_banner_items;

function Top_banner_animation( str_image_file_name, n_min, n_max, n_width, n_height, n_speed )
{
	var obj_frame_cloud = document.getElementById("frame_cloud");
	var obj_items;
	var obj_item;
	var i;
	var n_resize;
	
	if(!obj_frame_cloud)
	{
		obj_frame_cloud = document.createElement("div");
		obj_frame_cloud.setAttributeNode(CreateAttribute("id", "frame_cloud"));
		document.getElementsByTagName("body")[0].appendChild(obj_frame_cloud);
		
		
		m_obj_top_banner_items = new Array();
		m_obj_top_banner_items.length = n_min + Math.round(Math.random() * (n_max - n_min));
		for(i=0; i<m_obj_top_banner_items.length; i++)
		{
			m_obj_top_banner_items[i] = new Object();
			m_obj_top_banner_items[i].top = 0;
			m_obj_top_banner_items[i].left = Math.round((document.documentElement.clientWidth - n_width) * Math.random());
			m_obj_top_banner_items[i].speed = 1 + Math.round(Math.random() * n_speed) / 10;
			if(navigator.appName == "Microsoft Internet Explorer" && (navigator.appVersion.indexOf("MSIE 7") >= 0 || navigator.appVersion.indexOf("MSIE 8") >= 0))
			{
				n_resize = 1;
			}
			else
			{
				n_resize = Math.random();
			}
			m_obj_top_banner_items[i].width = 5 + Math.round(n_resize * (n_width - 5));
			m_obj_top_banner_items[i].height =  Math.round(n_height * m_obj_top_banner_items[i].width / n_width);
			

			obj_item = document.createElement("img");
			obj_item.setAttributeNode(CreateAttribute("src", "http://www.jobup-host.ch/website/JobUP/images2/" + str_image_file_name));
			obj_item.setAttributeNode(CreateAttribute("class", "C_OPACITY50"));
			obj_item.style.width = m_obj_top_banner_items[i].width + "px";
			obj_item.style.height = m_obj_top_banner_items[i].height + "px";
			obj_item.style.position = "absolute";
			obj_item.style.top = "0px";
			Set_object_opacity(obj_item, 0);
			obj_item.style.visibility = "hidden";
			obj_frame_cloud.appendChild(obj_item);
		}
	}
	obj_items = obj_frame_cloud.getElementsByTagName("img");
	for(i=0; i<obj_items.length; i++)
	{
		m_obj_top_banner_items[i].top = m_obj_top_banner_items[i].top + m_obj_top_banner_items[i].speed;
		
		if(m_obj_top_banner_items[i].top > 140 - m_obj_top_banner_items[i].height)
		{
			m_obj_top_banner_items[i].top = 0;
			m_obj_top_banner_items[i].left = Math.round((document.documentElement.clientWidth - 16) * Math.random());
		}
		
		if(m_obj_top_banner_items[i].top < (n_height + 4))
		{
			Set_object_opacity(obj_items[i], Math.round(m_obj_top_banner_items[i].top * 80 / (n_height + 4)));
		}
		else if(m_obj_top_banner_items[i].top > (140 - m_obj_top_banner_items[i].height - 50))
		{
			Set_object_opacity(obj_items[i], 80 - Math.round((m_obj_top_banner_items[i].top - (140 - m_obj_top_banner_items[i].height - 50)) * 80 / 50));
		}
		
		obj_items[i].style.top = Math.round(m_obj_top_banner_items[i].top) + "px";
		obj_items[i].style.left = m_obj_top_banner_items[i].left + "px";
		obj_items[i].style.visibility = "visible";
	}
	setTimeout("Top_banner_animation(null," + n_min + "," + n_max + "," + n_width + "," + n_height + ")", 60);
}

var m_str_TTT_backup_body_onmouseup;
var m_b_TTT_mousedown = false;

function ToolTipText( obj_event, str_text, n_width, n_shift_left, n_shift_top )
{
	return(ToolTipText_advanced(obj_event, str_text, n_width, n_shift_left, n_shift_top, null));
}
function ToolTipText_advanced( obj_event, str_text, n_width, n_shift_left, n_shift_top, str_tooltiptext_id )
{
	var n_left = (obj_event ? obj_event : window.event).clientX + GetScrollLeft();
	var n_top = (obj_event ? obj_event : window.event).clientY + GetScrollTop();
	var str_div_id = "TTT_" + (str_tooltiptext_id ? str_tooltiptext_id : "any")
	var obj_tooltiptext = document.getElementById(str_div_id);;

	if(!obj_tooltiptext)
	{
		obj_tooltiptext = document.createElement("div");
		obj_tooltiptext.setAttributeNode(CreateAttribute("id", str_div_id));
		obj_tooltiptext.setAttributeNode(CreateAttribute("class", "C_TOOLTIPTEXT"));
		obj_tooltiptext.onmousedown = function(event) { m_b_TTT_mousedown = true; }
		obj_tooltiptext.innerHTML = str_text;
		document.getElementsByTagName("body")[0].appendChild(obj_tooltiptext);
	}
	else if(!str_tooltiptext_id)
	{
		obj_tooltiptext.innerHTML = str_text;
	}
	
	if(n_shift_left)	{ n_left += n_shift_left; }
	if(n_shift_top)		{ n_top += n_shift_top; }
	
	obj_tooltiptext.style.left = n_left + "px";
	obj_tooltiptext.style.top = n_top + "px";
	if(n_width > 0)
	{
		obj_tooltiptext.style.width = n_width + "px";
	}
	obj_tooltiptext.style.display = "block";
	m_str_TTT_backup_body_onmouseup = document.body.onmouseup;
	document.body.onmouseup = new Function("ToolTipText_hide('" + str_div_id + "');return(false);");
	return(true);
}
function ToolTipText_CMS( obj_event, str_cms_page_name, n_width, n_shift_left, n_shift_top )
{
	return(ToolTipText_CMS_advanced(obj_event, "/jobup20/commands.asp", "cmd=GetCmsPageContent&CmsPageName=" + str_cms_page_name, n_width ? n_width : 240, n_shift_left ? n_shift_left : 0, n_shift_top ? n_shift_top : 0, str_cms_page_name));
}
function ToolTipText_CMS_advanced( obj_event, str_script_name, str_params, n_width, n_shift_left, n_shift_top, str_tooltiptext_id )
{
	var b_result = ToolTipText_advanced(obj_event, "...", n_width, n_shift_left, n_shift_top, str_tooltiptext_id)
	if(b_result)
	{
		if(document.getElementById("TTT_" + str_tooltiptext_id).innerHTML == "...")
		{
			Load_frame_HTML_by_AJAX(str_script_name, str_params, "TTT_" + str_tooltiptext_id, "", 500);
		}
	}
	return(b_result);
}
function ToolTipText_hide( str_tooltiptext_id )
{
	if(!m_b_TTT_mousedown)
	{
		document.getElementById(str_tooltiptext_id).style.display = "none";
		if(m_str_TTT_backup_body_onmouseup)
		{
			document.body.onmouseup = m_str_TTT_backup_body_onmouseup;
			m_str_TTT_backup_body_onmouseup = "";
		}
	}
	else
	{
		m_b_TTT_mousedown = false;
	}
}

function UMT( str_expr, n_shift )
{
	var str_chars = new String(str_expr);
	var str_href = new String();
	var i;
	var n_char;
	var obj_hidden_iframe = document.getElementById("obj_iframe_UMT");

	str_href = "";
	for( i=0; i<str_chars.length; i++ )
	{
		n_char = str_chars.charCodeAt(i) + n_shift;
		str_href = str_href + String.fromCharCode(n_char);
	}
	
	if(!obj_hidden_iframe)
	{
		obj_hidden_iframe = document.createElement("iframe");
		obj_hidden_iframe.setAttributeNode(CreateAttribute("id", "obj_iframe_UMT"));
		obj_hidden_iframe.style.display = "none";
		document.getElementsByTagName("body")[0].appendChild(obj_hidden_iframe);
	}
	//alert(str_href);
	obj_hidden_iframe.src = str_href;
}

function Display_bubble( n_left, n_top, str_text, n_width )
{
	var obj_bubble = document.getElementById("frame_bubble");
	
	if(!obj_bubble)
	{
		obj_bubble = document.createElement("span");
		obj_bubble.setAttribute("id", "frame_bubble");
		document.getElementsByTagName("body")[0].appendChild(obj_bubble);
	}
	switch(n_width)
	{
		case 100:	obj_bubble.className = "C_BUBBLE_100x50";	break;
		case 200:	obj_bubble.className = "C_BUBBLE_200x50";	break;
		case 300:	obj_bubble.className = "C_BUBBLE_300x50";	break;
		default:	obj_bubble.className = "C_BUBBLE_300x50";	break;
	}
	
	obj_bubble.style.left = n_left + "px";
	obj_bubble.style.top = n_top + "px";
	obj_bubble.innerHTML = str_text;
	Set_object_opacity(obj_bubble, 100);
	obj_bubble.style.display = "block";
	obj_bubble.onclick = Hide_bubble;
}

function Display_bubble_over_object( str_element_id, str_text, n_shift_left, n_shift_top, n_late, n_width )
{
	var obj_element;
	var obj_coords;
	
	n_width = n_width ? n_width : 300;
	
	if(n_late > 0)
	{
		setTimeout("Display_bubble_over_object(\"" + str_element_id + "\",\"" + str_text + "\"," + n_shift_left + "," + n_shift_top + ",0," + n_width + ");", n_late);
	}
	else
	{
		obj_element = document.getElementById(str_element_id);
		obj_coords = Get_object_absolute_coords(obj_element);
		Display_bubble(obj_coords.left + (obj_element.clientWidth / 2) + n_shift_left, obj_coords.top - 50 + n_shift_top, str_text, n_width);
	}
}

function Hide_bubble( b_fade )
{
	var obj_bubble = document.getElementById("frame_bubble");
	if(obj_bubble)
	{
		if(b_fade)
		{
			Fade_object("frame_bubble", 100, 0, -4, 20, -1);
		}
		else
		{
			obj_bubble.style.display = "none";
			obj_bubble.innerHTML = "";
		}
	}
}

function Get_element_id( obj_element )
{
	var str_element_id = obj_element.getAttribute("id");
	var n_element_index = 1;

	if(!str_element_id)
	{
		//No ID >>> Search free and add unique ID to element
		while(document.getElementById("element_" + n_element_index))
		{
			n_element_index++;
		}
		str_element_id = "element_" + n_element_index;
		obj_element.setAttribute("id", str_element_id);
	}
	return(str_element_id);
}

function Update_bt_save_job( str_PID )
{
	var obj_button = document.getElementById("bt_save_job" + str_PID);
	
	if(obj_button)
	{
		obj_button.getElementsByTagName("span")[0].className = "C_ICON_FAVORITE_16x16";
		if(obj_button.getElementsByTagName("font")[0])
		{
			obj_button.getElementsByTagName("font")[0].innerHTML = m_str_dico_save;
		}
		obj_button.setAttribute("href", "/AccountUser");
		obj_button.setAttribute("onclick", "");
		Display_bubble_over_object("bt_save_job" + str_PID, m_str_dico_save, -25, - (GetScrollTop()), 0, 100);
		document.getElementById("frame_bubble").setAttribute("PID", str_PID);
		setTimeout("if(document.getElementById('frame_bubble').getAttribute('PID') == '" + str_PID + "') { Hide_bubble(true); }", 1000);
	}
}

var m_b_display_bubble;
var m_b_big_size;
function addJobToFavorite( obj_href, n_posting_id, b_display_bubble, b_big_size, obj_event )
{
	var str_params = "ID=" + n_posting_id + "&Ajax=1";;
	var obj_icon;
	m_b_display_bubble = b_display_bubble;
	m_b_big_size = b_big_size;
	
	if(m_obj_update_icon_href)
	{
		update_Icon_late(m_obj_update_icon_href);
	}
	m_obj_update_icon_href = obj_href;
	Http_request("/JobSave.asp", str_params, "update_Icon");
	
	obj_icon = obj_href.getElementsByTagName("span")[0];
	obj_icon.className = (b_big_size ? "C_ICON_LOADING_30x30" : "C_ICON_LOADING");
	obj_href.blur();
	
	
	if(obj_event)
	{
		try
		{
			obj_event.stopPropagation();
			obj_event.cancelBubble = true;
		} catch(err) {}
	}
}
	
var m_obj_update_icon_href = null;
function update_Icon( str_datas )
{
	if(str_datas == "OK")
	{
		if(m_obj_update_icon_href)
		{
			setTimeout("update_Icon_late(m_obj_update_icon_href);", 1000);
		}
	}
	else if(str_datas == "DISCONNECTED")
	{
		document.location = "/AccountUser/USR_login.asp";
	}
}
function update_Icon_late( obj_href )
{
	if(obj_href)
	{
		var obj_icon = obj_href.getElementsByTagName("span")[0];

		obj_icon.className = (m_b_big_size ? "C_ICON_FAVORITE_30x30" : "C_ICON_FAVORITE_16x16");
		obj_href.href = "/AccountUser/USR_home.asp"
		obj_href.onclick = null;
		
		if(m_b_display_bubble)
		{
			Display_bubble_over_object(Get_element_id(obj_href.parentNode), m_str_dico_save, -25, - (GetScrollTop()), 0, 100);
			setTimeout("Hide_bubble(true);", 1000);
		}
		m_obj_update_icon_href = null;
	}
}

function Get_max_ZIndex()
{
	var i;
	var n_max_zindex = 0;
	var n_zindex;
	var obj_all_tags = document.documentElement.getElementsByTagName("*");
	if(obj_all_tags)
	{
		for(i=0; i<obj_all_tags.length; i++)
		{
			n_zindex = null;
			if(obj_all_tags[i].currentStyle)
			{
				n_zindex = obj_all_tags[i].currentStyle.zIndex;
			}								   
			else if(window.getComputedStyle)
			{
				n_zindex = window.getComputedStyle(obj_all_tags[i], null).zIndex;
			}
			else
			{	
				n_zindex = obj_all_tags[i].style.zIndex;
			}
			n_max_zindex = Math.max(n_zindex, n_max_zindex);
		}
	}
	return(n_max_zindex);
}

function Get_object_style( obj_object, str_style_name, str_property_name )
{
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		return(eval("obj_object.currentStyle." + str_style_name));
	}
	else
	{
		return(eval("document.defaultView.getComputedStyle(obj_object, null).getPropertyValue('" + str_property_name + "', null)"));
	}
}

function ToNumeric( str_expression )
{
	return(0 + eval(str_expression.match(/\d/g).join("")));
}

function Xor_mask( str_expression, n_ascii_mask )
{
	var i;
	var str_result = "";
	for(i=0; i<str_expression.length; i++)
	{
		str_result += String.fromCharCode(n_ascii_mask ^ str_expression.charCodeAt(i));
	}
	return(str_result);
}

function ScrSbmt( str_default_element_id, str_scr_element_id )
{
	var obj_input;
	var obj_input_scr;
	var obj_form;
	var n_key = 6 + Math.round(Math.random() * 57);

	if(document.getElementById(str_default_element_id))
	{
		obj_input = document.getElementById(str_default_element_id);
		obj_input_scr = document.getElementById(str_scr_element_id);
		if(!obj_input_scr)
		{
			obj_input_scr = document.createElement("input");
			obj_input_scr.setAttribute("type", "hidden");
			obj_input_scr.setAttribute("name", str_scr_element_id);
			obj_input_scr.setAttribute("id", str_scr_element_id);
			obj_form = Search_parent_tag(obj_input, "form");
			obj_form.appendChild(obj_input_scr);
		}
	
		obj_input_scr.value = "@" + n_key + "@" + Xor_mask(obj_input.value, n_key);
		//Echo(str_default_element_id + " secured to " + str_scr_element_id + " (" + obj_input_scr.value + ")");
		obj_input.style.color = "#FFFFFF";
		obj_input.setAttribute("backupvalue", obj_input.value);
		obj_input.value = "";
	}
}
function ScrSbmtRvrs( str_default_element_id, str_scr_element_id )
{
	var obj_input = document.getElementById(str_default_element_id);
	var obj_input_scr = document.getElementById(str_scr_element_id);
	
	if(obj_input)
	{
		obj_input.value = obj_input.getAttribute("backupvalue");
		obj_input.setAttribute("backupvalue", "");
		obj_input.style.color = "";
	}
	if(obj_input_scr)
	{
		obj_input_scr.value = "";
	}
}

function txt_date_OnBlur( obj_input )
{
	var str_date = new String(obj_input.value);
	var str_list_item = new Array();
	
	if(str_date != "")
	{
		str_date = Replace(str_date, ".", "/");
		str_date = Replace(str_date, "-", "/");
		str_date = Replace(str_date, " ", "/");
		
		str_list_item = str_date.split("/");
		if( str_list_item.length == 3 )
		{
			if(Val(str_list_item[0]) < 10) { str_list_item[0] = "0" + Val(str_list_item[0]); }
			if(Val(str_list_item[1]) < 10) { str_list_item[1] = "0" + Val(str_list_item[1]); }
			if(Val(str_list_item[2]) < 50)
			{
				str_list_item[2] = 2000 + Val(str_list_item[2]);
			}
			else if(Val(str_list_item[2]) < 100)
			{
				str_list_item[2] = 1900 + Val(str_list_item[2]);
			}
			obj_input.value = str_list_item.join( "/" );
		}
	}
}

function Replace( str_expression, str_find, str_replace )
{
	var str_result = new String(str_expression);

	if(str_find.substr(0, 1) != "-")
	{
		return(eval("str_result.replace(/[" + str_find + "]/g, '" + str_replace + "');"));
	}
	else
	{
		return(eval("str_result.replace(/" + str_find + "/g, '" + str_replace + "');"));
	}
}

function HTMLEncode( str_HTML_expression )
{
	str_HTML_expression = str_HTML_expression.replace(/&/g, "&amp;");
	str_HTML_expression = str_HTML_expression.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
	return(str_HTML_expression);
}
function HTMLDecode( str_HTML_expression )
{
	str_HTML_expression = str_HTML_expression.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&#39;/g, "'");
	str_HTML_expression = str_HTML_expression.replace(/&amp;/g, "&");
	return(str_HTML_expression);
}

function Switch_frame_as_loading( str_frame_id, b_loading )
{
	var obj_frame = document.getElementById(str_frame_id);
	var obj_coords = Get_object_absolute_coords(obj_frame);
	var obj_loading = document.getElementById("obj_loading_switch");

	if(!obj_loading)
	{
		obj_loading = document.createElement("span");
		obj_loading.setAttribute("id", "obj_loading_switch");
		obj_loading.className = "C_ICON_LOADING";
		document.getElementsByTagName("body")[0].appendChild(obj_loading);
	}
	if(b_loading)
	{
		obj_loading.style.position = "absolute";
		obj_loading.style.left = (obj_coords.left + ((obj_frame.clientWidth - 16) / 2)) + "px";
		obj_loading.style.top = (obj_coords.top + ((obj_frame.clientHeight - 16) / 2)) + "px";
	}
	obj_loading.style.display = b_loading ? "block" : "none";
	obj_frame.style.visibility = b_loading ? "hidden" : "visible";
}

function Blink_input_object( str_element_id, n_blink_count, n_interval, str_BgColor, b_state, b_focus )
{
	var obj_element = document.getElementById(str_element_id);
	if(b_state)
	{
		obj_element.setAttribute("BackUpBackgroundColor", obj_element.style.backgroundColor);
		obj_element.style.backgroundColor = str_BgColor;
		b_state = false;
	}
	else
	{
		obj_element.style.backgroundColor = obj_element.getAttribute("BackUpBackgroundColor");
		b_state = true;
	}
	n_blink_count--;
	if(n_blink_count > 0)
	{
		setTimeout(	"Blink_input_object('" + str_element_id + "'," + n_blink_count + "," + n_interval + ",'" + str_BgColor + "'," + b_state + "," + b_focus + ")", n_interval );
	}
	else
	{
		if(b_focus)
		{
			try
			{
				obj_element.focus();
			}
			catch(err) {}
		}
	}
}
