function div_video(file, w, h, text){
	ffon();
	document.getElementById("titleV").innerHTML=text;
	var player = document.getElementById("player1");
	player.style.display="block";
	var W1 = document.documentElement.offsetWidth;
	var H = document.documentElement.offsetHeight;
	player.style.left = ((W1 - w) / 2) + 'px';
	player.style.top = '100px';//((H - 450) / 2) + 'px';
	player.style.width=w+'px';
	var video = document.getElementById("video1");
	//video.innerHTML = "<h1>Видео</h1>";
	video.innerHTML = '<object type="application/x-shockwave-flash" data="./files/video/uflvplayer.swf" height="'+h+'" width="'+w+'"><param name="bgcolor" value="#FFFFFF" /><param name="allowFullScreen" value="true" /><param name="movie" value="./files/video/uflvplayer.swf" /><param name="FlashVars" value="way=http://avtovodila.ru/files/video/'+file+'&amp;swf=./files/video/uflvplayer.swf&amp;w='+w+'&amp;h='+h+'&amp;pic=http://&amp;autoplay=0&amp;tools=1&amp;skin=white&amp;volume=100&amp;q=&amp;comment=www.avtovodila.ru" /></object>';
}

function closeV(){
	document.getElementById("player1").style.display="none";
	document.getElementById("video1").innerHTML="";
	document.getElementById("titleV").innerHTML="";
	$('#TB_overlay').remove();
}

function ffon(){
	if(!jQuery("body").find("#TB_overlay").is("div")) /* если фон уже добавлен не добавляем повторно */
	{
		if(!jQuery.browser.msie) /* если браузер не ИЕ фоном будет div */
			jQuery("body").append("<div id='TB_overlay'></div>");
		else /* иначе добавляем iframe */
		   jQuery("body").append("<div id='TB_overlay'><iframe scrolling='no' frameborder='0' style='position: absolute; top: 0; left: 0; width: 100%; height: 100%; filter:alpha(opacity=0)'></iframe></div>");
	}
}
