function backindex(thislink,thishref) {
  itemz = new Array(0);
  parts = new Array(0);
  thisitem = new String;
	thisurl = document.location.href;
	locate = 0;
	locate = thisurl.search(/\/backindex/);
  if (locate < 1) {
    thisurl = document.referrer;
    locate = 0;
    locate = thisurl.search(/\/backindex/);
  }
  if (locate < 1) {
  	if (parent != self) { 
	  thisurl = parent.document.referrer;
	  locate = 0;
	  locate = thisurl.search(/\/backindex/);
	}
  }
	if (locate > 0) {
		parts = thishref.split("/");
		pagename = parts[parts.length - 1];
		itemz = thisurl.split("/");
		wherebackindex = 0;
		locate = 0;
		counter = 0;
		while (counter <= (itemz.length - 1)) {
			if (wherebackindex == 0) {
        thisitem = itemz[counter];
				locate = thisitem.search(/backindex/);
				if (locate > -1) {
					wherebackindex = counter;
				}
			}
		counter = counter + 1;
		}
		pubyr = itemz[wherebackindex + 1];
		pubmo = itemz[wherebackindex + 2];
		pubda = itemz[wherebackindex + 3];
		thislink.href = "/backindex/" + pubyr + "/" + pubmo + "/" + pubda + "/" + pagename;
	}
}

function back(thislink,thishref,pagename) {
  itemz = new Array(0);
  thisitem = new String;
	thisurl = document.location.href;
	locate = -1;
	locate = thisurl.search(/\/backindex/);
  if (locate < 1) {
    thisurl = document.referrer;
    locate = -1;
    locate = thisurl.search(/\/backindex/);
  }
  if (locate < 1) {
  	if (parent != self) { 
	  thisurl = parent.document.referrer;
	  locate = 0;
	  locate = thisurl.search(/\/backindex/);
	}
  }
	if (locate > -1) {
		itemz = thisurl.split("/");
		wherebackindex = 0;
		locate = 0;
		counter = 0;
		while (counter <= (itemz.length - 1)) {
			if (wherebackindex == 0) {
        thisitem = itemz[counter];
				locate = thisitem.search(/backindex/);
				if (locate > -1) {
					wherebackindex = counter;
				}
			}
		counter = counter + 1;
		}
		pubyr = itemz[wherebackindex + 1];
		pubmo = itemz[wherebackindex + 2];
		pubda = itemz[wherebackindex + 3];
		thislink.href = "/backindex/" + pubyr + "/" + pubmo + "/" + pubda + "/" + pagename;
  }
}
function backalt(thislink,newurl) {
  itemz = new Array(0);
  thisitem = new String;
	thisurl = document.location.href;
	locate = 0;
	locate = thisurl.search(/\/backindex/);
  if (locate < 1) {
    thisurl = document.referrer;
    locate = 0;
    locate = thisurl.search(/\/backindex/);
  }
  if (locate < 1) {
  	if (parent != self) { 
	  thisurl = parent.document.referrer;
	  locate = 0;
	  locate = thisurl.search(/\/backindex/);
	}
  }
	if (locate > 0) {
    if (newurl.search(/pubdate/) > -1) {
		  itemz = thisurl.split("/");
		  wherebackindex = 0;
		  locate = 0;
		  counter = 0;
		  while (counter <= (itemz.length - 1)) {
			  if (wherebackindex == 0) {
          thisitem = itemz[counter];
				  locate = thisitem.search(/backindex/);
				  if (locate > -1) {
					  wherebackindex = counter;
				  }
			  }
		  counter = counter + 1;
		  }
		  pubyr = itemz[wherebackindex + 1];
		  pubmo = itemz[wherebackindex + 2];
		  pubda = itemz[wherebackindex + 3];
      pubdate = pubyr + pubmo + pubda;
      newurl = newurl.replace(/pubdate/,pubdate);
    }
    thislink.href = newurl;
  }
}
function noback(thislink) {
	thisurl = document.location.href;
	locate = 0;
	locate = thisurl.search(/\/backindex/);
  if (locate < 1) {
    thisurl = document.referrer;
    locate = 0;
    locate = thisurl.search(/\/backindex/);
  }
  if (locate < 1) {
  	if (parent != self) { 
	  thisurl = parent.document.referrer;
	  locate = 0;
	  locate = thisurl.search(/\/backindex/);
  	}
  }
  if (locate > 0) {
    thislink.href = "/backindex/nolinkavailable.htm";
  }
}
