/**
    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':			180,			//	width to resize all banners to, only takes effect if above is 1
	'img_height':			110, 			// 	height to resize all banners to, only takes effect if above is 1
	
	'refresh_time':			0,			//	the seconds between refreshs of the banners - use 0 to disable
	'refresh_max':			100,			//	maximum number of refreshs on each page load
	
	'duplicate_banners':	0,				//	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 = [
	//-----------------------------------------------------clothing
		//mens tees
	new banner('Logo Tee | Light Blue', 'http://aedionaesthetic.com/store/mens/tees/logoB.html', 'assets/images/site/ads/logoLtBlue.jpg', '01/01/3000',	'product'),
	new banner('Logo Tee | Yellow', 'http://aedionaesthetic.com/store/mens/tees/logoY.html', 'assets/images/site/ads/logoYellow.jpg', '01/01/3000',	'product'),
	new banner('Logo Tee | Black', 'http://aedionaesthetic.com/store/mens/tees/logoBl.html', 'assets/images/site/ads/logoBlack.jpg', '01/01/3000',	'product'),
	new banner('Mask Tee | White', 'http://aedionaesthetic.com/store/mens/tees/mask.html', 'assets/images/site/ads/mask.jpg', '01/01/3000',	'product'),
	new banner('Stylist Tee | Yellow', 'http://aedionaesthetic.com/store/mens/tees/stylist.html', 'assets/images/site/ads/stylist.jpg', '01/01/3000',	'product'),
	new banner('Lion Tee | Pomegranate', 'http://aedionaesthetic.com/store/mens/tees/lionP.html', 'assets/images/site/ads/lionPom.jpg', '01/01/3000',	'product'),
	new banner('Lion Tee | Black', 'http://aedionaesthetic.com/store/mens/tees/lionB.html', 'assets/images/site/ads/lionBlack.jpg', '01/01/3000',	'product'),
	new banner('Derek Tee | White', 'http://aedionaesthetic.com/store/mens/tees/derekW.html', 'assets/images/site/ads/derekW.jpg', '01/01/3000',	'product'),
	new banner('Trees Tee | Kelly Green', 'http://aedionaesthetic.com/store/mens/tees/trees.html', 'assets/images/site/ads/trees.jpg', '01/01/3000',	'product'),
	new banner('Anna Tee | Pomegranate', 'http://aedionaesthetic.com/store/mens/tees/annaP.html', 'assets/images/site/ads/annaPom.jpg', '01/01/3000',	'product'),
	new banner('Anna Tee | Mint', 'http://aedionaesthetic.com/store/mens/tees/annaM.html', 'assets/images/site/ads/annaMint.jpg', '01/01/3000',	'product'),
	new banner('LiberTee | Black', 'http://aedionaesthetic.com/store/mens/tees/liberteeB.html', 'assets/images/site/ads/libertyBlack.jpg', '01/01/3000',	'product'),
	new banner('LiberTee | Seafoam', 'http://aedionaesthetic.com/store/mens/tees/liberteeS.html', 'assets/images/site/ads/libertySea.jpg', '01/01/3000',	'product'),
	new banner('Skæte Tee | Blue', 'http://aedionaesthetic.com/store/mens/tees/skateB.html', 'assets/images/site/ads/skateBlue.jpg', '01/01/3000',	'product'),
	new banner('Skæte Tee | White', 'http://aedionaesthetic.com/store/mens/tees/skateW.html', 'assets/images/site/ads/skateWhite.jpg', '01/01/3000',	'product'),
		//mens hoods
	new banner('Logo Zip | Asphalt', 'http://aedionaesthetic.com/store/mens/hoods/asphaltZip.html', 'assets/images/site/ads/mlogoAsphalt.jpg', '01/01/3000',	'product'),
	new banner('Logo Zip | Black', 'http://aedionaesthetic.com/store/mens/hoods/blackZip.html', 'assets/images/site/ads/mlogoBlack.jpg', '01/01/3000',	'product'),
	new banner('Logo Zip | SaltnPepper', 'http://aedionaesthetic.com/store/mens/hoods/saltpepperZip.html', 'assets/images/site/ads/mlogoSaltpepper.jpg', '01/01/3000',	'product'),
	new banner('Logo Zip | Merman', 'http://aedionaesthetic.com/store/mens/hoods/mermanZip.html', 'assets/images/site/ads/mlogoMerman.jpg', '01/01/3000',	'product'),
	new banner('Logo Zip | Pink', 'http://aedionaesthetic.com/store/mens/hoods/pinkZip.html', 'assets/images/site/ads/mlogoPink.jpg', '01/01/3000',	'product'),
	new banner('Logo Zip | Cranberry', 'http://aedionaesthetic.com/store/mens/hoods/cranberryZip.html', 'assets/images/site/ads/mlogoCranberry.jpg', '01/01/3000',	'product'),
		//womens tees
	new banner('Aesthetic Tee | Poppy', 'http://aedionaesthetic.com/store/womens/tees/aestheticSS.html', 'assets/images/site/ads/aestheticPoppy.jpg', '01/01/3000',	'product'),
	new banner('Aesthetic LS | White', 'http://aedionaesthetic.com/store/womens/tees/aestheticLS.html', 'assets/images/site/ads/aestheticWhite.jpg', '01/01/3000',	'product'),
	new banner('Logo LS | Asphalt', 'http://aedionaesthetic.com/store/womens/tees/logoLS.html', 'assets/images/site/ads/logoAsphalt.jpg', '01/01/3000',	'product'),
	new banner('Logo Tee | Mint', 'http://aedionaesthetic.com/store/womens/tees/logoSS.html', 'assets/images/site/ads/logoMint.jpg', '01/01/3000',	'product'),
	new banner('Lines Tee | Pomegranate', 'http://aedionaesthetic.com/store/womens/tees/lines.html', 'assets/images/site/ads/linesPom.jpg', '01/01/3000',	'product'),
	new banner('Lion V-Neck | Purple Heather', 'http://aedionaesthetic.com/store/womens/tees/lionP.html', 'assets/images/site/ads/lionPurple.jpg', '01/01/3000',	'product'),
	new banner('Lions V-Neck | Grey Heather', 'http://aedionaesthetic.com/store/womens/tees/lionG.html', 'assets/images/site/ads/lionGrey.jpg', '01/01/3000',	'product'),
	new banner('Allison V-Neck | Blue Heather', 'http://aedionaesthetic.com/store/womens/tees/allison.html', 'assets/images/site/ads/allisonBlue.jpg', '01/01/3000',	'product'),
	new banner('Anna Tee | Narural White', 'http://aedionaesthetic.com/store/womens/tees/anna.html', 'assets/images/site/ads/annaNatural.jpg', '01/01/3000',	'product'),
	new banner('Lips Legs Tee | Lavender', 'http://aedionaesthetic.com/store/womens/tees/lipslegs.html', 'assets/images/site/ads/lipslegsLavender.jpg', '01/01/3000',	'product'),
		//womens hoods
	new banner('Logo Zip | Asphalt', 'http://aedionaesthetic.com/store/womens/hoods/asphaltZip.html', 'assets/images/site/ads/wlogoAsphalt.jpg', '01/01/3000',	'product'),
	new banner('Logo Zip | Black', 'http://aedionaesthetic.com/store/womens/hoods/blackZip.html', 'assets/images/site/ads/wlogoBlack.jpg', '01/01/3000',	'product'),
	new banner('Logo Zip | SaltnPepper', 'http://aedionaesthetic.com/store/womens/hoods/saltpepperZip.html', 'assets/images/site/ads/wlogoSaltpepper.jpg', '01/01/3000',	'product'),
	new banner('Logo Zip | Merman', 'http://aedionaesthetic.com/store/womens/hoods/mermanZip.html', 'assets/images/site/ads/wlogoMerman.jpg', '01/01/3000',	'product'),
	new banner('Logo Zip | Pink', 'http://aedionaesthetic.com/store/womens/hoods/pinkZip.html', 'assets/images/site/ads/wlogoPink.jpg', '01/01/3000',	'product'),
	new banner('Logo Zip | Cranberry', 'http://aedionaesthetic.com/store/womens/hoods/cranberryZip.html', 'assets/images/site/ads/wlogoCranberry.jpg', '01/01/3000',	'product'),
	
	//----------------------------------aediots
	
	//athletes
	new banner('Brian Jimenez', 'http://aedionaesthetic.com/team/athletes/brianJimenez.html', 'assets/images/site/ads/jimenez.jpg', '01/01/3000',	'aediot'),
	new banner('Aaron Daly', 'http://aedionaesthetic.com/team/athletes/aaronDaly.html', 'assets/images/site/ads/daly.jpg', '01/01/3000',	'aediot'),
	new banner('Tony Bollinger', 'http://aedionaesthetic.com/team/athletes/tonyBollinger.html', 'assets/images/site/ads/bollinger.jpg', '01/01/3000',	'aediot'),
	new banner('Kevin Able', 'http://aedionaesthetic.com/team/athletes/kevinAble.html', 'assets/images/site/ads/able.jpg', '01/01/3000',	'aediot'),
	new banner('Kevin McNally', 'http://aedionaesthetic.com/team/athletes/kevinMcnally.html', 'assets/images/site/ads/mcnally.jpg', '01/01/3000',	'aediot'),
	new banner('Sean Davis', 'http://aedionaesthetic.com/team/athletes/seanDavis.html', 'assets/images/site/ads/davis.jpg', '01/01/3000',	'aediot'),
	new banner('Dylan Hartsell', 'http://aedionaesthetic.com/team/athletes/dylanHartsell.html', 'assets/images/site/ads/hartsell.jpg', '01/01/3000',	'aediot'),
	new banner('Jonny Williamson', 'http://aedionaesthetic.com/team/athletes/jonnyWilliamson.html', 'assets/images/site/ads/williamson.jpg', '01/01/3000',	'aediot'),
	new banner('Sam Scheer', 'http://aedionaesthetic.com/team/athletes/samScheer.html', 'assets/images/site/ads/scheer.jpg', '01/01/3000',	'aediot'),
	new banner('Lenwood Franklin', 'http://aedionaesthetic.com/team/athletes/lenwoodFranklin.html', 'assets/images/site/ads/franklin.jpg', '01/01/3000',	'aediot'),
	//new banner('Lucian Fiore', 'http://aedionaesthetic.com/team/athletes/lucianFiore.html', 'assets/images/site/ads/fiore.jpg', '01/01/3000',	'aediot'),
	//new banne('Derek Jaskot', 'http://aedionaesthetic.com/team/athletes/derekJaskot.html', 'assets/images/site/ads/jaskot.jpg', '01/01/3000',	'aediot'),
	new banner('Teva Barnea', 'http://aedionaesthetic.com/team/athletes/tevaBarnea.html', 'assets/images/site/ads/barnea.gif', '01/01/3000',	'aediot'),
		
	//artists
	//new banner('Ian Culley', 'http://aedionaesthetic.com/team/artists/ianCulley.html', 'assets/images/site/ads/culley.jpg', '01/01/3000',	'aediot'),
	//new banner('Erik Abel', 'http://aedionaesthetic.com/team/artists/erikAbel.html', 'assets/images/site/ads/abel.jpg', '01/01/3000',	'aediot'),
	//new banner('Clay Davidson', 'http://aedionaesthetic.com/team/artists/clayDavidson.html', 'assets/images/site/ads/davidson.jpg', '01/01/3000',	'aediot'),
	//new banner('Jess Gleasman', 'http://aedionaesthetic.com/team/artists/jessGleasman.html', 'assets/images/site/ads/gleasman.jpg', '01/01/3000',	'aediot'),
	//new banner('Griffin Loop', 'http://aedionaesthetic.com/team/artists/griffinLoop.html', 'assets/images/site/ads/loop.jpg', '01/01/3000',	'aediot'),
	//new banner('Marz', 'http://aedionaesthetic.com/team/artists/marz.html', 'assets/images/site/ads/marz.jpg', '01/01/3000',	'aediot'),
	//new banner('JaMario Stills', 'http://aedionaesthetic.com/team/artists/jamarioStills.html', 'assets/images/site/ads/stills.jpg', '01/01/3000',	'aediot'),
	//new banner('Brendan Coughlin', 'http://aedionaesthetic.com/team/artists/brendanCoughlin.html', 'assets/images/site/ads/coughlin.jpg', '01/01/3000',	'aediot'),
	//new banner('Griffin Loop', 'http://aedionaesthetic.com/team/artists/griffinLoop.html', 'assets/images/site/ads/loop.jpg', '01/01/3000',	'aediot'),	
		
	//--------------------------------events
	//new banner('Valentines Rail Jam | 2011', 'http://aedionaesthetic.com/blog/log/valentines11.html', 'assets/images/site/ads/eventValentines.jpg', '01/01/3000',	'event'),
	//new banner('SOU Skate Jam | 2010', 'http://aedionaesthetic.com/blog/log/skateJam10.html', 'assets/images/site/ads/eventSkate10.jpg', '01/01/3000',	'event'),
	//new banner('SOU Skate Jam | 2009', 'http://aedionaesthetic.com/blog/log/skateJam09.html', 'assets/images/site/ads/eventSkate09.jpg', '01/01/3000',	'event'),
	//new banner('Mt. Ashland | 2010', 'http://aedionaesthetic.com/blog/log/bigAir10.html', 'assets/images/site/ads/eventBigAir10.jpg', '01/01/3000',	'event'),
	//new banner('SOU Skate Jam | 2010', 'http://aedionaesthetic.com/blog/log/skateJam11.html', 'assets/images/site/ads/eventSkate11.jpg', '01/01/3000',	'event'),
	//new banner('Back 2 School Sale', 'http://aedionaesthetic.com/blog', 'assets/images/site/ads/bannerB2S.jpg', '01/01/3000',	'event'),
	new banner('Back to Snow Sale', 'http://aedionaesthetic.com/blog', 'assets/images/site/ads/bannerB2SNOW.jpg', '01/01/3000',	'event'),
	
	
]

//         				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);
