function click(e)
{/*
    if (document.all)
    {
        if (event.button == 2)
        {
           alert("Sorry, you do not have access to this feature.");
           return false;
        }
    }
    if (document.layers)
    {
        if (e.which == 3)
        {
            alert("Sorry, you do not have access to this feature.");
            return false;
        }
    }
	*/
}

if (document.layers)
{
    document.captureEvents(Event.MOUSEDOWN);
}

document.onmousedown=click;

function popuppage(pgname)
{
	window.open(pgname, 'PopupWindow', 'width=200,height=200,scrollbars=no,resizable=no');
}
function Trim(str) 
{
	return str.replace(/\s/g,"");
}
function isNumeric(obj)
{		
	if(obj.value.search(/[^0-9]/) != -1) // only number checking
	{
		alert('The field must contain number only');
		obj.value="";
		obj.focus();
		return false;			
	}
	return true;
}
function isPrice(obj)
{	
	if((obj.value.search(/[^0-9.]/) != -1) || (dotCheck(obj.value) > 1))  
	{
		alert('Amount must be valid');
		obj.value="";
		obj.focus();
		return false;			
	}
}
function dotCheck(val)
{
	count = 0;
	for(dot=0; dot<val.length; dot++)
	{
		if(val.substring(dot,dot+1) == '.') 
			count++;
	}
	return count;
}
function dateformat(obj)
{
	var f = eval(obj); 
	var f_val = f.value;
	ind1 = f_val.charAt(2);
	ind2 = f_val.charAt(5);
	if(f_val!= "" && ind1!="-" && ind2!="-")
	{
		if(f_val.length < 8)
		{
			alert("Date must have at least 8 digits (MMDDYYYY).")	
			f.focus();
		}
		else
			f.value = f_val.substring(0,2) +"-"+ f_val.substring(2,4) +"-"+ f_val.substring(4,f_val.lenght);
	}	
}
function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}