function addEvent(instance, eventName, listener) {
	var listenerFn = listener;
	if (instance.addEventListener) {
		instance.addEventListener(eventName, listenerFn, false);
	} else if (instance.attachEvent) {
		listenerFn = function() {
			listener(window.event);
		}
		instance.attachEvent("on" + eventName, listenerFn);
	} else {
		throw new Error("Event registration not supported");
	}
	var event = {
		instance: instance,
		name: eventName,
		listener: listenerFn
	};
	return event;
}

function setScroll(){var windowWidth, windowHeight;if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;windowHeight = self.innerHeight;} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;	windowHeight = document.documentElement.clientHeight;} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;windowHeight = document.body.clientHeight;}	return [windowWidth,windowHeight];}

function setMinScroll() {var wndHeight = setScroll();if (wndHeight[1] < 480) {document.body.style.overflowY = 'auto';document.body.style.height = "480px";} else {	document.body.style.overflowY = 'hidden';}}

function setFullHeight() {
	var wndHeight = setScroll();
	var cont = document.getElementById('content');
	if (!cont.autoHeight)
	{
		cont.autoHeight = true;
		cont.initialHeight = parseInt(cont.offsetHeight);
		addEvent(window,'resize',setFullHeight);		
	}
	if (cont.initialHeight < wndHeight[1]) {
		cont.style.height = (wndHeight[1] - 53) + 'px';
	} else {
		cont.style.height = cont.initialHeight + 'px';
	}

	

}
