// ----------------------------------------------------------------------------
//------ Global Variables
	
	var global_selected = false;
// ----------------------------------------------------------------------------
// Radio Button Validation
// copyright Stephen Chapman, 15th Nov 2004,14th Sep 2005
// you may copy this function but please keep the copyright notice with it
function valButton(btn, rdisplay_name) {
var cnt = -1;
for (var i=btn.length-1; i > -1; i--) {
   if (btn[i].checked) {cnt = i; i = -1;}
   }
if (cnt > -1) return btn[cnt].value;
else 
alert("Please make a selection for "+rdisplay_name)
return null;
}

<!--SAMPLE FORM -------------------------------->
var fieldalias="Email address"

function verify(element1, element2){
var passed=false
if (element1.value==''){
alert("Please enter your "+fieldalias+"!")
element1.focus()
}
else if (element2.value==''){
alert("Please re-enter your "+fieldalias+"!")
element2.focus()
}
else if (element1.value!=element2.value){
alert("The two "+fieldalias+"es do not match")
element1.select()
}
else
passed=true

return passed

}

// ----------------------------------------------------------------------------	
	function browse_large_keys(element_name, key_table_name, keys, element_object)
	{
		key_url = "browse_keys.jsp?element_name=" + element_name;
		key_url += "&keytable=" + key_table_name;
		key_url += "&keys=" + keys;
		key_url += "&element_value=" + integer(element_object);
		
		jwindow_size(key_url, 400, 330);
	}	
// ----------------------------------------------------------------------------
	function clear_date(date_prefix)
	{
		cd_obj = element(date_prefix + "_month");
		
		if(  !is_object(cd_obj)  )
			return;
		
		cd_obj.value = "";
		cd_obj.focus();
		
		cd_obj = element(date_prefix + "_day");
		cd_obj.value = "";
			
		cd_obj = element(date_prefix + "_year");
		cd_obj.value = "";
	}
// ----------------------------------------------------------------------------
	function element(element_name)
	{
			frm = document.frmMain;
			obj = eval("frm." + element_name);
			return obj;
	}
// ----------------------------------------------------------------------------
	function focused(element_name)
	{
			frm = document.frmMain;
			obj = eval("frm." + element_name);
			
			if(is_object(obj))
				obj.focus();
	}	
// ----------------------------------------------------------------------------
	function float_value(gf_obj)
	{
		if(!is_object(gf_obj))
			return 0;
				
		if(!isNumeric(gf_obj.value))
			return 0;
		else
			return parseFloat(trim(gf_obj.value));
	}	
// ----------------------------------------------------------------------------
	function force_numeric(fn_object, fn_display_name)
	{
		if(!isNumeric(fn_object.value))
		{
			alert("Please enter a numeric value for: " + fn_display_name);
			fn_object.focus();
		}
		else if(parseFloat(trim(fn_object.value)) <= 0)
		{
			alert("The value for: " + fn_display_name + " must be greater than zero");
			fn_object.focus();
		}
		else
			return true;
			
		return false;	
	}
// ----------------------------------------------------------------------------
	function getObject(go_name, go_index)
	{
		frm = document.frmMain;
		
		go_obj = eval("frm." + go_name);
		
		if(!is_object(go_obj))
			return null;
		
		if(go_obj.length == null)
			return go_obj;
		else
		{
			go_obj = eval("frm." + go_name + "[" + go_index + "]");
			return go_obj;
		}
	}	
// ----------------------------------------------------------------------------	
	function integer(gi_obj)
	{
		if(!is_object(gi_obj))
			return 0;
		
		if(!isNumeric(gi_obj.value))
			return 0;
		else
			return parseInt(trim(gi_obj.value));
	}
// ----------------------------------------------------------------------------		
	function invalidate_form()
	{
		document.frmMain.check_form_submission.value = "false";
	}	
// ----------------------------------------------------------------------------
	function is_a_checkbox_checked(cc_obj)
	{
			if(!is_object(cc_obj))
				return false;
				
			cc_total_count = cc_obj.length;
			
			if(cc_total_count == null)
				return cc_obj.checked;
			else
			{
				for(cc_count = 0; cc_count < cc_total_count; cc_count++)
				{
					if(cc_obj[cc_count].checked)
						return true;
				}
			}
			
			return false;
	}
// ----------------------------------------------------------------------------	
	function is_date_before(month_obj, day_obj, year_obj, target_month, target_day, target_year)
	{
		if(!valid_date(month_obj, day_obj, year_obj))
			return false;
			
		v_month = integer(month_obj);
		v_day = integer(day_obj);
		v_year = integer(year_obj);
		
		if(target_year > v_year)
			return true;
		else if(  (target_year == v_year) && (target_month > v_month)  )
			return true;
		else if(  (target_year == v_year ) && (target_month == v_month) && (target_day > v_day) )
			return true;
		else
			return false;
	}	
// ----------------------------------------------------------------------------
	function isNumeric(in_value)
	{
		if(in_value == null || in_value == "")
			return false;
			
		in_value = trim(in_value);
	
		in_valid = "0123456789";
		in_period_count = 0;
		in_comma_count = 0;
		
		if(in_value.charAt(0) == "-")
			in_start = 1;
		else
			in_start = 0;
			
		for(in_count = in_start; in_count < in_value.length; in_count++)
		{
			in_test = in_value.charAt(in_count);
			
			if(in_test == ".")
			{
				in_period_count++;
				
				if(in_period_count > 1)
					return false;
			}
			else if(in_test == ",")
			{
				in_comma_count++;
				
				if(in_comma_count > 1)
					return false;
			}			
			else if(in_valid.indexOf(in_test) < 0)
				return false;
		}
	
		return true;	
	}
// ----------------------------------------------------------------------------	
	function is_in(in_value, in_array)
	{
		if(in_value == null || in_array == null)
			return false;
			
		for(in_i = 0; in_i < in_array.length; in_i++)
		{
			if(in_value.toLowerCase() == in_array[in_i].toLowerCase())
				return true;
		}
		
		return false;
	}	
// ----------------------------------------------------------------------------
	function is_object(io_obj)
	{
		if(!io_obj || io_obj == null)
			return false;
		else
			return true;
	}	
// ----------------------------------------------------------------------------
	function is_selectbox_selected(sel_obj)
	{
		if(!is_object(sel_obj))
			return false;
			
		sel_total = sel_obj.options.length;
		
		if(sel_total == null)
			return false;
	
		if(sel_obj.selectedIndex == -1)
			return false;
		
		return true;	
	}
// ----------------------------------------------------------------------------
	function jwindow(url)
	{
		openCenteredWindow(url, 600, 500, 'win','resizable=yes,scrollbars=yes');
	}
// ----------------------------------------------------------------------------
	function jwindow_size(url, width, height)
	{
		openCenteredWindow(url, width, height, 'win','resizable=yes,scrollbars=yes');
	}	
// ----------------------------------------------------------------------------
	function len(lvalue)
	{
		if(lvalue == null || lvalue == "")
			return 0;
			
		total = lvalue.length;

		if(total == null)
			return 0;
		else
			return parseInt(total);
	}
// ----------------------------------------------------------------------------
	function ltrim(t_value)
	{
		if(t_value == null || t_value == "")
			return "";
			
		t_forward = "";
		t_start = false;
		
		for(t = 0; t < t_value.length; t++)
		{
			if(!t_start && t_value.charAt(t) == " ")
				continue;
			else if(!t_start && t_value.charAt(t) != " ")
			{
				t_start = true;
				t_forward += t_value.charAt(t);
			}
			else
				t_forward += t_value.charAt(t);
		}
		
		return t_forward;
	}	
// ----------------------------------------------------------------------------
	function numeric(fn_object, fn_display_name)
	{
		if(!isNumeric(fn_object.value))
		{
			alert("Please enter a numeric value for: " + fn_display_name);
			fn_object.focus();
		}
		else
			return true;
			
		return false;	
	}
// ----------------------------------------------------------------------------
	function openCenteredWindow(url, width, height, name, parms) {
	   var left = Math.floor( (screen.width - width) / 2);
	   var top = Math.floor( (screen.height - height) / 2);
	   var winParms = "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width;
	   if (parms) { winParms += "," + parms; }
	   var win = window.open(url, name, winParms);
	   if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}
// ----------------------------------------------------------------------------
	function rtrim(t_value)
	{
		if(t_value == null || t_value == "")
			return "";
			
		t_back = "";
		t_start = false;
		
		for(t = (t_value.length - 1); t > -1; t--)
		{
			if(!t_start && t_value.charAt(t) == " ")
				continue;
			else if(!t_start && t_value.charAt(t) != " ")
			{
				t_start = true;
				t_back += t_value.charAt(t);
			}
			else
				t_back += t_value.charAt(t);
		}
		
		t_forward = "";
		
		for(t = (t_back.length - 1); t > - 1; t--)
		{
			t_forward += t_back.charAt(t);
		}
		
		return t_forward;
	}	
// ----------------------------------------------------------------------------
	function row_over(row)
	{
			row.style.cursor = "hand";
			row.bgColor = "#ebebeb";
			row.borderColor = "#ebebeb";
	}
// ----------------------------------------------------------------------------
	function row_out(row)
	{
			row.style.cursor = "default";
			row.bgColor = "#fofofo";
			row.borderColor = "#fofofo";
	}
// ----------------------------------------------------------------------------
	function select_all_checkboxes(sac_obj)
	{
		if(!is_object(sac_obj))
			return;
			
		sac_total_count = sac_obj.length;
		
		global_selected = !global_selected;
		
		if(sac_total_count == null)
			sac_obj.checked = global_selected;
		else
		{
			for(sac_count = 0; sac_count < sac_total_count; sac_count++)
			{
				sac_obj[sac_count].checked = global_selected;
			}
		}
	}	
// ----------------------------------------------------------------------------
	function selectbox_add(add_obj, add_display, add_value)
	{
		if(!is_object(add_obj))
			return;
			
		add_total = add_obj.options.length;
		
		if(add_total == null)
			return;
			
		add_obj.options[add_total] = new Option(add_display, add_value);
	}	
// ----------------------------------------------------------------------------
	function selectbox_all_values(all_obj)
	{
		if(!is_object(all_obj))
			return "";
			
		all_total = all_obj.options.length;
		
		if(all_total == null)
			return "";
		
		all_str = "";
		
		for(all_i = 0; all_i < all_total; all_i++)
		{
			if(all_i > 0)
				all_str += ",";
				
			all_str += all_obj.options[all_i].value;
		}
		
		return all_str;
	}
// ----------------------------------------------------------------------------
	function selectbox_array(sa_obj)
	{
		if(!is_object(sa_obj))
			return null;
			
		sa_count = selectbox_count(sa_obj);
		
		if(sa_count == 0)
			return null;
			
		sa_return = new Array();
		
		for(sa_i = 0; sa_i < sa_count; sa_i++)
		{
			sa_return[sa_i] = sa_obj.options[sa_i].value;
		}
		
		return sa_return;
	}		
// ----------------------------------------------------------------------------
	function selectbox_clear(csw_obj)
	{
		if(!selectbox_clear_noselect(csw_obj))
			return;
			
		selectbox_add(csw_obj, "--- select ---", "0");
		csw_obj.selectedIndex = 0;
		
		return;
	}
// ----------------------------------------------------------------------------
	function selectbox_clear_noselect(clear_obj)
	{
		if(!is_object(clear_obj))
			return;
			
		clear_total = clear_obj.options.length;
		
		if(clear_total == null)
			return;
		
		for(clear_i = clear_total; clear_i > -1; clear_i--)
		{
			clear_obj.options[clear_i] = null;
		}
		
	}
// ----------------------------------------------------------------------------
	function selectbox_clear_except_first(clear_obj)
	{
		if(!is_object(clear_obj))
			return;
			
		clear_total = clear_obj.options.length;
		
		if(clear_total == null)
			return;
		
		for(clear_i = clear_total; clear_i > 0; clear_i--)
		{
			clear_obj.options[clear_i] = null;
		}
		
	}			
// ----------------------------------------------------------------------------
	function selectbox_copy(copy_from, copy_to)
	{
		if(!is_object(copy_from) || !is_object(copy_to))
			return;
			
		copy_from_index = copy_from.options.length;
		copy_to_index = copy_to.options.length;
		
		if(copy_from_index == null)
			return;
		
		if(copy_to_index == null)
			copy_to_index = 0;
			
		copy_index = copy_from.selectedIndex;
		
		if(copy_index == -1)
			return;
			
		using_multiple = false;
		
		if(selectbox_selected_count(copy_from) > 1)
			using_multiple = true;
		
		if(!using_multiple)
		{		
				copy_text = copy_from.options[copy_index].text;
				copy_value = copy_from.options[copy_index].value;
		
				sct_values = selectbox_array(copy_to);
				
				if(is_in(copy_value, sct_values))
				{
					alert("Value already exists in list");
					return;
				}
 
 				selectbox_add(copy_to, copy_text, copy_value);			
		}
		else
		{
				c_options = copy_from.options;
				
				for(c = 0; c < c_options.length; c++)
				{
					copy_text = c_options[c].text;
					copy_value = c_options[c].value;
		
					sct_values = selectbox_array(copy_to);
				
					if(is_in(copy_value, sct_values))
						continue;
						
					selectbox_add(copy_to, copy_text, copy_value);		
				}
		}
		
		if(using_multiple)
			selectbox_first(copy_to);
		else
			selectbox_last(copy_to);
	}
// ----------------------------------------------------------------------------	
	function selectbox_copy_text(copy_from, copy_to)
	{
		if(!is_object(copy_from) || !is_object(copy_to))
			return;
		
		sct_values = selectbox_array(copy_to);
		
		if(is_in(copy_from.value, sct_values))
		{
			alert("Value already exists in list");
			return;
		}
		
		selectbox_add(copy_to, copy_from.value, copy_from.value);	
		
		selectbox_last(copy_to);
	}		
// ----------------------------------------------------------------------------
	function selectbox_count(count_obj)
	{
		if(!is_object(count_obj))
			return 0;
		
		count_total = count_obj.options.length;
		
		if(count_total == null)
			return 0;

		return count_total;		
	}
// ----------------------------------------------------------------------------	
	function selectbox_first(select_obj)
	{
		if(!is_object(select_obj))
			return;
			
		select_total = select_obj.options.length;
		
		if(select_total == null)
			return;
			
		select_obj.selectedIndex = 0;
	}
// ----------------------------------------------------------------------------	
	function selectbox_index(select_obj)
	{
		if(!is_object(select_obj))
			return 0;
		else
			return select_obj.selectedIndex;
	}		
// ----------------------------------------------------------------------------	
	function selectbox_last(select_obj)
	{
		if(!is_object(select_obj))
			return;
			
		select_total = select_obj.options.length;
		
		if(select_total == null)
			return;
			
		select_obj.selectedIndex = (select_total - 1);
	}	
// ----------------------------------------------------------------------------
	function selectbox_move_down(down_obj)
	{
		if(!is_object(down_obj))
			return;
			
		down_total = down_obj.options.length;
		
		if(down_total == null)
			return;
			
		down_index = down_obj.selectedIndex;
		
		if(down_index == -1)
			return;
		
		if(down_index >= (down_total - 1) )
			return;
			
		down_values = new Array();
		down_text = new Array();
		
		for(down_i = 0; down_i < down_total; down_i++)
		{
			down_values[down_i] = down_obj.options[down_i].value;
			down_text[down_i] = down_obj.options[down_i].text;
		}	
		
		selectbox_clear_noselect(down_obj);
		
		temp_value = down_values[down_index];
		temp_text =  down_text[down_index];
		
		down_values[down_index] = down_values[down_index + 1];
		down_text[down_index] = down_text[down_index + 1];
		
		down_values[down_index + 1] = temp_value;
		down_text[down_index + 1] = temp_text;
		
		for(down_i = 0; down_i < down_total; down_i++)
		{
			selectbox_add(down_obj, down_text[down_i], down_values[down_i]);
		}
		
		down_obj.selectedIndex = (down_index + 1);	
	}
// ----------------------------------------------------------------------------
	function selectbox_move_up(up_obj)
	{
		if(!is_object(up_obj))
			return;
			
		up_total = up_obj.options.length;
		
		if(up_total == null)
			return;
			
		up_index = up_obj.selectedIndex;
		
		if(up_index == -1)
			return;
		
		if(up_index < 1)
			return;
			
		up_values = new Array();
		up_text = new Array();
		
		for(up_i = 0; up_i < up_total; up_i++)
		{
			up_values[up_i] = up_obj.options[up_i].value;
			up_text[up_i] = up_obj.options[up_i].text;
		}	
		
		selectbox_clear_noselect(up_obj);
		
		temp_value = up_values[up_index - 1];
		temp_text =  up_text[up_index - 1];
		
		up_values[up_index - 1] = up_values[up_index];
		up_text[up_index - 1] = up_text[up_index];
		
		up_values[up_index] = temp_value;
		up_text[up_index] = temp_text;
		
		for(up_i = 0; up_i < up_total; up_i++)
		{
			selectbox_add(up_obj, up_text[up_i], up_values[up_i]);
		}
		
		up_obj.selectedIndex = (up_index - 1);
			
	}
// ----------------------------------------------------------------------------
	function selectbox_selected_count(count_obj)
	{
		if(!is_object(count_obj))
			return 0;
		
		count_total = count_obj.options.length;
		
		if(count_total == null)
			return 0;
			
		sopt = count_obj.options;
		
		sc_return = 0;
		
		for(sc = 0; sc < count_total; sc++)
		{
			if(sopt[sc].selected)
				sc_return++;
		}	

		return sc_return;		
	}	
// ----------------------------------------------------------------------------
	function selectbox_text(st_obj)
	{
		if(!is_object(st_obj))
			return "";
			
		st_total = st_obj.options.length;
		
		if(st_total == null)
			return "";
		else if(!is_selectbox_selected(st_obj))
			return "";
					
		return st_obj.options[st_obj.selectedIndex].text;
	}
// ----------------------------------------------------------------------------
	function selectbox_remove(remove_obj)
	{
		if(!is_object(remove_obj))
			return;
		
		remove_total = remove_obj.options.length;
		
		if(remove_total == null)
			return;
		else if(!is_selectbox_selected(remove_obj))
			return;
		
		remove_obj.options[remove_obj.selectedIndex] = null;
		
		if(selectbox_count(remove_obj) > 0)
			remove_obj.selectedIndex = 0;
	}	
// ----------------------------------------------------------------------------
	function selectbox_value(s_obj)
	{
		s_return = '';
		
		if(!is_object(s_obj))
			return s_return;
			
		s_total = s_obj.options.length;
		
		if(s_total == null)
			return s_return;
		else if(!is_selectbox_selected(s_obj))
			return s_return;
		
		return s_obj.options[s_obj.selectedIndex].value;
	}	
// ----------------------------------------------------------------------------	
	function sendform(sf_target)
	{
		frm = document.frmMain;
		frm.action = sf_target;
		invalidate_form();
		frm.submit();
	}
// ----------------------------------------------------------------------------
	function set_date(date_prefix, sd_month, sd_day, sd_year)
	{
		cd_obj = element(date_prefix + "_month");
		
		if(  !is_object(cd_obj)  )
			return;
		
		cd_obj.value = sd_month;
		cd_obj.focus();
		
		cd_obj = element(date_prefix + "_day");
		cd_obj.value = sd_day;
			
		cd_obj = element(date_prefix + "_year");
		cd_obj.value = sd_year;
	}	
// ----------------------------------------------------------------------------
	function submitform(sf_target)
	{
		frm = document.frmMain;
		frm.action = sf_target;
		frm.submit();
	}
// ----------------------------------------------------------------------------
	function trim(str)
	{
		v = ltrim(str);
		v = rtrim(v);
		return v;
	}
// ----------------------------------------------------------------------------
	function valid_date(vd_month_obj, vd_day_obj, vd_year_obj)
	{
		v_month = integer(vd_month_obj);
		v_day = integer(vd_day_obj);
		v_year = integer(vd_year_obj);
		
		if(v_month < 1 || v_month > 12 || v_day < 1 || v_day > 31 || v_year < 1900 || v_year > 2999)
			return false;
		else if( (v_month == 1 || v_month == 3 || v_month == 5 || v_month == 7 || v_month == 8 || v_month == 10 || v_month == 12)  && ( v_day >= 31 )    )
			return false;
		else if(v_month == 20 && v_day >= 30)
			return false;
		else
			return true;
	}
// ----------------------------------------------------------------------------
	function validate(v_object, v_display_name)
	{
		if(trim(v_object.value) == "")
		{
			alert("Please enter a value for: " + v_display_name);
			v_object.focus();
		}
		else
			return true;
			
		return false;	
	}
// ----------------------------------------------------------------------------		
	function validate_alias(ve_obj)
	{
		if(!is_object(ve_obj))
			return false;
		else if(   len(trim(ve_obj.value)) < 3)
		{
			alert("Please enter a valid email address");
			ve_obj.focus();
			return false;
		}
			
		period_count = 0;
		at_count = 0;
		
		for(ve_i = 0; ve_i < ve_obj.value.length; ve_i++)
		{
			ve_char = ve_obj.value.charAt(ve_i);
			
			if(ve_char == "@")
				at_count++;
			else if(ve_char == ".")
				period_count++;
		}
		
		if(at_count == 0)
			return true;
		else		{
			alert("Please enter your ALIAS only! Your alias is the combination of text before the @ symbol.");
			ve_obj.focus();		
			return false;
		}
	
	}
// ----------------------------------------------------------------------------		

	function validate_date(vd_month_object, vd_day_object, vd_year_object, vd_display_name)
	{
		if(!valid_date(vd_month_object, vd_day_object, vd_year_object))
		{	
			alert("Please enter a valid date for: " + vd_display_name);
			vd_month_object.focus();
			return false;
		}
		
		return true;
	}	
// ----------------------------------------------------------------------------	
	function validate_email2(ve_obj)
	{
		if(!is_object(ve_obj))
			return false;
		else if(   len(trim(ve_obj.value)) < 3)
		{
			alert("Please enter a valid email address");
			ve_obj.focus();
			return false;
		}
			
		period_count = 0;
		at_count = 0;
		
		for(ve_i = 0; ve_i < ve_obj.value.length; ve_i++)
		{
			ve_char = ve_obj.value.charAt(ve_i);
			
			if(ve_char == "@")
				at_count++;
			else if(ve_char == ".")
				period_count++;
		}
		
		if(at_count == 1 && period_count > 0)
			return true;
		else
		{
			alert("Please enter a valid email address");
			ve_obj.focus();		
			return false;
		}
	
	}
// ----------------------------------------------------------------------------	
	
	

var testresults
function checkemail(){
var str=document.validation.emailcheck.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
testresults=true
else{
alert("Please input a valid email address!")
testresults=false
}
return (testresults)
}

function checkbae(){
if (document.layers||document.getElementById||document.all)
return checkemail()
else
return true
}

	
// ----------------------------------------------------------------------------	
	function validate_large_key(vs_object, vs_display_name)
	{
		large_value = integer(vs_object);
		
		if(large_value == 0)
		{
			alert("Please select a value for: " + vs_display_name);
		}
		else
			return true;
			
		return false;	
	}		
// ----------------------------------------------------------------------------	
	function validate_select(vs_object, vs_display_name)
	{
		if(vs_object.selectedIndex == 0)
		{
			alert("Please select a " + vs_display_name);
			vs_object.focus();
		}
		else
			return true;
			
		return false;	
	}
// ----------------------------------------------------------------------------
	function validate_textarea(v_object, v_display_name, v_max)
	{
		if(trim(v_object.value) == "")
		{
			alert("Please enter a value for: " + v_display_name);
			v_object.focus();
		}
		else if( (parseInt(v_max) > 0) && (v_object.value.length > parseInt(v_max))  )
		{
			alert(v_display_name + ":  must be " + v_max + " characters or less");
			v_object.focus();
		}
		else
			return true;
			
		return false;	
	}	
// ----------------------------------------------------------------------------


// LabVantage Index codes
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}



//--- Macromedia Codes


	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
// ----------------------------------------------------------------------------
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
// ----------------------------------------------------------------------------
	function MM_findObj(n, d) { //v4.0
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && document.getElementById) x=document.getElementById(n); return x;
	}
// ----------------------------------------------------------------------------
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
// ----------------------------------------------------------------------------