//function to get random number upto m
function randomXToY2(minVal, maxVal, floatVal) {
    var randVal = minVal+(Math.random()*(maxVal-minVal));
    return typeof floatVal=='undefined'?Math.round(randVal):randVal.toFixed(floatVal);
} // function

var delay2 = 4500; // rotation delay (in milliseconds)
var tracking2 = 1;
var randomize2 = 1;

rotationImage2 = new Array();
rotationImage2[0] = new Image(112, 72);
rotationImage2[0].src = "/portals/34ee189d82/files/consolidated.png";
rotationImage2[1] = new Image(112, 61);
rotationImage2[1].src = "/portals/34ee189d82/files/infinity.png";
rotationImage2[2] = new Image(96, 81);
rotationImage2[2].src = "/portals/34ee189d82/files/nozzlenolenlogo.jpg";
//rotationImage2[3] = new Image(96, 81);
//rotationImage2[3].src = "/portals/34ee189d82/files/superiormoving.png";
rotationImage2[3] = new Image(96, 81);
rotationImage2[3].src = "/portals/34ee189d82/files/alohaLOGO.jpg";

rotationUrl2 = new Array();
rotationUrl2[0] = "http://www.seflorida.bbb.org/BusinessReport.aspx?CompanyID=4004191";
rotationUrl2[1] = "http://www.bbb.org/south-east-florida/business-reviews/business-services/infinity-sales-group-in-delray-beach-fl-92014004";
rotationUrl2[2] = "http://www.bbb.org/south-east-florida/business-reviews/pest-control-services/nozzle-nolen-in-west-palm-beach-fl-7727";
//rotationUrl2[3] = "http://www.seflorida.bbb.org/BusinessReport.aspx?CompanyID=4003963";
rotationUrl2[3] = "http://www.bbb.org/south-east-florida/business-reviews/air-conditioning-and-heating-contractors/aloha-air-conditioning-in-davie-fl-27003857";

rotationTracker2 = new Array();
rotationTracker2[0] = "/ftc-clicks/consolidated";
rotationTracker2[1] = "/ftc-clicks/infinity";
rotationTracker2[2] = "/ftc-clicks/nozzle-nolan";
//rotationTracker2[3] = "/ftc-clicks/babies";
rotationTracker2[4] = "/ftc-clicks/aloha";

var totalImgNumber2 = rotationImage2.length;
var imgNumber2 = randomXToY2(0, totalImgNumber2-1);

function rotateImg2() {
	var content2 = "";
	content2 = getImg2();
	document.getElementById("advice_sponsors").innerHTML = content2;
	imgNumber2++;
	if (imgNumber2 >= totalImgNumber2) {
		imgNumber2=0;
	} // if
} // function

function recordClick(link, category) {
	try {
		var myTracker=_gat._getTrackerByName();
    		_gaq.push(['myTracker._trackEvent', ' + category + ', 'click']);
    		//alert("category tracked: "+category);
    		setTimeout('document.location = "' + link.href + '"', 100);
	} catch(err) {}
} // function

function getImg2() {
	if (tracking2) {
		return '<a href="'+rotationUrl2[imgNumber2]+'" onclick="recordClick(this, \''+rotationTracker2[imgNumber2]+'\');return false;"  style="cursor: pointer;"><img src="'+rotationImage2[imgNumber2].src+'" name="rotationImg2" style="border: #000000 0px solid;" /></a>';
	} else {
		return '<a href="'+rotationUrl2[imgNumber2]+'" target="_blank" id="sponsor_link2"><img src="'+rotationImage2[imgNumber2].src+'" name="rotationImg2" style="border: #000000 0px solid;" /></a>';
	} // if
} // function

function rotate2() {
      rotateImg2();
      setTimeout("rotate2()", delay2);
} // function

rotate2();

