var N4 = document.layers;
var IE = document.all;
var N6 = document.getElementById && !IE;
//==============================================================================================================
// Standard DreamWeaver open window function 
function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
  window.open(theURL,winName,features);
}
//==============================================================================================================
// Cross browser show layername function...
function display(layername) {
   if (N4){ document[layername].visibility = "show";}
   else if (IE){ document.all[layername].style.visibility = "visible"; document.all[layername].style.display = "inline";}
   else if (N6){ document.getElementById(layername).style.visibility = "visible"; document.getElementById(layername).style.display = "inline";}
} 
//==============================================================================================================
// Cross browser hide layername function...
function hide(layername) {
   if (N4){ document[layername].visibility = "hide";}
   else if (IE){ document.all[layername].style.visibility = "hidden"; document.all[layername].style.display = "none";}
   else if (N6){ document.getElementById(layername).style.visibility = "hidden"; document.getElementById(layername).style.display = "none";}
}
//==============================================================================================================
//This function is related to X-Other 
// For an example, please refer to http://www.ckgtesting.dev/X_other/default.php..
// When the user selects the "Other" option from the 'how did you find us?", this function will hide and show an extra field.
function GetSelectedItem() 
{
	len = document.forma.source.length
	i = 0
	chosen = "none"
	for (i = 0; i < len; i++) 
	{
		if (document.forma.source[i].selected) {
			chosen = document.forma.source[i].value
		} 
	}

	//This part of the funtion hides and shows the div data called xother_more
	if (chosen == 'X_Other') 
	{
		display('xothermore');
		display('xothermore2');
	} else {
		hide('xothermore');
		hide('xothermore2');
	}
} 
//==============================================================================================================
function background_color(obj,color){
obj.style.backgroundColor = color;
	}

function input_highlight(obj){
obj.style.backgroundColor = "#FFFF00";
	}

function input_unhighlight(obj){
obj.style.backgroundColor = "#FFFFFF";
	}
function IsNumeric(sText) {
   var ValidChars = "0123456789.()-";
   var IsNumber=true;
   var Char;

   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   }	
   
function autotab(original,destination){
if (IsNumeric(original.value))
destination.focus()
}
(function($) {
   $(function() {
      $.mask.addPlaceholder("~","[+-]");
      $("#zipcode").mask("99999");
	  $("#phone").mask("(999)999-9999");
	  $("#homephone").mask("(999)999-9999");
	  $("#workphone").mask("(999)999-9999");
   });
})(jQuery);
//==============================================================================================================