/*////////////////////////////////////////////////////////////
JavaScript Code Library
Developed by GrafX Design Division Pty Ltd
http://www.grafx.com.au

Last Checked In By : Richard Czeiger
Public Revision No : 1.0

The software and related user documentation are
protected under copyright laws and remain the sole
property of GrafX Design Division. Full license is
available on the GrafX Design Division web site or
in the original download.

Technical support is available via the GrafX web site at
http://www.grafx.com.au
////////////////////////////////////////////////////////////*/



// Tracking Code for SEO
var ns_data,ns_hp,ns_tz,ns_rf,ns_sr,ns_img,ns_pageName;
ns_pageName= this.location;
document.cookie='__support_check=1';ns_hp='http';
ns_rf=document.referrer;ns_sr=window.location.search;
ns_tz=new Date();if(location.href.substr(0,6).toLowerCase() == 'http:')
ns_hp='http';ns_data='&an='+escape(navigator.appName)+ 
'&sr='+escape(ns_sr)+'&ck='+document.cookie.length+
'&rf='+escape(ns_rf)+'&sl='+escape(navigator.systemLanguage)+
'&av='+escape(navigator.appVersion)+'&l='+escape(navigator.language)+
'&pf='+escape(navigator.platform)+'&pg='+escape(ns_pageName);
ns_data=ns_data+'&cd='+screen.colorDepth+'&rs='+escape(screen.width+ ' x '+screen.height)+
'&tz='+ns_tz.getTimezoneOffset()+'&je='+ navigator.javaEnabled();
ns_img=new Image();ns_img.src=ns_hp+'://tracker.statgauge.com/statistics.aspx'+
'?v=1&s=213&acct=225647'+ns_data+'&tks='+ns_tz.getTime();



// Get the hacked stylesheet
document.write('<style type="text/css">@import url("styles/hacks.css");</style>');



// Suppress JavaScript Errors
window.onerror=new Function("return true")



// Set the Status Bar Message
var statusMsg = 'Randwick Lodges - Sydney Accommodation';
window.defaultStatus=statusMsg;



// Fixes IE6 CSS Rendering Bug
if (document.all && window.attachEvent) window.attachEvent("onload", fixWinIE);
function fixWinIE() {
	if (document.body.scrollHeight < document.body.offsetHeight) { document.body.style.display = 'block'; }
}



// Spam Suppression for Emails
function stopSpam(name, domain, subject) {
	var symbol = '@';
	// Took out the Subject due to MS fault in Outlook Express (Source - http://support.microsoft.com/kb/q182985/ )
	// document.write('<a href="mailto:' + name + symbol + domain + '&subject=' + subject + '">' + name + symbol + domain + '</a>');
	document.write('<a href="mailto:' + name + symbol + domain + '">' + name + symbol + domain + '</a>');
}



// XHTML External Link Script
function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
		}
	}
}



// Toggle Function
function toggle(obj) {
	if (obj.style.display == "none") {
		obj.style.display = "";
	} else {
		obj.style.display = "none";
	}
}



// Pop Up Image Window
// function PopupPic(sPicURL, sPicTitle) {
// 	window.open('image.html?'+sPicURL+'&'+sPicTitle, 'imagePopUp', 'resizable=1,width=20,height=20');
// }
function showImage(whichOne) {
	if (document.getElementById('sideImage')) {
		document.getElementById('sideImage').src = 'http://www.therandwicklodges.com/images/' + whichOne + '.jpg';
	}
}



// Multiple Onload Functions to be called
function multipleOnload() {
	externalLinks();
}
window.onload = multipleOnload;

function bb_set_date(){
	
	var today = new Date();
	var month = today.getMonth() + 1;
	var bb_dateFrom_day = document.getElementById("bb_dateFrom_day");
	var bb_dateFrom_month = document.getElementById("bb_dateFrom_month");
	
	if(today.getDate()<10){
		bb_dateFrom_day.value = '0' + today.getDate();
	}else{
		bb_dateFrom_day.value = today.getDate();
	}

	if(month<10){
		month = '0' + month;
	}
	
	var value = today.getFullYear() + "-" + month;
	bb_dateFrom_month.value = value;
	
}
window.onload = bb_set_date;

function bb_submit()
{
	var bb_dateFrom = document.getElementById('bb_dateFrom_month').value + "-" + document.getElementById('bb_dateFrom_day').value;
	
	document.getElementById('dateFrom').value = bb_dateFrom;
	try
  	{
  		pageTracker._linkByPost(document.getElementById('bb_check_availability'));
  	}
	catch(err)
  	{
  	}
	document.getElementById('bb_check_availability').submit();
}