function AlertMessage(string)
{
	alert(string);
	return false;
}

function ConfirmDelete(msg,url)
{
	var msg = window.confirm(msg);
	if (msg == false)
	{
		return false;
	}
	
	if (msg == true && url != "")
		window.location.href=url;
	else if (msg == true)
		return true;
}

function CheckSpace(oSrc,args)
{
	alert(oSrc);
	args.IsValid = (document.forms[0].ctrlAddFile.value.indexOf(' ') >= 0);
				
}
function RemovePublicationConfirmation(msg,url)
{
	var msg = window.confirm(msg);
	if (msg == false)
		return false;
	else
		window.location.href=url;
}
function DownloadPublication()
{
	alert("To download this publication, please right click on the publication name and select \"Save Target As\" from the menu.");
	return false;
}

function CopyClipboardData(string)
{
	window.clipboardData.setData("Text",string);
	return false;
}
function SelectAllItemToDelete(checkbox,formName)
{
	if (checkbox.checked == true)
	{
		for(var i=0;i<document.forms[formName].elements.length;i++)
		{
			var elm = document.forms[formName].elements[i];
			if (elm.type == "checkbox")
			{
				elm.checked = true;
			}
		}	
	}
	else
	{
		for(var i=0;i<document.forms[formName].elements.length;i++)
		{
			var elm = document.forms[formName].elements[i];
			if (elm.type == "checkbox")
			{
				elm.checked = false;
			}
		}		
	}
}

function KeyDownHandler(btn)
{
	if (event.keyCode == 13)
    {
        // cancel the default submit
        event.returnValue=false;
        event.cancel = true;
        // submit the form by programmatically clicking the specified button
        btn.click();
    }
}
