var arrOldValues="";
var arrNewValues="";
var fromarrnew="";
var fromarrold="";
var ccarrnew="";
var ccarrold="";
var nov=0;
var pdfW=0;
var dW=0;
var pW=0;
var cart=0;
var AUTHORFIND=0;
var WH=screen.availHeight;
var WW=screen.availWidth/2;;
var WT=0;
var WL=screen.availWidth;
var AN=0;
var EN=0;
var BN=0;
var mymaxmen=0;
var tcount=0;
var menutimer=null;

var NN4 = document.layers? true : false;
var IE4 = document.all? true : false;
var NN6 = document.getElementById? true : false;

function hidem(layer) {
	var divref;
	var i; var mstr;
	for (i=2;i<=mymaxmen;i++) {
		mstr='divshim-'+i;
		if (document.getElementById(mstr)) {
			divref=document.getElementById(mstr);
			divref.style.display='none';
		}
	} if (menutimer != null) {
		clearTimeout(menutimer);
		menutimer=null;
	}
	document.getElementById(layer).style.visibility='hidden';
	for (i=2;i<=mymaxmen;i++)
	{
		mstr='mu-'+i;
		if (document.getElementById(mstr))
			document.getElementById(mstr).style.visibility='hidden';
	}
}

function abconfirm(msg) {
 var m=confirm(msg);
 if (m) return true;
 else
 return false;
 }

function showmenu(layer,mm) {
mymaxmen=mm;
if (tcount == 0) {
if (menutimer == null);
menutimer=setTimeout('goaway()',3000);}
var divref;
 var i; var mstr;
for (i=2;i<=mymaxmen;i++) {
mstr='divshim-'+i;
if (document.getElementById(mstr)) {
divref=document.getElementById(mstr);
divref.style.display='none';
}
}
 document.getElementById(layer).style.visibility='visible';
 for (i=2;i<=mymaxmen;i++)
 {
 mstr='mu-'+i;
 if (document.getElementById(mstr))
document.getElementById(mstr).style.visibility='hidden';
 }
 }

function dectcount() { if (tcount > 0) tcount=0
}

function goaway() { if (tcount <= 0) {
hidem('mu-1');
menutimer=setTimeout('goaway()',3000);
}
}

function showm(base,layer,top,left) {
tcount=1;
var divref;
 var tmp;
 var mstr;
 var i;
 var ja;
var sk;
var a1=new Array();
a1=base.split(',');
 for (i=2;i<=mymaxmen;i++) {
sk=0;
for (ja=0;ja<a1.length;ja++) {
tmp=a1[ja].substring(3);
if (tmp == i)
sk=1;
}
if (sk == 1)
continue;
 mstr='divshim-'+i;
if (document.getElementById(mstr)) {
divref=document.getElementById(mstr);
divref.style.display='none';
}
}
for (i=2;i<=mymaxmen;i++)
 {

sk=0;
for (ja=0;ja<a1.length;ja++) {
tmp=a1[ja].substring(3);
if (tmp == i)
sk=1;
}
if (sk == 1)
continue; mstr='mu-'+i;
 if (document.getElementById(mstr))
document.getElementById(mstr).style.visibility='hidden';
 }
 for (ja=a1.length-1;ja<a1.length;ja++) {
mstr = a1[ja].substring(0,2);
 if (mstr  == 'mu' && a1[ja] != 'mu-1')
 {
document.getElementById(a1[ja]).style.top=top;
 document.getElementById(a1[ja]).style.left=left;
 tmp='divshim-'+a1[ja].substring(3);
 divref=document.getElementById(tmp);
mstr=document.getElementById(a1[ja]);
tmp=a1[ja].substring(3);
divref.style.width=mstr.offsetWidth;
divref.style.height=mstr.offsetHeight;
divref.style.top=top;
divref.style.left=left;
divref.style.zIndex=tmp-1;
mstr.style.visibility='visible';
mstr.style.display='block';
divref.style.display='block';
  }
 }
}

function postpage(title) {
 document.forms['subform1'].title.value=title;
 return true;
 }

function closeclwd()
{
pdfW=open('http://www.abfeusa.com/close.html','pdf','resizable,independent');
dW=open('http://www.abfeusa.com/close.html','htm','resizable,independent');
if (opener)
opener.focus();
}

function helpmsg(ID,sText) 
{
if (sText != ' ')
{
if (IE4)
document.all[ID].innerHTML = sText;
if (NN4)
document.layers[ID].value=sText;
if (NN6)
document.getElementById(ID).innerHTML=sText;
 document.getElementById(ID).style.visibility="visible";
}else
document.getElementById(ID).style.visibility="hidden"; 
} 
//-->

 function pagePrint()
{
if (window.print) window.print();
}
function closeclwd()
{
pdfW=open('http://www.abfeusa.com/close.html','pdf','resizable,independent');
dW=open('http://www.abfeusa.com/close.html','htm','resizable,independent');
if (opener)
opener.focus();
}

function resizeW(W)
{
if (W) {
if (!W.closed) {
W.resizeTo(WW,WH);
}
}
}

function closeW()
{
if (pdfW)
{

pdfW.close();
pdfW=0;
}
if (dW)
{

dW.close();
dW=0;
}
}

function leftW(W)
{
   if (W) {
      if (!W.closed) {
	 W.resizeTo(screen.availWidth-WW,WH);
	 W.moveTo(0,0);
      }
   }
}

function rightW(W)
{
   if (W) {
      if (!W.closed) {
	 W.resizeTo(screen.availWidth-WW,WH);
	 W.moveTo(screen.availWidth-WW,0);
      }
   }
}

function rightWQ(W)
{
   if (W) {
      if (!W.closed) {
	 W.resizeTo(screen.availWidth-WW,WH/2+50);
	 W.moveTo(screen.availWidth-WW,0);
      }
   }
}

function GetSelectValues(MULTI){
var strTemp = new Array();
var j=0;
for(var i=0;i<MULTI.length;i++){
if(MULTI.options[i].selected == true){
strTemp[j]=i;
j++;
}
}
return strTemp;
}

function ToName(myMULTI)
{
var MULTI=document.getElementById(myMULTI);
var ind=MULTI.selectedIndex;
while (ind >= 0)
{
var tn=document.getElementById('idnewmembers');
var fnd=false;
for (var i=0;i<tn.length;i++)
if (MULTI.options[ind].value == tn.options[i].value)
fnd=true;
if (!fnd)
{
var ob1=new Option(MULTI.options[ind].value,MULTI.options[ind].value,true,true);
var l=tn.length;
tn.options[l]=ob1;
tn.options[l].selected=true;
}
MULTI.options[ind].selected=false;ind=MULTI.selectedIndex;

}
}

function ToTag(myMULTI)
{
var MULTI=document.getElementById(myMULTI);
var ind=MULTI.selectedIndex;
if (ind >= 0)
{
dtlfrm.ltrarea.value=dtlfrm.ltrarea.value+"<"+MULTI.options[ind].value+">\n";
}
}

function insgltr(myMULTI)
{
var MULTI=document.getElementById(myMULTI);
var ind=MULTI.selectedIndex;
if (ind >= 0)
{
dtlfrm.showto.value=dtlfrm.showto.value+MULTI.options[ind].value+'\n';
}
}

function ToMail(myMULTI)
{
var MULTI=document.getElementById(myMULTI);
var ind=MULTI.selectedIndex;
if (ind >= 0)
{
dtlfrm.showto.value=dtlfrm.showto.value+MULTI.options[ind].value+'\n';
}
}

function ToText(myText,myMULTI)
{
var thisText=document.getElementById(myText);
var MULTI=document.getElementById(myMULTI);
if (MULTI)
{
var ind=MULTI.selectedIndex;
if (ind >= 0)
{
if (thisText.value.length == 0)
thisText.value=MULTI.options[ind].value;
else
thisText.value=thisText.value+'; '+MULTI.options[ind].value;
thisText.scrollTop=thisText.scrollHeight;
}
}
}

function showhide(layer) {
 var mstr;
dtlfrm.showto.value='';
 for (var i=1;i<3;i++) {
 mstr='Lv'+i;
 document.getElementById(mstr).style.visibility='hidden';
 }
 document.getElementById(layer).style.visibility='visible';
}

function hidemsg(layer) {
 var mstr;
for (var i=1;i<2;i++) {
 mstr='Iv'+i;
 document.getElementById(mstr).style.visibility='hidden';
 }
}

function showmsg(layer) {
 var mstr;
for (var i=1;i<2;i++) {
 mstr='Iv'+i;
 document.getElementById(mstr).style.visibility='visible';
 }
}

function insmeta(myMULTI)
{
var MULTI=document.getElementById(myMULTI);
var ind=MULTI.selectedIndex;
if (ind >= 0)
{
dtlfrm.ltrarea.value=dtlfrm.ltrarea.value+"<%"+MULTI.options[ind].value+"%>";
}
}

function insltr(myMULTI)
{
var MULTI=document.getElementById(myMULTI);
var ind=MULTI.selectedIndex;
if (ind >= 0)
{
dtlfrm.ltrarea.value=dtlfrm.ltrarea.value+"<%"+MULTI.options[ind].value+"%>";
}
}

function GetCurrentFrom(MULTI){
fromarrold=GetSelectValues(MULTI);
}

function GetFromListValues(MULTI){
FromFillListValues(MULTI);
}

function FromFillListValues(MULTI)
{
var intNewPos=(-1);
var count=0;
var ncount=0;
var i;
var fnd;
fromarrnew = GetSelectValues(MULTI);
count=fromarrnew.length;
for(i=0;i<count;i++)
{
intNewPos=fromarrnew[i];
fnd=false;
for (var j=0;j<fromarrold.length;j++)
{
if (fromarrold[j] == fromarrnew[i])
{
fromarrold[j]=(-1);
fnd=true;
}
}
if(!fnd)
{
ncount=fromarrold.length;
fromarrold[ncount]=intNewPos;
}
else
{
MULTI.options[intNewPos].selected=false;
}
}
fnd=true;
if (count == 0)
fnd=false;
count=fromarrold.length;
for (i=0;i<count;i++)
{
intNewPos=fromarrold[i];
if (intNewPos >= 0)
{
if (fnd)
MULTI.options[intNewPos].selected=true;
else
{
MULTI.options[intNewPos].selected=false;
fromarrold[i]=(-1);
}
}
}
}

function GetFromAuthorSelect(MULTI){
var strTemp="";
var ind;
for (var i=0;i<fromarrold.length;i++)
{
ind=fromarrold[i];
if (ind >= 0)
strTemp += MULTI.options[ind].value+"\n";
}
return strTemp;
}

function GetChkboxSelectValues(MULTI){
for(var i=0;i<MULTI.length;i++){
if(MULTI.options[i].selected == true){
dtlfrm.addgroup.value=MULTI.options[i].value;
}
}
}

function GetLetterSelectValues(MULTI){
for(var i=0;i<MULTI.length;i++){
if(MULTI.options[i].selected == true){
dtlfrm.newltr.value=MULTI.options[i].value;
}
}
}

function SelNames(session,next,lang)
{
pdfW=open('http://www.abfeusa.com/cgi-bin/abnames.cgi?action=abnames&session='+session+'&id='+next+'&lang='+lang,'htm','resizable,scrollbars,dependent');
rightWQ(pdfW);
pdfW.focus();
}

function sendtifonce(action,session,tif,next)
{
pdfW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action=gettiff&session='+session+'&tif='+tif+'&next='+next,'TIF','resizable,scrollbars,dependent');
leftW(pdfW);
pdfW.focus();
dW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action='+action+'&session='+session+'&tif='+tif+'&next='+next,'htm','resizable,scrollbars,dependent');
rightW(dW);
dW.focus();
}

function sendpdfile(action,pdf)
{
dW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action='+action+'&did='+pdf,'htm','resizable,scrollbars,independent');
rightW(dW);
dW.focus();
}



function sendtifdqn(action,session,tif,next)
{
pdfW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action=getdqntiff&session='+session+'&tif='+tif+'&next='+next,'TIF','resizable,scrollbars,dependent');
leftW(pdfW);
pdfW.focus();
dW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action='+action+'&session='+session+'&tif='+tif+'&next='+next,'htm','resizable,scrollbars,dependent');
rightW(dW);
dW.focus();
if (!opener)
{opener=self;
opener.pdfW=pdfW;
opener.dW=dW;
}
}

function ToParChk(myChk)
 {
var thisChk=opener.parent.document.getElementById(myChk);
if (thisChk != null) thisChk.checked=true; }

function ToParUnChk(myChk)
 {
var thisChk=opener.parent.document.getElementById(myChk);
if (thisChk != null) thisChk.checked=false; }

function sendtiffqr(action,session,tif,next)
{
pdfW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action=getfqrtiff&session='+session+'&tif='+tif+'&next='+next,'TIF','resizable,scrollbars,dependent');
leftW(pdfW);
pdfW.focus();
dW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action='+action+'&session='+session+'&tif='+tif+'&next='+next,'htm','resizable,scrollbars,dependent');
rightW(dW);
dW.focus();
}

function sendtiffac(action,session,tif,next)
{
pdfW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action=getfactiff&session='+session+'&tif='+tif+'&next='+next,'TIF','resizable,scrollbars,dependent');
leftW(pdfW);
pdfW.focus();
dW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action='+action+'&session='+session+'&tif='+tif+'&next='+next,'htm','resizable,scrollbars,dependent');
rightW(dW);
dW.focus();
}

function sendtifdow(action,session,tif,next)
{
pdfW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action=getdowtif&session='+session+'&tif='+tif+'&next='+next,'TIF','resizable,scrollbars,dependent,location=0');
leftW(pdfW);
pdfW.focus();if (opener != null)
opener.pdfW=pdfW;

dW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action='+action+'&session='+session+'&tif='+tif+'&next='+next,'htm','resizable,scrollbars,dependent');
rightW(dW);
dW.focus();if (opener != null)
opener.dW=dW;}

function sendtifabl(action,session,tif,next)
{
pdfW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action=getabltif&session='+session+'&tif='+tif+'&next='+next,'TIF','resizable,scrollbars,dependent,location=0');
leftW(pdfW);
pdfW.focus();
dW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action='+action+'&session='+session+'&tif='+tif+'&next='+next,'htm','resizable,scrollbars,dependent');
rightW(dW);
dW.focus();
}

function sendpull(session)
{
pW=opener.open('abfeusa.cgi?action=tifloctsk&'+session,'htm','resizable,scrollbars,dependent');
pW.focus();
}

function printpage()
{
window.print();
}

function checkit()
{
if (document.dtlfrm.ckbeg_nbr.checked)
{
BN=document.dtlfrm.pg.value;
document.dtlfrm.beg_nbr.value=BN;
}if (document.dtlfrm.chabeg_nbr.checked)
{
AN=document.dtlfrm.pg.value
document.dtlfrm.abeg_nbr.value=AN;
}
if (document.dtlfrm.chaend_nbr.checked)
{EN=document.dtlfrm.pg.value;
document.dtlfrm.aend_nbr.value=EN;
}
}

function GetCCType(MULTI) { var strLv=new Array();
 strLv[0]=1;
 strLv[1]=1;
 strLv[2]=1;
 strLv[3]=1;
 strLv[4]=2;
 strLv[5]=3;
 strLv[6]=4;
 var i=0;
 ind=MULTI.selectedIndex;
 var thisLv='Lv'+strLv[ind];
 var mstr;
 for (i=1;i<=4;i++) { 
mstr='Lv'+i;
 document.getElementById(mstr).style.visibility='hidden';
 }
 document.getElementById(thisLv).style.visibility='visible';
 return true;
 }

function getCookie(name) {
   var start = document.cookie.indexOf(name+"=");
   var len = start+name.length+1;
   if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
   if (start == -1) return null;
   var end = document.cookie.indexOf(";",len);
   if (end == -1) end = document.cookie.length;
   return unescape(document.cookie.substring(len,end));
}

function checkabfecid() {
   var tn=document.dtlfrm.cart.value;
   if (getCookie('abfecid')) {
      var cid = getCookie('abfecid');
      if (cid != 0)
      {
	 cart=cid;
	 document.dtlfrm.cart.value=cid;
      }
   }
   else
   {   
      if (tn != 0)
         cart=tn;
   }
}

function cartpage(myurl)
{
    var newurl=myurl+'&cart='+cart;
    window.location=newurl;
}

function sendshipshow(action,did)
{
   var zip=document.dtlfrm.estzip.value.replace(/^\s+|\s+$/g, '');
   var len=zip.length;
   if (len < 5)
      alert("Not a valid Zip Code");
   else
   {
      dW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action='+action+'&cart='+did+'&zip='+zip,'htm','resizable,scrollbars,independent');
      rightWQ(dW);
      dW.focus();
   }
}

function sendordhist(action,did,cart)
{
   dW=open('http://www.abfeusa.com/cgi-bin/abfeusa.cgi?action='+action+'&did='+did+'&cart='+cart,'htm','resizable,scrollbars,independent');
   rightW(dW);
   dW.focus();
}




