function ShowForSaleItems(){var retval=false;var alt=false;var showSold="";var altClass="";var output="";$("#forSaleList").html("");$(document).ready(function($){$.ajax({type:"GET",url:"./forsale/photos.xml",dataType:"xml",cache:false,success:function(xml){var gotPhotos=false;if($.browser.msie){if(xml.childNodes[1].childNodes.length>0){$('#forSaleText').show();output+="<table id=\"tblForSale\">";if(xml.childNodes[1].childNodes!=undefined){$(xml.childNodes[1].childNodes).each(function(){if(this.attributes!=null){if(this.attributes["name"]==undefined){var photoName=this.attributes[0].nodeValue;var photoSold=this.attributes[1].nodeValue;var photoDesc=this.childNodes[0].text;var photoPrice=this.childNodes[1].text}else{var photoName=this.attributes["name"].nodeValue;var photoSold=this.attributes["sold"].nodeValue;var photoDesc=this.childNodes[1].textContent;var photoPrice=this.childNodes[3].textContent}if(photoSold=="true")showSold=" <div class=\"forSaleSold\">S o l d</div>";else showSold="&pound;"+photoPrice;if(alt)altClass=" forSaleAltRow";else altClass="";alt=!alt;output+="<tr><td class=\"forSalePhotoCell"+altClass+"\"><a class=\"forSaleLink\" href=\"forsale/"+photoName+"\">";output+="<img class=\"forSalePhoto"+altClass+"\" src=\"forsale/"+photoName+"\" /></a></td>";output+="<td class=\"forSaleDesc"+altClass+"\">"+photoDesc+"</td>";output+="</td><td class=\"forSalePrice"+altClass+"\">"+showSold+"</td></tr>"}})}else{$(xml.childNodes[1].childNodes).each(function(){if(this.attributes!=null){var photoName=this.attributes[0].nodeValue;var photoSold=this.attributes[1].nodeValue;var photoDesc=this.childNodes[0].text;var photoPrice=this.childNodes[1].text;if(photoSold=="true")showSold=" <div class=\"forSaleSold\">S o l d</div>";else showSold="&pound;"+photoPrice;if(alt)altClass=" forSaleAltRow";else altClass="";alt=!alt;output+="<tr><td class=\"forSalePhotoCell"+altClass+"\"><a class=\"forSaleLink\" href=\"forsale/"+photoName+"\">";output+="<img class=\"forSalePhoto"+altClass+"\" src=\"forsale/"+photoName+"\" /></a></td>";output+="<td class=\"forSaleDesc"+altClass+"\">"+photoDesc+"</td>";output+="</td><td class=\"forSalePrice"+altClass+"\">"+showSold+"</td></tr>"}})}output+="</table>";$("#forSaleList").html(output);$("a.forSaleLink").fancybox({'transitionIn':'elastic','transitionOut':'elastic','speedIn':600,'speedOut':200,'overlayShow':true,'hideOnContentClick':true})}else{$('#forSaleText').hide();showPage('Home')}}else{if(xml.childNodes[0].childNodes.length>1){$('#forSaleText').show();$("<table id='tblForSale'>").appendTo('#forSaleList');$(xml.childNodes[0].childNodes).each(function(){if(this.attributes!=null){if($.browser.msie){var photoName=this.attributes[1].nodeValue;var photoSold=this.attributes[0].nodeValue;var photoDesc=this.childNodes[1].textContent;var photoPrice=this.childNodes[3].textContent}else{var photoName=this.attributes[0].nodeValue;var photoSold=this.attributes[1].nodeValue;var photoDesc=this.childNodes[1].textContent;var photoPrice=this.childNodes[3].textContent}if(photoSold=="true")showSold=" <div class=\"forSaleSold\">S o l d</div>";else showSold="&pound;"+photoPrice;if(alt)altClass=" forSaleAltRow";else altClass="";alt=!alt;$('<tr><td class="forSalePhotoCell'+altClass+'"><a class="forSaleLink" href="forsale/'+photoName+'"><img class="forSalePhoto'+altClass+'" src="forsale/'+photoName+'" /></a></td><td class="forSaleDesc'+altClass+'">'+photoDesc+'</td><td class="forSalePrice'+altClass+'">'+showSold+'</td></tr>').appendTo('#tblForSale')}});$("a.forSaleLink").fancybox({'transitionIn':'elastic','transitionOut':'elastic','speedIn':600,'speedOut':200,'overlayShow':true,'hideOnContentClick':true})}else{$('#forSaleText').hide();showPage('Home')}}},error:function(){$('#forSaleText').hide();showPage('Home')}})});return retval}function showPage(pageToShow){var pageToHide='';$('#menus div').removeClass('menuSelected');if(pageToShow!='ForSale')$('#divMnu'+pageToShow).addClass('menuSelected');if($('#pageHome').is(':visible'))pageToHide='Home';else if($('#pageServices').is(':visible'))pageToHide='Services';else if($('#pageGallery').is(':visible'))pageToHide='Gallery';else if($('#pageHistory').is(':visible'))pageToHide='History';else if($('#pageExclusive').is(':visible'))pageToHide='Exclusive';else if($('#pageTestimonials').is(':visible'))pageToHide='Testimonials';else if($('#pageContact').is(':visible'))pageToHide='Contact';else if($('#pageForSale').is(':visible'))pageToHide='ForSale';else return;if(pageToHide==pageToShow)return;if(pageToShow=='Contact')$('#page'+pageToHide).fadeOut('fast',function(){$('#page'+pageToShow).fadeIn('slow');getMap()});else $('#page'+pageToHide).fadeOut('fast',function(){$('#page'+pageToShow).fadeIn('slow')})}function getMap(){var latlng=new google.maps.LatLng(51.043728,-0.260754),myOptions={zoom:12,center:latlng,mapTypeId:google.maps.MapTypeId.ROADMAP},map=new google.maps.Map(document.getElementById("map_canvas"),myOptions),marker=new google.maps.Marker({position:latlng,map:map,title:"Heritage Upholstery"}),infowindow=new google.maps.InfoWindow({content:"<h3>Heritage Upholstery</h3>Feel free to come and see us.<br />...just call to ensure we are there."});infowindow.open(map,marker);google.maps.event.addListener(marker,'click',function(){infowindow.open(map,marker)})}function LoadForSalePage(){showPage('ForSale');ShowForSaleItems()}$(document).ready(function($){if((navigator.userAgent.toLowerCase().indexOf('msie 6')!=-1)||(navigator.userAgent.toLowerCase().indexOf('msie 7')!=-1)){$('#page').hide();$('#ie6').show();return}ShowForSaleItems();slideShow(6000);$("a#lnkExclusivePriceList").fancybox();$("a#exclusivePriceList").fancybox({'hideOnContentClick':true});$('#thumbs').galleriffic({numThumbs:15,preloadAhead:15,enableTopPager:false,enableBottomPager:true,imageContainerSel:'#slideshow',controlsContainerSel:'#controls',captionContainerSel:'#caption',loadingContainerSel:'#loading',enableHistory:false});var gallery1=$('#thumbs1').galleriffic({numThumbs:10,preloadAhead:10,enableTopPager:false,enableBottomPager:false,imageContainerSel:'#slideshow1',controlsContainerSel:'#controls1',captionContainerSel:'#caption1',loadingContainerSel:'#loading1',enableHistory:false,renderNavControls:true,renderSSControls:true,onPageTransitionOut:function(callback){this.fadeTo('fast',0.0,callback)},onPageTransitionIn:function(){var prevPageLink=this.find('a.prev').css({'visibility':'hidden','height':'100%'}),nextPageLink=this.find('a.next').css({'visibility':'hidden','height':'100%'}),lastPage=0;if(this.displayedPage>0)prevPageLink.css('visibility','visible');lastPage=this.getNumPages()-1;if(this.displayedPage<lastPage)nextPageLink.css('visibility','visible');this.fadeTo('fast',1.0)}});$('div.navigation').css({'width':'455px','float':'left','min-width':'455px','position':'absolute'});$('div.content').css('display','block');$('div.navigation1').css({'width':'912px','margin-left':'25px','margin-top':'20px','height':'85px','border':'solid 1px #B1B1BF'});$('div.gallery1').css({'width':'100%','padding-left':'30px'});$('div.content1').css({'width':'100%','height':'400px'});$('div.content1 #thumbs1').css({'background-color':'#363636','bottom':'0px','clear':'both'});$('div.content1 #thumbs1 ul.thumbs').css({'float':'left','clear':'none'});$('div.slideshow1-container').css({'width':'100%','height':'400px'});$('#caption1').css({'width':'100%','float':'left','height':'10px'});$('#thumbs1').addClass('roundbox');$('#slideshow1 span').css({'width':'100%','border':'solid 1px red'});$('#gallery div.caption').css({'width':'500px','margin-top':'38px'});gallery1.find('a.prev').click(function(e){gallery1.previousPage();e.preventDefault()});gallery1.find('a.next').click(function(e){gallery1.nextPage();e.preventDefault()})});function showExclusivePrices(){$('#thumbs').lightBox()}
