var days = new Array();
days[0] = "Sunday";
days[1] = "Monday";
days[2] = "Tuesday";
days[3] = "Wednesday";
days[4] = "Thursday";
days[5] = "Friday";
days[6] = "Saturday";

var month = new Array();
month[0] = "January";
month[1] = "February";
month[2] = "March";
month[3] = "April";
month[4] = "May";
month[5] = "June";
month[6] = "July";
month[7] = "August";
month[8] = "September";
month[9] = "October";
month[10] = "November";
month[11] = "December";

var mon = new Array();
mon[0] = "Jan";
mon[1] = "Feb";
mon[2] = "Mar";
mon[3] = "Apr";
mon[4] = "May";
mon[5] = "Jun";
mon[6] = "Jul";
mon[7] = "Aug";
mon[8] = "Sep";
mon[9] = "Oct";
mon[10] = "Nov";
mon[11] = "Dec";

function createDropdownDate(b,e,s)
{
	if (s==0)
	{
		now = new Date();
		s = now.getDate();
	}
	for (i=b; i<=e; i++)
	{
		if (i==s)
			document.write('<option value="'+i+'" selected="selected">'+i+'</option>');
		else
			document.write('<option value="'+i+'">'+i+'</option>');
	}
}

function createtheatredates()
{
	f=document.form;
	now = new Date();
	d = now.getDate();
	m = now.getMonth();
	y = now.getFullYear();

	for (i=y; i<=(y+1); i++)
	{
		for (j=1; j<=12; j++)
		{
		    for (x=1;x<=31;x++)
		    {
			if (x<10) x="0"+x;
			if (i==y)
			{
				if ((j-1)>m)
				{
					len = f['showdate'].length++;
					f['showdate'].options[len].text = x+" "+month[j-1]+" "+i;					
					if (j<10) sj="0"+j;
					else sj=j;
					f['showdate'].options[len].value = x+"/"+i+"Z"+sj;
				}
				else if ((j-1)==m)
				{
					if (x>=d)
					{
						len = f['showdate'].length++;
						f['showdate'].options[len].text = x+" "+month[j-1]+" "+i;
						if (j<10) sj="0"+j;
						else sj=j;
						f['showdate'].options[len].value = x+"/"+i+"Z"+sj;
					}
				}
			}
			else
			{
				len = f['showdate'].length++;
				f['showdate'].options[len].text = x+" "+month[j-1]+" "+i;
				if (j<10) sj="0"+j;
				else sj=j;
				f['showdate'].options[len].value = x+"/"+i+"Z"+sj;
			}
			if ((j==3 || j==5 || j==7 || j==9) && x==30) break;
			else if (j==1 && x==29) break;
                  }
	      }
	}
}

function createtheatredates2()
{
	f=document.form2;
	now = new Date();
	d = now.getDate();
	m = now.getMonth();
	y = now.getFullYear();

	for (i=y; i<=(y+1); i++)
	{
		for (j=1; j<=12; j++)
		{
		    for (x=1;x<=31;x++)
		    {
			if (x<10) x="0"+x;
			if (i==y)
			{
				if ((j-1)>m)
				{
					len = f['qdate'].length++;
					f['qdate'].options[len].text = x+" "+month[j-1]+" "+i;					
					if (j<10) sj="0"+j;
					else sj=j;
					f['qdate'].options[len].value = i+"Z"+sj+"#"+x;
				}
				else if ((j-1)==m)
				{
					if (x>=d)
					{
						len = f['qdate'].length++;
						f['qdate'].options[len].text = x+" "+month[j-1]+" "+i;
						if (j<10) sj="0"+j;
						else sj=j;
						f['qdate'].options[len].value = i+"Z"+sj+"#"+x;

					}
				}
			}
			else
			{
				len = f['qdate'].length++;
				f['qdate'].options[len].text = x+" "+month[j-1]+" "+i;
				if (j<10) sj="0"+j;
				else sj=j;
				f['qdate'].options[len].value = i+"Z"+sj+"#"+x;

			}
			if ((j==3 || j==5 || j==7 || j==9) && x==30) break;
			else if (j==1 && x==29) break;
                  }
	      }
	}
}

function setYears(type, sel, abbr)
{
	f=document.form;
	now = new Date();
	m = now.getMonth();
	y = now.getFullYear();

	for (i=y; i<=(y+1); i++)
	{
		for (j=0; j<=11; j++)
		{
			if (i==y)
			{
				if (j>=m)
				{
					len = f[type].length++;
					f[type].options[len].value = j+"|"+i;
					if (abbr==1)
						f[type].options[len].text = mon[j]+" "+i.toString().substring(2);
					else
						f[type].options[len].text = month[j]+" "+i;
				}
			}
			else
			{
				len = f[type].length++;
				f[type].options[len].value = j+"|"+i;
				if (abbr==1)
					f[type].options[len].text = mon[j]+" "+i.toString().substring(2);
				else
					f[type].options[len].text = month[j]+" "+i;
			}
		}
	}
	if (sel!='')
		setDropdown(sel, type);
}

function setSunday(t)
{
	if (t==-1)
		dateset = readCookieDatesFree();
	else
		dateset = readCookieDates(t);
	if (dateset==0)
	{
		f = document.form;
		now = new Date();
		today = now.getDay();
		smonth = getMonthValue(f.arrivedate2.options[f.arrivedate2.selectedIndex].value);
		if (today==0)
			n = 7;
		else
			n = 7 - today;

		now.setTime(now.getTime() + n * 24 * 60 * 60 * 1000);
		f.arrivedate.selectedIndex = now.getDate();
		if (now.getMonth()==0 && smonth==11)
		  smonth=-1;
		f.arrivedate2.selectedIndex = f.arrivedate2.selectedIndex + (now.getMonth() - smonth);
		setEndDate(1);
	}
}

function setEndDate(n)
{
	f = document.form;
	now = new Date();
	smonth = getMonthValue(f.arrivedate2.options[f.arrivedate2.selectedIndex].value);
	syear = getYearValue(f.arrivedate2.options[f.arrivedate2.selectedIndex].value);
	now.setYear(syear);
	now.setDate(1);
	now.setMonth(smonth);
	now.setDate(f.arrivedate.selectedIndex);

	checkdate = checkDate(now.getTime());

	now.setTime(now.getTime() + n * 24 * 60 * 60 * 1000);
	f.departdate.selectedIndex = now.getDate();
	if (now.getMonth() < smonth)
		f.departdate2.selectedIndex = f.arrivedate2.selectedIndex + ((now.getMonth() + 12) - smonth);
	else
		f.departdate2.selectedIndex = f.arrivedate2.selectedIndex + (now.getMonth() - smonth);

	setDayName('arrive',f.arrivedate.selectedIndex,f.arrivedate2.options[f.arrivedate2.selectedIndex].value);
	setDayName('depart',f.departdate.selectedIndex,f.departdate2.options[f.departdate2.selectedIndex].value);
}

function checkDate(d)
{
	thisdate = new Date();
	thisdate = new Date(thisdate.getYear(),thisdate.getMonth(),thisdate.getDate());
	checkdate = d - thisdate.getTime();
	return checkdate;
}

function userDate(sdate,smonth,syear,edate,emonth,eyear)
{
	f = document.form;
	f.arrivedate.selectedIndex = sdate;
	smy = smonth + "|" + syear;
	setDropdown(smy,'arrivedate2');

	f.departdate.selectedIndex = edate;
	emy = emonth + "|" + eyear;
	setDropdown(emy,'departdate2');
}

function setDropdown(date,field)
{
	f = document.form;
	for (i=0; i < f[field].options.length; i++)
	{
		check = f[field].options[i].value;
		if (date == check)
		{
			f.elements[field].selectedIndex = i;
			break;
		}
	}
}

function checkPeriod()
{
	f = document.form;
	valid = 0;
	if (f.date_select[1].checked==true)
	{
		valid = validDate(f.arrivedate.selectedIndex,f.arrivedate2.options[f.arrivedate2.selectedIndex].value);
		if (valid==1)
		{
			alert("The start date you have entered is invalid");
			return false;
		}
		valid = validDate(f.departdate.selectedIndex,f.departdate2.options[f.departdate2.selectedIndex].value);
		if (valid==1)
		{
			alert("The end date you have entered is invalid");
			return false;
		}
		stime = getTimeValue(f.arrivedate.selectedIndex,f.arrivedate2.options[f.arrivedate2.selectedIndex].value);
		etime = getTimeValue(f.departdate.selectedIndex,f.departdate2.options[f.departdate2.selectedIndex].value);

		dtime = (etime - stime) / (24 * 60 * 60 * 1000);
		if (dtime>31)
		{
			alert("Please select a period no longer than 31 days");
			return false;
		}
		else if (dtime<0)
		{
			alert("Please select a longer period");
			return false;
		}
	}
}

function validDate(d,m)
{
	valid = 0;
	cmonth = getMonthValue(m);
	cyear = getYearValue(m);

	if (cyear % 4 != 0)
	{
		if ((cmonth == 1)&&(d > 28))
			valid = 1;
		if (((cmonth == 3)||(cmonth == 5)||(cmonth == 8)||(cmonth == 10))&&(d > 30))
			valid = 1;
	}
	if (cyear % 4 == 0)
	{
		if ((cmonth == 1)&&(d > 29))
			valid = 1;
		if (((cmonth == 3)||(cmonth == 5)||(cmonth == 8)||(cmonth == 10))&&(d > 30))
			valid = 1;
	}
	return valid;
}

function getMonthValue(m)
{
	pos = m.indexOf("|");
	month = m.substring(0,pos);
	return month;
}

function getYearValue(y)
{
	pos = y.indexOf("|");
	year = y.substring(pos+1);
	return year;
}

function getTimeValue(d,m)
{
	now = new Date();
        now.setFullYear(2007);
        now.setMonth(0);
        now.setDate(1);
	month = getMonthValue(m);
	year = getYearValue(m);
	now.setFullYear(year);
	now.setMonth(month);
	now.setDate(d);
	return now.getTime();
}

function getDayName(d,m)
{
	now = new Date();
        now.setFullYear(2007);
        now.setMonth(0);
        now.setDate(1);
	year = getYearValue(m);
	month = getMonthValue(m);
	now.setFullYear(year);
	now.setMonth(month);
	now.setDate(d);
	return now.getDay();
}

function setToday(n)
{
	f = document.form;
	now = new Date();
	now.setTime(now.getTime() + n * 24 * 60 * 60 * 1000);
	m = now.getMonth();
	y = now.getFullYear();
	dropMonth = m + "|" + y;

	f.arrivedate.selectedIndex = now.getDate();
	setDropdown(dropMonth, 'arrivedate2');
	f.departdate.selectedIndex = now.getDate() + 1;
	setDropdown(dropMonth, 'departdate2');
}

function setNights()
{
	f = document.form;
	f.nights.length = 20;

	stime = getTimeValue(f.arrivedate.selectedIndex,f.arrivedate2.options[f.arrivedate2.selectedIndex].value);
	etime = getTimeValue(f.departdate.selectedIndex,f.departdate2.options[f.departdate2.selectedIndex].value);

	setDayName('arrive',f.arrivedate.selectedIndex,f.arrivedate2.options[f.arrivedate2.selectedIndex].value);
	setDayName('depart',f.departdate.selectedIndex,f.departdate2.options[f.departdate2.selectedIndex].value);

	dtime = (etime - stime) / (24 * 60 * 60 * 1000);

	if (dtime > 20)
	{
		for (i=21; i<=dtime; i++)
		{
			len = f.nights.length++;
			f.nights.options[len].value = i;
			f.nights.options[len].text = i;
		}
	}

	f.nights.selectedIndex = Math.ceil(dtime - 1);
	//f.nights.selectedIndex = dtime;
}

function setDayName(t,d,m)
{
	f = document.form;
	f[t+'day'].value = days[getDayName(d,m)];
}

function populateDates()
{
	w = window.opener;
	f = document.form;
	if (w.f)
	{
		city = w.f.city.value;
		city_set = 0;
		for (i=0; i<f.city.length; i++)
		{
			if (f.city[i].value==city)
			{
				f.city[i].checked = true;
				city_set = 1;
			}
		}
		if (city_set==0)
		{
			for (i=0; i<f.other_city.length; i++)
			{
				if (f.other_city.options[i].value==city)
					f.other_city.options[i].selected = true;
			}
		}
	}
	dateset = readCookieDates();
	if (dateset==0)
	{
	  if (w.f)
	  {
		f.arrivedate.selectedIndex = w.f.arrivedate.selectedIndex;
		f.arrivedate2.selectedIndex = w.f.arrivedate2.selectedIndex;
		f.nights.selectedIndex = w.f.nights.selectedIndex;
		setEndDate(f.nights.options[f.nights.selectedIndex].value);
		f.rooms.selectedIndex = w.f.rooms.selectedIndex;
		showRooms(f.rooms.options[f.rooms.selectedIndex].value)
		for (i=1; i<=f.rooms.options[f.rooms.selectedIndex].value; i++)
		{
			f['roomtype'+i].selectedIndex = w.f['roomtype'+i].selectedIndex;
		}
          }
	  else setSunday('0');
	}
}

function checkArrivalDate()
{
	f = document.form;
	//now = new Date();
	smonth = getMonthValue(f.arrivedate2.options[f.arrivedate2.selectedIndex].value);
	syear = getYearValue(f.arrivedate2.options[f.arrivedate2.selectedIndex].value);
	//now.setYear(syear);
	//now.setMonth(smonth);
	//now.setDate(f.arrivedate.selectedIndex);
	now = new Date(syear,smonth,f.arrivedate.selectedIndex);

	checkdate = checkDate(now.getTime());
	
	return checkdate;
}

function compareDates()
{
	f = document.form;
	//arr = new Date();
	smonth = getMonthValue(f.arrivedate2.options[f.arrivedate2.selectedIndex].value);
	syear = getYearValue(f.arrivedate2.options[f.arrivedate2.selectedIndex].value);
	//arr.setYear(syear);
	//arr.setMonth(smonth);
	//arr.setDate(f.arrivedate.selectedIndex);
	//arr.setFullYear(syear,smonth,f.arrivedate.selectedIndex);
	arr = new Date(syear,smonth,f.arrivedate.selectedIndex);

	//dep = new Date();
	emonth = getMonthValue(f.departdate2.options[f.departdate2.selectedIndex].value);
	eyear = getYearValue(f.departdate2.options[f.departdate2.selectedIndex].value);
	//dep.setYear(eyear);
	//dep.setMonth(emonth);
	//dep.setDate(f.departdate.selectedIndex);
	dep = new Date(eyear,emonth,f.departdate.selectedIndex);

	checkdate = checkDate(now.getTime());

	if (dep.getTime()<=arr.getTime())
		check = 1;
	else
		check = 0;

	return check;
}

function setCookieDates()
{
	f = document.form;
	document.cookie="";
	document.cookie = "sd=" + f.arrivedate.selectedIndex + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "sm=" + f.arrivedate2.selectedIndex + "; domain=www.hoteldirect.co.uk;path=/;";
	document.cookie = "nights=" + f.nights.selectedIndex + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "rooms=" + f.rooms.selectedIndex + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room1=" + f.roomtype1.selectedIndex + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room2=" + f.roomtype2.selectedIndex + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room3=" + f.roomtype3.selectedIndex + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room4=" + f.roomtype4.selectedIndex + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room5=" + f.roomtype5.selectedIndex + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room1value=" + f.roomtype1.options[f.roomtype1.selectedIndex].value + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room2value=" + f.roomtype2.options[f.roomtype2.selectedIndex].value + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room3value=" + f.roomtype3.options[f.roomtype3.selectedIndex].value + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room4value=" + f.roomtype4.options[f.roomtype4.selectedIndex].value + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room5value=" + f.roomtype5.options[f.roomtype5.selectedIndex].value + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "kidsage=" + f.kidsage.value + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "dateset=yes; domain=www.hoteldirect.co.uk; path=/;";
}

function readCookieDates(t)
{
	f = document.form;
	cookie = document.cookie;
	broken_cookie = cookie.split(";");
	m = broken_cookie.length;
	dateset = 0;

	for (i=0; i<m; i++)
	{
		broken_cookie[i] = trimString(broken_cookie[i]);
		if (broken_cookie[i]=='dateset=yes')
			dateset = 1;
	}
	if (dateset==1)
	{
		for (k=0; k<m; k++)
		{
			if (broken_cookie[k].substring(0,3)=='sd=')
				f.arrivedate.selectedIndex = broken_cookie[k].substring(3);
			if (broken_cookie[k].substring(0,3)=='sm=')
				f.arrivedate2.selectedIndex = broken_cookie[k].substring(3);
			if (broken_cookie[k].substring(0,7)=='nights=')
			{
				f.nights.selectedIndex = parseInt(broken_cookie[k].substring(7));
				setEndDate(f.nights.options[f.nights.selectedIndex].value);
			}
			if (broken_cookie[k].substring(0,6)=='rooms=')
			{
				f.rooms.selectedIndex = broken_cookie[k].substring(6);
				showRooms(f.rooms.options[f.rooms.selectedIndex].value, t);
			}

/*
			if (broken_cookie[k].substring(0,6)=='room1=')
				f.roomtype1.selectedIndex = broken_cookie[k].substring(6);
			if (broken_cookie[k].substring(0,6)=='room2=')
				f.roomtype2.selectedIndex = broken_cookie[k].substring(6);
			if (broken_cookie[k].substring(0,6)=='room3=')
				f.roomtype3.selectedIndex = broken_cookie[k].substring(6);
			if (broken_cookie[k].substring(0,6)=='room4=')
				f.roomtype4.selectedIndex = broken_cookie[k].substring(6);
			if (broken_cookie[k].substring(0,6)=='room5=')
				f.roomtype5.selectedIndex = broken_cookie[k].substring(6);
*/

			if (broken_cookie[k].substring(0,11)=='room1value=')
			{
				roomtypename = broken_cookie[k].substring(11);
				found=false;
				i=0;
				while (i<f.roomtype1.options.length && !found)
				{
					if (f.roomtype1.options[i].value==roomtypename)
					{
						f.roomtype1.selectedIndex=i;
						found=true;
					}
					else i++;
				}
			}
			if (broken_cookie[k].substring(0,11)=='room2value=')
			{
				roomtypename = broken_cookie[k].substring(11);
				found=false;
				i=0;
				while (i<f.roomtype2.options.length && !found)
				{
					if (f.roomtype2.options[i].value==roomtypename)
					{
						f.roomtype2.selectedIndex=i;
						found=true;
					}
					else i++;
				}
			}
			if (broken_cookie[k].substring(0,11)=='room3value=')
			{
				roomtypename = broken_cookie[k].substring(11);
				found=false;
				i=0;
				while (i<f.roomtype3.options.length && !found)
				{
					if (f.roomtype3.options[i].value==roomtypename)
					{
						f.roomtype3.selectedIndex=i;
						found=true;
					}
					else i++;
				}
			}
			if (broken_cookie[k].substring(0,11)=='room4value=')
			{
				roomtypename = broken_cookie[k].substring(11);
				found=false;
				i=0;
				while (i<f.roomtype4.options.length && !found)
				{
					if (f.roomtype4.options[i].value==roomtypename)
					{
						f.roomtype4.selectedIndex=i;
						found=true;
					}
					else i++;
				}
			}
			if (broken_cookie[k].substring(0,11)=='room5value=')
			{
				roomtypename = broken_cookie[k].substring(11);
				found=false;
				i=0;
				while (i<f.roomtype5.options.length && !found)
				{
					if (f.roomtype5.options[i].value==roomtypename)
					{
						f.roomtype5.selectedIndex=i;
						found=true;
					}
					else i++;
				}
			}
			if (broken_cookie[k].substring(0,8)=='kidsage=')
			{
				f.kidsage.value = broken_cookie[k].substring(8);
			}
		}
	}
	return dateset;
}


function setCookieDatesFree()
{
	f = document.form;
	document.cookie = "sd=" + f.arrivedate.selectedIndex + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "sm=" + f.arrivedate2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "nights=" + f.nights.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
	rooms=-1;
	if (f.family1.selectedIndex>0) rooms=rooms+f.family1.selectedIndex;
	if (f.family2.selectedIndex>0) rooms=rooms+f.family2.selectedIndex;
	document.cookie = "rooms=" + rooms + "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "family1=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "family2=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";

	if (f.family1.selectedIndex>0)
	{
		if (f.family1.selectedIndex==1)
		{	
			document.cookie = "room1=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room1value=family1; domain=www.hoteldirect.co.uk; path=/;";
			if (f.family2.selectedIndex>0)
			{
				document.cookie = "room2=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room2value=family2; domain=www.hoteldirect.co.uk; path=/;";
			}
			else
			{
				document.cookie = "room2=0; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room2value=;domain=www.hoteldirect.co.uk; path=/;";
			}
		}
		else if (f.family1.selectedIndex==2)
		{	
			document.cookie = "room1=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room1value=family1; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room2=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room2value=family1; domain=www.hoteldirect.co.uk; path=/;";
			if (f.family2.selectedIndex>0)
			{
				document.cookie = "room3=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room3value=family2; domain=www.hoteldirect.co.uk; path=/;";
			}
			else
			{
				document.cookie = "room3=0; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room3value=;domain=www.hoteldirect.co.uk; path=/;";
			}

		}
		else if (f.family1.selectedIndex==3)
		{	
			document.cookie = "room1=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room1value=family1; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room2=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room2value=family1; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room3=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room3value=family1; domain=www.hoteldirect.co.uk; path=/;";
			if (f.family2.selectedIndex>0)
			{
				document.cookie = "room4=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room4value=family2; domain=www.hoteldirect.co.uk; path=/;";
			}
			else
			{
				document.cookie = "room4=0; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room4value=;domain=www.hoteldirect.co.uk; path=/;";
			}

		}
		else if (f.family1.selectedIndex==4)
		{	
			document.cookie = "room1=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room1value=family1; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room2=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room2value=family1; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room3=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room3value=family1; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room4=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room4value=family1; domain=www.hoteldirect.co.uk; path=/;";
			if (f.family2.selectedIndex>0)
			{
				document.cookie = "room5=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room5value=family2; domain=www.hoteldirect.co.uk; path=/;";
			}
			else
			{
				document.cookie = "room5=0; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room5value=;domain=www.hoteldirect.co.uk; path=/;";
			}

		}
		else if (f.family1.selectedIndex==5)
		{	
			document.cookie = "room1=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room1value=family1; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room2=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room2value=family1; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room3=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room3value=family1; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room4=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room4value=family1; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room5=" + f.family1.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room5value=family1; domain=www.hoteldirect.co.uk; path=/;";
			foundfamily1=5;
		}
	}
	else
	{
		if (f.family2.selectedIndex>0)
		{
			if (f.family2.selectedIndex==1)
			{	
				document.cookie = "room1=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room1value=family2; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room2=0; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room2value=;domain=www.hoteldirect.co.uk; path=/;";
			}
			else if (f.family2.selectedIndex==2)
			{	
				document.cookie = "room1=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room1value=family2; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room2=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room2value=family2; domain=www.hoteldirect.co.uk; path=/;";
			}
			else if (f.family2.selectedIndex==3)
			{	
				document.cookie = "room1=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room1value=family2; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room2=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room2value=family2; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room3=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room3value=family2; domain=www.hoteldirect.co.uk; path=/;";
			}
			else if (f.family2.selectedIndex==4)
			{	
				document.cookie = "room1=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room1value=family2; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room2=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room2value=family2; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room3=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room3value=family2; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room4=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room4value=family2; domain=www.hoteldirect.co.uk; path=/;";
			}
			else if (f.family2.selectedIndex==5)
			{	
				document.cookie = "room1=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room1value=family2; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room2=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room2value=family2; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room3=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room3value=family2; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room4=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room4value=family2; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room5=" + f.family2.selectedIndex+ "; domain=www.hoteldirect.co.uk; path=/;";
				document.cookie = "room5value=family2; domain=www.hoteldirect.co.uk; path=/;";
			}
		}
		else
		{
			document.cookie = "room1=0; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room1value=;domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room2=0; domain=www.hoteldirect.co.uk; path=/;";
			document.cookie = "room2value=;domain=www.hoteldirect.co.uk; path=/;";
		}
	}

	document.cookie = "kidsage=" + f.kidsage.value + "; domain=www.hoteldirect.co.uk; path=/;";

	document.cookie = "room3=0; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room4=0; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room5=0; domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room3value=;domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room4value=;domain=www.hoteldirect.co.uk; path=/;";
	document.cookie = "room5value=;domain=www.hoteldirect.co.uk; path=/;";
	/*
	roomnum = parseInt(f.family1.selectedIndex) + parseInt(f.family2.selectedIndex) - 1;
	if (roomnum > 4)
		roomnum = 4;
	document.cookie = "rooms=" + roomnum + "; domain=www.hoteldirect.co.uk; path=/;";
	maxroom = 0;
	if (f.family1.selectedIndex>0)
	{
		for (i = maxroom+1; i <= f.family1.selectedIndex; i++)
		{
			document.cookie = "room" + i + "=5" + "; domain=www.hoteldirect.co.uk; path=/;";
			maxroom = i;
		}
	}
	if ((f.family2.selectedIndex>0)&&(maxroom<5))
	{
		for (j = maxroom+1; j <= (f.family2.selectedIndex + maxroom); j++)
		{
			document.cookie = "room" + j + "=6" + "; domain=www.hoteldirect.co.uk; path=/;";
		}
	}
	*/
	document.cookie = "dateset=yes" + "; domain=www.hoteldirect.co.uk; path=/;";
}


function readCookieDatesFree()
{
	f = document.form;
	cookie = document.cookie;
	broken_cookie = cookie.split(";");
	m = broken_cookie.length;
	dateset = 0;

	for (i=0; i<m; i++)
	{
		broken_cookie[i] = trimString(broken_cookie[i]);
		if (broken_cookie[i]=='dateset=yes')
			dateset = 1;
	}
	if (dateset==1)
	{
		for (k=0; k<m; k++)
		{
			if (broken_cookie[k].substring(0,3)=='sd=')
				f.arrivedate.selectedIndex = broken_cookie[k].substring(3);
			if (broken_cookie[k].substring(0,3)=='sm=')
				f.arrivedate2.selectedIndex = broken_cookie[k].substring(3);
			if (broken_cookie[k].substring(0,7)=='nights=')
			{
				f.nights.selectedIndex = parseInt(broken_cookie[k].substring(7));
				setEndDate(f.nights.options[f.nights.selectedIndex].value);
			}
			
			/*
			if (broken_cookie[k].substring(0,8)=='family1=')
				f.family1.selectedIndex = broken_cookie[k].substring(8);
			if (broken_cookie[k].substring(0,8)=='family2=')
				f.family2.selectedIndex = broken_cookie[k].substring(8);
			*/

			if (broken_cookie[k].substring(0,11)=='room1value=')
			{
				roomtypename = broken_cookie[k].substring(11);
				found=false;
				i=0;
				while (i<6 && !found)
				{
					if (roomtypename=='family1')
					{
						f.family1.selectedIndex=i;
						found=true;
					}
					else i++;
				}
			}
			if (broken_cookie[k].substring(0,11)=='room2value=')
			{
				roomtypename = broken_cookie[k].substring(11);
				found=false;
				i=0;
				while (i<6 && !found)
				{
					if (roomtype=='family2')
					{
						f.roomtype2.selectedIndex=i;
						found=true;
					}
					else i++;
				}
			}
			

		}
	}
	return dateset;
}

function trimString(str)
{
	return str.replace(/^\s+/,"").replace(/\s+$/,"").replace(/\s+/g," ");
}

function setShowdate()
{
	f = document.form;
	url = document.URL;
	if (url.indexOf('?')>-1)
	{
	   if (url.indexOf('performance=M')>-1) f.performance.selectedIndex=0;
	   else f.performance.selectedIndex=1;
	   loaddates();

	   pos=url.indexOf('ntickets=');
	   if (pos>-1)
	   {
		   pos2=url.indexOf('&',pos+1);
		   ntickets=url.substring(pos+'ntickets='.length,pos2);
		   ntickets=ntickets-1;
		   f.ntickets.selectedIndex=ntickets;
	   }

	   pos=url.indexOf('showdate=');
	   if (pos>-1)
	   {
		   showdate=url.substring(pos+'showdate='.length);		
		   showdate=showdate.replace('%2F','/');
		   found=false;
		   i=0;
		   while (!found && i<f.showdate.length)
		   {
			if (f.showdate.options[i].value==showdate && f.showdate.options[i].text!='') 
			{
				found=true;			
				f.showdate.selectedIndex=i;
			}
			else i++;
		   }
	   }
	}	
}

function setTheatredate()
{
		f = document.form;
		now = new Date();
		showdate = f.showdate.options[f.showdate.selectedIndex].value;
		showmonth=showdate.substring(8);
		showmonth=showmonth-1;

		showday=showdate.substring(0,2);
		f.arrivedate.selectedIndex = showday;

		showmonth=showmonth-now.getMonth();
		if (showmonth<0) showmonth=0;

		f.arrivedate2.selectedIndex = showmonth;
		f.nights.selectedIndex = 0;
		setEndDate(1);
}

function populateshowinfo()
{
		f = document.form;

if (f.showid.options[f.showid.selectedIndex].value=='1667') f.theatre.value='132|`39 Steps` at Criterion Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2394') f.theatre.value='154|`After The Dance` at Lyttleton';
if (f.showid.options[f.showid.selectedIndex].value=='2329') f.theatre.value='120|`All My Sons` at Apollo Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2359') f.theatre.value='117|`All The Fun Of The Fair` at Garrick Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2331') f.theatre.value='613|`Antony and Cleopatra - Stratford Upon Avon` at Courtyard Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1459') f.theatre.value='191|`As You Like It` at Old Vic Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2334') f.theatre.value='613|`As You Like It - Stratford Upon Avon` at Courtyard Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1603') f.theatre.value='125|`Avenue Q` at Wyndham`s Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1039') f.theatre.value='116|`Bedroom Farce` at Duke of York`s';
if (f.showid.options[f.showid.selectedIndex].value=='1330') f.theatre.value='172|`Billy Elliot` at Victoria Palace';
if (f.showid.options[f.showid.selectedIndex].value=='1024') f.theatre.value='126|`Blood Brothers` at Phoenix Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2462') f.theatre.value='127|`Burn The Floor` at Shaftesbury Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1003') f.theatre.value='114|`Chicago` at Cambridge Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1597') f.theatre.value='112|`Dirty Dancing` at Aldwych Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2250') f.theatre.value='175|`Dreamboats and Petticoats` at Playhouse Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2315') f.theatre.value='128|`Enron` at Noel Coward Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2349') f.theatre.value='101|`Flamenco Sin Fronteras` at Sadlers Wells';
if (f.showid.options[f.showid.selectedIndex].value=='2411') f.theatre.value='127|`Flashdance` at Shaftesbury Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2464') f.theatre.value='116|`Ghost Stories` at Duke of York`s';
if (f.showid.options[f.showid.selectedIndex].value=='1093') f.theatre.value='131|`Grease` at Piccadilly Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2413') f.theatre.value='110|`Grumpy Old Women` at Novello Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2344') f.theatre.value='135|`Hair` at Gielgud Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2371') f.theatre.value='182|`Holding The Man` at Trafalgar Studios';
if (f.showid.options[f.showid.selectedIndex].value=='1768') f.theatre.value='156|`Jersey Boys` at Prince Edward Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2335') f.theatre.value='613|`Julius Caesar - Stratford Upon Avon` at Courtyard Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2046') f.theatre.value='613|`King Lear - Stratford Upon Avon` at Courtyard Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2404') f.theatre.value='134|`La Bete` at Comedy';
if (f.showid.options[f.showid.selectedIndex].value=='2199') f.theatre.value='119|`Legally Blonde` at Savoy Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1002') f.theatre.value='162|`Les Miserables` at Queen`s Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2465') f.theatre.value='196|`Lilies On The Land` at Arts Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2302') f.theatre.value='111|`Love Never Dies` at Adelphi Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1027') f.theatre.value='166|`Mamma Mia!` at Prince of Wales Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2353') f.theatre.value='184|`Merchants Of Bollywood` at Peacock Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2332') f.theatre.value='613|`Morte D`Arthur - Stratford Upon Avon` at Courtyard Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1031') f.theatre.value='118|`Mousetrap` at St Martins Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1083') f.theatre.value='134|`Mrs Warren`s Profession` at Comedy';
if (f.showid.options[f.showid.selectedIndex].value=='1859') f.theatre.value='123|`Oliver!` at Theatre Royal Drury Lane';
if (f.showid.options[f.showid.selectedIndex].value=='1018') f.theatre.value='161|`Phantom of the Opera` at Her Majesty`s Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1972') f.theatre.value='164|`Priscilla Queen of the Desert` at Palace Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2421') f.theatre.value='196|`Puss In Boots` at Arts Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2400') f.theatre.value='607|`Saltimbanco - Birmingham` at National Indoor Arena';
if (f.showid.options[f.showid.selectedIndex].value=='2406') f.theatre.value='609|`Saltimbanco - Newcastle` at Metro Radio Arena';
if (f.showid.options[f.showid.selectedIndex].value=='2403') f.theatre.value='147|`Saltimbanco - Wembley` at Wembley Arena';
if (f.showid.options[f.showid.selectedIndex].value=='2398') f.theatre.value='612|`Saltimbanco- Liverpool` at Echo Arena';
if (f.showid.options[f.showid.selectedIndex].value=='2399') f.theatre.value='606|`Saltimbanco-Glasgow` at SECC';
if (f.showid.options[f.showid.selectedIndex].value=='2407') f.theatre.value='608|`Saltimbanco-Manchester` at MEN Arena';
if (f.showid.options[f.showid.selectedIndex].value=='2402') f.theatre.value='610|`Saltimbanco-Nottingham` at Trent FM Arena';
if (f.showid.options[f.showid.selectedIndex].value=='2069') f.theatre.value='165|`Sister Act` at London Palladium';
if (f.showid.options[f.showid.selectedIndex].value=='1706') f.theatre.value='113|`Stomp` at The Ambassadors Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2408') f.theatre.value='146|`Strictly Come Dancing - The Professionals` at Hammersmith Apollo';
if (f.showid.options[f.showid.selectedIndex].value=='2396') f.theatre.value='133|`Sweet Charity` at Haymarket Theatre Royal';
if (f.showid.options[f.showid.selectedIndex].value=='2350') f.theatre.value='101|`Tanguera` at Sadlers Wells';
if (f.showid.options[f.showid.selectedIndex].value=='2410') f.theatre.value='110|`Tap Dogs` at Novello Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2473') f.theatre.value='136|`The Crucible` at Open Air';
if (f.showid.options[f.showid.selectedIndex].value=='2341') f.theatre.value='115|`The Fantasticks` at Duchess Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1001') f.theatre.value='199|`The Lion King` at Lyceum Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2422') f.theatre.value='181|`The Railway Children` at Waterloo Station Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2369') f.theatre.value='191|`The Real Thing` at Old Vic Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2037') f.theatre.value='191|`The Tempest` at Old Vic Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2357') f.theatre.value='154|`The White Guard` at Lyttleton';
if (f.showid.options[f.showid.selectedIndex].value=='2333') f.theatre.value='613|`The Winter`s Tale - Stratford Upon Avon` at Courtyard Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1887') f.theatre.value='165|`The Wizard Of Oz` at London Palladium';
if (f.showid.options[f.showid.selectedIndex].value=='1014') f.theatre.value='121|`The Woman in Black` at Fortune Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='2102') f.theatre.value='163|`Thriller - Live` at Lyric Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1769') f.theatre.value='129|`War Horse` at New London Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1041') f.theatre.value='139|`We Will Rock You` at Dominion Theatre';
if (f.showid.options[f.showid.selectedIndex].value=='1587') f.theatre.value='138|`Wicked` at Apollo Victoria';
if (f.showid.options[f.showid.selectedIndex].value=='2391') f.theatre.value='155|`Women Beware Women` at Olivier Theatre';



if (f.showid.options[f.showid.selectedIndex].value=='1667') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/the39steps.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2394') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/afterthedance.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2329') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/allmysonsmay2010.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2359') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/funatthefairnew.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2331') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/antonyrsc.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1459') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/asyoulikeitoldvic.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2334') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/rsclogo.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1603') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/ave-q-see-126x200-june09.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1039') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/bedroomfarce.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1330') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/billyelliot.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1024') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/bb20th.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2462') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/burnthefloor.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1003') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/chicagooct09.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1597') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/ddmarch2010.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2250') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/dap_100x150_encore1.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2315') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/enronposter.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2349') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/flamenco150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2411') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/flashdance150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2464') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/ghoststoriesmay2010.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1093') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/greasepinkjpg.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2413') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/grumpy150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2344') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/encorehair100x150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2371') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/holdingtheman100.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1768') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/jerseyboysmay2010.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2335') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/rsclogo.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2046') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/rsclogo.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2404') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/labetewhite.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2199') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/enc_100x1560px.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1002') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/lesmis25years.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2465') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/lilliesoftheland.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2302') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/lndapril2010.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1027') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/mmfeb2010new.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2353') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/bollywood.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2332') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/mortersc.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1031') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/mousetrap.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1083') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/warrenprofession.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1859') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/oliver100x150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1018') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/phantom2009.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1972') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/priscillaposter.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2421') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/pussinboots.jpg150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2400') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/saltimbanco150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2406') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/saltimbanco150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2403') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/saltimbanco150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2398') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/saltimbanco150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2399') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/saltimbanco150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2407') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/saltimbanco150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2402') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/saltimbanco150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2069') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/sisteractjan.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1706') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/encorestomp100x150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2408') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/strictlyprofessional.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2396') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/sweetcharity.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2350') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/tanguera.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2410') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/100x150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2473') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/crucibleopenair.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2341') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/fantastics150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1001') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/lk2007.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2422') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/railwaychildrenmay2010.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2369') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/therealthing.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2037') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/tempestoldvic.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2357') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/whiteguard.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2333') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/rsclogo.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1887') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/wiz-100x150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1014') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/wibapril2010.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2102') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/thriller.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1769') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/warhorse.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1041') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/wwry150.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='1587') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/apollovictoriawicked.jpg';
if (f.showid.options[f.showid.selectedIndex].value=='2391') f.theatreimage.value='http://theatre.hoteldirect.co.uk/images/RESOURCES/womenbewarewomen.jpg';


}
