function GenJS_ShowUserNote(id)
{
	notewin = window.open(
		root_path + "/admin/User/UserNote.php?<?= $url_vals ?>&user_id=" + id,
		"note_win",
		"width=400,height=400," +
		"scrollbars=1,statusbar=0,toolbar=0,menubar=0,resizable=1"
	);
}
function GenJS_DetailsWindow(vehid)
{
	view_det = window.open(
		root_path + "/Details/Details.php?" + url_vals + "&vehid=" + vehid,
		"details_win",
		"width=750,height=550," +
		"statusbar=0,toolbar=0,menubar=0,resizable=1,scrollbars=1"
	);
}

function GenJS_Print()
{
	if(window.print)
	{
		window.print();
	}
	else
	{
		alert("Your browser does not support this operation, " +
		      "please use the print icon in your browsers toolbar");
	}
}

function GenJS_AvailWindow()
{
	exp_ratings = window.open(
		root_path + "/Availability/AvailabilityExp.php?" + url_vals,
		"ratings_win",
		"width=540,height=300," +
		"statusbar=0,toolbar=0,menubar=0,resizable=1,scrollbars=1"
	);
}

function GenJS_SomethingChecked(checkbox_e)
{
	// if there is only one item, it's not dealt with as an array
	if(!checkbox_e.length)
	{
		if(checkbox_e.checked)
		{
			return true;
		}

	// else move through all the items looking for checked ones
	}
	else
	{
		for(var i = 0; i < checkbox_e.length; i++)
		{
			if(checkbox_e[i].checked)
			{
				return true;
			}
		}
	}

	return false;
}// end function 

function GenJS_GlueCheckboxVals(glue, checkbox_e, store_e)
{
	var str_values = '';

	// if there is only one item, it's not dealt with as an array
	if(!checkbox_e.length)
	{
		if(checkbox_e.checked)
		{
			str_values = checkbox_e.value;
		}

	// else move through all the items looking for checked ones
	}
	else
	{
		for(var i = 0; i < checkbox_e.length; i++)
		{
			if(checkbox_e[i].checked)
			{
				if(str_values == '')
				{
					str_values = checkbox_e[i].value;

				}
				else
				{
					str_values = str_values + glue + checkbox_e[i].value;
				}
			}// end if checked
		}// end foreach checkbox
	}// end else if more than one checkbox

	// if there were no favorites checked
	if(str_values == '') 
	{
		store_e.value = "";
		return false;

	}
	else
	{
		store_e.value = str_values;
		return true;
	}
}// end function 

function GenJS_GetSelected(menu)
{
	return menu.options[menu.selectedIndex].value;
}

function GenJS_SelectOption(menu,setting)
{
	for(var i=0; i < menu.options.length; i++)
	{
		if(menu.options[i].value == setting)
		{
			menu.selectedIndex = i;
		}
	}// end for
}

/************************************************************
* function that empties and reloads the menu sent with the
* 	options sent. Options should be an array and each value
* 	will be both the menu option and the menu option's value.
*/
function GenJS_ResetOptions(menu,newoptions,setting)
{
	menu.options.length = 0; 

	for(var i=0; i < newoptions.length; i++)
	{
		menu.options[i] = new Option(newoptions[i], newoptions[i]);
		if(newoptions[i] == setting)
		{
			menu.selectedIndex = i;
			//menu.options[i].selected = true;
		}
		//else
		//{
			//menu.options[i].selected = false;
		//}
	}
}// end of resetOptions function
