
if(document.getElementById("reviewdtls"))
  document.getElementById("reviewdtls").style.backgroundColor="white";  
	

	//hide the loading image
	 
//MM_showHideLayers_header('loading','','hide');
if(document.form_bhrc.hid_vs_scale.value !=0)
{
  MM_showHideLayers_header('niftyshow','','show');
} 	

if(document.form_bhrc.hid_vs_scale1.value >10 )
{
 
		if(navigator.appName=="Microsoft Internet Explorer")
		{ fill1()
 
		}
		else
		  {fill2()}
		  
		var totalrow;
 
 }
 
 function fill2()
		{
			var tot=document.form_bhrc.hid_vs_scale.value  
			var t1=document.getElementById("tbl") 
			var tr1=document.createElement("TR")
		for(i=0;i<=tot-1;i++)
			{
				var td1=document.createElement("TD") 
				td1.style.backgroundColor='#ffd700'
				td1.style.border='solid'

				td1.style.borderWidth='0px'
				td1.style.borderLeftWidth='0px'
				td1.style.borderRightWidth='1px'
				td1.style.borderTopWidth='0x'
				td1.style.borderBottomWidth='0px'
				 
				td1.innerHTML="<font size=1><td valign=middle width=10% bgColor='black'>&nbsp;"
				totalrow=i+1
				tr1.appendChild(td1)
			}
	
		 var tot1=tot.indexOf('.')          
			if((tot1)>0)
			{
				var prec=tot.substring(tot1)  
				if ((prec>=parseFloat(".10"))&&(prec<=parseFloat(".35")))
				{	               
				   var tbw=parseFloat(prec) *100
				   var c1=document.createElement("TD") 
				   c1.style.border='solid'
				   c1.style.borderWidth='0px'
				   c1.style.borderLeftWidth='0px'
				   c1.style.borderRightWidth='1px'
				   c1.style.borderTopWidth='0x'
				   c1.style.borderBottomWidth='0px'
				   
				   c1.innerHTML="<font size=1><td width=10%><table width=25% border=0 cellpadding=0 cellspacing=0><tr><td bgcolor='#ffd700'><font size=1>&nbsp</font></td></tr></table></font>"  
				   totalrow=i+1
				   tr1.appendChild(c1)
				}  
				 
				if ((prec>parseFloat(".35"))&&(prec<=parseFloat(".65")))
				{		               
				   var c1=document.createElement("TD") 
				   c1.style.border='solid'
				   c1.style.borderWidth='0px'
				   c1.style.borderLeftWidth='0px'
				   c1.style.borderRightWidth='1px'
				   c1.style.borderTopWidth='0x'
				   c1.style.borderBottomWidth='0px'
				  
				   c1.innerHTML="<font size=1><td width=10%><font size=1><table width=50% border=0 cellpadding=0 cellspacing=0><tr><td bgcolor='#ffd700'><font size=1>&nbsp;</font></td><td bgcolor='#ffd700'><font size=1>&nbsp;</font></td></tr></table></font>"  
				   totalrow=i+1
				   tr1.appendChild(c1)
				}
				    
				 if ((prec>parseFloat(".65"))&&(prec<=parseFloat(".85")))
				 {		               
				    var c1=document.createElement("TD") 
				    c1.style.border='solid'
				    c1.style.borderWidth='0px'
				    c1.style.borderLeftWidth='0px'
				    c1.style.borderRightWidth='1px'
				    c1.style.borderTopWidth='0x'
				    c1.style.borderBottomWidth='0px'
				    
					c1.innerHTML="<font size=1><td width=10%><table width=75% border=0 cellpadding=0 cellspacing=0><tr><td bgcolor='#ffd700'><font size=1>&nbsp;</font></td><td bgcolor='#ffd700'><font size=1>&nbsp;</font></td></tr></table>"  
					totalrow=i+1
					tr1.appendChild(c1)
				 }
				 
				 if ((prec>parseFloat(".85"))&&(prec<=parseFloat(".95")))
				 {			                
					var c1=document.createElement("TD") 
					c1.style.border='solid'
					c1.style.borderWidth='0px'
					c1.style.borderColor='black'
				    c1.style.borderLeftWidth='0px'
				    c1.style.borderRightWidth='1px'
				    c1.style.borderTopWidth='0x'
				    c1.style.borderBottomWidth='0px'
				    
					c1.innerHTML="<font size=1><td width=10%><font size=1><table width=95% border=0 cellpadding=0 cellspacing=0><tr><td bgcolor='#ffd700'><font size=1>&nbsp;</font></td><td bgcolor='#ffd700'><font size=1>&nbsp;</font></td></tr></table></font>"  
					totalrow=i+1
					tr1.appendChild(c1)
				 }
			}          
			        
			if (totalrow!=10)
			{
			  for (i=totalrow;i<=9;i++)
			  {
			     var c1=document.createElement("TD") 
			     c1.style.border='solid'
			     c1.style.borderWidth='0px'
			     c1.style.borderColor='black'
			     c1.style.borderWidth='0px'
				 c1.style.borderLeftWidth='0px'
				 c1.style.borderRightWidth='1px'
				 c1.style.borderTopWidth='0x'
				 c1.style.borderBottomWidth='0px'
				 
			     c1.innerHTML="<font size=1><td valign=middle width=10%>&nbsp</td></font>" 
			     tr1.appendChild(c1)   
			  }
		  }	
		t1.appendChild(tr1)

		}
		
		
		
		
		function fill1()
		{

			var tot=document.form_bhrc.hid_vs_scale.value  
			var t1=tbl.insertRow();
			         
			for(i=0;i<=tot-1;i++)
			{
				var c1=t1.insertCell();
				c1.style.backgroundColor='#ffd700'
				c1.style.border='solid'
				c1.style.borderLeftWidth='0px'
				c1.style.borderRightWidth='1px'
				c1.style.borderTopWidth='0x'
				c1.style.borderBottomWidth='0px'
				 
				c1.innerHTML="<font size=1><td valign=middle width=10% bgColor='black'>&nbsp;"
				totalrow=i+1
			}
			       
			var tot1=tot.indexOf('.')          
			if((tot1)>0)
			{
				var prec=tot.substring(tot1)  
				if ((prec>=parseFloat(".10"))&&(prec<=parseFloat(".35")))
				{	               
				   var tbw=parseFloat(prec) *100
				   var c1=t1.insertCell();
				   c1.style.border='solid'
				   c1.style.borderLeftWidth='0px'
				   c1.style.borderRightWidth='1px'
				   c1.style.borderTopWidth='0x'
				   c1.style.borderBottomWidth='0px'
				   
				   c1.innerHTML="<font size=1><td width=10%><table width=25% border=0 cellpadding=0 cellspacing=0><tr><td bgcolor='#ffd700'><font size=1>&nbsp</font></td></tr></table></font>"  
				   totalrow=i+1
				}  
				 
				if ((prec>parseFloat(".35"))&&(prec<=parseFloat(".65")))
				{		               
				   var c1=t1.insertCell();
				   c1.style.border='solid'
				   c1.style.borderLeftWidth='0px'
				   c1.style.borderRightWidth='1px'
				   c1.style.borderTopWidth='0x'
				   c1.style.borderBottomWidth='0px'
				  
				   c1.innerHTML="<font size=1><td width=10%><font size=1><table width=50% border=0 cellpadding=0 cellspacing=0><tr><td bgcolor='#ffd700'><font size=1>&nbsp;</font></td><td bgcolor='#ffd700'><font size=1>&nbsp;</font></td></tr></table></font>"  
				   totalrow=i+1
				}
				    
				 if ((prec>parseFloat(".65"))&&(prec<=parseFloat(".85")))
				 {		               
				    var c1=t1.insertCell();
				    c1.style.border='solid'
				    c1.style.borderLeftWidth='0px'
				    c1.style.borderRightWidth='1px'
				    c1.style.borderTopWidth='0x'
				    c1.style.borderBottomWidth='0px'
				    
					c1.innerHTML="<font size=1><td width=10%><table width=75% border=0 cellpadding=0 cellspacing=0><tr><td bgcolor='#ffd700'><font size=1>&nbsp;</font></td><td bgcolor='#ffd700'><font size=1>&nbsp;</font></td></tr></table>"  
					totalrow=i+1
				 }
				 
				 if ((prec>parseFloat(".85"))&&(prec<=parseFloat(".95")))
				 {			                
					var c1=t1.insertCell();
					c1.style.border='solid'
				    c1.style.borderLeftWidth='0px'
				    c1.style.borderRightWidth='1px'
				    c1.style.borderTopWidth='0x'
				    c1.style.borderBottomWidth='0px'
				    
					c1.innerHTML="<font size=1><td width=10%><font size=1><table width=95% border=0 cellpadding=0 cellspacing=0><tr><td bgcolor='#ffd700'><font size=1>&nbsp;</font></td><td bgcolor='#ffd700'><font size=1>&nbsp;</font></td></tr></table></font>"  
					totalrow=i+1
				 }
			}          
			        
			if (totalrow!=10)
			{
			  for (i=totalrow;i<=9;i++)
			  {
			     var c1=t1.insertCell();
			     c1.style.border='solid'
				 c1.style.borderLeftWidth='0px'
				 c1.style.borderRightWidth='1px'
				 c1.style.borderTopWidth='0x'
				 c1.style.borderBottomWidth='0px'
				 
			     c1.innerHTML="<font size=1><td valign=middle width=10%>&nbsp"
			        
			  }
			        
			}
		      
		} 
 
 setnonights(2, 'N');
function Show(objdiv)
{		if (objdiv.style.display == 'none')
			objdiv.style.display = 'block';
		else
			objdiv.style.display = 'none'
}	
jb_PageLoad = false ; 	
function JF_BackToHome(url)
{	
	document.form_bhrc.action=url;
	document.form_bhrc.submit();
}

var msgWindow='';
function JF_CallPop(as_imgname,as_est_cd,as_hotel_nam,as_inc)
{

if(as_imgname.indexOf("_t")>0)
{
splitImage=as_imgname.split("_t")
as_r_img=splitImage[0] + splitImage[1];
}
else
{
as_r_img=as_imgname;
}

msgWindow=window.open("bhrc_hotel_popup.asp?hid_img_nam="+as_r_img+"&hid_est_code="+as_est_cd+"&hid_hotel_name="+as_hotel_nam+"&hid_img_inc="+as_inc,"displayWindow","menubar=no,scrollbars=no,status=no,width=550,height=600,top=1,left=1")
if (msgWindow.opener == null) msgWindow.opener = self;
msgWindow.focus() 

}


function JF_divshow()
{
var Obj = document.getElementById("reviewdtls")
if (Obj.style.display == "block")
	{	
		Obj.style.display = "none";
		return;
	}
else
	{		
		
		js_top = document.body.scrollTop 
		temp = parseFloat(document.body.clientHeight)+parseFloat(document.body.scrollTop) ;
		    	    
		if(js_top>temp) 
		js_top = window.pageYOffset + eval(yMousePos);
		Obj.style.top = document.body.scrollTop  + 5
	    Obj.style.left = document.body.scrollLeft+450
	    Obj.style.display = "block";
	    
		JF_Paging();
		return;
	}		
}
	
function JF_Paging(m,limit)
{        
		if (m=='N')
		{		  
			document.form_bhrc.hid_pagecnt.value=parseInt(document.form_bhrc.hid_pagecnt.value)+1;						
		}
			
		if (m=='P')
		{			
			document.form_bhrc.hid_pagecnt.value=parseInt(document.form_bhrc.hid_pagecnt.value)-1;			
		}		 
		
		 if (m=="L")
		{			
			document.form_bhrc.hid_pagecnt.value=parseInt(limit);		   
		}
		if (m=="F")
		{		
			document.form_bhrc.hid_pagecnt.value="1";          
        }
        
		var Obj = document.getElementById("reviewdtls")		
		Obj.src ='bhrc_customer_reviewdtls.asp?hid_curpage='+document.form_bhrc.hid_pagecnt.value+'&hid_estcode=' + document.form_bhrc.Hid_Est_Cd.value;		
}

function JF_closedtls()
{
var Obj = document.getElementById("reviewdtls")
Obj.style.display = "none";
}

function JF_custreview(seq_num)
{
var Obj = document.getElementById("reviewdtls")
Obj.src = 'bhrc_customer_review.asp?hid_page=6&seq_num='+seq_num
Obj.style.display = "block";
}
js_book_from = document.form_bhrc.CurDate.value;
js_book_to = document.form_bhrc.Vs_BookTo.value;

js_curday = parseInt(document.form_bhrc.hid_curday.value);
js_curmonth = parseInt(document.form_bhrc.hid_CurMon.value);
js_curyear = parseInt(document.form_bhrc.hid_curyear.value);



/*From Asp Page*/
function JF_RoomChange(id)
{
	if(id=='top')
	{
		window.document.form_bhrc.sle_NoOfRooms_bottom.selectedIndex = window.document.form_bhrc.sle_NoOfRooms_top.selectedIndex ;
	}
	else
	{
		window.document.form_bhrc.sle_NoOfRooms_top.selectedIndex = window.document.form_bhrc.sle_NoOfRooms_bottom.selectedIndex ;
	}
}

function JF_AdultChange(id)
{
	if(id=='top')
	{
		window.document.form_bhrc.sle_NoOfAdlts_bottom.selectedIndex = window.document.form_bhrc.sle_NoOfAdlts_top.selectedIndex ;
	}
	else
	{
		window.document.form_bhrc.sle_NoOfAdlts_top.selectedIndex = window.document.form_bhrc.sle_NoOfAdlts_bottom.selectedIndex ;
	}
}


function Jf_imagemap(id)
{


//window.open("bhrc_hotel_popup.asp?hid_img_nam="+as_r_img+"&hid_est_code="+as_est_cd+"&hid_hotel_name="+as_hotel_nam+"&hid_img_inc="+as_inc,"displayWindow","menubar=no,scrollbars=no,status=no,width=550,height=600,top=1,left=1")
var msgWindow=window.open("bhrc_map_popup.asp?seqmap="+id,"displayWindow","directories=no, height=700, left=305, location=0, menubar=no,resizable=yes,fullscreen=no,scrollbars=yes, status=no, titlebar=yes, toolbar=no, top=0, width=700")
if (msgWindow.opener == null) msgWindow.opener =top;
 msgWindow.focus()  


}
function JF_DIsplay_IFrame(imgid)
{	

	var eP=eval('document.getElementById("'+ imgid +'")');

	var eL=0;
	var eT=0;
	var p=eP;
	while(p&&p.tagName!="BODY")
	{
		eT+=p.offsetTop;
		eL+=p.offsetLeft;
		p=p.offsetParent;
	}

	var eH=eP.offsetHeight;
	//calendar height
	var dH=200 ;
	//calendar width
	var W=146;
	var sT=document.body.scrollTop;
	var dW=0;
	var temp=parseFloat(eT)+parseFloat(eH)+parseFloat(dH) ;
	var temp1=parseFloat(document.body.clientHeight)+parseFloat(sT);

	if(temp>temp1)
	
	{
		dH=parseFloat(dH)+30;
		eT-=dH;
	}
	else 
	{
		if(imgid=='cal_image3' || imgid=='cal_image4')
		{
		eH=parseFloat(eH)-250;
		eT+=eH;
		}
		else
		{
		eH=parseFloat(eH)+10;
		eT+=eH;
		}		
	}
	return eT;
}

function Jf_CheckDate()
{
	var Jf_samday_bkng=document.form_bhrc.Hid_samday_bkng.value
	if(msgWindow &&msgWindow.open &&!msgWindow.closed)
	{
	  msgWindow.moveit1(); 
	 
	}
	     
	if (obj1!=null)
		calClose();
	document.form_bhrc.Hid_Srv_Srl_Nums.value="";
	var ArrDate;
	var ValDate = document.form_bhrc.CurDate.value;
	
	var NextYrDt = document.form_bhrc.Vd_NextYear.value;
	
	DD=document.form_bhrc.Sel_Right_Day.value;
	var mm_yy1=document.form_bhrc.Sel_Right_month_year.value;
	mm_yy_split1=mm_yy1.split("-");
	MM=mm_yy_split1[0];
	YYYY=mm_yy_split1[1];
	
	if (!setnonights(2, 'Y'))
		return;
	
	js_dd_cal=document.form_bhrc.Sel_Day.value;
	var mm_yy=document.form_bhrc.Sel_month_year.value;
	mm_yy_split=mm_yy.split("-");
	js_mm_cal=mm_yy_split[0];
	js_yy_cal=mm_yy_split[1];
	
	ArrDate = parseFloat(js_yy_cal + js_mm_cal +js_dd_cal);	
	//ValDate = (parseFloat(ValDate) - 1);

	Jf_SetDateVal();
	
	if(JF_ChkValidDate('document.form_bhrc.Sel_Day1','Arrival date ','Y') != true)
	return;
	
	//if((ArrDate <= ValDate)&&(Jf_samday_bkng!='Y'))
	
	
	if((ArrDate < ValDate &&Jf_samday_bkng!='Y')||(ArrDate < ValDate &&Jf_samday_bkng=='Y')||(ArrDate < ValDate && Jf_samday_bkng=='N'))
	
	
	{
	  if(Jf_samday_bkng=='Y')
	  {
		alert("Bookings have to be made Current Day (or)atleast one day in advance.\rIf a booking has to be made for today, call us on +44 (0) 20 7592 3055 for call centre support.");
		document.form_bhrc.Sel_Day.focus();
		return;
	  }	
	  else
	  {
	   alert("Bookings have to be made atleast one day in advance.\rIf a booking has to be made for today, call us on +44 (0) 20 7592 3055 for call centre support.");
	   document.form_bhrc.Sel_Day.focus();
	   return;
	  }
	}
	
	
	if(ArrDate > NextYrDt)
	{
		alert("Arrival Date should not be more than a year");
		document.form_bhrc.Sel_Day.focus();
		return;
	}
	if(Trim(document.form_bhrc.sle_nights.value)=='')
	{
		alert('Nights should be entered');
		return;
	}
	
	if(Trim(document.form_bhrc.sle_nights.value)!='')
	{
		if(parseInt(Trim(document.form_bhrc.sle_nights.value)) > 15)
		{
			alert('Please contact us by phone or email if you would like to book for more than 15 nights.\rOur long stay rates are heavily discounted. \r Phone:+44 (0) 20 7592 3055, Email:hotels@bhrconline.com');
			return;
		}
	}
	
	if(isNaN(document.form_bhrc.sle_nights.value))
	{
		alert('Nights should be a numeric value');
		return;
	}
	else
	{
		if(parseInt(document.form_bhrc.sle_nights.value) < 1)
		{
			alert('Nights should be atleast one');
			return;
		}
		if(document.form_bhrc.sle_nights.value.indexOf('.') != -1)
		{
			alert('Nights should not have the decimal values');
			return;
		}
	}
	//if(document.form_bhrc.hid_rate_source.value=='P')
	//{
		document.form_bhrc.sle_NoOfRooms_peg.value = document.form_bhrc.sle_NoOfRooms_top.options[document.form_bhrc.sle_NoOfRooms_top.selectedIndex].value ;
		document.form_bhrc.sle_NoOfAdlts_peg.value = document.form_bhrc.sle_NoOfAdlts_top.options[document.form_bhrc.sle_NoOfAdlts_top.selectedIndex].value ;
	//}
	document.form_bhrc.action = document.form_bhrc.hid_Non_Secure.value + "bhrc_hotel_book1.asp";
	document.form_bhrc.submit();
}

function JF_OpenStreetMap(js_estnam, js_pCode, js_address)
{
	
	var js_url;
	
	js_url = document.form_bhrc.hid_Non_Secure.value + "BHRC_StreetMap.asp?Est_nam=" + escape(js_estnam) + "&Post_cd=" + escape(js_pCode) + "&Address=" + escape(js_address);
	
	var wf = 'toolbar=no,location=no,directories=no,top=125,left=200,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=494,height=550';
	jo_map = window.open(js_url,'MapWindow',wf)	
	if (!(bname=="Microsoft Internet Explorer" && bver<"4"))
		jo_map.focus();
}

function JF_UpdateLink(linkname)
{
	//alert ("linkname = " +linkname);
	var js_hdr_id="0";
	jsrsExecute("bhrc_resolution.asp", JF_UpdateLinkName, "UpdateLink", Array(js_hdr_id,linkname));
}
function JF_UpdateLinkName(returnstring) 
{ 
	//alert ("returnstring="+returnstring);
	return;
}

function JF_GetTop(imgid)
{	

	var eP=eval('document.getElementById("'+ imgid +'")');

	var eL=0;
	var eT=0;
	var p=eP;
	while(p&&p.tagName!="BODY")
	{
		eT+=p.offsetTop;
		eL+=p.offsetLeft;
		p=p.offsetParent;
	}

	var eH=eP.offsetHeight;
	// height
	var dH=400 ;
	// width
	var W=146;
	var sT=document.body.scrollTop;
	var dW=0;
	var temp=parseFloat(eT)+parseFloat(eH)+parseFloat(dH) ;
	var temp1=parseFloat(document.body.clientHeight)+parseFloat(sT);
	var	max_div_height = 500;

	if(temp>temp1)
	
	{
		dH=parseFloat(dH)+30;
		eT-=dH;
		
		if(browser_type=='Netscape')
		{
			eT = window.pageYOffset + yMousePos - 600;			
		}
		else
		{
			/*alert(document.body.scrollTop) ;
			alert(window.event.clientY) ;
			alert(temp1) ;
			alert(eH) ;
			alert(eT) ;*/
			
			if((document.body.scrollTop + window.event.clientY - max_div_height)<document.body.scrollTop)
			{
				if(document.body.scrollTop<temp1)
				{
					eT = document.body.scrollTop + window.event.clientY - max_div_height ;
				}
				else
					eT = document.body.scrollTop;
			}
			else
				eT = document.body.scrollTop + window.event.clientY - max_div_height ;
		}
	}
	else 
	{
		eH=parseFloat(eH)+10;
		eT+=eH;
	}
	return eT;
}
	
function EnterContentInfo(layerName, obj, bRemoveClose)
{	
	var temp ;
    TContent = obj;
	TContent=TContent.replace("*","'");
					
	var TContent_obj=TContent.split("<br>");

	ContentInfo = '<table border="0" cellpadding="0" cellspacing="0" width="350">'+
	'<tr height="25"><td valign="middle" align="left" noWrap bgcolor="#001C84"><font color=white size=-1 face="Arial"><b>&nbsp;Detail Rate Information</b></font>'+
	'</td></tr>' +
		
	'<tr><td valign="top" align="left" noWrap>'+
	'<table border="0" cellpadding="0" bgcolor="#001C84" cellspacing="1" width="350">'+
	'<tr><td valign="top" align="left" noWrap><font color=white size=-1 face="Arial">'+TContent_obj[0]+'</font></td></tr>'+
	'</table>' +
	'</td></tr>' ;

	if(!bRemoveClose)
		ContentInfo = ContentInfo +'<tr bgcolor="#001C84" height="25"><td noWrap valign="middle" align="right"><a style="cursor:pointer;cursor:hand;" onclick=javacript:deActivate("'+layerName+'"); title="Click here to close"><font color=white size=-1 face="Arial"><b>Close</b></font></a>&nbsp;</td></tr>' ;
	
	ContentInfo = ContentInfo +'</table>' ;

	if(browser_type == 'Netscape')
	{
		obj_tip = MM_findObj_header('ToolTip');
		obj_tip.innerHTML = ContentInfo;
	}
	else
	{
		ToolTip.innerHTML = ContentInfo;
	}
	MM_showHideLayers_header('ToolTip','','show');
}
function jf_dispgetratesbutton()
{
	document.getElementById('A_getrates').style.display = 'block';
	document.getElementById('A_getrates2').style.display = 'block';
}
/*From asp Page*/