function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+'\n'; }
  } if (errors) alert('The following was not entered:\n\n'+errors);
  document.MM_returnValue = (errors == '');
}

function showImage(image)
{
	if(commonWindow==null||commonWindow.closed==true)
	{
    if(NS)commonWindow=window.open(image,'GB Property','resizable=yes,screenY=100,screenX=200,status=no,width=320,height=220')
    if(IE)commonWindow=window.open(image,'GB Property','resizable=yes,pageYOffset=100,pageXOffset=200,status=no,width=320,height=220')
  }
	else
	{
		commonWindow.location=image
		setTimeout("commonWindow.focus()",500)
	}
}

PositionX = 100;
PositionY = 100;

defaultWidth  = 500;
defaultHeight = 500;

var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=yes,resizable=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=yes,resizable=yes,width=700,height=700,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(700,700);');
writeln('width=document.body.clientWidth;');
writeln('height=document.body.clientHeight;');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["GBImage"].width;');writeln('window.innerHeight=document.images["GBImage"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="yes" resizable="yes" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="yes" resizable="yes" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="GBImage" src='+imageURL+' style="display:block"></body></html>');
close();

}}

function doClock(){ 
  var t=new Date(),a=doClock.arguments,str="",i,a1,lang="1";
  var month=new Array('January','Jan', 'February','Feb', 'March','Mar', 'April','Apr', 'May','May', 'June','Jun', 'July','Jul', 'August','Aug', 'September','Sep', 'October','Oct', 'November','Nov', 'December','Dec');
  var tday= new Array('Sunday','Sun','Monday','Mon', 'Tuesday','Tue', 'Wednesday','Wed','Thursday','Thr','Friday','Fri','Saturday','Sat');
  for(i=0;i<a.length;i++) {a1=a[i].charAt(1);switch (a[i].charAt(0)) {
  case "M":if  ((Number(a1)==3) && ((t.getMonth()+1)<10)) str+="0";
  str+=(Number(a1)>1)?t.getMonth()+1:month[t.getMonth()*2+Number(a1)];break;
  case "D": if ((Number(a1)==1) && (t.getDate()<10)) str+="0";str+=t.getDate();break;
  case "Y": str+=(a1=='0')?t.getFullYear():t.getFullYear().toString().substring(2);break;
  case "W":str+=tday[t.getDay()*2+Number(a1)];break; default: str+=unescape(a[i]);}}return str;
}

function ChangeImage(imgLocation)
{
var mainImage;
mainImage = window.document.getElementById("MainImage");
lblCaption = window.document.getElementById("MainImageCaption");
mainImage.src = imgLocation;
}

function MM_jumpMenu(targ,selObj,sel1bj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+sel1bj.options[sel1bj.selectedIndex].value+".html'");
  if (restore) selObj.selectedIndex=0;
}
function TimeText(objForm,selectIndex) {

if (objForm.day.selectedIndex!=-1)
{
	if (objForm.day.options[objForm.day.selectedIndex].text!='')
	{
	switch (selectIndex)
	{
	  case 0: window.document.all('ViewingText').innerHTML =objForm.day.options[objForm.day.selectedIndex].text+' '+objForm.month.options[objForm.month.selectedIndex].text+' '+objForm.year.options[objForm.year.selectedIndex].text+' Between 10.00 and 12:00'; break;
	  case 1: window.document.all('ViewingText').innerHTML =objForm.day.options[objForm.day.selectedIndex].text+' '+objForm.month.options[objForm.month.selectedIndex].text+' '+objForm.year.options[objForm.year.selectedIndex].text+' Between 12.30 and 17:00'; break;
	  case 2: window.document.all('ViewingText').innerHTML =objForm.day.options[objForm.day.selectedIndex].text+' '+objForm.month.options[objForm.month.selectedIndex].text+' '+objForm.year.options[objForm.year.selectedIndex].text+' Between 18.00 and 21:00'; break;
	  default: window.document.all('ViewingText').innerHTML ='';
	}
	objForm.YMLP4.value = window.document.all('ViewingText').innerHTML;
	}
	else
	{
	objForm.YMLP4.value = '';
	}
}
else
{
	populate(objForm,objForm.month.selectedIndex);
	window.alert('Day not selected');
}
}

function MoveinTimeText(objForm,selectIndex) {

if (objForm.moveinday.selectedIndex!=-1)
{
	if (objForm.moveinday.options[objForm.moveinday.selectedIndex].text!='')
	{
		objForm.YMLP5.value = objForm.moveinday.options[objForm.moveinday.selectedIndex].text+' '+objForm.moveinmonth.options[objForm.moveinmonth.selectedIndex].text+' '+objForm.moveinyear.options[objForm.moveinyear.selectedIndex].text;
	}
}
else
{
	populate(objForm,objForm.moveinmonth.selectedIndex);
	window.alert('Day not selected');
}
}

function populatemovein(objForm,selectIndex) {
timeA = new Date(objForm.moveinyear.options[objForm.moveinyear.selectedIndex].text, objForm.moveinmonth.options[objForm.moveinmonth.selectedIndex].value,1);
timeDifference = timeA - 86400000;
timeB = new Date(timeDifference);
var daysInMonth = timeB.getDate();
for (var i = 0; i < objForm.moveinday.length; i++) {
objForm.moveinday.options[0] = null;
}
for (var i = 0; i < daysInMonth; i++) {
objForm.moveinday.options[i] = new Option(i+1);
}
document.f1.moveinday.options[0].selected = true;
}

function populatemoveout(objForm,selectIndex) {
timeA = new Date(objForm.moveoutyear.options[objForm.moveoutyear.selectedIndex].text, objForm.moveoutmonth.options[objForm.moveoutmonth.selectedIndex].value,1);
timeDifference = timeA - 86400000;
timeB = new Date(timeDifference);
var daysInMonth = timeB.getDate();
for (var i = 0; i < objForm.moveoutday.length; i++) {
objForm.moveoutday.options[0] = null;
}
for (var i = 0; i < daysInMonth; i++) {
objForm.moveoutday.options[i] = new Option(i+1);
}
document.f1.moveoutday.options[0].selected = true;
}

function populate(objForm,selectIndex) {
timeA = new Date(objForm.year.options[objForm.year.selectedIndex].text, objForm.month.options[objForm.month.selectedIndex].value,1);
timeDifference = timeA - 86400000;
timeB = new Date(timeDifference);
var daysInMonth = timeB.getDate();
for (var i = 0; i < objForm.day.length; i++) {
objForm.day.options[0] = null;
}
for (var i = 0; i < daysInMonth; i++) {
objForm.day.options[i] = new Option(i+1);
}
document.f1.day.options[0].selected = true;
}
function getYears() {

// You can easily customize what years can be used
var years = new Array(2006,2007,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020)

for (var i = 0; i < document.f1.year.length; i++) {
document.f1.year.options[0] = null;
}
timeC = new Date();
currYear = timeC.getFullYear();
for (var i = 0; i < years.length; i++) {
document.f1.year.options[i] = new Option(years[i]);
}
document.f1.year.options[2].selected=true;
}
window.onLoad = getYears;

var imgs1 = new Array("images/f1.gif","images/f2.gif","images/f3.gif","images/f4.gif")
var lnks1 = new Array("http://www.gbproperty.co.uk/index1.html","http://www.gbproperty.co.uk/index2.html","http://www.gbproperty.co.uk/index3.html",
"http://www.gbproperty.co.uk/index4.html")
var alt1 = new Array("Image 1","Image 2","Image 3","Image 4")
var currentAd1 = 0
var imgCt1 = 4
function cycle1() {
currentAd1++
if (currentAd1 == imgCt1) {
currentAd1 = 0
}
document.adBanner1.src=imgs1[currentAd1]
document.adBanner1.alt=alt1[currentAd1]
adLink1.href=lnks1[currentAd1]
setTimeout("cycle1()",5 * 1000)
}
