﻿<!--

var phone_field_length=0;
function TabNext(obj,event,len,id) {
    next_field = getElementById_s(id);
	if (event == "down") {
		phone_field_length=obj.value.length;
		}
	else if (event == "up") {
		if (obj.value.length != phone_field_length) {
			phone_field_length=obj.value.length;
			if (phone_field_length == len) {
				next_field.focus();
				}
			}
		}
	}

function UpdatePhone(txtPhone,txtAreaCode,txtPhone1,txtPhone2,txtPhoneExt)
{
    var phone = getElementById_s(txtPhone);
    var area = getElementById_s(txtAreaCode);
    var num1 = getElementById_s(txtPhone1);
    var num2 = getElementById_s(txtPhone2);
    var ext = getElementById_s(txtPhoneExt);
    phone.value =  area.value + '-' + num1.value + '-' + num2.value;
    
    if(ext.value != "")
    {
      phone.value += ' x' + ext.value;
    } 
}

function UpdatePhoneC2C(txtPhone,txtAreaCode,txtPhone1,txtPhone2)
{
    var phone = getElementById_s(txtPhone);
    var area = getElementById_s(txtAreaCode);
    var num1 = getElementById_s(txtPhone1);
    var num2 = getElementById_s(txtPhone2);
    phone.value =  area.value + '-' + num1.value + '-' + num2.value;
}

function hide(x)
{
   getElementById_s(x).style.display="none";
}

function IsDigit(e)
{
    var key;
    if (window.event)
        key = window.event.keyCode;
    else if (e)
        key = e.which;
    else
        return true;
    
    if ((key > 47 && key < 58) || (key > 95 && key < 106))
        return true;
    if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 || key ==37 || key ==39 || key == 46 || key == 35 || key == 36)
        return true;
    return false;
}
	
function getElementById_s(id){
   var obj = null;
   if(document.getElementById){
   /* Prefer the widely supported W3C DOM method, if
   available:-
   */
   obj = document.getElementById(id);
   }else if(document.all){
   /* Branch to use document.all on document.all only
   browsers. Requires that IDs are unique to the page
   and do not coincide with NAME attributes on other
   elements:-
   */
   obj = document.all[id];
   }
   /* If no appropriate element retrieval mechanism exists on
   this browser this function always returns null:-
   */
   return obj;
   }
   
function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

function toggleLayerI( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'inline':'none';
  vis.display = (vis.display==''||vis.display=='inline')?'none':'inline';
}

function checkSubmit()
{
    // if postback - return false
    if (document.getElementById("<%=HFSubmitForm.ClientID %>").value==1)
    return false;
    else
    {
    // mark that submit is to be done and return true
    document.getElementById("<%=HFSubmitForm.ClientID% >").value = 1;
    return true;
    }
}

function hide( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  if(elem)
  {
      vis = elem.style;
      // if the style.display value is blank we try to figure it out here
      vis.display = 'none';
  }
}
   
 -->  
