//Adding re-direct for Gearstore 07/07/06 by Ernest Fretwell
if (location.hostname == "www.bellsouthgearstore.com") {
var target = "http://www.bellsouth.com/gearstore"; 
	if (document.images) {location.replace(target); } 
	else { location.href = target;}
}

//AutoTab function 
if (is_nav4up){
   document.captureEvents(Event.KEYPRESS);
}

//AutoTab function 
function autotab_toname(evt, cur_field, char_max, goto_field) {    
	if (is_nav4) {
		if (cur_field.value.length >= char_max) {
		goto_field.focus();
		}
	}
	if (is_ie4up || is_nav5up) {
		if (cur_field.value.length > (char_max-1)) {
		goto_field.focus();
		}
	}
}

//DSL Validation
function dslScript(){
   //validate number entry

var errorStr = "";
var errorFlag = "false";
var npa = fm.LOOPTEST_PHONELINE1A.value;
var nxx = fm.LOOPTEST_PHONELINE1B.value;
var line = fm.LOOPTEST_PHONELINE1C.value;
   
if(isEmpty(npa) || npa.length < 3 || npa.length < 3 || isEmpty(nxx) || nxx.length < 3 || nxx.length < 3 || isEmpty(line) || line.length < 4 || line.length < 4){
errorStr = errorStr + "Please enter a 10 digit<br />phone number.";
errorFlag = "true";
}
else if (isNaN(npa) || isNaN(nxx) || isNaN(line)) {
errorStr = errorStr + "Please use numbers<br />only.";
errorFlag = "true";
} 
if(errorFlag == "true") {
errorBuilder(errorStr, "errorDisplay");
fm.LOOPTEST_PHONELINE1A.focus();
return false
}
else {
document.fm.submit();
}	   	 
return false;
}

 function errorBuilder(errorStr,errorID){
   var errorCell = errorID;
   var errorFeed = document.getElementById(errorCell); 
   var tStr=errorStr;
   errorFeed.innerHTML=tStr;
 }

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function overRow(row) {
row.className = "hover";
}

function outRow(row) {
row.className = "";
}

function onRow(row) {
var cell = row.firstChild;
if(!cell.firstChild) cell = cell.nextSibling;
if (cell.firstChild.id) _hbLink(cell.firstChild.id);
window.location = cell.firstChild.href;
}