// Image Pop Script to launch daughter win w/ image
function image_pop(imageUrl,title,w,h) { //v2.0
	var dimensions = "width="+w+",height="+h; 
	var winName = title.replace(/ /g,""); 
	var title = title+" - ISTC"; 
	var win = window.open("",winName,dimensions); 
	var d = win.document;
	d.writeln("<html>"); 
	d.writeln("<head><title>"+title+"</title></head>"); 
	d.writeln("<body marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 onLoad=window.focus();>"); 
	d.writeln("<img src=\""+imageUrl+"\" border=0>"); 
	d.writeln("</body>"); 
	d.writeln("</html>"); 
	d.close();
}

// Image Pop Script to launch daughter win w/ image
function img_pop_download(imageUrl,downloadUrl,title,w,h) { //v2.0
	var dimensions = "width="+w; 
	var winName = title.replace(/ /g,""); 
	var title = title+" - ISTC"; 
	var win = window.open("",winName,dimensions); 
	var d = win.document;
	d.writeln("<html>"); 
	d.writeln("<head><title>"+title+"</title></head>"); 
	d.writeln("<body marginheight=\"0\" marginwidth=\"0\" topmargin=\"0\" leftmargin=\"0\" onLoad=\"window.focus();\">"); 
	d.writeln("<img src=\""+imageUrl+"\" border=\"0\">"); 
	// d.writeln("<p><a href=\""+downloadURL+"\">Click here to download the full resolution version of this image</a></p>");
	d.writeln("<p align=center><a href="+downloadUrl+" target=_blank>Click here to download the full resolution version of this image.</a></p>");
	d.writeln("</body>"); 
	d.writeln("</html>"); 
	d.close();
}

// Image Pop Script to launch daughter win w/ image
function definition(word,definition) { //v2.0
	var dimensions = "resizable=1,width=500,height=200"; 
	var title = word;
	var winName = title.replace(/ /g,""); 
	var title = title+" - ISTC"; 
	var win = window.open("",winName,dimensions); 
	var d = win.document;
	d.writeln("<html>"); 
	d.writeln("<head><title>"+title+"</title></head>"); 
	d.writeln("<body marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 onLoad=window.focus();>"); 
	d.writeln("<h3>"+word+"</h3>"); 
	d.writeln("<p>"+definition+"</p>"); 
	d.writeln("</body>"); 
	d.writeln("</html>"); 
	d.close();
}

function flash_pop(flashFN,title,w,h) { //v2.0
	var dimensions = "width="+w+",height="+h; 
	var winName = title.replace(/ /g,""); 
	var title = title+" - ISTC"; 
	var win = window.open("",winName,dimensions); 
	var d = win.document;
	d.writeln("<html>"); 
	d.writeln("<head><title>"+title+"</title></head>"); 
	d.writeln("<body marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 onLoad=window.focus();>"); 
	d.writeln("<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width="+w+" height="+h+">"); 
	d.writeln("<param name=movie value=/flash/"+flashFN+">"); 
	d.writeln("<param name=quality value=high>"); 
	d.writeln("<embed src=/flash/"+flashFN+" quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width="+w+" height="+h+"></embed>"); 
	d.writeln("</object>"); 
	d.writeln("</body>"); 
	d.writeln("</html>"); 
	d.close();
}

/*
	Shortlinks
	constrains the length of links displayed to a defined length
	written by Chris Heilmann (http://icant.co.uk/)

function shortlinks()
{
	var mode='right';
	var mustlength=75; 
	var connector='...';
	var titleadd=' (Full address: %url%)';
	var contentlinks=document.getElementsByTagName('a');
	for(var i=0;i<contentlinks.length;i++)
	{
		if(!contentlinks[i].getAttribute('href') || !contentlinks[i].firstChild){continue;}
		var t=contentlinks[i].firstChild.nodeValue;
		if(/http:/.test(t) && t.length>mustlength)
		{
			switch(mode){
				case 'middle':
					var newt=t.substr(0,mustlength/2)+connector+t.substr(t.length-mustlength/2-connector.length,t.length);
				break;
				case 'right':
					var newt=t.substr(0,mustlength-connector.length)+connector;
				break;
			}
			contentlinks[i].title+=titleadd.replace(/%url%/,t);
			contentlinks[i].replaceChild(document.createTextNode(newt),contentlinks[i].firstChild);
		}
	
	}	
}
*/