//make all external links open in a new window, should be called at the end of the page
function extLinksPop() 
{
	/*
	//load into the opener's window instead
	if((opener)&&(!opener.closed)&&(opener.location)){
		opener.location = location.href;
		if(window.close) window.close();
		return;
	}
	*/

	var hostname = window.location.hostname;
	hostname = hostname.replace("www.","").toLowerCase();
	var a = document.getElementsByTagName("a");	
	
	//if I am in a pop-up with browser features disabled, all links open in a new window
	var allNew = /*!window.location.visible ||*/ window.menubar && !window.menubar.visible || window.toolbar && !window.toolbar.visible;
	
	this.check = function(obj){
		var href = obj.href.toLowerCase();
		return (href.indexOf("http://")!=-1 && href.indexOf(hostname)==-1) ? true : false;				
	}
	this.set = function(obj){
		obj.target = "_blank";
		//obj.className = "external";
	}	
	for (var i=0;i<a.length;i++)
		if(allNew || check(a[i])) set(a[i]);	
}

function embed(filename, width, height)
{
	/*document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="' +width + '" height="' + height+'"' + ' align="middle">'+
	'<param name="allowScriptAccess" value="sameDomain" />'+
	'<param name="allowFullScreen" value="true" />'+
	'<param name="movie" value="' + filename + '" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />'+
	'<embed src="' + filename + '" quality="high" bgcolor="#ffffff" width="' +width + '" height="' + height+'"' + ' align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" content-type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'+
	'</object>');*/
	
	document.write('<embed src="' + filename + '" width="' +width + '" height="' + height+'"' + ' allowFullScreen="true" content-type="application/x-shockwave-flash">');
}

