var close_box_display = 'non'+'e';
var box_display = 'di' + 'splay:' + close_box_display;

<!-- Begin function for opening a window - arg 1 is url, arg 2 is (arbitrary) name, args 3&4 are width & height, arg 5 is scrollbars required (yes or no)-->
var win=null;
function NewWindow(mypage,myname,w,h,scroll)
{
myleft=(screen.width)?(screen.width-w)/2:100;
mytop=(screen.height)?(screen.height-h)/2:100;
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=" + scroll + ",location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes";
win=window.open(mypage,myname,settings);
win.focus();
}
<!-- End -->


<!-- Begin function for resizing enlargement screens - arg 1 is required width, arg 2 is required height-->

function ResizeScreen(Width,Height)
{window.moveTo(0,0);
var PageWidth = Width;	
if (Height == null) 
	{PageHeight = screen.availHeight} 	
else 
	{PageHeight = Height} 	 	
if (screen.availHeight < Height) 
	{PageHeight = screen.availHeight};
if (screen.availWidth < Width) 
	{PageWidth = screen.availWidth};
window.resizeTo(PageWidth,PageHeight);
}

<!--End -->

<!-- Begin function for getting correct object prefix, according to how browser treats document elements-->

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

<!--End -->

<!-- Begin function for showing a help box (div) on screen -->

function show_help_box(divname,boxheight)
{
var divtoshow = new getObj(divname);
divtoshow.style.display = 'block';
}

<!-- End -->

<!-- Begin function for showing a help box (div) on screen, with display:inline -->

function show_help_box_inline(divname,boxheight)
{
var divtoshow = new getObj(divname);
divtoshow.style.display = 'inline';
}

<!-- End -->

<!-- Begin function for hiding a help box (div) on screen-->

function close_help_box(divname)
{
var divtoclose = new getObj(divname);
divtoclose.style.display = close_box_display;  
}
<!-- end -->

<!-- Begin function for showing a div on screen -->

function show_div(divname,boxheight)
{
var divtoshow = new getObj(divname);
divtoshow.style.display = 'block';
}

<!-- Begin function for hiding a div on screen-->

function hide_div(divname)
{
var divtoclose = new getObj(divname);
divtoclose.style.display = close_box_display;  
}
<!-- end -->

<!-- Begin function for showing location info (div) on screen -->

function show_location_info(divname,type,boxheight)
{
if (! document.getElementById(divname))
	alert ('Sorry - we don\'t have any information on this location at the moment!');
var divtoshow = new getObj(divname);
divtoshow.style.display = 'block';
var divtoclose = new getObj('initial_instructions');
divtoclose.style.display = close_box_display; 
location.replace('#'+divname); 
}
<!-- end -->

<!-- Begin function for hiding location info (div) on screen-->

function hide_location_info(divname)
{
var divtoclose = new getObj(divname);
divtoclose.style.display = close_box_display;  
}
<!-- end -->

<!-- Begin function for hiding location more info (div) on screen-->

function hide_more_info(divname)
{
var divtoclose = new getObj(divname);
divtoclose.style.display = close_box_display;  
}
<!-- end -->

<!-- Begin function for changing the atag which shows/hides the location more info div into a 'hide' button -->

function change_info_button_to_hide(location)
{
var atagid = location + '_more_info';
var atagtochange = new getObj(atagid);
atagtochange.obj.title = 'click here to hide the extra information';
var moreinfodivid = location + '_more' ;
var printbuttondivid = location + '_print_button';
atagtochange.obj.href = "javascript:hide_div('" + moreinfodivid  + "');change_info_button_to_show('" + location + "')";
<!--hide_div('" + printbuttondivid + "')";-->
atagtochange.obj.innerHTML = "<span>hide 'more information'&nbsp;&nbsp;&nbsp;</span>";
}
<!-- end -->

<!-- Begin function for changing the atag which shows/hides the location more info div back into a 'show' button -->

function change_info_button_to_show(location)
{
var atagid = location + '_more_info';
var atagtochange = new getObj(atagid);
atagtochange.obj.title = 'click here to read more about ' + location + ' - where to stay, where to eat and what to do ...';
var moreinfodivid = location + '_more' ;
var addressdivid = location + '_address' ;
var printbuttondivid = location + '_print_button';
atagtochange.obj.href = "javascript:show_div('" + moreinfodivid  + "');change_info_button_to_hide('" + location + "');show_div('" + printbuttondivid + "')";
atagtochange.obj.innerHTML = '<span>more information&nbsp;&nbsp;</span>';
}
<!-- end -->

<!-- Begin function for changing the atag which shows/hides the member more info div and member address div into a 'hide' button -->

function change_member_info_button_to_hide(member_no)
{
var atagid = member_no + '_more_info';
var atagtochange = new getObj(atagid);
atagtochange.obj.title = 'click here to hide the extra information';
var moreinfodivid = member_no + '_more' ;
var addressdivid = member_no + '_address' ;
var facilitiesid = member_no + '_extra_facilities_info' ;
var printbuttondivid = member_no + '_print_button';
atagtochange.obj.href = "javascript:hide_div('" + moreinfodivid  + "');hide_div('" + addressdivid  + "');hide_div('" + facilitiesid  + "');change_member_info_button_to_show('" + member_no + "');hide_div('" + printbuttondivid + "')";
atagtochange.obj.innerHTML = "<span>hide 'more information'&nbsp;&nbsp;&nbsp;</span>";
}
<!-- end -->

<!-- Begin function for changing the atag which shows/hides the location more info div back into a 'show' button -->

function change_member_info_button_to_show(member_no)
{
var atagid = member_no + '_more_info';
var atagtochange = new getObj(atagid);
var business_name_heading = new getObj(member_no+'_name');
atagtochange.obj.title = 'click here to read more about ' + business_name_heading.obj.innerHTML;
var moreinfodivid = member_no + '_more' ;
var addressdivid = member_no + '_address' ;
var facilitiesid = member_no + '_extra_facilities_info' ;
var printbuttondivid = member_no + '_print_button';
atagtochange.obj.href = "javascript:show_div('" + moreinfodivid  + "');show_div('" + addressdivid  + "');show_div('" + facilitiesid  + "');change_member_info_button_to_hide('" + member_no + "');show_div('" + printbuttondivid + "')";
atagtochange.obj.innerHTML = '<span>more information&nbsp;&nbsp;</span>';
}
<!-- end -->

<!-- begin function for changing a specified enlargement image -->
function change_enlargement(location_name,image_src,image_title,image_width,image_height)
{
enlargement_img_id = location_name + '_main_photo';
var img_to_change = new getObj(enlargement_img_id);
img_to_change.obj.src = image_src;
img_to_change.obj.width = image_width;
img_to_change.obj.height = image_height;
img_to_change.obj.title = image_title
}

<!-- end -->

<!-- begin location div print functions -->
function  make_location_page(html_source,location,neighbouring_locations)
{
  // We break the closing script tag in half to prevent
  // the HTML parser from seeing it as a part of
  // the *main* page.

  return "<html>\n" +
    "<head>\n" +
    "<title>World Heritage Coast Hospitality Association</title>\n" +
    "<link rel='stylesheet' href='location-print-style.css' type='text/css'>" +
    "<style>div.hr {"+box_display+";}hr {"+box_display+";}div.button {"+box_display+";}div.buttons {"+box_display+";}form {"+box_display+";}div.print_button {"+box_display+";}div.close_button {"+box_display+";}</style>" +
    "<script type='text/javascript' src='javascript/functions.js'></scr"+"ipt><script>\n" +
    "function step1() {\n" +
    "var neighbouring_locations = " + neighbouring_locations + "; if(neighbouring_locations) {var locmore = new getObj('" + location+ "_more');locmore.style.position='relative';locmore.style.top='-20px'};setTimeout('step2()', 10);\n" +
    "}\n" +
    "function step2() {\n" +
    "  window.print();\n" +
    "  window.close();\n" +
    "}\n" +
    "</scr" + "ipt>\n" +
    "</head>\n" +
    "<body onLoad='step1()'>\n" +
    "<div class='location'>" +
    html_source +
    "</div></body>\n" +
    "</html>\n";
}

/* neighbouring location is true if there are neighbouring locations and a main photo */
/* if so, we will need to move the 'more' div up by 20px */
function print_location_div(location,neighbouring_locations)
{
	var location_div = new getObj(location);
	link = 'about:blank';
	var print_window = window.open(link, '_new');
	print_window.document.open();
	print_window.document.write(make_location_page(location_div.obj.innerHTML,location,neighbouring_locations));
	print_window.document.close();
}
<!-- end div print functions -->

<!-- begin member div print functions -->
function make_member_page(html_source,business_name)
{
  // We break the closing script tag in half to prevent
  // the HTML parser from seeing it as a part of
  // the *main* page.

html_source=html_source.replace(/<(\/)?script(>)?/ig,"")
html_source=html_source.replace(/type=(")?text\/javascript(")?>/ig,"")
if (html_source.indexOf('GenerateEmailLink') > -1)
	{
	html_source=html_source.replace(/GenerateEmailLink.+\)/,'')
	}
if (html_source.indexOf('GenerateWebLink') > -1)
	{
	html_source=html_source.replace(/GenerateWebLink.+\)/,'')
	}

  return "<html>\n" +
    "<head>\n" +
    "<title>"+business_name+"</title>\n" +
    "<link rel='stylesheet' href='member-print-style.css' type='text/css'>" +
    "<style>div.hr {"+box_display+";}hr {"+box_display+";}div.button {"+box_display+";}div.buttons {"+box_display+";}form {"+box_display+";}div.print_button {"+box_display+";}div.close_button {"+box_display+";}</style>" +
    "<script type='text/javascript' src='javascript/functions.js'></scr"+"ipt><script>\n" +
    "function step1() {\n" +
    "setTimeout('step2()', 10);\n" +
    "}\n" +
    "function step2() {\n" +
    "  window.print();\n" +
    "  window.close();\n" +
    "}\n" +
    "</scr" + "ipt>\n" +
    "</head>\n" +
    "<body onLoad='step1()'>\n" +
    html_source +
    "</body>\n" +
    "</html>\n";
}

function print_member_div(member_no,extra_flag)
{
	var member_div = new getObj(member_no);
	var business_name_heading = new getObj(member_no+'_name');
	link = 'about:blank';
	var print_window = window.open(link, '_new');
	print_window.document.open();
	print_window.document.write(make_member_page(member_div.obj.innerHTML,business_name_heading.obj.innerHTML));
	print_window.document.close();
}
<!-- end div print functions -->


<!-- Begin function for generating text email link 

// **************************************************************
// AUTHOR: Andrew Green (copyright 2004)
// URL: http://www.andrewgreen.biz
// Feel free to use this script - just leave this message intact.
// **************************************************************

function GenerateEmailLink(domain,emailrecipient,linktype,linktext,styleclass,atagtitle,emailsubject,emailbody,atagid)
{
var atsign = '@';
if (domain.substr(0,4) == 'www.')
	{domain = domain.substring(4,(domain.length+1));}
if (domain.substr(0,11) == 'http://www.')
	{domain = domain.substring(11,(domain.length+1));}
if (emailrecipient.indexOf('@') > -1)
	{emailaddress = emailrecipient} 
else
	{emailaddress = emailrecipient + atsign + domain} 
if (emailaddress.search(/[ \/;:,]/) > -1)
	{alert ('email addresses can\'t have a space or , or ; or : or / in them.\nYou used \'' + emailrecipient + '\', which is invalid'); return} 
if ((linktype != 'text') && (linktype != 'address')) 
	{alert ('the linktype argument must be \'text\' or \'address\'.\nYou used \'' + linktype + '\''); return;}
if ((atagid == '') || (atagid == undefined)) 
	{idattribute=''} 
else 
	{idattribute = 'id="' + atagid + '" '}
if ((emailsubject == '') || (emailsubject == undefined))  
	{emailsubjectsubattribute=''} 
else
	{emailsubjectsubattribute = '?subject=' + emailsubject};
if ((emailbody == '') || (emailbody == undefined))  
	{emailbodysubattribute=''} 
else
	{emailbodysubattribute = '&body=' + emailbody};
atagcode = '<a class="' 
	+ styleclass + '" ' 
	+ idattribute
	+ 'href="mailto:'
	+ emailaddress
	+ emailsubjectsubattribute 
	+ emailbodysubattribute
	+ '" title="'
	+ atagtitle
	+ '">';
(linktype == 'text')? 
	linkcode = linktext + '</a>' : 
	linkcode = emailrecipient + atsign + domain + '</a>';
document.write (atagcode);
document.write (linkcode);
}

// End -->

<!-- Begin function for generating email anchor tag for an image 

// **************************************************************
// AUTHOR: Andrew Green (copyright 2004)
// URL: http://www.andrewgreen.biz
// Feel free to use this script - just leave this message intact.
// **************************************************************

function GenerateEmailAnchor(domain,emailrecipient,atagtitle,emailsubject,emailbody)
{
var atsign = '@';
if (domain.substr(0,4) == 'www.')
	{domain = domain.substring(4,(domain.length+1));}
if (domain.substr(0,11) == 'http://www.')
	{domain = domain.substring(11,(domain.length+1));}
if (emailrecipient.indexOf('@') > -1)
	{emailaddress = emailrecipient} 
else
	{emailaddress = emailrecipient + atsign + domain} 
if (emailaddress.search(/[ \/;:,]/) > -1)
	{alert ('email addresses can\'t have a space or , or ; or : or / in them.\nYou used \'' + emailrecipient + '\', which is invalid'); return} 
if ((emailsubject == '') || (emailsubject == undefined))  
	{emailsubjectsubattribute=''} 
else
	{emailsubjectsubattribute = '?subject=' + emailsubject};
if ((emailbody == '') || (emailbody == undefined))   
	{emailbodysubattribute=''} 
else 
	{emailbodysubattribute = '&body=' + emailbody};
atagcode = '<a class="' 
	+ '" href="mailto:'
	+ emailaddress
	+ emailsubjectsubattribute 
	+ emailbodysubattribute
	+ '" title="'
	+ atagtitle
	+ '">';
document.write (atagcode);
}

// End -->

<!-- Begin function for generating email anchor tag (for buttons) 

// **************************************************************
// AUTHOR: Andrew Green (copyright 2004)
// URL: http://www.andrewgreen.biz
// Feel free to use this script - just leave this message intact.
// **************************************************************

function GenerateEmailButtonAnchor(domain,emailrecipient,atagtitle,imgtagname,emailsubject,emailbody)
{
var atsign = '@';
if ((emailbody == '') || (emailbody == undefined))   
	{emailbodysubattribute=''} 
else 
	{emailbodysubattribute = '&body=' + emailbody};
atagcode = '<a class="' 
	+ '" href="mailto:'
	+ emailrecipient
	+ atsign
	+ domain
	+ '?subject='
	+ emailsubject 
	+ emailbodysubattribute
	+ '" title="'
	+ atagtitle
	+ '" '
	+ 'onmouseover="'
	+ imgtagname
	+ '.src=commover.src" onmouseout="'
	+ imgtagname
	+ '.src=commbutt.src">';
document.write (atagcode);
}

// End -->

<!-- Begin function for getting correct document body, to be used with checking the scroll position-->

function truebody()
{return (document.compatMode!="BackCompat")? document.documentElement : document.body}

<!--End -->

<!-- Begin function for generating text email link -- >

function GenerateWebLink(domain,businessid,businessname)
{
domain=domain.replace('https:','http:');
url=domain;
if (domain.substr(0,7) != 'http://') {url = 'http://' + domain};
domain=domain.replace('http://www','www');
atagcode = '<a  href="' + url + '" target="_blank" title="' + businessname + ' - click here to visit their website (opens in a new window)">';
document.write (atagcode);
document.write (domain + '</a>');
}

function GenerateSimpleWebLink(url,titleatt)
{
atagcode = '<a  href="' + url + '" target="_blank" title="click here to visit the ' + titleatt + ' website (opens in a new window)">'
document.write (atagcode);
}

<!-- End -->

function ShowEnlargement(imageUrl,imageWidth,imageHeight,imageName,bgcolor,hugger,hugMargin,flag) 
{
// by E Michael Brandt of ValleyWebDesigns.com - Please leave these comments intact.
// version 3.0.4 
// modified by Andrew Green - www.andrewgreen.biz - to remove automatic close and include stylesheet in html source 

	if (bgcolor=="") {
		bgcolor="#FFFFFF";
	}
	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	if (imageWidth>w){	
	  byFactor = w / imageWidth;			
	  imageWidth = w;
	  imageHeight = imageHeight * byFactor;
	}
	if ((imageHeight)>h-adj){
	  byFactor = h / imageHeight;
	  imageWidth = (imageWidth * byFactor);
	  imageHeight = h; 
	}
	   
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if ((imageHeight)>scrHeight){
  	  imageHeight=imageHeight*lift;
	  imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
	  if (hugMargin == ""){
	    hugMargin = 0;
	  }
	  var scrHeightTemp = imageHeight - 0 + 2*hugMargin;
	  if (scrHeightTemp < scrHeight) {
		scrHeight = scrHeightTemp;
	  } 
	  var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
	  if (scrWidthTemp < scrWidth) {
		scrWidth = scrWidthTemp;
	  }
	  
	  if (scrHeight<100){scrHeight=100;}
	  if (scrWidth<100){scrWidth=100;}

	  posTop =  ((h-(scrHeight/lift)-adj)/2);
	  posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}
	posTop = parseInt(posTop);
	posLeft = parseInt(posLeft);		
	scrWidth = parseInt(scrWidth); 
	scrHeight = parseInt(scrHeight);
	
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1){
	  var args= new Array();
	  args[0]='parent';
	  args[1]=imageName;
	  var i ; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {
	newWindow = window.open("enlargement.html","newWindow","width="+scrWidth+",height="+(scrHeight+30)+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+imageName+'</title><link rel="stylesheet" type="text/css" href="style.css"><body class="enlargement">');  
	newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
	if (flag=="allsop")
		{newWindow.document.write('<center>' +
		'<script type="text/javascript" src="javascript/fade-images-allsop.js"></script>' +
		'</center>')}	
	else
		{newWindow.document.write('<img src="'+imageUrl+'" width='+imageWidth+' height='+imageHeight+' alt="' +imageName+ '" title="' +imageName+ '">');} 
	newWindow.document.write('</td></tr></table><center><a href="javascript:self.close()" title="click here to close this window">close</a></center></body></html>');
	newWindow.document.close();
	newWindow.focus();
	}
}

<!-- Begin function for generating links --> 

// **************************************************************
// AUTHOR: Andrew Green (copyright 2004)
// URL: http://www.andrewgreen.biz
// Feel free to use this script - just leave this message intact.
// **************************************************************

function GenerateLink(linktype,linkurl,linktext,atagtitle,htmlimgtag)
{
var displayedlinkurl = linkurl;
if (linkurl.indexOf('www') == -1) {displayedlinkurl = 'http://' + linkurl};
var htmlatagend = 'href="http://' + linkurl + '" target="_blank" title="' + atagtitle + '">';
document.write('<div style="float:left;display:inline;margin:0px 40px 10px 0px;width:420px;">');
document.write('<a class="hover" ' + htmlatagend); 
if (linktype == 'image')
	{
	document.write(htmlimgtag + ' ');
	}
document.write(linktext + '</a>');
document.write('</div><div style="float:left;display:inline;width:150px;">');
styleclassdefn = 'class="hover" ' 
document.write('<a ' + htmlatagend); 
document.write(displayedlinkurl + '</a></div>');
}

<!-- End -->

function GenerateArticleWebLink(url,titleatt)
{
atagcode = '<a class="hover" style="font-style:normal;" href="' + url + '" target="_blank" title="click here to read this article in full (opens in a new window)">'
document.write (atagcode);
}

var size_increase = 0;
var unit = 'pt';
var fontsize = 10;

function FontSizer(inc) 
{
	if (!document.getElementById) return;
	size_increase += inc;
	getBody = document.getElementsByTagName('body')[0];
	getBody.style.fontSize = (fontsize + size_increase) + unit
}

function FontDefaults() 
{
	if (!document.getElementById) return;
	show_help_box('sizer')	
	size_increase = 0;
	getBody = document.getElementsByTagName('body')[0];
	getBody.style.fontSize = fontsize + unit	
}

