/*====================================================================================================*/
/*====================================================================================================*/
function StartBlender() {
	xBlender=document.getElementById("blender");
	if (xBlender) {
		xBLENDimages=xBlender.getElementsByTagName("img");
		xNUMimages=xBLENDimages.length;
		for (i=0;i<xNUMimages;i++) {
			xIMG=xBLENDimages[i];
			setOpacity(xIMG, 0);
			xIMG.style.zIndex=i;
			xIMG.style.display="block";
		} //next i<xNUMimages
		setOpacity(xIMG, 100);
		setInterval("FadeInImage()", 10000);
	}//end if (xBlender)
}//end function
/*====================================================================================================*/
function FadeInImage() {
	xBlender=document.getElementById("blender");
	if (xBlender) {
		xBLENDimages=xBlender.getElementsByTagName("img");
		xNUMimages=xBLENDimages.length;
		xWORKINGimage=xBLENDimages[0];
		xWORKINGzIndex=xWORKINGimage.style.zIndex;
		for (i=0;i<xNUMimages;i++) {
			xCHECKINGimage=xBLENDimages[i];
			xCHECKINGzIndex=xCHECKINGimage.style.zIndex;
			if (xCHECKINGzIndex<xWORKINGzIndex) {
				xWORKINGimage=xCHECKINGimage;
				xWORKINGzIndex=xCHECKINGzIndex;
			}//end if (xCHECKINGzIndex<xWORKINGzIndex)
		}//next i<xNUMimages
		xIMAGEtoMove=xWORKINGimage;
		xZINDEXtoGoTo=xWORKINGzIndex+xNUMimages;
		setOpacity(xIMAGEtoMove, 0);
		xIMAGEtoMove.style.zIndex=xZINDEXtoGoTo;
		for (o=0;o<=100;o++) {
			setTimeout("setOpacity(xIMAGEtoMove, "+o+")", 10*o)
		}//next o<=100
	}//end if (xBlender)
}//end function
/*====================================================================================================*/
function setOpacity(theObject, theOpacity) {
    theObject.style.opacity=(theOpacity/100);
    theObject.style.MozOpacity=(theOpacity/100);
    theObject.style.KhtmlOpacity=(theOpacity/100);
    theObject.style.filter='alpha(opacity='+theOpacity+')';
}//end function
/*====================================================================================================*/
function ShowMap(thePostCode) {
	if (GBrowserIsCompatible()) {
		var map;
		var localSearch=new GlocalSearch();
		var icon=new GIcon();
		icon.image="http://www.bigstorage.info/images/css/bigbox.png";
		icon.shadow="http://www.bigstorage.info/images/css/bigboxshadow.png";
		icon.iconSize=new GSize(20, 18);
		icon.shadowSize=new GSize(37, 34);
		icon.iconAnchor=new GPoint(10, 34);
		map=new GMap2(document.getElementById("map"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		localSearch.setSearchCompleteCallback(null, 
			function() {
				if (localSearch.results[0]) {
					var resultLat=localSearch.results[0].lat;
					var resultLng=localSearch.results[0].lng;
					var point=new GLatLng(resultLat,resultLng);
					map.setCenter(point, 11);
					var marker=new GMarker(point,icon);
					map.addOverlay(marker);
				}//end if (localSearch.results[0])
			});	
		localSearch.execute(thePostCode + ", UK");
	}//end if (GBrowserIsCompatible())
}//end function
/*====================================================================================================*/
function setHighlights() {
	xInputs=document.getElementsByTagName("input");
	for (i=0;i<xInputs.length;i++) {
		if (xInputs[i].type=="text") {
			xInputs[i].onfocus=function() {
					if (this.defaultValue==this.value) {
						this.select();
					}//end if ()
				}//end function
			xInputs[i].onmouseup=function(){return false};//because safari is special
		}//end if (xInputs[i].type=="text")
	}//next i<xInputs.length
	xTextAreas=document.getElementsByTagName("textarea");
	for (i=0;i<xTextAreas.length;i++) {
		xTextAreas[i].onfocus=function() {
				if (this.defaultValue==this.value) {
					this.select();
				}//end if ()
			}//end function
		xTextAreas[i].onmouseup=function(){return false};//because safari is special
	}//next i<xTextAreas.length
}//end function
/*====================================================================================================*/
function compute(form)  {
	overAllTotal=0;	//reset total
	for (j=0;j<form.qty.length;j++ ) {
		itemQty=form.qty[j].value;
			if (!isNaN(itemQty)) {
				itemTotal=itemQty*form.volume[j].value;
				overAllTotal+=itemTotal;
				form.total[j].value=itemTotal;
			} else {
				form.qty[j].value="err";
				form.total[j].value=0;
			}//end if (!isNaN(itemQty))
		form.overAllTotal.value=overAllTotal;
	} //next j < form.qty.length
}//end function
/*====================================================================================================*/
window.onload=function() {
	StartBlender();
	setHighlights();
}//end function
/*====================================================================================================*/