<!-- DECLARE PRINT AD FUNCTION -->
function printads (i, LST_ads) {
		
	if (i == "") {
	
		i = Math.ceil(Math.random() * (LST_ads.length-1));
		
	}
	
	document.getElementById('body').style.backgroundImage = "url(" 
		+ LST_ads[i]["src"]
		+	")";
		
	var caption = "";
		
	if (LST_ads[i]["url"]!="") {
	
		caption = "<p><a href=\"" 
			+ LST_ads[i]["url"] 
			+ "\"><img src=\"" 
			+ LST_ads[i]["btn"] 
			+ "\" border=\"0\" class=\"action_button\""
			+ "\" style=\"" + LST_ads[i]["btn_style"] + "\" /></a></p>";
						
	}

	document.getElementById('caption').innerHTML = LST_ads[i]["cpt"] + caption;
	document.getElementById('caption').style.paddingBottom = 15;
	document.getElementById('caption_wrapper').style.verticalAlign = "bottom";
	
	/*
	
	verify all variables are declared in ad listings script: if one is not declared, the following conditionals will also not work
	
	c = ++c;
	LST_ads[c] = new Array(); 
	LST_ads[c]["lbl"] =  "Flap Systems Test Bench";	<!-- set text for link list -->
	LST_ads[c]["src"] =  "/images/airframe/homepage/blank.jpg";	<!-- set background image -->
	LST_ads[c]["btn"] =  "/images/buttons/read_more.gif"; <!-- set button image -->
	LST_ads[c]["url"] =  "/redirect/airframe/homepage/flap_test.php"; <!-- set button target URL -->
	LST_ads[c]["cpt"] =  "<span style=\"color: #ffffff;\">Solve Challenger Flap Squawks Faster</span><p style=\"color: #ffffff;\">Our exclusive flap systems test bench helps us troubleshoot intermittent squawks faster. Available for Challenger 600 series flap systems.</p>";	<!-- set ad text -->
	LST_ads[c]["width"] =  "";	<!-- override ad text width -->
	LST_ads[c]["pdng_btm"] =  "";	<!-- override ad bottom padding -->
	
	*/
	
	if (LST_ads[i]["width"]!="") {
		
		document.getElementById('caption').style.width = LST_ads[i]["width"];
		
	}
		
	if (LST_ads[i]["pdng_btm"]!="") {
		
		document.getElementById('caption').style.paddingBottom = LST_ads[i]["pdng_btm"];
		
	}

	if (LST_ads[i]["color"]!="") {
		
		document.getElementById('caption').style.color = LST_ads[i]["color"];
		
	}

}

<!-- INITIALIZE VARIABLES -->
var LST_ads = new Array();
var rand_no = "";
var c = 0;