var origWidth = 0;
var time = 0;
var maxWidth = 562;
var opened = false;
var obj;
function init_banner() {
	obj = document.getElementById('cont');
	origWidth = obj.clientWidth;
	time = setTimeout(move_out, 1000);
	obj.onmouseover = null;
	opened = true;
	time = setTimeout(move_back, 4000);
}

function move_out() {
	obj.style.width = parseInt(obj.style.width) + Math.ceil((maxWidth - parseInt(obj.style.width)) / 4) + "px";
	pic_out();
	if (parseInt(obj.style.width) != maxWidth) {
		time = setTimeout(move_out, 10);
	}
}

function pic_out() {
	obj.style.backgroundPosition = parseInt(obj.style.backgroundPosition) - 4 + 'px';
}

function move_back() {
	obj.style.width = parseInt(obj.style.width) - Math.ceil((parseInt(obj.style.width) - origWidth)) / 2 + "px";
	pic_back();
	if (parseInt(obj.style.width) != origWidth) {
		time = setTimeout(move_back, 40);
	}
}

function pic_back() {
	obj.style.backgroundPosition = parseInt(obj.style.backgroundPosition) + Math.ceil(-parseInt(obj.style.backgroundPosition) / 2) + "px";
	if (opened == true) {
		add_listener();
	}
}

function add_listener() {
	if(window.addEventListener) {
		obj.addEventListener('mouseover', move_out, false);
	} else if(window.attachEvent) { // IE
		obj.attachEvent('onmouseover', move_out);
	}

	opened=false;
}