var aservices=[
	"4x4 / 4wd",
	"Suspension",
	"Snorkels",
	"Dump pipes",
	"Air flow",
	"Exhausts systems",
	"Headers",
	"Mufflers",
	"Induction kits",
	"Cobra",
	"Big Mouth",
	"Brakes",
	"Boronia",
	"Genie",
	"Hi-tech",
	"Pacemaker",
	"Hurricane",
	"Redback",
	"X Force",
	"Varex mufflers",
	"DiFilippo",
	"Remus",
	"Tunit Diesel Power Chips",
	"Pedders",
	"Fulcrum",
	"Towbars",
	"Hayman Reece",
	"Roadworthy certificates",
	"Raw Suspension",
	"Log book servicing",
	"Engine rebuilds ",
	"Motor cycles",
	"Trucks & Rigs"
	]
aservices.sort();
var acount = 0;

function renderServices(until){
	var begin = acount;
	for(i=acount; i<aservices.length;i++){
		if(i < (begin + until)){
			document.writeln(aservices[i] + "<br/>");
			acount++;
		}
	}
}


function getPromoImage(){
	var randValue = Math.floor(Math.random() * 6);
	document.write("<img src='./res/images/photos/promo/"+(randValue+1)+".jpg' border='0' class='photo'>");
}


function getBrandImages(count){
	var abrandlogos=[
		//"4x4enhancementcentre.jpg",
		//"a1exhausts.jpg",
		"cobra.jpg",
		"dpchip.jpg",
		"fulcrum.jpg",
		"genie.jpg",
		"growler.jpg",
		//"nationalexhaustwarranty.jpg",
		"pacemaker.jpg",
		"redback.jpg",
		"ssinductions.jpg",
		"superpro4x4.jpg",
		"pedders.jpg",
		"hurricane.jpg",
		"superpro.jpg"
		]
	abrandlogos.sort(function() {return 0.5 - Math.random()})

	document.writeln("<img src='./res/images/logos/a1exhausts.jpg' border='0' class='photo'>");

	for(i=0; i<count;i++){
		document.writeln("<img src='./res/images/logos/" + abrandlogos[i] + "' border='0' class='photo'>");
	}
}


function getRidesImages(count){
	var arides=[
		"fordxr6_1.jpg",
		"harley_1.jpg",
		"hondahornet_1.jpg",
		"impreza_2.jpg",
		"rotarygemini_1.jpg",
		"supracelica_1.jpg"
		]
	arides.sort(function() {return 0.5 - Math.random()})

	for(i=0; i<count;i++){
		document.writeln("<a href='rides.html'><img src='./res/images/photos/rides/" + arides[i] + "' border='0' style='border:2px solid black;width:100px;margin-bottom:10px'></a>");
	}
}

function getTip()
{
	var aTips = new Array();
	aTips[0] = "Why a performance manifold?|Standard exhaust manifolds are restrictive and actually limit fuel economy by making the engine work harder, by fitting performance headers the gases escape faster allowing the engine to perform at its true potential, giving you better fuel economy and increase in power." ;
	aTips[1] = "Why use SS Inductions' Systems?|There are many reasons...<br/>Improved power! Increased torque! And better fuel economy. Smoother overall performance, sharper acceleration and a factory appearance. Less heat sock, high flow rate witha rewashable filter. Simple installation and no need for an expensive tune.";
	aTips[2] = "What is a Diesel Chip or Tunit Chip?|It is an interactive computer, which exploits the full potential of modern diesel engines by programming and re-mapping the vehicles injection signals. You can expect gains of up to 25% in Kw and up to 35% torque and also up to 10% better fuel economy.";
	aTips[3] = "Does airflow really matter?|Standard exhaust systems are restrictive and actually limit airflow through the vehicles exhaust. By increasing the pipe size, to allow gases to escape more readily,  your engine can breathe better, so you will actually gain better fuel economy and more power. So come in and talk with one of experienced staff members to see how we can benefit your car or 4x4.";
	aTips[4] = "What does Ultimate specialise in?|We are your local exhaust specialist - mufflers, extractors, catalytic converters sports mufflers, performance exhausts, 4x4 exhaust systems, diesel performance chips and cold air induction, tow bars, plus our services include suspension and mechanical services (RWC).  We use only quality parts, offer competitive prices and quick efficient service.  Our aim is to get you back on the road as quickly and as cost effectively as we can.";
	aTips[5] = "Discounts for Seniors|Did you know we also offer a Seniors Discount - 10% off on presentation of card and can also offer a Life Time Warranty, conditions apply, see instore for more details.";
	var randValue = Math.floor(Math.random() * aTips.length);
	var atip = aTips[randValue].split("|");
	var title = atip[0];
	var text = atip[1];
	document.write("<h2>Ultimate Tip #" + (randValue+1) + ": " + title + "</h2>" + text);
}