﻿function onImgErrorSmall(source)
{
source.src ="../../images/no-image-200px.gif";
// disable onerror to prevent endless loop
source.onerror = "";
return true;
}

function imageError(theImage) {
msg = 'We apologize, our servers are currently undergoing\nroutine maintenance.\n\n' +
'Images may not display correctly.\n\n' +
'Please try back again in approximately 15 minutes.';
alert(msg);
}

var NS = (document.layers);
var IE = (document.all);
var popup
if (IE)
{
popup = null;
}
function new_window(s,w,h)
{
var w=w+0;
var h=h+0;
var halfWidth = ((screen.width / 2) - (w / 2));
var halfHeight = ((screen.height / 2) - (h / 2));
if (NS)
{
popup = null;
}
if (popup != null && !popup.closed)
{
popup.close();
}
 
popup =
window.open(s,'popup','toolbar=no,title=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=' + w + ',height=' + h + ',top=' + halfHeight + ', left=' + halfWidth + '');

}

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_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_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;
}

