var as_form=eval("document.form_bhrc");
var js_ie_netsc="";
js_ie_netsc=as_form.Hid_IE_Netsc.value;
var js_Non_Secure=as_form.Hid_Non_Secure.value;
var js_Secure=as_form.Hid_Secure.value;
function JF_HotelList(link_select){
	as_form.hid_link_select.value=link_select;as_form.Hid_Str_Rating.value="";MM_goToURL("parent",js_Non_Secure+"hotel-in-central-london.asp");return document.MM_returnValue;}
function JF_Airport(link_select){
	as_form.hid_link_select.value=link_select;MM_goToURL("parent",js_Non_Secure+"bhrc_search_airport.asp");	return document.MM_returnValue;}
function JF_CheckAvail(link_select){
	as_form.hid_link_select.value=link_select;MM_goToURL("parent",js_Non_Secure+"bhrc_check_availability.asp");return document.MM_returnValue;}
function JF_Offers(link_select){
	as_form.hid_link_select.value=link_select;MM_goToURL("parent",js_Non_Secure+"bhrc_offers.asp");	return document.MM_returnValue;}
function JF_Map(link_select){
	as_form.hid_link_select.value=link_select;MM_goToURL("parent",js_Non_Secure+"uk/asp/lon/bhrc_map.htm");return document.MM_returnValue;}
function JF_Contact(){
	MM_goToURL("parent",js_Non_Secure+"bhrc_contact.asp");return document.MM_returnValue;}
function JF_open(w,f, link_select){
	var js_url=js_Non_Secure+w;	if(typeof(link_select)!='undefined') as_form.hid_link_select.value=link_select;	as_form.action = js_url;as_form.submit();}
function Jf_CanForm(){
	var js_url=js_Non_Secure+"bhrc_amend.asp";as_form.action = js_url;as_form.submit();}
function Trim(str)/***	PURPOSE: Remove trailing and leading blanks from our string.   IN: str - the string we want to Trim RETVAL: A Trimmed string! ***/
{
	trim_str = RTrim(LTrim(str));return trim_str;
}
function LTrim(str)/*** PURPOSE: Remove leading blanks from our string.IN: str - the string we want to LTrim RETVAL: An LTrimmed string!***/
{
    var whitespace = new String(" \t\n\r");
    var s = new String(str);
    if (whitespace.indexOf(s.charAt(0)) != -1) {// We have a string with leading blank(s)...
        var j=0, i = s.length;
        while (j < i && whitespace.indexOf(s.charAt(j)) != -1) // Iterate from the far left of string until we // don't have any more whitespace...
            j++;
        s = s.substring(j, i);// Get the substring from the first non-whitespace     // character to the end of the string...
    }
    return s;
}
function RTrim(str)/*** PURPOSE: Remove trailing blanks from our string.IN: str - the string we want to RTrim RETVAL: An RTrimmed string! ***/
{
    var whitespace = new String(" \t\n\r");// We don't want to trip JUST spaces, but also tabs, line feeds, etc.  Add anything else you want to "trim" here in Whitespace
    var s = new String(str);
    if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
        var i = s.length - 1;       // Get length of string // We have a string with trailing blank(s)...
        
        while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)// Iterate from the far right of string until we  don't have any more whitespace...
            i--;
        s = s.substring(0, i+1);// Get the substring from the front of the string to where the last non-whitespace character is...
    }
    return s;
}
function JF_ErrHandle(as_name, as_label, as_err) {
 alert(as_err);
 as_name.focus();
 return; 
}
function JF_open_popwin(val){
	if (val=="P"){
		js_url=js_Non_Secure+"bhrc_policy.htm";
		privplcy= window.open(js_url,"privplcy","top,left,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=600,width=567");	
	}
	if (val=="T"){
		js_url=js_Non_Secure+"Bhrc_terms.htm";
		termsWin= window.open(js_url,"termsWin","top,left,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=600,width=568");	
	}
	if (val=="U"){
		js_url=js_Non_Secure+"bhrc_Useful_Links.asp";
		termsWin= window.open(js_url,"termsWin","top,left,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=604,width=626");	
	}
}
//Added to display the feedback page while user leaves the website
function JF_FeedbackLeave(){
    var top=self.screenTop;
	if (top>9000){
		wf = 'toolbar=no,location=no,directories=no,top,left,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=570,height=580';
		msgwin = window.open(js_Non_Secure+'bhrc_visit_feedback.asp?Page_id='+as_form.Hid_PagId.value+'&guid='+as_form.Hid_Guid.value+'&hdr_id='+as_form.hid_hdr_id.value+'&hid_screen_res='+as_form.hid_screen_res.value,'ratewindow',wf)
        	bname = navigator.appName;
		bver = parseInt(navigator.appVersion);
		if (!(bname=="Microsoft Internet Explorer" && bver<"4"))
           msgwin.focus();
	}
}
function JF_Unload()
{
	if (document.all){
		if(as_form.hid_vs_disp_srv_nums.value=="")
			JF_FeedbackLeave();
	} 
	else {
		var top=window.innerHeight;
		if (top==0){
			wf = 'toolbar=no,location=no,directories=no,top,left,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=570,height=620';
			window.open(js_Non_Secure+'bhrc_visit_feedback.asp?Page_id='+as_form.Hid_PagId.value+'&guid='+as_form.Hid_Guid.value+'&hdr_id='+as_form.hid_hdr_id.value+'&hid_screen_res='+as_form.hid_screen_res.value,'ratewindow',wf);
		}     
	}
}
function JF_Scroll(){
	MM_showHideLayers_header('navBar','','show');
	var obj1=MM_findObj_header('navBar');
	if(document.all)
		obj1.style.pixelTop = document.body.scrollTop + 90 ;
	else{
		obj1.style.top = window.pageYOffset + 90 ;
	}
}
window.onunload=JF_Unload;
if(!document.all){
	document.onmousemove = captureMousePosition;
}
// Global variables
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page
var browser_type = navigator.appName;

function captureMousePosition(e) {
    if (document.layers) {
        // When the page scrolls in Netscape, the event's mouse position
        // reflects the absolute position on the screen. innerHight/Width
        // is the position from the top/left of the screen that the user is
        // looking at. pageX/YOffset is the amount that the user has 
        // scrolled into the page. So the values will be in relation to
        // each other as the total offsets into the page, no matter if
        // the user has scrolled or not.
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        // When the page scrolls in IE, the event's mouse position 
        // reflects the position from the top/left of the screen the 
        // user is looking at. scrollLeft/Top is the amount the user
        // has scrolled into the page. clientWidth/Height is the height/
        // width of the current page the user is looking at. So, to be
        // consistent with Netscape (above), add the scroll offsets to
        // both so we end up with an absolute value on the page, no 
        // matter if the user has scrolled or not.
        xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
    } else if (document.getElementById) {
        // Netscape 6 behaves the same as Netscape 4 in this regard 
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
}
function MM_findObj_header(n, d) { //v4.0
  var p,i,x;
  if(!d) d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length){
	d=parent.frames[n.substring(p+1)].document; 
	n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) 
	x=d.all[n]; 
  for (i=0;!x&&i<d.forms.length;i++) 
	x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
	x=MM_findObj_header(n,d.layers[i].document);
  if(!x && document.getElementById) 
	x=document.getElementById(n); 
  return x;
}
function MM_showHideLayers_header() { //v3.0
	var i,p,v,obj,args=MM_showHideLayers_header.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj_header(args[i]))!=null){ 
		v=args[i+2];
		if (obj.style){ 
			obj=obj.style; 
			v=(v=='show')?'visible':(v='hide')?'hidden':v; 
		}
		obj.visibility=v; 
		if(v=='visible')
			obj.display='inline';
		else
			obj.display='none';
	}
}
function div_Show(uk){
	var obj=MM_findObj_header(uk) ;
	if (uk !=null){
		obj.style.visibility = 'visible' ;
	}
}
function div_Hide(uk){
	var obj=MM_findObj_header(uk) ;
	if (uk !=null){
		obj.style.visibility = 'hidden' ;
	}	
}
function JF_TellAFriend(){
	var wf;
	var pid = as_form.Hid_PagId.value;
	if(as_form.Hid_Est_Cd)
		var est_cd=as_form.Hid_Est_Cd.value;
	else
		var est_cd='';
	wf = 'toolbar=no,location=no,directories=no,top,left,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=609,height=541';
	var str1 = js_Non_Secure + 'BHRC_TellAFriend.asp?page_id=' + pid+'&est_cd='+est_cd;
	msgwin = window.open(str1,'ratewindow',wf)
    bname = navigator.appName;
	bver = parseInt(navigator.appVersion);
	if (!(bname=="Microsoft Internet Explorer" && bver<"4"))
          msgwin.focus();
}
function JF_Currency(){
	wf = 'toolbar=no,location=no,directories=no,top,left,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=325,height=270';
	var str1 = js_Non_Secure + 'BHRC_Currency.asp';
	msgwin = window.open(str1,'currencywindow',wf)
    bname = navigator.appName;
	bver = parseInt(navigator.appVersion);
	if (!(bname=="Microsoft Internet Explorer" && bver<"4"))
          msgwin.focus();
}
function JF_FAQ(){
	wf = 'toolbar=no,location=no,directories=no,top,left,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=325,height=270';
	var str1 = 'BHRC_Faq.asp';
	msgwin = window.open(str1,'currencywindow',wf)
    bname = navigator.appName;
	bver = parseInt(navigator.appVersion);
	if (!(bname=="Microsoft Internet Explorer" && bver<"4"))
          msgwin.focus();
}
function highlight(obj){
	obj = MM_findObj_header(obj);
	obj.className="highlight" ;
}
function simple(obj){
	obj = MM_findObj_header(obj);
	obj.className="simple" ;
}
function JF_openreqform(){
	mywindow=window.open("bhrc_reqform.asp","reqform","top,left,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=700,width=705");	
	if (mywindow.opener == null) mywindow.opener = self;
	mywindow.focus();
}
function JF_BookMark()
{
	if (document.all)
	{	
		if(navigator.appName == "Opera")
		alert("Sorry. Opera users must bookmark the pages manually by hitting <Ctrl-D>");
		else
		window.external.AddFavorite(window.location, document.title);
	}
	else if(window.sidebar)
	{
 		window.sidebar.addPanel(document.title,window.location,"")
	}
	/*else
		alert("Sorry. Netscape users must bookmark the pages manually by hitting <Ctrl-D>");
*/
}
if (as_form.hid_bool_Usr_Track.value=="Y")
{
	var js_hdr_id=as_form.hid_hdr_id.value 
	js_res=window.screen.width+" by "+window.screen.height+" pixels"; window.status="Loading .......";
	jsrsExecute("bhrc_resolution.asp", JF_Resolution, "UpdateResolution", Array(js_hdr_id, js_res));
}
function JF_Resolution(as_rslt) 
{ //window.status="Loading .......";
return; }

/****************************************************************************
        Tax Div Functions
*****************************************************************************/


function Taxincexc(layerName, TContent, obj_bk)
{	
	
	var obj_tip ;	
	   
    //TContent = eval(obj).value;
	//TContent=TContent.replace("*","'");
	//TContent="This rates includes VAT @ 17.5%"
	ContentInfo = '<table border="0" cellpadding="4" bgcolor="#B10004" cellspacing="0" width="148">'+
	'<tr><td><font color=white size=-1 face="Arial">'+TContent+'</font></td></tr>'+
	'</table>';
	if(browser_type=='Netscape')
	{
		obj_tip = MM_findObj_header(layerName) ;
		if (obj_tip !=null)
		{
			obj_tip.innerHTML = ContentInfo ;
			/*top = JF_GetTop(obj_bk);
			obj_tip.style.top = top ;
			obj_tip.style.left = 750 ;*/
			obj_tip.style.top = yMousePos ;
			obj_tip.style.left = xMousePos ;

			MM_showHideLayers_header('Taxinfo','','show');
		}			
	}
	else
	{
		Taxinfo.innerHTML = ContentInfo;
		Taxinfo.style.left = document.body.scrollLeft + eval(window.event.clientX);
		Taxinfo.style.top = document.body.scrollTop + window.event.clientY
		Taxinfo.style.visibility = 'visible';
	}	
	return;
		
}
function deActivateTAX(layerName,temp)
{
	var obj ;
	if(browser_type=='Netscape')
	{
		MM_showHideLayers_header(layerName,'','hide');
		if (temp)
		{
			var obj_temp;
			obj_temp = MM_findObj_header(temp);
			obj_temp.style.cursor="hand";
			obj_temp.style.color="brown";
		}			
	}
	else
	{
		obj  = eval(layerName);
		obj.style.visibility = 'hidden';

		if (temp)
		{
			temp.style.cursor="hand";
			temp.style.color="brown";
		}
	}	
	return;
}
function JF_CheckInvdChrs()
{
var jl_len = document.forms[0].length;
	for(incelm=0; incelm < jl_len; incelm++)
	{	
		if (document.forms[0].elements[incelm].type == 'text' || document.forms[0].elements[incelm].type == 'textarea'|| document.forms[0].elements[incelm].type == 'password')
		{
			if( (document.forms[0].elements[incelm].value).indexOf("'") != -1 || (document.forms[0].elements[incelm].value).indexOf(">") != -1 || (document.forms[0].elements[incelm].value).indexOf("<") != -1 || (document.forms[0].elements[incelm].value).indexOf("--") != -1 || (document.forms[0].elements[incelm].value).indexOf("/*") != -1 || (document.forms[0].elements[incelm].value).indexOf("=") != -1 )
			{	
				alert('Entry should not have \', /*, --, >, <, = Characters');
				document.forms[0].elements[incelm].focus();
				return false;
			}
		}
	}
return true;
}
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;
}