function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_swapImgRestore() {//v1.0
 var doc=document,i; if(doc.$imgSwaps) { for(i=0;i<doc.$imgSwaps.length;i++) {
  var elm=doc.$imgSwaps[i]; if(elm) { elm.src=elm.$src; elm.$src=null; } } 
  doc.$imgSwaps=null; }
}

function FP_swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

function FP_openNewWindow(w,h,nav,loc,sts,menu,scroll,resize,name,url) {//v1.0
 var windowProperties=''; if(nav==false) windowProperties+='toolbar=no,'; else
  windowProperties+='toolbar=yes,'; if(loc==false) windowProperties+='location=no,'; 
 else windowProperties+='location=yes,'; if(sts==false) windowProperties+='status=no,';
 else windowProperties+='status=yes,'; if(menu==false) windowProperties+='menubar=no,';
 else windowProperties+='menubar=yes,'; if(scroll==false) windowProperties+='scrollbars=no,';
 else windowProperties+='scrollbars=yes,'; if(resize==false) windowProperties+='resizable=no,';
 else windowProperties+='resizable=yes,'; if(w!="") windowProperties+='width='+w+',';
 if(h!="") windowProperties+='height='+h; if(windowProperties!="") { 
  if( windowProperties.charAt(windowProperties.length-1)==',') 
   windowProperties=windowProperties.substring(0,windowProperties.length-1); } 
// window.open(url,name,windowProperties);
 TheNewWin = window.open(url,name,windowProperties);
 TheNewWin.moveTo(0,0);
}

function closeWindow() {//v1.0
 this.focus();
 self.opener = this;
 self.close();
}

function bottomMargin(hIE, hNS) {//v1.0
 d = new Date(document.lastModified);
 y = d.getYear();
 if (y < 2000) {
   document.writeln("<tr><td style=\'height:" + (hNS) + "\'>&nbsp;</td></tr>");
 }
 else {
   document.writeln("<tr><td style=\'height:" + (hIE) + "\'>&nbsp;</td></tr>");
 }
}

function FP_jumpMenu(el,frm,sel) {//v1.0
 var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
 if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
}

function FP_goToURL(url) {//v1.0
 window.location=url;
}

function openHelpWindow(mypage,myname,w,h) {//v1.0
 if(help_window && help_window.open && !help_window.closed) help_window.close();
 LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
 TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
 settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',resizable';
 help_window = window.open(mypage,myname,settings);
}

function closeHelpWindow() {//v1.0
 if(help_window && help_window.open && !help_window.closed) help_window.close();
}

function about() {//v1.0
 document.writeln("<tr>");
 document.writeln("<td align=\"center\">");
 document.writeln("<p style=\"margin-bottom: 6px\"><font face=\"Arial, Helvetica, Sans-Serif\" size=\"2\" color=\"gray\"><strong>Version 1.0</strong></font></td>");
 document.writeln("</tr>");
 //document.writeln("<tr>");
 //document.writeln("<td align=\"center\"><font face=\"Arial, Helvetica, Sans-Serif\" size=\"1\" color=\"gray\">");
 //document.writeln("<strong>Copyright &copy; 2006, 2005 Steven M. Boettcher and Yi Zhu.</strong></font></td>");
 //document.writeln("</tr>");
 //document.writeln("<tr>");
 //document.writeln("<td align=\"center\">");
 //document.writeln("<p style=\"margin-top: 6px; margin-bottom: 6px\"><font face=\"Arial, Helvetica, Sans-Serif\" size=\"1\" color=\"gray\">");
 //document.writeln("<strong>This software is protected by national and international copyright laws.</strong></font></td>");
 //document.writeln("</tr>");
 //document.writeln("<tr>");
 //document.writeln("<td align=\"center\"><font face=\"Arial, Helvetica, Sans-Serif\" size=\"1\" color=\"gray\">");
 //document.writeln("<strong>Site content appears by permission. All rights reserved.</strong></font></td>");
 //document.writeln("</tr>");
}