var fillertext=["There's a voice that keeps on calling me. Down the road, that's where I'll always be. Every stop I make, I make a new friend. Can't stay for long, just turn around and I'm gone again. Maybe tomorrow, I'll want to settle down, Until tomorrow, I'll just keep moving on.", "Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn't commit. These men promptly escaped from a maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune. If you have a problem and no one else can help, and if you can find them, maybe you can hire the A-team.", "Just the good ol' boys, never meanin' no harm. Beats all you've ever saw, been in trouble with the law since the day they was born. Straight'nin' the curve, flat'nin' the hills. Someday the mountain might get 'em, but the law never will. Makin' their way, the only way they know how, that's just a little bit more than the law will allow. Just good ol' boys, wouldn't change if they could, fightin' the system like a true modern day Robin Hood."]
function filltext(paragraph){
  for (var i=0; i<paragraph; i++)
    document.write(fillertext[Math.floor(Math.random()*3)]+" ")
}

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

function Netphiles_findObj(n, d){
  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=Netphiles_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n);
  return x;
}

function Netphiles_nbGroup(event, grpName){
  var i,img,nbArr,args=Netphiles_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = Netphiles_findObj(args[2])) != null && !img.Netphiles_init) {
      img.Netphiles_init = true;
      img.Netphiles_up = args[3];
      img.Netphiles_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2)
      if ((img = Netphiles_findObj(args[i])) != null) {
        if (!img.Netphiles_up) img.Netphiles_up = img.src;
        img.src = img.Netphiles_dn = args[i+1];
        nbArr[nbArr.length] = img;
      }
    }
  } else if (event == "over") {
    document.Netphiles_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3)
    if ((img = Netphiles_findObj(args[i])) != null) {
      if (!img.Netphiles_up) img.Netphiles_up = img.src;
      img.src = (img.Netphiles_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.Netphiles_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.Netphiles_nbOver.length; i++) {
      img = document.Netphiles_nbOver[i];
      img.src = (img.Netphiles_dn) ? img.Netphiles_dn : img.Netphiles_up;
    }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) {
        img=nbArr[i];
        img.src = img.Netphiles_up;
        img.Netphiles_dn = 0;
      }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2)
    if ((img = Netphiles_findObj(args[i])) != null) {
      if (!img.Netphiles_up) img.Netphiles_up = img.src;
      img.src = img.Netphiles_dn = (args[i+1])? args[i+1] : img.Netphiles_up;
      nbArr[nbArr.length] = img;
    }
  }
}

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

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

function Netphiles_setTextOfLayer(objName,x,newText){
  if ((obj=Netphiles_findObj(objName))!=null) with (obj)
    if (document.layers) {
      document.write(unescape(newText));
      document.close();
    }
  else innerHTML = unescape(newText);
}

function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=500');");
}

function popUpImage(URL,WIDTH,HEIGHT) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=" + WIDTH + ",height=" + HEIGHT + "');");
}

function Netphiles_reloadPage(init){
  if (init==true) with (navigator) {
    if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
      document.Netphiles_pgW=innerWidth;
      document.Netphiles_pgH=innerHeight;
      onresize=Netphiles_reloadPage;
    }
  } else if (innerWidth!=document.Netphiles_pgW || innerHeight!=document.Netphiles_pgH) {
    location.reload();
  }
}
Netphiles_reloadPage(true);

function P7_JumpMenu(selObj,restore){
  var theFullString = selObj.options[selObj.selectedIndex].value;
  if (restore) selObj.selectedIndex=0;
  var theLength = theFullString.length;
  var endPos = theFullString.lastIndexOf("~");
  var theUrl, theTarget, theParent;
  if (endPos > 0) {
    theUrl = theFullString.substring(0,endPos);
  } else {
    theUrl = theFullString;
  }
  endPos++
  if (endPos < theLength) {
    theTarget = theFullString.substring(endPos,theLength)
  } else {
    theTarget = "window:Main";
  }
  if (theTarget == "window:New") {
    window.open(theUrl);
  } else if (theTarget == "window:Main") {
    eval("parent.location='"+theUrl+"'");
  } else {
    eval("parent.frames[\'"+theTarget+"\'].location='"+theUrl+"'");
  }
}

function P7_JumpMenuGo(selName,restore){
  var selObj = Netphiles_findObj(selName);
  if (selObj) P7_JumpMenu(selObj,restore);
}

var expDays = 30;
function setCookie(name, val) {
  var exp = new Date();
  var cookieTimeToLive = exp.getTime() + (expDays * 24 * 60 * 60 * 1000);
  exp.setTime(cookieTimeToLive);
  document.cookie = name + "=" + escape(val) + "; expires=" + exp.toGMTString();
}

function getCookie(name) {
  var cookieNameLen = name.length;
  var cLen = document.cookie.length;
  var i = 0;
  var cEnd;
  var myStringToReturn;
  var myStringToReturnLen;
  while (i < cLen) {
    var j = i + cookieNameLen;
    if (document.cookie.substring(i,j) == name) {
      cEnd = document.cookie.indexOf(";",j);
      if (cEnd == -1) {
        cEnd = document.cookie.length;
      }
      myStringToReturn = unescape(document.cookie.substring(j,cEnd));
      myStringToReturnLen = myStringToReturn.length;
      myStringToReturn = myStringToReturn.substring(1,myStringToReturnLen+1);
      return myStringToReturn;
    }
    i++;
  }
  return "";
}

function setDefaultValues() {
  var strCookieName, strCookieVal;
  var iFormsCount = 0;
  var iElementsCount = 0;
  for(iFormsCount=0;iFormsCount < document.forms.length;iFormsCount++) {
    for(iElementsCount=0; iElementsCount < document.forms[iFormsCount].elements.length; iElementsCount++) {
      strCookieName = document.forms[iFormsCount].elements[iElementsCount].name;
      strCookieVal = getCookie(strCookieName);
      if (strCookieVal != null && !(isNaN(strCookieVal)) && strCookieVal != '') {
        document.forms[iFormsCount].elements[iElementsCount].selectedIndex = strCookieVal;
      }
    }
  }
}
