var max = 0;
var hmove1 = 1;
var hmove2 = 1;

function HeightPlus(){

	document.getElementById("videoarea").style.display = "block";
	max = document.getElementById("videoarea").offsetHeight;
	if( movedonce !=1){
		HeightMovePlus();
	}
}

function HeightMovePlus(){
	htime1 = setTimeout("HeightMovePlus()", 1);
	document.getElementById("videoarea").style.height = (hmove1 * 10) + "px";
	hmove1++;
	if((hmove1 * 10) > max){
		max = 0;
		hmove1 = 1;
		hmove2 = 1;
		clearTimeout(htime1);
	}

}

function HeightMinus(){

	hmove2 = document.getElementById("videoarea").offsetHeight;
	HeightMoveMinus();

}

function HeightMoveMinus(){
	htime2 = setTimeout("HeightMoveMinus()", 1);
	hmove2 = hmove2 - 10;
	if(hmove2 > 0){
		document.getElementById("videoarea").style.height = hmove2 + "px";
	}else{
		clearTimeout(htime2);
		document.getElementById("videoarea").style.height = "";
		document.getElementById("videoarea").style.display = "none";
	}

}

function callmov(YouTubeID){
	document.getElementById("videoarea").innerHTML = '<iframe width="520" height="330" src="http://www.youtube.com/embed/' + YouTubeID + '?autoplay=1" frameborder="0" allowfullscreen></iframe>';
	HeightPlus();
	var movedonce = 1;
}
