// misc functions

function addFavourite()
{
	if(!IE)
		return;

	var url =  location.href;
	var title = document.title;

	window.external.AddFavorite(url,title);
}

function openWindow(url,winName,top,left,width,height)
{
	this.width = arguments.length > 4 ? width : 800;
	this.height = arguments.length > 5 ? height : 480;
	
	return window.open(url,winName,"width="+this.width+",height="+this.height+",location=no,toolbar=no,menubar=no,titlebar=yes,scrollbars=no,resizable=no,top="+top+",left="+left);
}

function doLink(url)
{
	if(IE4 || IE5 || IE5p5 || IE6 || IE7 || NN4 || NN7){
		if(childWin && !childWin.closed){
			childWin.location = url;
			childWin.focus();
			return;
		}
	}					   
			
	var left = screen.availWidth > 800 ? 50 : 0;
	var top = screen.availHeight > 480 ? 50 : 0;
	
	if(IE4 || IE5 || IE5p5 || IE6 || IE7 || NN4 || NN6 || NN7)
		childWin = openWindow(url,"ChildWindow",top,left,310,260);
		
	else
		window.location.href = url;
}
var childWin = null;

function getObjectStyle(id)
{		
	if(typeof id != "string")
		return id;
		
	var obj = getObject(id);
	
	if(NN4)
		return obj;
		
	return obj ? obj.style : null;
}

function getObject(id)
{
	if(typeof id != "string")
		return id;
		
	if(document.getElementById)			
		return document.getElementById(id);
		
	return document.all ? document.all[id] : null;
}

function doCode()
{
	var str = "";
	for (var i=0; i < arguments.length; i++)
		str += String.fromCharCode(arguments[i]);

	document.writeln(str);
}

function getMonthYear()
{
	var months = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
	var date = new Date();
	var mm = date.getMonth();
	var yy = date.getYear();
	
	return months[mm] + " " + yy;
}

