var tWidth='255px';                  // width (in pixels)

var tHeight='14px';		     // font height (in pixels)

var hHeight='18px';                  // layer height (in pixels)

var tcolour='#ffffff';               // background colour:

var moStop=true;                     // pause on mouseover (true or false)

var fontfamily = 'verdana,arial,sans-serif'; // font for content

var tSpeed=2;                        // scroll speed (1 = slow, 5 = fast)



// enter your ticker content here (use \/ and \' in place of / and ' respectively)





// Simple Marquee / Ticker Script

// copyright 3rd January 2006, Stephen Chapman

// permission to use this Javascript on your web page is granted

// provided that all of the below code in this script (including this

// comment) is used without any alteration

var cps=tSpeed;

 var aw, mq;

 var fsz = parseInt(tHeight) - 4;

 /*function startticker()

{

	if (document.getElementById) 

	{

		var tick = '<div style="position:absolute;width:'+tWidth+';left:36px;border:1px solid black;margin:2px;padding-top:2px;top:295px;height:'+hHeight+';overflow:hidden;z-index:5;background-color:'+tcolour+'"';

		if (moStop) 

		{

			tick += ' onmouseover="cps=0" onmouseout="cps=tSpeed"';

			tick +='><div id="mq" style="position:absolute;left:0px;top:0px;font-family:'+fontfamily+';font-size:'+fsz+'px;white-space:nowrap;padding-top:2px;"><\/div><\/div>';

		}

		document.getElementById('ticker').innerHTML = tick;

		mq = document.getElementById("mq"); 

		mq.style.left=(parseInt(tWidth)+10)+"px";

		mq.innerHTML='<span id="tx">'+content+'<\/span>'; 

		aw = document.getElementById("tx").offsetWidth;

		lefttime=setInterval("scrollticker()",50);

	}

} */

function scrollticker()

{

	mq.style.left = (parseInt(mq.style.left)>(-10 - aw)) ?parseInt(mq.style.left)-cps+"px" : parseInt(tWidth)+10+"px";

} 

//window.onload=startticker;

function newImage(arg) {

	if (document.images) {

		rslt = new Image();

		rslt.src = arg;

		return rslt;

	}

}



function changeImages() {

	if (document.images ) {

		for (var i=0; i<changeImages.arguments.length; i+=2) {

			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];

		}

	}

}



var fadeimages1=new Array();

//SET IMAGE PATHS. Extend or contract array as needed

fadeimages1[0]=["photos/ditton.jpg", "", ""] //plain image syntax

fadeimages1[1]=["photos/dittoncopy.jpg", "", ""] //image with link syntax

 

var fadeimages2=new Array(); //2nd array set example. Remove or add more sets as needed.

//SET IMAGE PATHS. Extend or contract array as needed

fadeimages2[0]=["photos/kingston.jpg", "", ""] //plain image syntax

fadeimages2[1]=["photos/kingstoncopy.jpg", "", ""] //image with link syntax



var fadeimages3=new Array();

fadeimages3[0]=["photos/marketplace.jpg", "", ""]

fadeimages3[1]=["photos/marketplacecopy.jpg", "", ""]



var fadeimages4=new Array();

fadeimages4[0]=["photos/newmalden.jpg", "", ""]

fadeimages4[1]=["photos/newmaldencopy.jpg", "", ""]



var fadeimages5=new Array();

fadeimages5[0]=["photos/river.jpg", "", ""]

fadeimages5[1]=["photos/rivercopy.jpg", "", ""]



var fadeimages6=new Array();

fadeimages6[0]=["photos/surbiton.jpg", "", ""]

fadeimages6[1]=["photos/surbitoncopy.jpg", "", ""]



var fadeimages7=new Array();

fadeimages7[0]=["photos/teddington.jpg", "", ""]

fadeimages7[1]=["photos/teddingtoncopy.jpg", "", ""]



var fadeimages8=new Array();

fadeimages8[0]=["photos/tolworth.jpg", "", ""]

fadeimages8[1]=["photos/tolworthcopy.jpg", "", ""]



var fadeimages9=new Array();

fadeimages9[0]=["photos/worcesterpark.jpg", "", ""]

fadeimages9[1]=["photos/worcesterparkcopy.jpg", "", ""]



var fadebgcolor="white"

 

////NO need to edit beyond here/////////////

 

var fadearray=new Array() //array to cache fadeshow instances

var fadeclear=new Array() //array to cache corresponding clearinterval pointers

 

var dom=(document.getElementById) //modern dom browsers

var iebrowser=document.all

 

function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){

sD = document.getElementById("centerdiv");

sD.style.display="block";

this.pausecheck=pause

this.mouseovercheck=0

this.delay=delay

this.degree=10 //initial opacity degree (10%)

this.curimageindex=0

this.nextimageindex=1

fadearray[fadearray.length]=this

this.slideshowid=fadearray.length-1

this.canvasbase="canvas"+this.slideshowid

this.curcanvas=this.canvasbase+"_0"

if (typeof displayorder!="undefined")

theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)

this.theimages=theimages

this.imageborder=parseInt(borderwidth)

this.postimages=new Array() //preload images

for (p=0;p<theimages.length;p++){

this.postimages[p]=new Image()

this.postimages[p].src=theimages[p][0]

}

 

var fadewidth=fadewidth+this.imageborder*2

var fadeheight=fadeheight+this.imageborder*2

 

if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)

document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;background-color:'+fadebgcolor+'"></div></div>')

else

document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')

 

if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox

this.startit()

else{

this.curimageindex++

setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)

}

}



function fadepic(obj){

if (obj.degree<100){

obj.degree+=10

if (obj.tempobj.filters&&obj.tempobj.filters[0]){

if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+

obj.tempobj.filters[0].opacity=obj.degree

else //else if IE5.5-

obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"

}

else if (obj.tempobj.style.MozOpacity)

obj.tempobj.style.MozOpacity=obj.degree/101

else if (obj.tempobj.style.KhtmlOpacity)

obj.tempobj.style.KhtmlOpacity=obj.degree/100

}

else{

clearInterval(fadeclear[obj.slideshowid])

obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"

obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)

obj.populateslide(obj.tempobj, obj.nextimageindex)

obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0

setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)

}

}

 

fadeshow.prototype.populateslide=function(picobj, picindex){

var slideHTML=""

if (this.theimages[picindex][1]!="") //if associated link exists for image

slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'

slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'

if (this.theimages[picindex][1]!="") //if associated link exists for image

slideHTML+='</a>'

picobj.innerHTML=slideHTML

}

 

 

fadeshow.prototype.rotateimage=function(){

if (this.pausecheck==1) //if pause onMouseover enabled, cache object

var cacheobj=this

if (this.mouseovercheck==1)

setTimeout(function(){cacheobj.rotateimage()}, 100)

else if (iebrowser&&dom||dom){

this.resetit()

var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)

crossobj.style.zIndex++

fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)

this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"

}

else{

var ns4imgobj=document.images['defaultslide'+this.slideshowid]

ns4imgobj.src=this.postimages[this.curimageindex].src

}

this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0

}

 

fadeshow.prototype.resetit=function(){

this.degree=10

var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)

if (crossobj.filters&&crossobj.filters[0]){

if (typeof crossobj.filters[0].opacity=="number") //if IE6+

crossobj.filters(0).opacity=this.degree

else //else if IE5.5-

crossobj.style.filter="alpha(opacity="+this.degree+")"

}

else if (crossobj.style.MozOpacity)

crossobj.style.MozOpacity=this.degree/101

else if (crossobj.style.KhtmlOpacity)

crossobj.style.KhtmlOpacity=obj.degree/100

}

 

 

fadeshow.prototype.startit=function(){

var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)

this.populateslide(crossobj, this.curimageindex)

if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER

var cacheobj=this

var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)

crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}

crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}

}

this.rotateimage()

}

 

function lib_bwcheck(){ //Browsercheck (needed)

	this.ver=navigator.appVersion

	this.agent=navigator.userAgent

	this.dom=document.getElementById?1:0

	this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0

	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 

	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;

	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;

	this.ie=this.ie4||this.ie5||this.ie6

	this.mac=this.agent.indexOf("Mac")>-1

	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 

	this.ns4=(document.layers && !this.dom)?1:0;

	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)

	return this

}

var bw=lib_bwcheck()



function bookmark(strPage,strTitle)

{

	if (window.sidebar) 

	{ 

		window.sidebar.addPanel(strTitle, strPage,"");	

	} 

	else if( window.external ) 

	{

		window.external.AddFavorite(strPage, strTitle); 

	}	

	else if(window.opera && window.print) 

	{ 

		return true; 

	}

}

function validateVL()

{

	strForm = document.forms[0];

	blError = false;

	strError = 'You have not filled in the following fields:\n';

	if (strForm.valuationfirst.value == "")

	{

		blError = true;

		strError += 'First Name\n';

	}

	if (strForm.valuationlast.value == "")

	{

		blError = true;

		strError += 'Surname\n';

	}

	if (strForm.valuationaddress1.value == "")

	{

		blError = true;

		strError += 'Address - line 1\n';

	}

	if (strForm.valuationaddress2.value == "")

	{

		blError = true;

		strError += 'Address - line 2\n';

	}

	if (strForm.valuationcounty.value == "")

	{

		blError = true;

		strError += 'County\n';

	}

	if (strForm.valuationpostcode.value == "")

	{

		blError = true;

		strError += 'Postcode\n';

	}

	if (strForm.valuationemail.value == "")

	{

		blError = true;

		strError += 'Email\n';

	}

	if (blError == true)

	{

		alert(strError);

	}

	else

	{

		strForm.submit();

	}

}

function validateVW()

{

	strForm = document.forms[0];

	blError = false;

	strError = 'You have not filled in the following fields:\n';

	if (strForm.first.value == "")

	{

		blError = true;

		strError += 'First Name\n';

	}

	if (strForm.last.value == "")

	{

		blError = true;

		strError += 'Surname\n';

	}

	if (strForm.tel.value == "")

	{

		blError = true;

		strError += 'Telephone No.\n';

	}

	if (strForm.email.value == "")

	{

		blError = true;

		strError += 'Email\n';

	}



	if (blError == true)

	{

		alert(strError);

	}

	else

	{

		strForm.submit();

	}

}

function validateIN()

{

	strForm = document.forms[0];

	blError = false;

	strError = 'You have not filled in the following fields:\n';

	if (strForm.investmentfirst.value == "")

	{

		blError = true;

		strError += 'First Name\n';

	}

	if (strForm.investmentlast.value == "")

	{

		blError = true;

		strError += 'Surname\n';

	}

	if (strForm.investmentaddress1.value == "")

	{

		blError = true;

		strError += 'Address - line 1\n';

	}

	if (strForm.investmentaddress2.value == "")

	{

		blError = true;

		strError += 'Address - line 2\n';

	}

	if (strForm.investmentcounty.value == "")

	{

		blError = true;

		strError += 'County\n';

	}

	if (strForm.investmentpostcode.value == "")

	{

		blError = true;

		strError += 'Postcode\n';

	}

	if (strForm.investmentemail.value == "")

	{

		blError = true;

		strError += 'Email\n';

	}

	if (blError == true)

	{

		alert(strError);

	}

	else

	{

		strForm.submit();

	}

}

function chgIm(strNew)

{

	strDiv = document.getElementById("propPhoto");

	strHTML = '<img src="photos/'+strNew+'" style="border:1px solid #626262;">';

	strDiv.innerHTML = strHTML;

}

function chSearch(strID)

{
	for (i=0;i<6;i++)

	{

		strDiv = document.getElementById('fil'+i);

		strDiv.style.display = 'none';

	}

	strDiv = document.getElementById(strID);

	strDiv.style.display = 'block';
	
	if(strID == 'fil5')
	{
		document.search_form.action = 'property-search-buy.php';
	}

	if(strID == 'fil4')
	{
		document.search_form.action = 'property-search.php';
	}


}

var ifcount = Math.floor(Math.random()*9);

ifcount += 1;

fadeimages = eval('fadeimages'+ifcount);

//my functions afzaal
function isEmail (theStr) 
{
	var atIndex = theStr.indexOf('@');
	var dotIndex = theStr.indexOf('.', atIndex);
	var flag = true;
	theSub = theStr.substring(0, dotIndex+1)
	if ((atIndex < 1)||(atIndex != theStr.lastIndexOf('@'))||(dotIndex < atIndex + 2)||(theStr.length <= theSub.length)) 
	{	 
		flag = false; 
	}
	else 
	{ 
		flag = true; 
	}
	return(flag);
}