function showBookForm(id){
	//document.getElementById('cms_BookForm_'+id).style.display="block";
	var obj=document.getElementById('cms_BookForm_'+id);
	obj.style.opacity='0';
	obj.style.height='auto';
	var maxHeight=obj.offsetHeight;
	if (maxHeight<10) maxHeight=500;
	//var maxHeight=800;
	var height=0;
	obj.style.height=0+'px';
	var dy=10;
	//var maxIter=50;
	//var iter=0;
	obj.style.display='block';

	setTimeout (
			function() {
				//iter++;
				var opacity=parseFloat(obj.style.opacity);
				opacity+=0.05; 
				var height=parseInt(obj.style.height);
				dy+=5
				//if (dy<15) dy=15;
				height+=dy;
				if (height<maxHeight){ //&& (iter<maxIter)  ){
					obj.style.opacity=opacity;
					obj.style.height=height+'px';
					setTimeout(arguments.callee,30);
				}	
				else{
					obj.style.display='block';
					obj.style.height='auto';
					obj.style.opacity=1;
				}
			}, 30
		)	
}
function hideBookForm(id){
//	document.getElementById('cms_BookForm_'+id).style.display="none";
	var obj=document.getElementById('cms_BookForm_'+id);
	obj.style.opacity='1.0';
	var height=obj.offsetHeight;
	obj.style.height=height+'px';
	var dy=1;

	setTimeout (
			function() {
				
				var opacity=parseFloat(obj.style.opacity);
				opacity-=0.05; 
				var height=parseInt(obj.style.height);
				dy+=5;
				//if (dy<15) dy=15;
				height-=dy;
				if (height>0){
					obj.style.opacity=opacity;
					obj.style.height=height+'px';
					setTimeout(arguments.callee,30);
				}	
				else{
					obj.style.display='none';
					obj.style.height='auto';
					obj.style.opacity=1;
					
					var newlocation=location.href;
					var pos=0;
					if ((pos=location.href.indexOf('#'))>1){
						newlocation=location.href.substr(0,pos);
						//alert(newlocation);
					}
					location.href=newlocation+'#price_'+id;
				}
			}, 30
		)
}	
//var Products=new Array();

function submitBookForm(id){
	var form=document.getElementById('cms_BookForm_'+id);
	var phone=new String(form.phone.value);
	phone.trim;
	if (phone.length != 0){
		ajaxFormSubmit('cms_BookForm_'+id,'book_product');
		hideBookForm(id);
	}else{
		printBookError(id)
	}
}
function printBookError(id){
	document.getElementById('BookError_'+id).innerHTML="Пожалуйста, укажите контактный телефон!";
}