var xmlHttp

function showCustomer(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="ajaxretrieve.php"
url=url+"?q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
} 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
//Tool Tips
function gettip(txt)
{
document.getElementById('tip').innerHTML=txt
}

function reset()
{
document.getElementById('tip').innerHTML=""
}

//change picture to photograph
function change_picture()
{
var contr = document.getElementById("picture");
var span = document.getElementById("pict");
var pict = document.createElement("img");
pict.setAttribute("id","pict");
pict.setAttribute("src","./images/cottagephoto.jpg");
pict.setAttribute("width","380");
pict.setAttribute("height","190");
contr.replaceChild(pict,span);
}
// change photograph back to drawing
function change_picture_back()
{
var contr = document.getElementById("picture");
var span = document.getElementById("pict");
var pict = document.createElement("img");
pict.setAttribute("id","pict");
pict.setAttribute("src","./images/cottage.jpg");
pict.setAttribute("width","380");
pict.setAttribute("height","190");
contr.replaceChild(pict,span);
}

function insert_picture1()
{
var contr = document.getElementById("rightcolumn");
var span01 = document.getElementById("span1");
var pict01 = document.createElement("img");
pict01.setAttribute("id","p01");
pict01.setAttribute("src","./images/dairykitchen.jpg");
pict01.setAttribute("width","325");
pict01.setAttribute("height","240");
contr.replaceChild(pict01,span01);
} 
function replace_text_picture1(){
var contr = document.getElementById("rightcolumn"); 
var pict01 = document.getElementById("p01");
var span01 = document.createElement("span");
span01.setAttribute("id","span1");
var text = document.createTextNode("Conditions of Hire");
var head = document.createElement("h3");
head.appendChild(text);
span01.appendChild(head);
text = document.createTextNode("Lettings are for a minimum of 3 nights.");
var list = document.createElement("ol");
var list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Electricity and Gas are included.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Linen and towels are provided.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Pets by prior arrangement at an extra charge.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Breakages or damage must be reported to Mrs Waugh and paid for accordingly.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("The Hirer is expected to leave the Cottage and it's contents reasonably clean and tidy.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("The Hirer is responsible for the property and is expected to take all reasonable care of it.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Bookings & Cancellations must be in writing.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("For bookings made more than 6 weeks before arrival, a 30% deposit is payable on booking,\
 the balance being due 6 weeks before arrival. For bookings made 6 weeks or less before arrival, the full amount is required.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
span01.appendChild(list);
contr.replaceChild(span01,pict01);
}

function insert_picture2()
{
var contr = document.getElementById("righttext");
var span01 = document.getElementById("span2");
var pict01 = document.createElement("img");
pict01.setAttribute("id","p02");
pict01.setAttribute("src","./images/dairybedtwin.jpg");
pict01.setAttribute("width","330");
pict01.setAttribute("height","195");
contr.replaceChild(pict01,span01);
} 

function replace_text_picture2()
{
var contr = document.getElementById("righttext"); 
var pict = document.getElementById("p02");
var span = document.createElement("span");
span.setAttribute("id","span2");
var text = document.createTextNode("An area rich in history and scenic beauty with attractions of: Petworth House\
 1.5 miles, Goodwood Racecourse, Weald Open Air Museum, Chichester Festival Theatre & Harbour, Arundel Castle all\
 within 12 miles. Parham House and Garden and Polo at Midhurst both 9 miles. Fishbourne Roman Palace 14 miles,\
 Guildford 19 miles. Local Golf course. Ballooning, Riding and Fishing locally by arrangement. Coast, harbour and\
 beach 15 miles.");
 var text1 = document.createTextNode("Located Near Petworth");
 var heading = document.createElement("h4");
 heading.appendChild(text1);
var head = document.createElement("p");
head.appendChild(text);
span.appendChild(heading);
span.appendChild(text);
contr.replaceChild(span,pict);
}
function insert_picture3()
{
//alert("this works");
var contr = document.getElementById("leftcolumn");
var span03 = document.getElementById("span3");
var pict03 = document.createElement("img");
pict03.setAttribute("id","p03");
pict03.setAttribute("src","./images/dairysitroom.jpg");
pict03.setAttribute("width","250");
pict03.setAttribute("height","220");
contr.replaceChild(pict03,span03);
} 


function replace_text_picture3()
{
var contr = document.getElementById("leftcolumn"); 
var pict = document.getElementById("p03");
var span = document.createElement("span");
span.setAttribute("id","span3");
var text = document.createTextNode("Facilities");
var head = document.createElement("h3");
head.appendChild(text);
span.appendChild(head);
text = document.createTextNode("Sleeps 4 plus cot.");
var list = document.createElement("ul");
var list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("1 Double & 1 Twin Bedroom.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Open Plan Livingroom & Kitchen.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Colour TV & CD Music Center.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("DVD Player.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Electric Hob, Fan Oven, Microwave.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Washing Machine.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Dishwasher.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Spacious Bathroom.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Central Heating.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Ample Parking.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Telephone +44(1798) 342900 (incoming calls only)");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
text = document.createTextNode("Patio with Barbecue.");
list1 = document.createElement("li");
list1.appendChild(text);
list.appendChild(list1);
span.appendChild(list);
contr.replaceChild(span,pict);
}
function insert_picture4()
{
var contr = document.getElementById("lefttext");
var span = document.getElementById("span4");
var pict = document.createElement("img");
pict.setAttribute("id","p04");
pict.setAttribute("src","./images/dairybed1.jpg");
pict.setAttribute("width","250");
pict.setAttribute("height","195");
contr.replaceChild(pict,span);
} 

function replace_text_picture4()
{
var contr = document.getElementById("lefttext"); 
var pict = document.getElementById("p04");
var span = document.createElement("span");
span.setAttribute("id","span4");
var text = document.createTextNode("A beautiful conversion of a former byre forming part of an 18th Century farm\
 yard in a rural setting adjacent to the river Rother. The Old Dairy is tastefully decorated and attractively\
 furnished giving an air of spaciousness and charm, with fine views across farm land towards Petworth.");
var text1 = document.createTextNode("Self-Catering Holiday Cottage");
 var heading = document.createElement("h4");
 heading.appendChild(text1);
var head = document.createElement("p");
head.appendChild(text);
span.appendChild(heading);
span.appendChild(head);
contr.replaceChild(span,pict);
}



function insert_pictures(){
change_picture();
insert_picture1();
insert_picture2();
insert_picture3();
insert_picture4();
}

function replace_text_pictures(){
change_picture_back();
replace_text_picture1();
replace_text_picture2();
replace_text_picture3();
replace_text_picture4();
}

