function preloadImages() {
	if (document.images) {
		if (!document.p) document.p = new Array();
		var i, j = document.p.length, arg = preloadImages.arguments;
		for (i = 0; i < arg.length; i++) {
			if (arg[i].indexOf('#') != 0) {
				document.p[j] = new Image;
				document.p[j++].src = arg[i];
			}
		}
	}
}

function swap(imgId, imgUrl) {
  var oImg;
  
  if (document.getElementById) {
    oImg = document.getElementById(imgId);
  } else if (document.images) {
    oImg = document.images[imgId];
  } else if (document.all) {
    oImg = document.all[imgId];
  }
  
  if (oImg && oImg.src) {
    oImg.src = imgUrl;
  }
}

function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// JavaScript Written By Marc Castles MCWeb - version 1
// You can change the background color below

function popupMedia(url,width,height) {
	winheight = parseFloat(height) + 30;
	winwidth =  parseFloat(width) + 30;

	newWin=window.open('', 'popupwin','resizable=0,HEIGHT='+winheight+',WIDTH='+winwidth+', scrollbars=0', true);
	newWin.document.write('<html>\n');
	newWin.document.write('<head>\n');
	newWin.document.write('<title>Image</title>');
	newWin.document.write('<script language="javascript" type="text/javascript">\n<!--\n');
	newWin.document.write('var arrTemp=self.location.href.split("?");\n');
	newWin.document.write('var picUrl = (arrTemp.length>1)?arrTemp[1]:"";\n');
	newWin.document.write('var NS = (navigator.appName=="Netscape")?true:false;\n');
	newWin.document.write('function fitMedia() {\n');
	newWin.document.write('	iWidth = (NS)?window.innerWidth:document.body.clientWidth;\n');
	newWin.document.write('	iHeight = (NS)?window.innerHeight:document.body.clientHeight;\n');
	newWin.document.write('	iWidth = '+winwidth+' - iWidth;\n');
	newWin.document.write('	iHeight = '+winheight+' - iHeight;\n');
	newWin.document.write('	window.resizeBy(iWidth, iHeight);\n');
	newWin.document.write('	var posLeft = (window.screen.width - '+winwidth+')/2;\n');
	newWin.document.write('	window.moveTo(posLeft,80);\n');
	newWin.document.write('};\n');
	newWin.document.write('-->\n</script>\n');

	newWin.document.write('<style>html,body{height:100%;padding:0px;}</style>\n');
	newWin.document.write('</head>\n');
	newWin.document.write('<body style="background-color:white; margin:0px; padding:0px;">\n');
	newWin.document.write('<table border=0 style="height:100%; width:100%; text-align:center;"><tr><td>\n');
	newWin.document.write('<img src="'+url+'" width="'+width+'" height="'+height+'" alt="" />');
	newWin.document.write('</td>\n</tr>\n</table>\n</body>\n<script language="javascript" type="text/javascript">\n<!--\n');
	newWin.document.write('fitMedia();\n');
	newWin.document.write('-->\n</script>\n');	
	newWin.document.write('</html>');
	newWin.document.close()
	newWin.focus();
}