var $a,$b,$c;var $d=new Object;var $e=new Object;var $f,$g;var $h;function portfolioPhoto($i,$j,$k,$l){this.filenameA=$i+'A.jpg';this.filenameB=$i+'B.jpg';this.description=$j;this.headingA=$k;this.headingB=$l;this.imgA=new Image;this.imgA.src='/images/pf/'+this.filenameA;this.imgB=new Image;this.imgB.src='/images/pf/'+this.filenameB;};function setupPhotos($m){if(!$a){$c=-1;$a=new Array();addPhoto($m,'architectural-services','Westoning','Extension, Westoning');addPhoto($m,'project-management','Bushmead','Classroom extension at Bushmead Primary School, Luton');addPhoto($m,'architectural-services','GLuton','Bungalow extension / conversion, Luton');addPhoto($m,'architectural-services','Gransden2','Extension of two dwellings in Great Gransden, conservation area');addPhoto($m,'project-management','Printers','Fire/Insurance damage repairs and internal refurbishment works, Luton');addPhoto($m,'architectural-services','Sim1','Two storey side extension, Luton');addPhoto($m,'architectural-services','SideExtLU','Two storey side extension, Luton');addPhoto($m,null,'WMK','Single Storey rear extension, Milton Keynes');addPhoto($m,'architectural-services','Gamlingay','Single Storey extension, Gamlingay');addPhoto($m,'architectural-services','Stevenage1','Domestic garden building, Stevenage','New-build pool enclosure','Internal view');addPhoto($m,null,'BiggleswadeAnnexe','Annexe to Shop, Biggleswade');addPhoto($m,'architectural-services','GransdenPlaygroup','Extension to pre-school, Great Gransden');addPhoto($m,'architectural-services','Westoning2','Extension, Westoning');addPhoto($m,'architectural-services','Dunstable','Single Storey rear extension, Dunstable');addPhoto($m,'architectural-services','StAlbans','Single Storey rear extension, St Albans');addPhoto($m,'architectural-services','InfillBedfordshire','Infill extension, Bedfordshire');addPhoto($m,null,'BLuton','Two storey side extension, Luton');addPhoto($m,'project-management','JStevenage2','Fire/Insurance Damage repairs, Stevenage');addPhoto($m,null,'GransdenBarn','Barn Conversion, Great Gransden');addPhoto($m,null,'Sandy1','Single storey front extension, Sandy');addPhoto($m,null,'Sandy2','Two storey front extension, Sandy');try{$a.sort(function(){return 0.5-Math.random()})}catch(e){};addPhoto($m,null,'Arkley-Front','Extension and Refurbishment, Arkley');addPhoto($m,null,'Arkley-Rear','Extension and Refurbishment, Arkley');$d.clock=null;$d.count=1;$e.clock=null;$e.count=1;try{$h=(document.getElementsByTagName("body")[0].innerText!=undefined)?true:false;}catch(e){}}};function addPhoto($n,$o,$i,$j,$k,$l){if((!$n&&($o!='project-management'))||($n==$o)){$c++;$a[$c]=new portfolioPhoto($i,$j,$k,$l);}};function showPortfolio($m){try{$b=0;setupPhotos($m);var el=document.getElementById('photoblock');el.innerHTML='<table border="0" cellspacing="0" cellpadding="0"><tr class="header"><td id="pbBeforeText">Before</td><td id="pbAfterText">After</td></tr><tr><td><img src="/images/pf/blank.gif" width="300" height="225" id="pbImgLeft" alt="Portfolio Image" /></td><td><img src="/images/pf/blank.gif" width="300" height="225" id="pbImgRight" alt="Portfolio Image" /></td></tr><tr><td colspan="2" id="pbText">&nbsp;</td></tr></table>';updatePortfolio();}catch(e){return false;};return true;};function setInnerText(el,$p){if($h){el.innerText=$p;}else{el.textContent=$p;}};function updatePortfolio(){try{if(!$f)$f=document.getElementById('pbImgLeft');if(!$g)$g=document.getElementById('pbImgRight');var $q=document.getElementById('pbText');var $r=document.getElementById('pbBeforeText');var $s=document.getElementById('pbAfterText');swapImage('l',$a[$b].filenameA);swapImage('r',$a[$b].filenameB);setInnerText($q,$a[$b].description);if($a[$b].headingA){setInnerText($r,$a[$b].headingA);setInnerText($s,$a[$b].headingB);}else{setInnerText($r,'Before');setInnerText($s,'After');};$b+=1;if($b>$c){$b=0;};setTimeout("updatePortfolio()",5000);}catch(e){alert(e);}};function swapImage($t,$u){crossfade($t,'/images/pf/'+$u,'2');};function crossfade(){var $v;if(arguments[0]=='l')$v=$d;else $v=$e;if($v.clock==null){if(arguments[0]=='l')$v.obj=$f;else $v.obj=$g;$v.src=arguments[1];if(typeof $v.obj.style.opacity!='undefined'){$v.type='w3c';}else if(typeof $v.obj.style.MozOpacity!='undefined'){$v.type='moz';}else if(typeof $v.obj.style.KhtmlOpacity!='undefined'){$v.type='khtml';}else if(typeof $v.obj.filters=='object'){$v.type=($v.obj.filters.length>0&&typeof $v.obj.filters.alpha=='object'&&typeof $v.obj.filters.alpha.opacity=='number')?'ie':'none';}else{$v.type='none';};if(typeof arguments[3]!='undefined'&&arguments[3]!=''){$v.obj.alt=arguments[3];};if($v.type!='none'){$v.newimg=document.getElementsByTagName('body')[0].appendChild((typeof document.createElementNS!='undefined')?document.createElementNS('http://www.w3.org/1999/xhtml','img'):document.createElement('img'));$v.newimg.className='idupe';$v.newimg.src=$v.src;$v.newimg.style.left=$v.getRealPosition($v.obj,'x')+'px';$v.newimg.style.top=$v.getRealPosition($v.obj,'y')+'px';$v.length=parseInt(arguments[2],10)*1000;$v.resolution=parseInt(arguments[2],10)*20;$v.clock=setInterval('crossfadeTmr(\'' + arguments[0] + '\')',$v.length/$v.resolution);}else{$v.obj.src=$v.src;}}};function crossfadeTmr(){var $v;if(arguments[0]=='l')$v=$d;else $v=$e;$v.count-=(1/$v.resolution);if($v.count<(1/$v.resolution)){clearInterval($v.clock);$v.clock=null;$v.count=1;$v.obj.src=$v.src;};switch($v.type){case 'ie':$v.obj.filters.alpha.opacity=$v.count*100;$v.newimg.filters.alpha.opacity=(1-$v.count)*100;break;case 'khtml':$v.obj.style.KhtmlOpacity=$v.count;$v.newimg.style.KhtmlOpacity=(1-$v.count);break;case 'moz':$v.obj.style.MozOpacity=($v.count==1?0.9999999:$v.count);$v.newimg.style.MozOpacity=(1-$v.count);break;default:$v.obj.style.opacity=($v.count==1?0.9999999:$v.count);$v.newimg.style.opacity=(1-$v.count);};$v.newimg.style.visibility='visible';$v.newimg.style.left=$v.getRealPosition($v.obj,'x')+'px';$v.newimg.style.top=$v.getRealPosition($v.obj,'y')+'px';if($v.count==1){$v.newimg.parentNode.removeChild($v.newimg);}};$d.getRealPosition=function(){this.pos=(arguments[1]=='x')?arguments[0].offsetLeft:arguments[0].offsetTop;this.tmp=arguments[0].offsetParent;while(this.tmp!=null){this.pos+=(arguments[1]=='x')?this.tmp.offsetLeft:this.tmp.offsetTop;this.tmp=this.tmp.offsetParent;};return this.pos;};$e.getRealPosition=function(){this.pos=(arguments[1]=='x')?arguments[0].offsetLeft:arguments[0].offsetTop;this.tmp=arguments[0].offsetParent;while(this.tmp!=null){this.pos+=(arguments[1]=='x')?this.tmp.offsetLeft:this.tmp.offsetTop;this.tmp=this.tmp.offsetParent;};return this.pos;};


