// Adverts.js

     function getadvert(cid) {

   var url = '/cf/advert_summary.cfm';
var pars = 'cid='+cid;
var target = 'ad_area';	
var myAjax = new Ajax.Updater(
	target, 
	url, 
	{ method: 'post', parameters: pars });
	
	}
  function gettext(next) {
	
	var text1 = "Enter product keywords or catalogue numbers into the search box.";
	var text2 = "Select the quantity of products required and add to basket.";
	var text3 = "Confirm details and check out or continue shopping.";
	var img1 = "search_only.gif";
	var img2 = "sw_mp_basket_ico_v2.gif";
	var img3 = "checkout_img.gif";
	var thisText = 'text' + next;
	var thisImg = 'img' + next;
	var content1 = "<div class='advert'><h3>3 Step Ordering</h3><img src='/images/" + eval(thisImg) + "' alt='search and order' style='float:right;margin-right:15px;'/>";
	var content2 = "<h5>Step " + next + ":</h5><p>" + eval(thisText) + "</p></div>";
	var thisContent = content1 + content2;
 
 	$('ad_area').innerHTML = thisContent;
 
	}	
    	
var nextPage = 1;		
var x = 10; 
var y = 1;
		
		
		function startNextText() {
		x = x-y; 
		setTimeout("startNextText()", 1000); 
		if(x==0){ 
		Element.hide('ad_area');
		gettext(nextPage); 
		x=10;
		Element.show('ad_area');
		nextPage++;
		if(nextPage==4) {nextPage=1;}
		 } 
		}