addthis_brand="P2 Design";var GLOBALAllImages="1##2##3##4##5##6##7##7##8##9##http://www.pco.co.uk/p2/imagefadertop.htm,Web,no,block";var GLOBALButtonLabels="Hello##Design##Ideas<span style='font-size:75%; position:absolute; top:-7px; left:35px; letter-spacing:0px; color:#ff0000;'>New</span>##Money##Examples##Technical##Code##Jobs##About Us##Copy##Gallery"; function Build(){var ToLoad=GLOBALAllImages.split("##");var ButtonLabels=GLOBALButtonLabels.split("##");var theDivs=new Array;var Total=0;for(x=0;x<ToLoad.length;x++){var Label=ButtonLabels[x];if(Label=="")Label=x+1;theDivs.push('<a href="index.htm?Web%20Design='+Label.replace(/<[^>]*>New<\/span>/ig,"")+'" onclick="return false"><div class="bottombutton" onclick="Open(this,\'Button'+(x+1)+"','"+ToLoad[x]+'\')" onmouseover="ExpandButton(this)" onmouseout="ContractButton(this)" id="Button'+(x+1)+'" style="right:-'+ 64*x+'px; top:0px; width:60px; height:60px; position:absolute; background-image:url(images/P2SmallButtonLogo.png); background-position:4px 4px; background-repeat:no-repeat;"><div class="ButtonText">'+Label+"</div></div></a>");Total=64*x}theDivs.push('<a href="index.htm?Web%20Design=Contact Us" onclick="return false"><div class="bottombutton" onclick="Open(this,\'Button'+(ToLoad.length+1)+'\',\'Contact\')" onmouseover="ExpandButton(this)" onmouseout="ContractButton(this)" style="right:-'+(Total+ 114)+'px; top:0px; width:60px; height:60px; position:absolute; width:110px; background-image:url(images/P2SmallButtonLogo.png); background-position:4px 4px; background-repeat:no-repeat;" id="Button'+(ToLoad.length+1)+'"><div class="ButtonText" style="width:100%">Contact Us</div></div></a>');var HowWideButtons=ToLoad.length/2*64-6;document.getElementById("Buttons").style.right=HowWideButtons+"px";document.getElementById("Buttons").innerHTML=theDivs.join("");LoadMap();PressTheRightButton();StartMovingImage()} function StartMovingImage(){var Pos=document.getElementById("P2Logo").style.backgroundPosition;var T=Pos.split(" ");var yPos=parseInt(T[1]);document.getElementById("P2Logo").style.backgroundPosition="0px "+(yPos-1)+"px";setTimeout("StartMovingImage()",50)} function PressTheRightButton(){var x=location.search;var loc=x.replace(/^\?Web[%0-9]*Design=/i,"");var Pressed=false;var HowMany=document.getElementById("Buttons").childNodes.length;for(x=0;x<HowMany;x++)if(document.getElementById("Buttons").childNodes[x].childNodes[0].childNodes[0].innerHTML==loc){document.getElementById("Buttons").childNodes[x].childNodes[0].onclick();Pressed=true;break}}function DoNothing(){return""} function Initialise(){var HowMany=document.getElementById("Buttons").childNodes.length;var Pressed=false;for(x=0;x<HowMany;x++)if(document.getElementById("Buttons").childNodes[x].childNodes[0].style.backgroundColor=="#ffffff"||document.getElementById("Buttons").childNodes[x].childNodes[0].style.backgroundColor=="rgb(255, 255, 255)")DoNothing();else{Pressed=true;break}if(Pressed==false)document.getElementById("Buttons").childNodes[0].childNodes[0].onclick()}var GLOBALLoaded=false; function LoadMap(){map=new VEMap("theMap");map.LoadMap();map.SetZoomLevel(13);PanMap(null,null,new VELatLong(52.271578,0.68801));AddPin();GLOBALLoaded=true;document.getElementById("HistoryIframe").src="history/whitehistory.htm?layer=Nothing&webaddress=1&WhatToDo=Close"} function ExpandButton(obj){var Top=obj.style.top;var Width=obj.style.width;var Height=obj.style.height;var Right=obj.style.right;obj.childNodes[0].className="ButtonTextOver";obj.style.right=parseInt(Right)-4+"px";obj.style.top=parseInt(Top)-4+"px";obj.style.width=parseInt(Width)+8+"px";obj.style.height=parseInt(Height)+8+"px";if(obj.style.backgroundColor=="rgb(255, 204, 0)"||obj.style.backgroundColor=="#ffcc00")DoNothing();else obj.style.backgroundColor="#ff9900";obj.style.zIndex=10} function ContractButton(obj){var Top=obj.style.top;var Width=obj.style.width;var Height=obj.style.height;var Right=obj.style.right;obj.childNodes[0].className="ButtonText";obj.style.right=parseInt(Right)+4+"px";obj.style.top=parseInt(Top)+4+"px";obj.style.width=parseInt(Width)-8+"px";obj.style.height=parseInt(Height)-8+"px";if(obj.style.backgroundColor=="rgb(255, 204, 0)"||obj.style.backgroundColor=="#ffcc00")DoNothing();else obj.style.backgroundColor="";obj.style.zIndex=1}var GLOBALOK=true; var GLOBALBusy=false;function Open(obj,Layer,WebAddress){if(GLOBALLoaded==true&&GLOBALOK==true){GLOBALOK=false;var ID=obj.id;var OpenOrClose="Open";var TheLayer=Layer.replace(/^Button/,"Display");if(parseInt(document.getElementById(TheLayer).style.left)==0)OpenOrClose="Close";document.getElementById("HistoryIframe").src="history/whitehistory.htm?layer="+Layer+"&webaddress="+WebAddress+"&WhatToDo="+OpenOrClose}} function OpenFromIframe(obj,Layer,WebAddress){if(GLOBALBusy==false)OpenFromIframeOK(obj,Layer,WebAddress)} function OpenFromIframeOK(Data){if(GLOBALBusy==false)GLOBALBusy=true;var Info=Data.split("&");var TheLayerID=Info[0].replace(/^Button/,"Display");CheckLayersAlreadyOpen();if(document.getElementById(TheLayerID)!=null)if(Info[1].match(/^webaddress=http/)!=null)if(document.getElementById(TheLayerID).style.left=="51%"){var M=Info[1].split(",");document.getElementById(TheLayerID).innerHTML='<iframe scrolling="'+M[2]+'" frameborder="0" style="position:absolute; overflow:hidden; height:100%; width:100%;" src="'+ M[0].replace(/^webaddress=/,"")+'" allowTransparency="true"></iframe>';document.getElementById(TheLayerID).style.zIndex="10";OpenLayer(TheLayerID,"Open");HighLightButton(TheLayerID);document.getElementById("Box").style.display="none";HideFaceLayer()}else{OpenLayer(TheLayerID,"Close");HighLightButton("Nothing");document.getElementById("Box").style.display="block"}else if(document.getElementById(TheLayerID).style.left=="51%"){document.getElementById(TheLayerID).style.zIndex="10";OpenLayer(TheLayerID, "Open");document.getElementById(TheLayerID).style.border="1px dotted #d3e4f2";HighLightButton(TheLayerID);document.getElementById("Box").style.display="none";HideFaceLayer()}else{OpenLayer(TheLayerID,"Close");TurnOffScrollBars(TheLayerID);HighLightButton("Nothing");document.getElementById("Box").style.display="block"}else{GLOBALBusy=false;HighLightButton("Nothing");document.getElementById("Box").style.display="block";ChangeOpac1(0,"FaceFrame")}} function HighLightButton(Layer){var HowMany=document.getElementById("Buttons").childNodes.length;for(x=0;x<HowMany;x++){document.getElementById("Buttons").childNodes[x].childNodes[0].style.backgroundColor="#ffffff";document.getElementById("Buttons").childNodes[x].childNodes[0].style.border="1px solid #d3e4f2";document.getElementById("Buttons").childNodes[x].childNodes[0].childNodes[0].style.color="";document.getElementById("ClickMessage").innerHTML=""}if(Layer!=null){var TheLayer=Layer.replace(/^Display/, "Button");if(document.getElementById(TheLayer)!=null)document.getElementById(TheLayer).style.backgroundColor="#ffcc00";if(document.getElementById(TheLayer)!=null)document.getElementById(TheLayer).style.border="1px solid #000000";if(document.getElementById(TheLayer)!=null)document.getElementById(TheLayer).childNodes[0].style.color="#000000";document.getElementById("ClickMessage").innerHTML=""}var counter=0;for(y=0;y<HowMany;y++)if(document.getElementById("Buttons").childNodes[y].childNodes[0].style.backgroundColor== "#ffcc00"||document.getElementById("Buttons").childNodes[y].childNodes[0].style.backgroundColor=="rgb(255, 204, 0)");else counter++;if(counter==HowMany)setTimeout("ShowFaceLayer()",200)}function TurnOffScrollBars(Layer){if(document.getElementById(Layer).childNodes[0]!=null&&document.getElementById(Layer).childNodes[0].style!=null){document.getElementById(Layer).childNodes[0].style.overflowY="hidden";document.getElementById(Layer).childNodes[0].style.overflowX="hidden"}} function CheckLayersAlreadyOpen(){var HowMany=document.getElementById("DisplayLayers").childNodes.length;for(x=0;x<HowMany;x++){var ID=document.getElementById("DisplayLayers").childNodes[x].id;if(document.getElementById("DisplayLayers").childNodes[x].style!=null&&parseInt(document.getElementById("DisplayLayers").childNodes[x].style.left)<50){TurnOffScrollBars(ID);document.getElementById(ID).style.zIndex="1";setTimeout("OpenLayer('"+ID+"','Close')",20)}}} function OpenLayer(Layer,OpenClose){var TheLayer=Layer.replace(/^Button/,"Display");if(OpenClose=="Open"){document.getElementById(TheLayer).style.left=parseInt(document.getElementById(TheLayer).style.left)-5+"%";document.getElementById(TheLayer).style.right=parseInt(document.getElementById(TheLayer).style.right)-5+"%";if(parseInt(document.getElementById(TheLayer).style.left)>0)setTimeout("OpenLayer('"+TheLayer+"','"+OpenClose+"')",20);else{document.getElementById(TheLayer).style.left="0%";document.getElementById(TheLayer).style.right= "0%";if(document.getElementById(TheLayer).childNodes[0]!=null&&document.getElementById(TheLayer).childNodes[0].style!=null&&document.getElementById(TheLayer).innerHTML.match(/<iframe/i)==null&&TheLayer!="Display12"){document.getElementById(TheLayer).childNodes[0].style.overflowY="auto";document.getElementById(TheLayer).childNodes[0].style.overflowX="hidden";document.getElementById(TheLayer).childNodes[0].scrollTop=0;document.getElementById(TheLayer).innerHTML=document.getElementById(TheLayer).innerHTML}if(TheLayer== "Display12"){AdjustMap();if(document.getElementById(TheLayer).childNodes[0]!=null&&document.getElementById(TheLayer).childNodes[0].style!=null)document.getElementById(TheLayer).childNodes[0].style.overflow="hidden"}GLOBALOK=true;GLOBALBusy=false}}else{document.getElementById(TheLayer).style.left=parseInt(document.getElementById(TheLayer).style.left)+5+"%";document.getElementById(TheLayer).style.right=parseInt(document.getElementById(TheLayer).style.right)+5+"%";if(parseInt(document.getElementById(TheLayer).style.left)< 50)setTimeout("OpenLayer('"+TheLayer+"','"+OpenClose+"')",20);else{document.getElementById(TheLayer).style.left="51%";document.getElementById(TheLayer).style.right="51%";document.getElementById(TheLayer).style.border="";if(document.getElementById(TheLayer).innerHTML.match(/<iframe/i)!=null)document.getElementById(TheLayer).innerHTML="";GLOBALOK=true;GLOBALBusy=false}}} function AdjustMap(){document.getElementById("theMap").style.width="70%";document.getElementById("theMap").style.height="100%";var W=document.getElementById("theMap").offsetWidth;var H=document.getElementById("theMap").offsetHeight;map.Resize(W,H);PanMap(null,null,new VELatLong(52.271578,0.68801));var Height=getHeight();if(Height[1]<850);else;}function PanMap(x,y,latlong){if(x!=null&y!=null)map.Pan(x,y);else if(latlong!=null)map.PanToLatLong(latlong)}var pinID=1; function AddPin(){var pin=new VEPushpin(pinID,map.GetCenter(),null,"P2 Design","Professional Web Design in Bury St Edmunds, Suffolk");map.AddPushpin(pin);pinID++}function BubbleCancel(evt){if(evt!=null)evt.cancelBubble=true;if(evt!=null)if(evt.stopPropagation)evt.stopPropagation()} document.onkeyup=function Woo(event){if(typeof event=="undefined")event=window.event;var KeyID=event.keyCode;if(document.layers)KeyID=event.which;if(KeyID==39)PressNextButton(1);if(KeyID==37)PressNextButton(-1);if(KeyID==40)PressNextButton(1);if(KeyID==38)PressNextButton(-1)}; function PressNextButton(Go){var HowMany=document.getElementById("Buttons").childNodes.length;var Found=-1;for(x=0;x<HowMany;x++)if(document.getElementById("Buttons").childNodes[x].childNodes[0].style.backgroundColor=="#ffcc00"||document.getElementById("Buttons").childNodes[x].childNodes[0].style.backgroundColor=="rgb(255, 204, 0)"){Found=x;break}var Destination=Found+Go;if(Destination>=HowMany)Destination=0;if(Destination<0)Destination=HowMany-1;document.getElementById("Buttons").childNodes[Destination].childNodes[0].onclick()} function SearchText(val){var HowManyButtons=document.getElementById("Buttons").childNodes.length;var regstring=new RegExp(val,"gi");for(y=0;y<HowManyButtons;y++)if(document.getElementById("Buttons").childNodes[y].childNodes[0].style.backgroundColor=="#ffcc00"||document.getElementById("Buttons").childNodes[y].childNodes[0].style.backgroundColor=="rgb(255, 204, 0)")DoNothing();else document.getElementById("Buttons").childNodes[y].childNodes[0].style.backgroundColor="#ffffff";if(val.length>=2){var HowMany= document.getElementById("DisplayLayers").childNodes.length;for(x=0;x<HowMany;x++)if(document.getElementById("DisplayLayers").childNodes[x].innerHTML!=undefined){var Text=document.getElementById("DisplayLayers").childNodes[x].innerHTML.replace(/<[^>]*>/gi,"");var ID=document.getElementById("DisplayLayers").childNodes[x].id.replace(/^Display/,"Button");var ar=Text.match(regstring);if(ar!=null)if(document.getElementById(ID).style.backgroundColor=="#ffcc00"||document.getElementById(ID).style.backgroundColor== "rgb(255, 204, 0)")DoNothing();else document.getElementById(ID).style.backgroundColor="#CCCCCC"}}}function ClearSearch(obj,chk,str){if(obj.value==chk)obj.value=str;else obj.onkeyup()}var OKToFade=true; function BoxMover(){if(OKToFade==true){var Dimensions=getHeight();var Info="Hello##Design##Ideas##Money##Examples##Technical##Code##Jobs##About Us##Copy##Gallery##Contact Us";var D=Info.split("##");BlendImage("BoxBack",50);var RandomWidth=Math.floor(Math.random()*(parseInt(Dimensions[0])-82));var RandomHeight=Math.floor(Math.random()*(parseInt(Dimensions[1])-182));document.getElementById("BoxText").innerHTML=D[Math.floor(Math.random()*D.length)];document.getElementById("Box").style.left=RandomWidth+ "px";document.getElementById("Box").style.top=RandomHeight+"px";OKToFade=false}} function FindButton(obj){var HowMany=document.getElementById("Buttons").childNodes.length;var Text=document.getElementById("BoxText").innerHTML;var regex=new RegExp(Text,"gi");HideFaceLayer();for(x=0;x<HowMany;x++)if(document.getElementById("Buttons").childNodes[x].childNodes[0].childNodes[0].innerHTML.match(regex)!=null){TheButton=x;break}var Messages="We knew you couldn't resist this...##Thank you, you have joined a big group by clicking the button... ##We guessed you'd follow the moving target...##It's nice when visitors to your site do what you expect...##Everyone likes a bit of interactive fun..";var M= Messages.split("##");var R=M[Math.floor(Math.random()*M.length)];document.getElementById("ClickMessage").innerHTML=R+'<BR><BR>please wait a moment and we\'ll load <span style="color:#f57e16">'+Text+"</span> for you...";setTimeout("NowPressTheButton("+TheButton+")",4500)}function NowPressTheButton(TheButton){document.getElementById("Buttons").childNodes[TheButton].childNodes[0].onclick()} function getHeight(){var myWidth=0,myHeight=0;if(typeof window.innerWidth=="number"){myWidth=window.innerWidth;myHeight=window.innerHeight}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight}return[myWidth, myHeight]}function BlendImage(imageid,millisec){if(OKToFade==true){var speed=millisec;var timer=0;var Colours=RandomColour();ChangeOpac(0,imageid);document.getElementById("BoxBack").style.backgroundColor=Colours[0];document.getElementById("BoxText").style.color=Colours[1];for(i=0;i<51;i++)setTimeout("ChangeOpac("+i+",'"+imageid+"')",i*speed)}} function RandomColour(){var R=Math.floor(Math.random()*255);var R1=255-R;var G=Math.floor(Math.random()*255);var G1=255-G;var B=Math.floor(Math.random()*255);var B1=255-B;var L="rgb("+R+","+G+","+B+")";var K="rgb("+R1+","+G1+","+B1+")";return[L,K]} function ChangeOpac(opacity,id){var ver=getInternetExplorerVersion();var object=document.getElementById(id).style;object.opacity=opacity*3.5/100;object.MozOpacity=opacity*3.5/100;object.KhtmlOpacity=opacity*3.5/100;if(ver>-1)object.filter="alpha(opacity="+opacity*7+")";if(opacity*3.5==175&&document.getElementById("Box").style.display=="block"&&OKToFade==false){OKToFade=true;BoxMover()}} function getInternetExplorerVersion(){var rv=-1;if(navigator.appName=="Microsoft Internet Explorer"){var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(re.exec(ua)!=null)rv=parseFloat(RegExp.$1)}return rv} function MakeSureAllLayersAreClosed(){var HowMany="Display1,Display2,Display3,Display4,Display5,Display6,Display7,Display8,Display9,Display10,Display11,Display12";var Q=HowMany.split(",");var StillOpen=false;for(x=0;x<Q.length;x++)if(parseInt(document.getElementById(Q[x]).style.left)<51){StillOpen=true;break}return StillOpen} function BlendImage1(imageid,millisec){if(ThePageHasLoaded==true){var speed=millisec;ChangeOpac1(0,"FaceFrame");document.getElementById("FaceFrame").style.display="block";document.getElementById("FaceHeader1").style.display="block";document.getElementById("FaceHeader2").style.display="block";for(i=0;i<26;i++)setTimeout("ChangeOpac1("+i+",'"+imageid+"',"+i+")",i*speed)}else BlendImage1("FaceFrame",50)} function ChangeOpac1(opacity,id,timer){var ver=getInternetExplorerVersion();var object=document.getElementById(id).style;object.opacity=opacity*4/100;object.MozOpacity=opacity*4/100;object.KhtmlOpacity=opacity*4/100;if(ver>-1)object.filter="alpha(opacity="+opacity*4+")";if(timer==25){if(ver!=8)StartFaceAgain();if(document.getElementById("FaceHeader1").style.display=="none")ChangeOpac1(0,"FaceFrame")}} function ShowFaceLayer(){var Check=MakeSureAllLayersAreClosed();if(Check==false){if(OKToFade==true)BoxMover();BlendImage1("FaceFrame",50)}else setTimeout("ShowFaceLayer()",100)}function PageLoaded(){ThePageHasLoaded=true}var ThePageHasLoaded=false;function StartFaceAgain(){if(ThePageHasLoaded==true)window.frames.FaceFrame.window.StartItUp()} function HideFaceLayer(){ChangeOpac1(0,"FaceFrame");window.frames.FaceFrame.window.ResetAll();var Colours=RandomColour();document.getElementById("BoxBack").style.backgroundColor=Colours[0];document.getElementById("BoxText").style.color=Colours[1];document.getElementById("FaceHeader1").style.display="none";document.getElementById("FaceHeader2").style.display="none";OKToFade=true} function DoMail(){var a="info";var addr="mailto:";addr=addr+a+String.fromCharCode(64);addr=addr+"pco";addr=addr+".co.uk";window.location=addr}function DovCard(){window.location="P2Design.vcf"};
