//***************************************************
// Pop up image in new window with background color and title/caption
//***************************************************

function popitup(imageURL, newwindowname, title, caption, imagewidth, imageheight)
{
	if (! window.focus) return true;
	windowheight=imageheight+112;
	windowwidth=imagewidth+20;
	newwindow=window.open('',newwindowname,'scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,height='+windowheight+',width='+windowwidth);
	var tmp = newwindow.document;
	tmp.write('<html><head><title>'+title+'</title>');
	tmp.write('</head><body bgcolor="#fcf3d6" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><div style="text-align:center"><img src="'+imageURL+'" alt="'+title+'" title="'+title+'" width="'+imagewidth+'" height="'+imageheight+'" vspace="6" border="0">');
	tmp.write('<p align="center" style="margin-top:0px;margin-bottom:0px;"><font face="Arial, Helvetica, sans-serif">'+caption+'<br><br><font size="-1"><a href="javascript:self.close()">Close the window</a></font></font></p>');
	tmp.write('</body></html>');
	tmp.close();
	newwindow.focus();
	return false;
}
function noSpam() {
	var link = noSpam.arguments[0]; // text for the link
	var pre = noSpam.arguments[2];  // number of segments before the @

	var myat = String.fromCharCode(64);   // @
	var mydot = String.fromCharCode(46);  // .
	var addr = '';

	// starting from the third argument,
	// read the segments and build the address:
	var i;
	for (i = 3; i < noSpam.arguments.length; i++) {
		if (addr) {
			// check whether this element (any but the first)
			// comes after the @ or a dot:
			addr += (i == pre + 2) ? myat : mydot;
		}
		addr += noSpam.arguments[i];
	}

	var str = '';
	// you could break this down further so that
	// the 'recipient' is less apparent:
	str = '<INPUT TYPE="hidden" NAME="recipient" VALUE="';
	
	str += addr;
	str += '">';

	document.write (str);
}

function noSpam2() {
	var link = noSpam2.arguments[0]; // text for the link
	var subject = noSpam2.arguments[1]; // if there's a subject line to the message
	var pre = noSpam2.arguments[2];  // number of segments before the @

	var myat = String.fromCharCode(64);   // @
	var mydot = String.fromCharCode(46);  // .
	var addr = '';

	// starting from the third argument,
	// read the segments and build the address:
	var i;
	for (i = 3; i < noSpam2.arguments.length; i++) {
		if (addr) {
			// check whether this element (any but the first)
			// comes after the @ or a dot:
			addr += (i == pre + 2) ? myat : mydot;
		}
		addr += noSpam2.arguments[i];
	}

	var str = '';
	if (link) {
		// you could break this down further so that
		// the 'mailto' is less apparent:
		str = '<a href="mailto:' + addr;
		
		if (subject) {
			// code to display the subject
			str += '?subject=' + subject;
		}
		
		str += '">';

		// if the first argument was literally 'addr', the text for the link
		// is the address itself, otherwise it's the text of the argument:
		str += (link == 'addr') ? addr : link;
		
		str += '<\/a>';  // close the tag
	}
	else {
		// if the first argument is '' just print the address
		// without making it a link at all:
		str = addr;
	}

	document.write (str);
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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

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

