// file added 23/3/2007 for UZ23169 K1 Code to text ratio - SS

function KeyDownHandler(name)
{
  // process only the Enter key
  if (event.keyCode == 13)
  {
    // cancel the default submit
    event.returnValue=false;
    event.cancel = true;
    // submit the form by programmatically clicking the specified button
    document.all(name).click();
  }
}

function SearchDownHandler(name)
{
  // process only the Enter key
  if (event.keyCode == 13)
  {
    // cancel the default submit
    event.returnValue=false;
    event.cancel = true;
    // submit the form by programmatically clicking the specified button
    document.all(name).click();
  }
}

function charsLimit(charsToCount, Limit) 
{ 
	if (charsToCount.value.length > Limit) charsToCount.value = charsToCount.value.substring(0, Limit);
}

function documentViewer(FileUrl){
	window.open("DocumentViewer.aspx?file=" + FileUrl, "Viewer" ,"height=250,width=250,toolbar=no,status=no,location=no,menubar=no,resizable=yes")
}

function VideoViewer(FileUrl){
	window.open("VideoViewer.aspx?file=" + FileUrl, "Viewer" ,"height=250,width=250,toolbar=no,status=no,location=no,menubar=no,resizable=yes")
}

function disableEnterKey()
{
	if ( window.event.keyCode == 13 )		// trap "Enter" keystroke
		window.event.keyCode = null;		// disable the keystroke
}
