
var notice={black:true,settings:{'shadowColor':'#000000','boxMainBack':'#FFFFFF','buttonArea':'#EDEDED','redirectText':'Please wait whilst we redirect you','radiusBorder':true},blackOutNode:null,noticeItemNode:null,screenDimensions:null,destinationURL:null,prevent_collapse:false,collapse:function(){if(!notice.prevent_collapse){try
{try{notice.blackOutNode.parentNode.removeChild(notice.blackOutNode);}catch(e){}
try{notice.noticeItemNode.parentNode.removeChild(notice.noticeItemNode);}catch(e){}}
catch(noticeException)
{}}},complete:function()
{try
{if(notice.destinationURL!=null)
{document.getElementById("NTCD").innerHTML=notice.settings.redirectText;location.href=notice.destinationURL;}
else
{try{notice.blackOutNode.parentNode.removeChild(notice.blackOutNode);}catch(e){}
notice.noticeItemNode.parentNode.removeChild(notice.noticeItemNode);}}
catch(noticeException)
{}},promptcomplete:function()
{try
{if(document.getElementById("notice_node").value>'')
{notice.response=document.getElementById("notice_node").value;try{notice.blackOutNode.parentNode.removeChild(notice.blackOutNode);}catch(e){}
notice.noticeItemNode.parentNode.removeChild(notice.noticeItemNode);}
else
{document.getElementById("NTCD").innerHTML="You must enter a name";}}
catch(noticeException)
{}},getScrollXY:function(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
return[scrOfX,scrOfY];},downAction:function(name,geoh,geov)
{HSSearch.addLocation(name,geoh,geov);checkSearchForm();notice.collapse();},select:function(message,title,options,buttonType)
{notice.collapse();try
{var initialTopFocus=notice.getScrollXY();var opheight=options.data.length*29;if(opheight>205)opheight=205;if(title!=null)message="<div style='text-align:left;padding:20px'><img style='padding-top:4px;padding-right:8px;' src='/hotels/resource/images/buttons/p_note.jpg' align='left'/><p><strong><span style='font-size:13px'>"+title+"</span></strong></p><span id='NTCD'>"+message+"</span></div>";message+="<div style=\"margin-bottom:15px;margin-left:20px;text-align:left;height:"+opheight+"px;width:400px;overflow:auto;border:1px solid #444444;\">";for(var count=0;count<options.data.length;count++)
{var border=(count<(options.data.length-1))?"border-bottom:1px dotted #444444;":"";message+="<div onmousedown=\"notice.downAction('"+options.data[count].name+"','"+options.data[count].geoh+"','"+options.data[count].geov+"');\" onmouseover=\"this.style.backgroundColor='#cccccc';this.style.color='#FFFFFF';\" onmouseout=\"this.style.backgroundColor='#FFFFFF';this.style.color='';\" style=\"cursor:pointer;"+border+"padding:5px\">"+options.data[count].hl+"</div>";}
message+="</div>";message+="<div onclick='HSSearch.clearSearch();checkSearchForm();notice.collapse();' style='margin-bottom:15px;margin-left:20px;text-align:left;cursor:pointer'>or <u>Search all central London hotels</u></div>";if(buttonType!=null)
{var buttonSegments=buttonType.split("|");var buttonActionSet='';notice.destinationURL=(buttonSegments[1]!="null")?buttonSegments[1]:null;buttonActionSet+="<div style='padding:8px;background-color:"+notice.settings.buttonArea+";border-top:1px solid #cccccc;text-align:left;color:#FFFFFF;'>";if(buttonSegments[0]!='null')
{buttonActionSet+="<img style='cursor:pointer;margin-left:12px;' src='/hotels/resource/images/buttons/back.jpg' onclick='notice.complete();'  name='bd' />";}
else
{buttonActionSet+="Connecting....";}
buttonActionSet+="</div>";message=message+""+buttonActionSet;}
notice.screen_dimensions=notice.getDimensions();notice.blackout();notice.noticeItemNode=notice.element("div",{'border':'4px solid '+notice.settings.shadowColor,'zIndex':'99999999','position':'absolute','backgroundColor':notice.settings.boxMainBack,'width':notice.notice_window+'px'},null);notice.noticeItemNode.innerHTML=message;var left=(notice.screen_dimensions[0]/2)-(notice.notice_window/2);var top=(notice.screen_dimensions[1]/2+initialTopFocus[1])-(400/2);notice.noticeItemNode.style.left=left+"px";notice.noticeItemNode.style.top=top+"px";if(notice.settings.radiusBorder)
{notice.noticeItemNode.style.MozBorderTopRightRadius='15px';notice.noticeItemNode.style.borderTopRightRadius='15px';notice.noticeItemNode.style.WebKitBorderTopRightRadius='15px';notice.noticeItemNode.style.MozBorderTopLeftRadius='15px';notice.noticeItemNode.style.borderTopLeftRadius='15px';notice.noticeItemNode.style.WebKitBorderTopLeftRadius='15px';}
document.body.appendChild(notice.noticeItemNode);}
catch(createException)
{}},create:function(message,title,buttonType)
{notice.collapse();try
{var initialTopFocus=notice.getScrollXY();if(title!=null)message="<div style='padding:20px;text-align:left;'><img style='padding-top:3px;padding-right:8px;' src='/hotels/resource/images/buttons/p_note.jpg' align='left'/><p><strong>"+title+"</strong></p><span id='NTCD'>"+message+"</span></div>";if(buttonType!=null)
{var buttonSegments=buttonType.split("|");var buttonActionSet='';notice.destinationURL=(buttonSegments[1]!="null")?buttonSegments[1]:null;buttonActionSet+="<div style='padding:8px;background-color:"+notice.settings.buttonArea+";border-top:1px solid #CCCCCC;text-align:right;color:#FFFFFF;'>";if(buttonSegments[0]!='null')
{buttonActionSet+="<img style='cursor:pointer' src='/hotels/resource/images/buttons/ok.jpg' onclick='notice.complete();'  name='bd' />";}
else
{buttonActionSet+="Connecting....";}
buttonActionSet+="</div>";message=message+""+buttonActionSet;}
notice.screen_dimensions=notice.getDimensions();notice.blackout();notice.noticeItemNode=notice.element("div",{'border':'4px solid '+notice.settings.shadowColor,'zIndex':'99999999','position':'absolute','backgroundColor':notice.settings.boxMainBack,'width':notice.notice_window+'px'},null);notice.noticeItemNode.innerHTML=message;var left=(notice.screen_dimensions[0]/2)-(notice.notice_window/2);var top=(notice.screen_dimensions[1]/2+initialTopFocus[1])-(200/2);notice.noticeItemNode.style.left=left+"px";notice.noticeItemNode.style.top=top+"px";if(notice.settings.radiusBorder)
{notice.noticeItemNode.style.MozBorderTopRightRadius='15px';notice.noticeItemNode.style.borderTopRightRadius='15px';notice.noticeItemNode.style.WebKitBorderTopRightRadius='15px';notice.noticeItemNode.style.MozBorderTopLeftRadius='15px';notice.noticeItemNode.style.borderTopLeftRadius='15px';notice.noticeItemNode.style.WebKitBorderTopLeftRadius='15px';}
document.body.appendChild(notice.noticeItemNode);}
catch(createException)
{}},response:'',notice_window:450,keytrap:function(e){e=(e)?e:window.event;if(e.keyCode==13)
{notice.promptcomplete();}},prompt:function(message,title,buttonType)
{try
{var initialTopFocus=notice.getScrollXY();if(title!=null)message="<div style='padding:20px'><img style='padding-top:3px;padding-right:8px;' src='/hotels/resource/images/buttons/p_message.jpg' align='left'/><p><strong>"+title+"</strong></p><span id='NTCD'>"+message+"</span></div>";if(buttonType!=null)
{var buttonSegments=buttonType.split("|");var buttonActionSet='';notice.destinationURL=(buttonSegments[1]!="null")?buttonSegments[1]:null;buttonActionSet+="<div style='height:28px;padding:8px;background-color:"+notice.settings.buttonArea+";border-top:1px solid #cccccc;text-align:left'><input type='text' onkeyup='notice.keytrap(event);' style='float:left;width:200px;' id='notice_node'><img style='padding-top:2px;float:right;cursor:pointer' src='/hotels/resource/images/buttons/ok.jpg' onclick='notice.promptcomplete();'  name='bd' /></div>";message=message+""+buttonActionSet;}
notice.screen_dimensions=notice.getDimensions();notice.blackout();notice.noticeItemNode=notice.element("div",{'border':'4px solid '+notice.settings.shadowColor,'zIndex':'99999999','position':'absolute','backgroundColor':notice.settings.boxMainBack,'width':'300px'},null);notice.noticeItemNode.innerHTML=message;var left=(notice.screen_dimensions[0]/2)-(300/2);var top=(notice.screen_dimensions[1]/2+initialTopFocus[1])-(200/2);notice.noticeItemNode.style.left=left+"px";notice.noticeItemNode.style.top=top+"px";document.body.appendChild(notice.noticeItemNode);}
catch(createException)
{}},blackout:function(){if(notice.black)
{notice.screen_dimensions=notice.getDimensions();var initialTopFocus=notice.getScrollXY();notice.blackOutNode=notice.element("div",{'zIndex':'99999998','backgroundColor':'#000000','position':'absolute','left':'0px','top':'0px','width':notice.screen_dimensions[0]+'px','height':(notice.screen_dimensions[1]+initialTopFocus[1])+'px'},{'id':'bblnode'});notice.transparency(notice.blackOutNode,80);document.body.appendChild(notice.blackOutNode);}
if(!notice.black)notice.black=true;},transparency:function(obj,level)
{obj.hidOpac=level;obj.style.MozOpacity=level/100;obj.style.opacity=level/100;obj.style.filter="alpha(opacity="+level+")";},element:function(n,s,a)
{var d=document.createElement(n);if(s)for(var i in s)d.style[i]=s[i];if(a)for(var j in a)d[j]=a[j];return d;},getDimensions:function()
{var viewportwidth;var viewportheight;if(typeof window.innerWidth!='undefined'){viewportwidth=window.innerWidth,viewportheight=window.innerHeight}else if(typeof document.documentElement!='undefined'&&typeof document.documentElement.clientWidth!='undefined'&&document.documentElement.clientWidth!=0){viewportwidth=document.documentElement.clientWidth,viewportheight=document.documentElement.clientHeight}else{viewportwidth=document.getElementsByTagName('body')[0].clientWidth,viewportheight=document.getElementsByTagName('body')[0].clientHeight}
return new Array(viewportwidth,viewportheight);}}
