function changeImage(a) {
	var a;
	var img;
	var strapline;
	if (a == 'default') { img = 'default'; strapline = 'Cost effective solutions for all your tachograph requirements...'; }
	if (a == 'tachograph-analysis') { img = 'tachograph-analysis'; strapline = 'Guaranteed 5 day turnaround or same day for digital...'; }
	if (a == 'training') { img = 'training'; strapline = 'Driver CPC &amp; Management Training, because training matters...'; }
	if (a == 'software') { img = 'software'; strapline = 'Disc-Check helping you keep an eye on your fleet...'; }
	if (a == 'ecommerce') { img = 'ecommerce'; strapline = 'Cost effective solutions for all your tachograph requirements...'; }
	if (a == 'services') { img = 'services'; strapline = 'Helping you be compliant...'; }
	$("#strapline").html(strapline);

	/*$("#banner img").fadeOut("slow",function(){
    $("#banner img").load(function () { //avoiding blinking, wait until loaded
        $("#banner img").fadeIn();
    });
    $("#banner img").attr("src",'images/banners/'+img+'.jpg');
	});*/

	$("#banner img.banner").attr("src", '/sites/all/themes/acquia_prosper/tdi/images/banners/'+img+'.jpg');
}



var curBanner = 1;

function setBlockActive(id) {
    setBlockInActive(1); setBlockInActive(2); setBlockInActive(3); setBlockInActive(4); setBlockInActive(5);
    if (id > 0) {
   document.getElementById("#banner_"+id).setAttribute("class", "block blockactive");
    }
}
function setBlockInActive(id) {
    document.getElementById("#banner_"+id).setAttribute("class", "block");
}
function swapImage(name) {
	if (name == 'tachograph-analysis') { changeImage('tachograph-analysis'); setBlockActive(1); curBanner = 2;  }
	if (name == 'training') { changeImage('training'); setBlockActive(2); curBanner = 3;  }
	if (name == 'software') { changeImage('software'); setBlockActive(3);  curBanner = 4; }
	if (name == 'ecommerce') { changeImage('ecommerce'); setBlockActive(4); curBanner = 5;  }
	if (name == 'services') { changeImage('services'); setBlockActive(5); curBanner = 0;  }
}
function rotateBanner(){
	//alert("ROTATE");
	if (curBanner == 0) { changeImage('default'); setBlockActive(0); }
	if (curBanner == 1) { changeImage('tachograph-analysis'); setBlockActive(1); }
	if (curBanner == 2) { changeImage('training'); setBlockActive(2);  }
	if (curBanner == 3) { changeImage('software'); setBlockActive(3);   }
	if (curBanner == 4) { changeImage('ecommerce'); setBlockActive(4);  }
	if (curBanner == 5) { changeImage('services'); setBlockActive(5);   }

	curBanner = curBanner + 1;
	//latestTenderPage(curBanner);
	if (curBanner == 6) { curBanner = 0; }
	setTimeout("rotateBanner()",4000);
}






(function ($) { 
$(document).ready(function(){  
    
   
    
    $('.category-products .uc-price-sell').each(function(index) {
	//alert("TEST");
	//alert($(this).text());
	//var price = $(this).text();
	var price = $(this).text().substring(1);
	var price = price.replace(/[^\d\.\-\ ]/g, '');
	var VAT = (price / 1.2);
	var newprice = VAT;
	newprice = newprice.toFixed(2);
	$(this).text('\u00A3'+newprice+' Ex VAT');
	//alert(newprice);
    });

});

}(jQuery));






