﻿// JScript File
/* Form Validation Script for Common Functions
Developed By	: Pooja Verma
Date			: Sept 23, 2008
Message			: Common Functions 
*/

function phoneKeypress(e)
{
    if ([e.keyCode||e.which]==8) //this is to allow backspace
    return true;
    if ([e.keyCode||e.which]==9) //this is to allow tab
    return true;
    if ([e.keyCode||e.which]==14) //this is to allow shift in
    return true;
    if ([e.keyCode||e.which]==15) //this is to allow shift out
    return true;
    if ([e.keyCode||e.which]==46) //this is to allow period
    return true;
    if ([e.keyCode||e.which]==43) //this is to allow + symbol
    return true;
    if ([e.keyCode||e.which]==45) //this is to allow - symbol
    return true;
    if ([e.keyCode||e.which]==37) //this is to allow left arrow symbol
    return true;
    if ([e.keyCode||e.which]==38) //this is to allow up arrow symbol
    return true;
    if ([e.keyCode||e.which]==39) //this is to allow right arrow symbol
    return true;
    if ([e.keyCode||e.which]==40) //this is to allow down arrow symbol
    return true;
    if ([e.keyCode||e.which]==41) //this is to allow down paranthesis
    return true;
    
    if ([e.keyCode||e.which] < 48 || [e.keyCode||e.which] > 57)
    e.preventDefault? e.preventDefault() : e.returnValue = false;
}


function numberKeypress(e)
{
    if ([e.keyCode||e.which]==8) //this is to allow backspace
    return true;
    if ([e.keyCode||e.which]==9) //this is to allow tab
    return true;
     if ([e.keyCode||e.which]==37) //this is to allow left arrow symbol
    return true;
    if ([e.keyCode||e.which]==38) //this is to allow up arrow symbol
    return true;
    if ([e.keyCode||e.which]==39) //this is to allow right arrow symbol
    return true;
    if ([e.keyCode||e.which]==40) //this is to allow down arrow symbol
    return true;
    if (e.keyCode==46 && e.which == 0) //this is to allow delete
    return true;
    
//    if ([e.keyCode||e.which]==46) //this is to allow period
//    return true;
//    if ([e.keyCode||e.which]==43) //this is to allow + symbol
//    return true;
//    if ([e.keyCode||e.which]==45) //this is to allow - symbol
//    return true;
    if ([e.keyCode||e.which] < 48 || [e.keyCode||e.which] > 57)
    e.preventDefault? e.preventDefault() : e.returnValue = false;
}
 function openNewWindow()
	{
	 window.open('acupuncture_popup.aspx','acupunture_popup', 'toolbar=no,width=800,height=650,left=10,top=50,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');
	}
