function addToBookmark()
{
	if (navigator.appName != 'Microsoft Internet Explorer')
		window.sidebar.addPanel(pageTitle, window.location.href, "");
	else
		window.external.AddFavorite(window.location.href, pageTitle);
}

function getLink(o)
{
	return (o instanceof  String || typeof o == "string") ? o : o.getAttribute('href');
}

function openWindow(o)
{
	var win = window.open(getLink(o));
	win.focus();
	return false;
}

function openPopup(url, w, h)
{
	var feats = '';
	var props = { width: w || screen.width, height: h || screen.height, resizable: 'no', location: 'no', status: 'no', menubar: 'no', toolbar: 'no'};
	for(prop in props) 
		feats = feats + prop + '=' + props[prop] + ',';
	prop_str = prop_str.substr(0, feats.length - 1);
	
	var link = getLink(o);
	var newWindow = window.open(link, '_blank', prop_str );
	if( newWindow )
	{
		if(newWindow.focus)
			newWindow.focus();
		return false;
	}
	return true;
}

function flashResize(id, miniw, minih, maxiw, maxih)
{
	var itm = document.getElementById(id);
	var w = document.body.clientWidth - 30 /* scrollbars */;
	var h = document.body.clientHeight - 30 /* scrollbars */;
	
	if(miniw != undefined)
		w = Math.max(w, miniw);
	if(maxiw != undefined)
		w = Math.min(w, maxiw);
	itm.width = w;
	
	if(minih != undefined)
		h = Math.max(h, minih);
	if(maxih != undefined)
		h = Math.min(h, maxih);
	itm.height = h;
	
	// alert('flashResize('+ w +', '+ h +')');
}