// Name    : general.js                                                        //
// Date    : 22/11/03                                                    //
// Author  : freshboundary.co.uk                                                    //
// Purpose : contain generic function for www.aplaceinprovence.co.uk          //
// Copyright www.aplaceinprovence.co.uk

function selectedPage()
{
	var objLink;

	for (i=0;i<arguments.length;i++)
	{
		(objLink = document.getElementById(arguments[i])) && (objLink.style.color = "#9999cc") && (objLink.style.fontWeight= "bold");
	}
}

function writeFooter()
{
document.write('<div id="footer"><hr width="80%" color="9999cc" size="1">'
+'<span class="footer">a place in provence - '
+'e-mail: </span><a class="footerlink" href="mailto:' + 'enquiries' + '@' + 'aplaceinprovence.co.uk">enquiries' + '@' + '<span class="email_space"> </span>aplaceinprovence.co.uk</a>'
+ '<br><a href="http://www.freshboundary.co.uk" target="_blank"><img src="images/freshboundary_logo.gif" alt="designed by freshboundary.co.uk" width="181" height="24" border="0"></a></div>');
}

function writeEmail(strName)
{
var strDom = "aplaceinprovence.co.uk";
document.write('<a class="copylink" href="mailto:' + strName + '@' + strDom + '">' + strName + '@' + strDom + '</a>');
}

function bookingForm()
{
      window.open("bookingform.html", "bookingform", "resizable=1,status=1,toolbar=1,directories=0,location=0,menubar=1,scrollbars=1,width=700,height=450,top=2,left=20").focus();
}

function openAvailability()
{
      window.open("http://www.holiday-rentals.com/index.cfm/ava/21216/property/13951/branding/none", "bookingform", "resizable=1,status=1,toolbar=1,directories=0,location=0,menubar=1,scrollbars=1,width=700,height=450,top=2,left=20").focus();
}

function priceRange()
{
	var arrBands = 
		[
		"£1,125",
		"£1,125",
		"£1,125",
		"from £1,125 to £1,628",
		"from £1,125 to £1,555",
		"from £1,555 to £1,628",
		"from £1,628 to £2,160",
		"from £1,628 to £2,160",
		"from £1,125 to £1,628",
		"£1,125",
		"£1,125",
		"from £1,125 to £1,628"
		]
		
var strURL = window.location.href;
var intIndexStart = strURL.indexOf("?")
var intIndexEnd = strURL.indexOf(",");
var intMonth;
var today=new Date();


if (intIndexStart != -1)
{
	intMonth = strURL.substring(intIndexStart + 1,intIndexEnd);	
}
else
{
	intMonth= today.getMonth();
}

//alert(arrBands[intMonth]);
document.write ('<p>The price will be ' + arrBands[intMonth] + " per week.</p>");
}