<!--
var popUp; 

function OpenCalendar(idname, postBack)
{
	popUp = window.open('http://localhost/RockCity/Calendar.aspx?formname=' + document.forms[0].name + 
		'&id=' + idname + '&selected=' + document.forms[0].elements[idname].value + '&postBack=' + postBack, 
		'popupcal', 
		'width=190,height=320,left=200,top=250');
	
}

function SetDate(formName, id, newDate, postBack)
{
	eval('var theform = document.' + formName + ';');
	popUp.close();
	theform.elements[id].value = newDate;
	if (postBack)
		__doPostBack(id,'');
}		

function OpenMap(s)
{
	
	window.open(s, 
		'MapQuest',
		'resizable,width=500,height=500,left=200,top=250');
}

var oPopup = window.createPopup();

function HelpPopup(value, width, height)
{
   if("False" == "False")
   {
      var iX = window.event.x;
      var iY = window.event.y;
      var sMenuText = "";

      //sMenuText = document.forms[0].elements[idname].value;
      sMenuText = value;

      var oPopupBody = oPopup.document.body;
         oPopupBody.style.padding = "4px";
         oPopupBody.style.backgroundColor = "infobackground";
         oPopupBody.style.color = "infotext";
         oPopupBody.style.borderTop = "2px solid threedshadow";
         oPopupBody.style.borderLeft = "2px solid threedshadow";
         oPopupBody.style.borderBottom = "2px solid threeddarkshadow";
         oPopupBody.style.borderRight = "2px solid threeddarkshadow";
         oPopupBody.style.fontFamily = "Tahoma";
         oPopupBody.style.fontSize = "x-small";
         oPopupBody.innerHTML = sMenuText;
         oPopupBody.onclick = doClick;

      oPopup.show(iX, iY,width, height, document.body);

   }
}

function doClick() 
{
   oPopup.hide();
} 

function OnNumKey()
{
	if ((window.event.keyCode < 48) || (window.event.keyCode > 57))
	{
		window.event.keyCode = 0;
	}
}



function OnDecKey()
{
	if ((window.event.keyCode < 46) || (window.event.keyCode > 57) || (window.event.keyCode == 47))
	{
		window.event.keyCode = 0;
	}
}

function OnKey()
{
	if ((window.event.keyCode < 48) || (window.event.keyCode > 57))
	{
		window.event.keyCode = 0;
	}
}
function ssnmask(t)
{
	var patt = /(\d{3}).*(\d{2}).*(\d{4})/;
	var donepatt = /^(\d{3})-(\d{2})-(\d{4})$/;
	var str = t.value;
	var result;
	
	if (!str.match(donepatt))
	{
		result = str.match(patt);
		if (result!= null)
		{
			t.value = t.value.replace(/[^\d]/gi,'');
			str = result[1] + '-' + result[2] + '-' + result[3];
			t.value = str;
			
			document.all._ctl0_cmdAdd.focus();
		}
		else
		{
			if (t.value.match(/[^\d]/gi))
			t.value = t.value.replace(/[^\d]/gi,'');
		}
	}
}
function phonemask(t)
{
	var patt = /(\d{3}).*(\d{3}).*(\d{4})/;
	var pattx = /(\d{3}).*(\d{3}).*(\d{4}).*(\d{4})/;
	var donepatt = /^(\d{3})-(\d{3})-(\d{4})$/;
	var donepattx = /^(\d{3})-(\d{3})-(\d{4})x(\d{4})$/;
	var str = t.value;
	var result;
	
	if(t.value.length > 10)
	{
		if(t.value.length < 14)
		{
			var zero = '0000';
			str = str.substring(0,10) + '0000'.substring(0,14 - t.value.length) + str.substring(10,t.value.length);
		}
		
		if (!str.match(donepattx))
		{
			result = str.match(pattx);
			if (result!= null)
			{
				t.value = t.value.replace(/[^\d]/gi,'');
				str = result[1] + '-' + result[2] + '-' + result[3] + 'x' + result[4];
				t.value = str;
			}
			else
			{
				if (t.value.match(/[^\d]/gi))
				t.value = t.value.replace(/[^\d]/gi,'');
			}
		}
	}
	else
	{
		if (!str.match(donepatt))
		{
			result = str.match(patt);
			if (result!= null)
			{
				t.value = t.value.replace(/[^\d]/gi,'');
				str = result[1] + '-' + result[2] + '-' + result[3];
				t.value = str;
			}
			else
			{
				if (t.value.match(/[^\d]/gi))
				t.value = t.value.replace(/[^\d]/gi,'');
			}
		}
	}
}
//-->

