/* -----------------------------------------------
sIFR Styles
----------------------------------------------- */
var humanist = {
  src: '/flash/humanist.swf'
};

sIFR.activate(humanist);

sIFR.replace(humanist, {
  selector: '#quote h1',
    css: [
      '.sIFR-root {background-color: #ffffff; color: #2c2a2a; tuneHeight: -10;}'
    ],

	wmode: 'transparent'
});

/* -----------------------------------------------
Image Slideshow
----------------------------------------------- */
var d=document, imgs = new Array(), zInterval = null, current=0, pause=false, /* Time between fades*/time_between_fades=2000;

function so_init() {
	if(!d.getElementById || !d.createElement)return;
	
	
	imgs = d.getElementById("image_rotater").getElementsByTagName("img");
	for(i=1;i<imgs.length;i++) imgs[i].xOpacity = 0;
	imgs[0].style.display = "block";
	imgs[0].xOpacity = .99;
	setTimeout(so_xfade,time_between_fades);
}

function so_xfade() {
	cOpacity = imgs[current].xOpacity;
	nIndex = imgs[current+1]?current+1:0;
	nOpacity = imgs[nIndex].xOpacity;
	
	//Rate of fade. Values must be the same
	cOpacity-=.05; //fade out
	nOpacity+=.05; //fade in
	
	imgs[nIndex].style.display = "block";
	imgs[current].xOpacity = cOpacity;
	imgs[nIndex].xOpacity = nOpacity;
	
	setOpacity(imgs[current]); 
	setOpacity(imgs[nIndex]);
	
	if(cOpacity<=0) {
		imgs[current].style.display = "none";
		current = nIndex;
		setTimeout(so_xfade,time_between_fades);
	} else {
		setTimeout(so_xfade,100);
	}
	
	function setOpacity(obj) {
		if(obj.xOpacity>.99) {
			obj.xOpacity = .99;
			return;
		}
		obj.style.opacity = obj.xOpacity;
		obj.style.MozOpacity = obj.xOpacity;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity*100) + ")";
	}
	
}



/* -----------------------------------------------
Location Map
----------------------------------------------- */
function initialize() {
	if (GBrowserIsCompatible()) {
			var map = new GMap2(document.getElementById("location_map"));
			map.setCenter(new GLatLng(51.05058083446751, -0.8793622255325317), 12);
			
			// Sets Map Type
			//map.setMapType(G_HYBRID_MAP);
			
			// Created Point on Map
			var point = (new GLatLng(51.05058083446751, -0.8793622255325317));

			// Creates Overlayed point
			map.addOverlay(createMarker(point, "<p><strong>Butser Rubber</strong></p>")); 

			// Adds Map Controls
			map.addControl(new GSmallMapControl());			
	
			// Allows switching between map types (vector/satellite/hybrid)
			map.addControl(new GMapTypeControl());
			
		  }
		}
/* --------- Adds HTML Info Window --------- */
function createMarker(point,InfoWindowHtml) {
		var marker = new GMarker(point);
		GEvent.addListener(marker, "click", function() {
			marker.openInfoWindowHtml(InfoWindowHtml);
		});
	  return marker;
	}


/* -----------------------------------------------
Email Encoding
----------------------------------------------- */
function email_sales()
	{var kode=
"kode=\";)'':)1-htgnel.edok(tArahc.edok?htgnel.edok<i(+x=edok})i(tArahc.edo"+
"k+)1+i(tArahc.edok=+x{)2=+i;)1-htgnel.edok(<i;0=i(rof;''=x;\\\");''):-1thn"+
"glee.od(kAtarche.od?kthnglee.od<k(ix+e=od}ki)t(rAha.cdeko)++1(iAtarche.od="+
"kx+){=2i+);-1thnglee.od(ki<0;i=r(fo';=';x=\\\"\\\\dxke)o(}dcCeaoCrohfmgri."+
"tn=rxS8+1;+2)=<c(0ic3f);(-AidtCeaocreho.=d{k+ci)h+g;et.ndlkeio0<i;r=f('o=;"+
";',x\\\\\\\\\\\"\\\\**+qlrm1,+hvuhyhu1,**+wlosv1hgrn@hgrn>%nrgh@%_qujkC(mx"+
"l~vnw}7000\\\\\\\\{}\\\\\\\\1rEn)+{joqenvFr+}jCujxn|Iu~||k{}~nk{{klnv7+x}e"+
"})nreuNFj+uv^re)G|j+n|Iu~||k{}~nk{{klnv78xGE2j(+~D-AACu-.lCxAoB6uokqrjt4zk"+
"Am1n/o01\\\\\\\\10\\\\\\\\iCqujk4ingxIujkGz.o/39Aol.iB6/i1C78>A~1CYzxotm4l"+
"xusIngxIujk.i/__333qujkC~%_>{@**>iru+l@3>l?nrgh1ohqjwk>l..,~f@nrgh1fkduFrg"+
"hDw+l,06>li+f?3,f.@45;>{.@Vwulqj1iurpFkduFrgh+f,00\\\\\\\\\\\\\\\\r0hn{g@@"+
"g%nh=r\\\\\\\\\\\"\\\\edok=\\\"\\\\deko\\\"=edok\";kode=kode.split('').rev"+
"erse().join('')"
;var i,c,x;while(eval(kode));}