// JavaScript Document

var dobreak=true;
var idTimeOut=0;
var eh=100;
window.setTimeout("shrink()", 10000)

function shrink(){
	dobreak=false;
	doshrink();
}

function doshrink(){

	if (dobreak==true){
		return;
	}
	dobreak=true;
	idTimeOut=setInterval("shrinkElement()",20);
}

function dogrow(){
	if (dobreak==true){
		return;
	}
	dobreak=true;
	eh=50;
	idTimeOut=setInterval("growElement()",20);
	
}


function shrinkElement() {
	var obj=document.getElementById('advert')
	obj.style.cssText="overflow:hidden!important;height:" + eh +"px!important;";

	for(var i=0;i<1;i++) eh--;
	if (eh <=50) {
		clearInterval(idTimeOut);
		obj.style.cssText="height:50px!important;overflow:hidden;"
		dobreak=false;
		}
}


function growElement() {
	var obj=document.getElementById('advert')
	obj.style.cssText="height:" + eh +"px!important;overflow:hidden!important;";

	for(var i=0;i<4;i++) eh++;
	if (eh >=100) {
		eh=100		
		clearInterval(idTimeOut);
		obj.style.cssText="height:" + eh +"px!important;overflow:hidden!important;";
		dobreak=false;
		}
}