/**
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

	--------------------------------------------------------------------
	
	Simple banner rotator. Version: 1.4.0
	Download and support: http://www.spyka.net 
	(c) Copyright 2008, 2009 spyka Web Group
	

	For full documentation:  http://www.spyka.net/docs/simple-banner-rotator
	For support:			 http://www.spyka.net/forums


**/

//								EDIT FROM HERE
///////////////////////////////////////////////////////////////////////////////////

/**
		Script settings
**/

var settings = {
	
	'force_size':			0,         		// 	if set to 1 all banners will be resized to the width and height in the next to settings
	'img_width':			700,			//	width to resize all banners to, only takes effect if above is 1
	'img_height':			85, 			// 	height to resize all banners to, only takes effect if above is 1
	
	'refresh_time':			9999,			//	the seconds between refreshs of the banners - use 0 to disable
	'refresh_max':			9999,				//	maximum number of refreshs on each page load
	
	'duplicate_banners':	1,				//	keep as 0 to make sure the same banner won't show on the same page. will only take effect
											//  if show_banners(); is used more than once. You must make sure you have enough banners to fill
											//  all the slots else the browser may freeze or give a stack overflow error
	
	'location_prefix': 		'adLocation-',	//	The prefix of the IDs of the <div> which wraps the banners - this div is generated dynamically.
											//  a number will be added on the end of this string. adLocation- was used by default before version 1.4.x
											
	'location_class':		'swb',			//  A class to add to all of the <div>s which wrap the banners, ideal to use for styling banners - use .swb img in your CSS	
	
	'window': 				'_self',		//	Window to open links in, _self = current, _blank = new. Use _top if in a frame!		
	
	'default_ad_loc':		'default'		//	The default adLocation. This is assigned to any banners not given an adLocation in the below banner list
											//  There is no real reason to need to change this
}


/**
		Banners
**/
// banner list syntax: new banner(website_name, website_url, banner_url, show_until_date, adlocation),  DATE FORMAT: dd/mm/yyyy
// if you're not using adlocations just leave it empty like '' as in the last example here
// to make sure a banner is always rotating, just set the date far into the future, i.e. year 3000

var banners = [
		new banner('OCB',			'http://goldenvoice.com/shows/details/?id=34673', 			'http://www.kcsn.org/images/banners/bruce_springsteen.jpg', 	'30/11/2020',	'top'),
		new banner('OCB',			'http://www.csun.edu/orangegrovebistro/', 			'http://www.kcsn.org/images/banners/Orange_Grove_Bistro.jpg', 	'30/11/2020',	'top'),
		new banner('MatadorsCreditUnion',			'http://www.matadors.org/', 			'http://www.kcsn.org/images/banners/Matadors_Community_Credit_Union.png', 	'30/11/2020',	'top'),
		new banner('Rattlers',			'http://rattlersbbq.com/', 			'http://www.kcsn.org/images/banners/rattlers.jpg', 	'30/11/2020',	'top'),
		new banner('StoneFire',			'http://www.stonefiregrill.com/', 			'http://www.kcsn.org/images/banners/stonefire.jpg', 	'30/11/2020',	'top'),
		new banner('KateMantilini',			'http://katemantilinirestaurant.com/', 			'http://www.kcsn.org/images/banners/kate_mantilini.jpg', 	'30/11/2020',	'top'),
		new banner('LeChene',			'http://www.lechene.com/', 			'http://www.kcsn.org/images/banners/lechene.jpg', 	'30/11/2020',	'top'),
		new banner('Presidente',			'http://www.presidenterestaurant.com/', 			'http://www.kcsn.org/images/banners/presidente.jpg', 	'30/11/2020',	'top'),
		new banner('FiveFive',			'http://www.musicindustrystudies.com/', 			'http://www.kcsn.org/images/banners/five_five.jpg', 	'30/11/2020',	'top'),
		new banner('CasaDePizza',			'http://www.yelp.com/biz/casa-de-pizza-granada-hills', 			'http://www.kcsn.org/images/banners/casa_de_pizza.jpg', 	'30/11/2020',	'top'),
		new banner('Lawrys',			'http://lawrysonline.com/lawrys-primerib/beverly-hills', 			'http://www.kcsn.org/images/banners/lawrys.jpg', 	'30/11/2020',	'top'),
		new banner('ShermanRoom',			'http://www.yelp.com/biz/sherman-room-van-nuys', 			'http://www.kcsn.org/images/banners/sherman_room.jpg', 	'30/11/2020',	'top'),
		new banner('Musashi',			'http://www.musashirestaurant.com/', 			'http://www.kcsn.org/images/banners/musashi.jpg', 	'30/11/2020',	'top'),
		new banner('ChiChis',			'http://chichispizza.com/', 			'http://www.kcsn.org/images/banners/chi_chis.jpg', 	'30/11/2020',	'top'),
		new banner('BistroAlessio',			'http://bistroalessio.com/', 			'http://www.kcsn.org/images/banners/bistro_alessio.jpg', 	'30/11/2020',	'top'),
		new banner('BuonGusto',			'http://www.buongustoristo.com/', 			'http://www.kcsn.org/images/banners/buon_gusto.jpg', 	'30/11/2020',	'top'),
		new banner('McCormick_Schmick',			'http://www.mccormickandschmicks.com/', 			'http://www.kcsn.org/images/banners/McCormick_Schmick.png', 	'30/11/2020',	'top'),
		new banner('LAWeekly',			'http://www.voicedailydeals.com/los-angeles/', 			'http://www.kcsn.org/images/banners/la_weekly.jpg', 	'30/11/2020',	'top'),
		new banner('the-cellar',			'http://www.thecellarwbr.com', 			'http://www.kcsn.org/images/banners/the-cellar.jpg', 	'30/11/2011',	'top'),
		new banner('ValleyScene',			'http://valleyscenemagazine.com/', 			'http://www.kcsn.org/images/banners/Valley_Scene.jpg', 	'26/03/2020',	'top'),
		new banner('Welsh',			'http://www.welshbaker.com/Croeso_Welsh_Cakes', 			'http://www.kcsn.org/images/banners/welsh.jpg', 	'26/07/2011',	'top'),
		new banner('Menchies',			'http://www.menchies.com/', 			'http://www.kcsn.org/images/banners/menchies.jpg', 	'26/03/2000',	'top'),
		new banner('Jills',			'http://www.jillscakecreations.com/', 			'http://www.kcsn.org/images/banners/Jills.jpg', 	'26/07/2011',	'top'),
		new banner('Matadors',			'http://gomatadors.cstv.com/', 			'http://www.kcsn.org/images/banners/Matadors.jpg', 	'26/03/2020',	'top'),
		new banner('CoolCups',			'http://www.cool-cups.com/', 			'http://www.kcsn.org/images/banners/cool_cups2.png', 	'26/07/2011',	'top'),
		new banner('Aszure',			'http://www.valleyperformingartscenter.org/', 			'http://www.kcsn.org/images/banners/Aszure.jpg', 	'26/03/2011',	'top'),
		new banner('SCMagazine',			'http://www.santaclaritamagazine.com/', 			'http://www.kcsn.org/images/banners/SC_Magazine.jpg', 	'13/02/2021',	'top'),
		new banner('SCVWineFest',			'http://www.scvwinefest.com/', 			'http://www.kcsn.org/images/banners/SCV_Wine_Fest.jpg', 	'13/02/2011',	'top'),
		new banner('RussianBallet',			'http://www.valleyperformingartscenter.org/', 			'http://www.kcsn.org/images/banners/russianballet.jpg', 	'08/02/2011',	'top'),
		new banner('AmoebaDownloads',			'http://www.amoeba.com/', 			'http://www.kcsn.org/images/banners/AMOEBAsellstuff700x85.gif', 	'30/04/2019',	'top'),
		new banner('CoffeeRoaster',			'http://www.thecoffeeroaster.net', 			'http://www.kcsn.org/images/banners/coffee-roaster.jpg', 	'24/10/2012',	'top'),
		new banner('NumeroUno',			'http://www.numerounopizza.com/', 			'http://www.kcsn.org/images/banners/numero_uno.jpg', 	'24/10/2012',	'top'),
		new banner('PizzaSaurus',			'', 			'http://www.kcsn.org/images/banners/pizzasaurus.jpg', 	'24/10/2012',	'top'),
		new banner('Weilers',			'http://www.weilersdeli.com/', 			'http://www.kcsn.org/images/banners/weilers.jpg', 	'24/10/2012',	'top'),
	    new banner('DonateCar',			'cars.html', 			'http://www.kcsn.org/images/banners/donate_car.jpg', 	'24/10/2012',	'top'),
		new banner('VegetableDelight',			'http://www.vegetabledelight.com', 			'http://www.kcsn.org/images/banners/vegetable_delight.jpg', 	'24/10/2012',	'top'),
		new banner('PhenominalWomenAwards',			'http://www.csun.edu/ws/PW/phenomenalwoman2010.html', 			'http://www.kcsn.org/images/banners/PWAbanner700by85.png', 	'24/10/2010',	'top'),
	    new banner('Autry',			'http://theautry.org/', 			'http://www.kcsn.org/images/banners/autry.jpg', 	'10/01/2010',	'top'),
	    new banner('SoCalGas',			'http://www.socalgas.com/', 			'http://www.kcsn.org/images/banners/SoCalGas.gif', 	'01/04/2019',	'top'),
	    new banner('MountainValley',			'http://www.mountainvalleywaterla.com', 			'http://www.kcsn.org/images/banners/mountain-valley.jpg', 	'30/04/2019',	'top'),
	    new banner('LAMag',	'http://www.lamag.com', 		'http://www.kcsn.org/images/banners/LA_Mag.gif',		'10/01/2011',	'top')
]

//         				There is no need to edit below here
///////////////////////////////////////////////////////////////////////////////////
var used=0;var location_counter=0;var refresh_counter=1;var map=new Array();function banner(a,b,c,d,e){this.name=a;this.url=b;this.image=c;this.date=d;this.active=1;this.oid=0;if(e!=''){this.loc=e}else{this.loc=settings.default_ad_loc}}function show_banners(a){location_counter=location_counter+1;if(a!=''&&a!=undefined){map[location_counter]=a}else{map[location_counter]=settings.default_ad_loc}var b='<div id="'+settings.location_prefix+location_counter+'" class="'+settings.location_class+'"></div>';document.write(b);display_banners(location_counter)}function display_banners(a){var b=new Array();if(a==''||!a||a<0){return}var c=banners.length;if((c==used)&&settings.duplicate_banners==0){return}for(i=0;i<(banners.length);i++){banners[i].oid=i;if((banners[i].loc==map[a])&&(banners[i].active==1)){b.push(banners[i])}}var d=Math.floor(Math.random()*b.length);var e=b[d];var f=(settings.force_size==1)?' width="'+settings.img_width+'" height="'+settings.img_height+'"':'';var g='<a href="'+e.url+'" title="'+e.name+'" target="'+settings.window+'"><img border="0" src="'+e.image+'"'+f+' alt="'+e.name+'" /></a>';var h=new Date();var j=e.date;j=j.split('/',3);var k=new Date();k.setFullYear(parseInt(j[2]),parseInt(j[1])-1,parseInt(j[0]));if((h<k)&&e.active==1){var l=document.getElementById(settings.location_prefix+a);if(l==null){alert('spyka Webmaster banner rotator\nError: adLocation doesn\'t exist!')}else{l.innerHTML=g;if(settings.duplicate_banners==0){banners[e.oid].active=0;used++}return}}else{display_banners(a)}return}function refresh_banners(){if((refresh_counter==settings.refresh_max)||settings.refresh_time<1){clearInterval(banner_refresh)}used=0;for(j=0;j<(banners.length);j++){banners[j].active=1}for(j=1;j<(location_counter+1);j++){display_banners(j)}refresh_counter++}var banner_refresh=window.setInterval(refresh_banners,settings.refresh_time);
