function footer(){
	document.write("	<div id='footer'>");
	document.write("	  <ul>");
if(navigator.userAgent.search(/msie/i)!= -1) {
	document.write("		<span><a href='http://www.propertyshotphotography.com.au'  target='_blank'>Photography by Saul Goodwin</a>, &nbsp;&nbsp;&nbsp;&nbsp;site design Copyright &copy; Sunseeker Motel 2011</span>");
	document.write("		<li><a href='#'>Comments</a></li>");
	document.write("		<li><a href='mailto:info@byronsun.com.au'>Contact Us</a></li>");
} else {
	document.write("		<li><a href='#'>Comments</a></li>");
	document.write("		<li><a href='mailto:info@byronsun.com.au'>Contact Us</a></li>");
	document.write("		<span><a href='http://www.propertyshotphotography.com.au'  target='_blank'>Photography by Saul Goodwin</a>,&nbsp;&nbsp;&nbsp;&nbsp; site design Copyright &copy; Sunseeker Motel 2011</span>");
}
	document.write("	  </ul>");
}


function header(){
document.write("    <div id='header' title='Byron Sunseeker Motel'>");
document.write("	<div id='skipmenu'><a href='http://www.whereis.com/nsw/byron-bay/100-bangalow-rd?id=DF1D594692DA17' target='_blank'>View Map</a>");
document.write("        </div>");
document.write("	<h1>");
document.write("	   <img src='images/sunseeker-logo.gif' alt='' width='110' height='85'>");
document.write("	   <img src='images/SunseekerTitle.gif' alt='' width='500' height='85'>");
document.write("	</h1>");
document.write("    </div>");
}

function menu(){
document.write("    <div id='mainnav'>");
document.write("		<ul>");
document.write("                        <li><a href='index.html'>Home</a></li>");
document.write("			<li><a href='features.html'>Features</a></li>");
document.write("			<li><a href='accomodation.html'>Accomodation</a></li>");
document.write("			<li><a href='location.html'>Location</a></li>");
document.write("			<li><a href='contactus.html'>Enquiries</a></li>");
document.write("			<li><a href='https://www.thebookingbutton.com.au/properties/byronsundirect' target='_blank'>Book Now</a></li>");
document.write("			<li><a href='http://www.byron-bay.com' target='_blank'>Byron Bay</a></li>");
document.write("			<li><a href='AboutUs.html'>About Us</a></li>");
document.write("		</ul>");
document.write("    </div>");
}

function nomenu(){
document.write("    <div id='mainnav'>");
document.write("    </div>");
}

function delayedRedirect(){
    window.history.go(-1);
}

function validateForm()
{
var x=document.forms["ContactForm"]["Name"].value;
if (x==null || x=="")
  {
  alert("Name must be filled out");
  return false;
  }
}

function RedirectHome(){
    window.location = "home.html";
}




function adjustRatio(img)
{
var winheight = (document.body.clientHeight === undefined)?window.innerHeight:document.body.clientHeight;
var winwidth = (document.body.clientWidth === undefined)?window.innerWidth:document.body.clientWidth;
winratio = winheight / winwidth;

if(winratio < imageratio)
{
img.style.height = 'auto';
img.style.width = '100%';
}
else
{
img.style.width = '100%';
img.style.height = 'auto';
}
img.style.width = '50%';
}

function centerContainer(cont)
{
var winwidth = (document.body.clientWidth === undefined)?window.innerWidth:document.body.clientWidth;
var curLeft = document.getElementById("container").style.left;
alert(curLeft);
}

setTimeout("adjustRatio(img)",1);


function setBackground(){
var img = document.getElementById('imgId');
window.onresize = function() {moveDiv();adjustRatio(img);}
//document.onload = function(){ adjustRatio(img);}
var imageratio = img.height / img.width;
adjustRatio(img);
}

function moveDiv()
{

	var winwidth = (document.body.clientWidth === undefined)?window.innerWidth:document.body.clientWidth;
	window.onresize = function() {moveDiv();}

//var curLeft = document.getElementById("container").style.left;

  // get the stylesheet
  //
  var the_style = getStyleObject("container");
  if (the_style)
  {
    // get the current coordinate and add x
    //
    var current_left = parseInt(the_style.left);
    var current_width = parseInt(the_style.width);
    var new_left = (winwidth-800);
    new_left = (new_left/2);

    // set the left property of the DIV, add px at the
    // end unless this is NN4
    //
    if (document.layers) 
    {
      the_style.left = new_left;
    }
    else 
    {  
      the_style.left = new_left + "px";
    }
    
  }
  return true;
}


function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

