﻿//Javascript

$j(document).ready(function(){

	var AddTopBanner = setInterval
	    (
	    /* create an anonymous function to run the code */
	    function() {
	    /* check if the function '$' exists (since we need to use it) and that
	    the container has been loaded (second condition) */
	    
	    if(typeof $!='undefined' && $('ka_le_headercont'))
	    {  
	    	//var ads = new Array('<a href="http://www.motorola.com/" target="_blank"><img src="http://www.diversitylive.net/images/New_Ads/foundation_REV.jpg" border=0></a>','<a href="http://www.motorola.com/" target="_blank"><img src="http://www.diversitylive.net/images/New_Ads/foundation_REV_02.jpg" border=0></a>');
	    	var ads = new Array('<a href="http://www.motorola.com/" target="_blank"><img src="http://www.diversitylive.net/images/New_Ads/foundation_REV_02_v2.jpg" border=0></a>');
			var max = ads.length;
			var num = Math.floor((Math.random() * max));
	  	
			$('ka_le_headercont').innerHTML = '<div id="logos"><a href="http://www.diversitylive.net" target="_self"><img alt="namic logo" src="http://www.diversitylive.net/newdesign/css-images/diversityliveNewLogo.gif" border="0"/></a></div><div id="topBanner"></div>';
			$('topBanner').innerHTML = ads[num];
	    	clearInterval(AddTopBanner);
	    }
	    },20
	    );
});
