function alrt(msg) {alert(msg) ; return(false)}

function prevcolor() {
rgb=document.nhf.rh.options[document.nhf.rh.selectedIndex].value
rgb+=document.nhf.gh.options[document.nhf.gh.selectedIndex].value
rgb+=document.nhf.bh.options[document.nhf.bh.selectedIndex].value

change = document.nhf.cm.options[document.nhf.cm.selectedIndex].value

if (change=='bg')    {document.bgColor=rgb ; return(false)}
if (change=='fg')    {document.fgColor=rgb ; return(false)}
if (change=='link')  {document.linkColor=rgb ; return(false)}
if (change=='alink') {document.alinkColor=rgb ; return(false)}
if (change=='vlink') {document.vlinkColor=rgb ; return(false)}
}

<!--  //-->

function changeC() {
  change=document.nhf.cm.options[document.nhf.cm.selectedIndex].value
  if (change=='bg')    {setall(document.bgColor)    ; return(false)}
  if (change=='fg')    {setall(document.fgColor)    ; return(false)}
  if (change=='link')  {setall(document.linkColor)  ; return(false)}
  if (change=='alink') {setall(document.alinkColor) ; return(false)}
  if (change=='vlink') {setall(document.vlinkColor) ; return(false)}
  }

function setall(rgb) {
   rv=hex.indexOf(rgb.substring(1,2) )*16
rv=rv+hex.indexOf(rgb.substring(2,3) )
   gv=hex.indexOf(rgb.substring(3,4) )*16
gv=gv+hex.indexOf(rgb.substring(4,5) )
   bv=hex.indexOf(rgb.substring(5,6) )*16
bv=bv+hex.indexOf(rgb.substring(6,7) )

  with (document.nhf) {
  rh.selectedIndex=rv
  gh.selectedIndex=gv
  bh.selectedIndex=bv
  }
}

function prevprecolor() {
c=document.nhf.pc.options[document.nhf.pc.selectedIndex].value

if (c=='none') {return(false)}
change = document.nhf.cm.options[document.nhf.cm.selectedIndex].value

document.nhf.pc.selectedIndex=0

if (change=='bg')    {document.bgColor=c    ; setall(document.bgColor) ; return(false)}
if (change=='fg')    {document.fgColor=c    ; setall(document.fgColor) ; return(false)}
if (change=='link')  {document.linkColor=c  ; setall(document.linkColor) ; return(false)}
if (change=='alink') {document.alinkColor=c ; setall(document.alinkColor) ; return(false)}
if (change=='vlink') {document.vlinkColor=c ; setall(document.vlinkColor) ; return(false)}
}

function makepage() {
with (document) {
text='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\n'+
'<HTML>\n<HEAD>\n<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\n'

if (!nhf.kw.value=='') { text+='<meta name="keywords" content="'+nhf.kw.value+'">\n' }
if (!nhf.de.value=='') { text+='<meta name="description" content="'+nhf.de.value+'">\n' }

text+='<TITLE>'+title+'</TITLE>\n</HEAD>\n'

text+='<BODY BGCOLOR="'+bgColor+'" TEXT="'+fgColor+'" LINK="'+linkColor+'"\n      ALINK="'+alinkColor+'" VLINK="'+vlinkColor+'">\n'


text+='\n<!--Insert your Document here... //-->\n\n</BODY>\n</HTML>\n'
nhf.outext.value=text
}
return(false)
}

function changetitle(ttl) { document.title=ttl }

function bright(v) {
 with (document.nhf) {
  change=cm.options[cm.selectedIndex].value
  if (change=='bg')    {rgb=document.bgColor}
  if (change=='fg')    {rgb=document.fgColor}
  if (change=='link')  {rgb=document.linkColor}
  if (change=='alink') {rgb=document.alinkColor}
  if (change=='vlink') {rgb=document.vlinkColor}

     rv=hex.indexOf(rgb.substring(1,2) )*16
  rv=rv+hex.indexOf(rgb.substring(2,3) )
     gv=hex.indexOf(rgb.substring(3,4) )*16
  gv=gv+hex.indexOf(rgb.substring(4,5) )
     bv=hex.indexOf(rgb.substring(5,6) )*16
  bv=bv+hex.indexOf(rgb.substring(6,7) )

  rv=eval(rv+v) ; if (rv>255) {rv=255} ; if (rv<0) {rv=0}
  gv=eval(gv+v) ; if (gv>255) {gv=255} ; if (gv<0) {gv=0}
  bv=eval(bv+v) ; if (bv>255) {bv=255} ; if (bv<0) {bv=0}
  rh.selectedIndex=rv
  gh.selectedIndex=gv
  bh.selectedIndex=bv
  prevcolor()
  br.selectedIndex=2
  }
}

function remember() {
var expdate = new Date();
expdate.setTime(expdate.getTime()+(5*24*60*60*1000));
 with (document) {
 prefs=document.title+'::'+nhf.kw.value+'::'+nhf.de.value+'::'+nhf.cm.selectedIndex+'::'+bgColor+'::'+fgColor+'::'+linkColor+'::'+alinkColor+'::'+vlinkColor
  SetCookie(pcid,prefs,expdate);
 }
return(false)
}

function recall() {
document.nhf.pc.selectedIndex=0
document.nhf.br.selectedIndex=2

getprefs =GetCookie(pcid)
 if (getprefs==null) {
 alert('After Finding your Prefered Base\nPress "Remember" to have the same\nsettings every time it loads')
  with (document) {
  title     =  'New Page'
  nhf.pt.value='New Page'
  nhf.kw.value=''
  nhf.de.value=''
  bgColor   =  '777777'
  fgColor   =  'black'
  linkColor =  'blue'
  alinkColor=  '5555ff'
  vlinkColor=  '800080'
  }
document.nhf.cm.selectedIndex=0
changeC()
 }
 else {
args= getprefs.split('::')
 change=args[3]
  with (document) {
  title     =  args[0]
  nhf.pt.value=title
  nhf.kw.value=args[1]
  nhf.de.value=args[2]
  bgColor   =  args[4]
  fgColor   =  args[5]
  linkColor =  args[6]
  alinkColor=  args[7]
  vlinkColor=  args[8]
document.nhf.cm.selectedIndex=Math.max(change,0)
changeC()
  }
 }
}

function setdateinfo(cname) {
var cid=new String(cname + "_cookie_date")
var cookie_date=new Date(document.lastModified);
var expdate = new Date();
expdate.setTime(expdate.getTime()+(5*24*60*60*1000));
document.write('<Font color="#440ff33">' + 'Page Last Modified: '+ '</font>' +document.lastModified);
document.write("");
old_date = GetCookie(cid)
 if (old_date == null) {
 SetCookie(cid,cookie_date,expdate);
 return('<font size="3" color="white"><br>Here you will be notified if this page has been modified</font><br>');
 }

 if (!(cookie_date == old_date)){
 SetCookie(cid,cookie_date,expdate);
 return('<font size="3" color="#ff0000"><br>This Page HAS changed since your last visit!</font><br>');
 }
 else {
 return('<font size="3" color="#00ff00"><br>This Page NOT changed since your last visit</font><br>');
 }
}

function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break; 
}
return null;
}
function SetCookie (name,value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}

