

function popupScrollNamed(page, name, width, height)
{
		var newWindow;
		newWindow = window.open(page, name, "width="+width+", height="+height+", scrollbars=yes, resizable=yes");

		newWindow.focus();

}//end function

function popup(page, width, height)
{
	var newWindow;
	newWindow = window.open(page, "new_window", "width="+width+", height="+height+", scrollbars=no");
}

function popupScroll(page, width, height)
{
	var newWindow;
	newWindow = window.open(page, "new_window", "width="+width+", height="+height+", scrollbars=yes");

}//end function

function getRadioValue(radioGroup)
{
	for (i = 0; i < radioGroup.length; i++) {

		if (radioGroup[i].checked) {

			return radioGroup[i].value;
		}
	}

	return '';

}//end function

function confirmRedir(url, message)
{
	if (confirm(message))
	{
		window.location.href = url;
	}

}//end function

function submitSearch(page)
{
	var f = document.forms["search"];
	f.elements["page"].value = page;
	f.submit();

}//end function

function confirmImgRoleChange(id, oldRole)
{
	var currForm = document.forms["image_"+id];
	var roleSel = currForm.elements["form[role]"];
	var newRole = roleSel.options[roleSel.selectedIndex].value;
	var mssg;

	if (newRole == 'thumbnail' && oldRole != 'thumbnail')
	{
		mssg = "Replace the current Thumbnail Image with this one?\nTo fit in the available space, it may be reduced in size.\nThe current thumbnail image will become an Additional Profile image.";
	}
	else if(newRole == 'profile' && oldRole != 'profile')
	{
		mssg = "Replace the current Primary Profile image with this one?\nThe current Primary Profile image will become an Additional Profile image.";
	}
	else if(newRole == 'additional_profile' && oldRole != 'additional_profile')
	{
		mssg = "Move this image to an Additional Profile Image?";
	}
	if (confirm(mssg))
	{
		currForm.submit();
	}

}//end function

function goBack(url)
{
	//window.document.location.replace(url);
	window.document.location = url;
	return false;

}//end function

function openPrint(url)
{
	popupScrollNamed(url, 'popup', 650, 500);

}//end function


