// Simple banner rotator
// (c) spyka Web Group 2008
// version info: 1.1.2
// Download & support: http://www.spyka.net
// Forums: http://www.spyka.net/forums
// Please keep this notice in place


function banner(name, url, image, date)
{
	this.name	= name;
	this.url	= url;
	this.image	= image;
	this.date	= date;
}

function banner_blurb( blurb )
{
	this.blurb = blurb;
}

var banners = new Array();
var blurbs = new Array();

///////////////////////////////////////////////////////////////////////////////////
//
//         						START EDITS HERE
//
///////////////////////////////////////////////////////////////////////////////////

// Full documentation & support: http://www.spyka.net/forums 

// if 1, all images will be resized to img_width and img_height, else images will display their correct size
var force_size	= 1;
// desired height and width of images, only takes affect if above is = 1
var img_width	= 468;
var img_height	= 60;

// banner list syntax: banners[x] = new banner(website_name, website_url, website_image_url, show_until_date);  DATE FORMAT: dd/mm/yyyy
//banners[0] = new banner( 'Emcore Magazine', 'http://www.emcore-magazine.com/', 'http://www.freertos.org/banner-images/emcore-magazine-banner-1.png', '30/04/2011');
//blurbs[0] = new banner_blurb( '<br><a href="http://www.freertos.org/RTOS-contact-and-support.html#advertising" target="basefrm"><small>Advertise here?</small></a>' );

banners[0] = new banner( 'FreeRTOS dark matter T-shirts', 'http://shop.freertos.org/FreeRTOS_Dark_Matter_T_shirts_s/1831.htm', 'http://www.freertos.org/banner-images/FreeRTOS-TShirts.gif', '30/04/2011');
blurbs[0] = new banner_blurb( '<br><a href="http://www.freertos.org/RTOS-contact-and-support.html#advertising" target="basefrm"><small>Advertise here?</small></a>' );


banners[1] = new banner( 'FreeRTOS documentation', 'http://shop.freertos.org/FreeRTOS_tutorial_books_and_reference_manuals_s/1825.htm', 'http://www.freertos.org/banner-images/FreeRTOS-book.png', '30/04/2011');
blurbs[1] = new banner_blurb( '<br><a href="http://www.freertos.org/RTOS-contact-and-support.html#advertising" target="basefrm"><small>Advertise here?</small></a>' );

banners[2] = new banner( 'FreeRTOS training', 'http://www.freertos.org/training/RTOS-tutorial-and-training.html', 'http://www.freertos.org/banner-images/freertos-training-top-banner.png', '30/04/2011');
blurbs[2] = new banner_blurb( '<br><a href="http://www.freertos.org/RTOS-contact-and-support.html#advertising" target="basefrm"><small>Advertise here?</small></a>' );

banners[3] = new banner( 'Eclipse banner', 'http://www.highintegritysystems.com/index.php?option=com_chronocontact&Itemid=67', 'http://www.freertos.org/banner-images/eclipse-banner.gif', '10/04/2011');
blurbs[3] = new banner_blurb( '<br><a href="http://www.freertos.org/RTOS-contact-and-support.html#advertising" target="basefrm"><small>Advertise here?</small></a>' );

banners[4] = new banner( 'FreeRTOS paperbacks', 'http://shop.freertos.org/FreeRTOS_tutorial_books_and_reference_manuals_s/1825.htm', 'http://www.freertos.org/banner-images/FreeRTOS-book-title-large.png', '30/04/2011');
blurbs[4] = new banner_blurb( '<br><small>5 book editions are available, <a href="http://shop.freertos.org/RTOS_primer_books_and_manual_s/1819.htm" target="_blank"><b>eBook</b></a> &amp; <a href="http://bit.ly/duJ9R0" target="_blank"><b>paperback</b></a> - includes 16 <b>simple</b> examples' );

banners[5] = new banner( 'Connect', 'http://www.highintegritysystems.com/index.php?option=com_content&view=article&id=77&Itemid=87', 'http://www.freertos.org/banner-images/connect_banner.gif', '10/04/2011');
blurbs[5] = new banner_blurb( '<br><a href="http://www.freertos.org/RTOS-contact-and-support.html#advertising" target="basefrm"><small>Advertise here?</small></a>' );

//banners[6] = new banner( 'FreeRTOS training', 'http://www.freertos.org/training/RTOS-tutorial-and-training.html', 'http://www.freertos.org/banner-images/freertos-training-top-banner.png', '30/04/2011');
//blurbs[6] = new banner_blurb( '<br><a href="http://www.freertos.org/RTOS-contact-and-support.html#advertising" target="basefrm"><small>Advertise here?</small></a>' );

banners[6] = new banner( 'FreeRTOS dark matter T-shirts', 'http://shop.freertos.org/FreeRTOS_Dark_Matter_T_shirts_s/1831.htm', 'http://www.freertos.org/banner-images/FreeRTOS-TShirts.gif', '30/04/2011');
blurbs[6] = new banner_blurb( '<br><a href="http://www.freertos.org/RTOS-contact-and-support.html#advertising" target="basefrm"><small>Advertise here?</small></a>' );

banners[7] = new banner( 'FreeRTOS documentation', 'http://shop.freertos.org/FreeRTOS_tutorial_books_and_reference_manuals_s/1825.htm', 'http://www.freertos.org/banner-images/FreeRTOS-book.png', '30/04/2011');
blurbs[7] = new banner_blurb( '<br><a href="http://www.freertos.org/RTOS-contact-and-support.html#advertising" target="basefrm"><small>Advertise here?</small></a>' );

//banners[6] = new banner( 'SafeRTOS in ROM', 'http://www.highintegritysystems.com/index.php?option=com_content&view=article&id=93&Itemid=97', 'http://www.freertos.org/banner-images/SafeRTOS_in_ROM_banner.jpg', '10/04/2011');
//blurbs[6] = new banner_blurb( '<br><a href="http://www.freertos.org/RTOS-contact-and-support.html#advertising" target="basefrm"><small>Advertise here?</small></a>' );

banners[8] = new banner( 'Connect Demo', 'http://www.highintegritysystems.com/index.php?option=com_chronocontact&Itemid=94', 'http://www.freertos.org/banner-images/connect_demo_banner.gif', '10/04/2011');
blurbs[8] = new banner_blurb( '<br><a href="http://www.freertos.org/RTOS-contact-and-support.html#advertising" target="basefrm"><small>Advertise here?</small></a>' );

banners[9] = new banner( 'FreeRTOS paperbacks', 'http://shop.freertos.org/FreeRTOS_tutorial_books_and_reference_manuals_s/1825.htm', 'http://www.freertos.org/banner-images/FreeRTOS-book-title-large.png', '30/04/2011');
blurbs[9] = new banner_blurb( '<br><small>5 book editions are available, <a href="http://shop.freertos.org/RTOS_primer_books_and_manual_s/1819.htm" target="_blank"><b>eBook</b></a> &amp; <a href="http://bit.ly/duJ9R0" target="_blank"><b>paperback</b></a> - includes 16 <b>simple</b> examples' );


///////////////////////////////////////////////////////////////////////////////////
//
//         						END EDITS HERE
//
///////////////////////////////////////////////////////////////////////////////////

function show_banners2()
{
	var am		= banners.length;
	
	if( typeof this.index == 'undefined' )
	{
		this.index = Math.floor(Math.random()*am);
	}

	var bn 		= banners[this.index];
	var bl		= blurbs[this.index];
	
	var image_size 	= (force_size == 1) ? ' width="' + img_width + '"' : '';
	var html 		= '<a href="' + bn.url + '" title="' + bn.name + '" target="_blank"><img border="0" src="' + bn.image + '"' + image_size + ' alt="' + bn.name+ '" /></a>' + bl.blurb;
	
	this.index++;
	if( this.index >= am )
	{
		this.index = 0;
	}
	
	return html;
}



