/**
    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':			468,			//	width to resize all banners to, only takes effect if above is 1
	'img_height':			60, 			// 	height to resize all banners to, only takes effect if above is 1
	
	'refresh_time':			40000,			//	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': 				'_blank',		//	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('AwesomeStyles',			'http://www.awesomestyles.com', 			'http://www.magnets4energy.com/images/banners/halfskyscraper/ad2.jpg', 	'30/04/2019',	'bottom'),
	new banner('Magnets 4 Energy', 'http://ruralsurvi.magnet4ene.hop.clickbank.net/', 'http://www.magnets4energy.com/images/banners/halfskyscraper/ad1.jpg', '10/10/2050','right'),
	new banner('2012 Report', 'http://ruralsurvi.dec212012.hop.clickbank.net/', 'http://www.2012officialcountdown.com/images/160x600.gif', '10/10/2050','right'),
	new banner('Global Warming Truth DVD', 'http://www.thelibertyman.com/globaldemo.php?ref_id=RuralSurvival.info', 'http://www.ruralsurvival.info/images/GW-DVD_Vban.png', '10/10/2050','right'),
	new banner('Magnets 4 Energy', 'http://ruralsurvi.magnet4ene.hop.clickbank.net/', 'http://www.magnets4energy.com/images/banners/halfskyscraper/ad2.jpg', '10/10/2050','right'),
new banner('Global Warming Truth DVD', 'http://www.thelibertyman.com/globaldemo.php?ref_id=RuralSurvival.info', 'http://www.ruralsurvival.info/images/GW-DVD_Vban.png', '10/10/2050','right'),
	new banner('Magnets 4 Energy', 'http://ruralsurvi.magnet4ene.hop.clickbank.net/', 'http://www.magnets4energy.com/images/banners/halfskyscraper/ad2.jpg', '10/10/2050','right'),
	new banner('Woodworking Projects', 'http://ruralsurvi.wood4home.hop.clickbank.net/', 'http://i29.tinypic.com/2nk0xg3.gif', '10/10/2050','right'),
	new banner('Sky Energy', 'http://ruralsurvi.sky4energy.hop.clickbank.net/', 'http://www.sky4energy.com/images/banners/halfskyscraper/ad4.jpg', '10/10/2050','right'),
new banner('Composting', 'http://3f237e6lk9vh1sphwi1-nexcrs.hop.clickbank.net/', 'http://www.wormfarmingsecrets.com/images/worm-composting-small-2.gif', '10/10/2050','right'),
	new banner('FullMovies.com', 'http://0b1d5i1lheurtlm2xin60r5s7v.hop.clickbank.net/', 'http://www.fullmovies.com/affiliates/banners/fulmov_160x600_001.gif', '10/10/2050','right'),
	new banner('Streaming DirecTV', 'http://345e1bxhlcussmmi3ehvv34q5w.hop.clickbank.net/', 'http://www.streamdirect.tv/affiliates/images/120x600streamdirect1.jpg', '10/10/2050','right'),
	new banner('Small Cabin Plans', 'http://35434fzbeftp2tt2wd--p4wbfi.hop.clickbank.net/', 'http://www.bunkhouseplans.com/wp-content/uploads/2011/03/banner1.png', '10/10/2050','right'),
	new banner('Woodworking Designs Plans and Projects', 'http://e0d88nvccgvqvmqos07ln9rq62.hop.clickbank.net/', 'http://www.tedswoodworking.com/images/banners/tedswood160600.gif', '10/10/2050','right'),
new banner('MyShedPlans', 'http://59178l9bf8xs-uweo6kcp6qget.hop.clickbank.net/', 'http://www.myshedplans.com/images/160x600shedplans.gif', '10/10/2050','right'),
	new banner('How to Build a Chicken Coop', 'http://484fcb7ec9utthn0q3gila1bdj.hop.clickbank.net/', 'http://www.buildingachickencoop.com/160X600.png', '10/10/2050','right'),
	new banner('14K Wood Working Plans', 'http://f185ec8hqh7szhqv-dsrmgu-8t.hop.clickbank.net/', 'http://i49.tinypic.com/xoqu0x.gif', '10/10/2050','right'),
	new banner('Aquaponics', 'http://ef5aakymfh4p0uxzsrfmzfx6xk.hop.clickbank.net/', 'http://www.aquaponics4you.com/images/banners/skyscraper/ad3.jpg', '10/10/2050','right'),
	new banner('Food 4 Wealth', 'http://16cffb6dikvg0lm9lfhretfk9j.hop.clickbank.net/', 'http://www.food4wealth.com/affiliates/bannerset1/160x600-set1.gif', '10/10/2050','right'),
	new banner('Dog Training', 'http://bf1b3i9bp71psgwas88uam4rbr.hop.clickbank.net/', 'http://www.dog-training-online.info/images/banners/dove-dog-training-160x600.jpg', '10/10/2050','right'),
	new banner('Chicken Coop Kit', 'http://bef04p2kkb0rshy6ucs7sdwg17.hop.clickbank.net/', 'http://www.chickenkit.com/images/160-x-600-wide-skyscraper.gif', '10/10/2050','right'),
	new banner('Going Rawr', 'http://7f4b0mynhgys4ov1y9u4661m95.hop.clickbank.net/', 'http://www.deliciousdogdiet.com/images/banners/03.gif', '10/10/2050','right'),
	new banner('Soap Making', 'http://dc4ebbveng7pstw522ckcymt2a.hop.clickbank.net/', 'http://www.soapmakingfun.com/images/easy120600.jpg', '10/10/2050','right'),
	new banner('DIY Beekeeping', 'http://edeaao3jfa2osjy-i5hriy6y4x.hop.clickbank.net/', 'http://diybeehive.com/linkimg/diy-160x600.jpg', '10/10/2050','right'),
	new banner('Mold Removal', 'http://26abcmyjp5-eyst-s3bk7yua6g.hop.clickbank.net/', 'http://www.moldmanuscript.com/images/creatives/banners/1202402.gif', '10/10/2050','right'),
	new banner('Family Organic Garden', 'http://c410fd3de6yl1qj6llk4uxaq6m.hop.clickbank.net/', 'http://www.familyorganicgarden.com/banners/banner1-2.gif', '10/10/2050','right'),
	new banner('Zero Chemicals', 'http://ruralsurvi.0chemicals.hop.clickbank.net/', 'http://www.zerochemicals.com/affiliates/bannersandgraphics/zc_120x600_01a.gif', '10/10/2050','right'),
	new banner('Earth 4 Energy', 'http://ruralsurvi.earth4.hop.clickbank.net/', 'http://www.earth4energy.com/affiliates/bannersandgraphics/e4e_160x600_01a.gif', '10/10/2050','right'),
new banner('DIY Hot Water', 'http://ruralsurvi.diyhot.hop.clickbank.net/', 'http://www.diyhotwater.com/affiliates/bannersandgraphics/diyhw_120x600_01a.gif', '10/10/2050','right'),
	new banner('My organic food garden', 'http://ruralsurvi.myorganic.hop.clickbank.net/', 'http://www.myorganicfoodgarden.com/affiliates/bannersandgraphics/mofg_120x600_01a.gif', '10/10/2050','right'),
	new banner('Super Soap-Making', 'http://6c5e2j8ih7xr0hwqxhkbxgcdcj.hop.clickbank.net/', 'http://www.supersoapmakingsecrets.com/images/01.gif', '10/10/2050','right'),
	new banner('How To Raise Turkeys', 'http://edd20fwqj7zf4lmj6bz5dhhv61.hop.clickbank.net/', 'http://www.howtoraiseturkeys.com/images/raisingturkey160x600_1.jpg', '10/10/2050','right'),
	new banner('Breeding Rabbits for food', 'http://f5513h1cjc5tvsr7t6k16awu7u.hop.clickbank.net/', 'http://www.breedingbunnies.com/banners/banner120x600.gif', '10/10/2050','right'),
	new banner('15K Woodworking Plans', 'http://5339dl7cocvs0qrbs1geq3ph8g.hop.clickbank.net/', 'http://www.ideawoodworkingplans.com/images/banners/120x600.jpg', '10/10/2050','right'),
new banner('House & Cabin Plans', 'http://19ff6q2knc-pxqs7m2wgjf2z3l.hop.clickbank.net/', 'http://www.cadhouseplans.com/wp-content/uploads/2011/03/160-x-600-house-and-cabin-plans-banner.png', '10/10/2050','right'),
new banner('Knitting Superstar', 'http://ca141o4qb85l-jt8u3wjv21nfv.hop.clickbank.net/', 'http://mydesignstorage.com/banners/0311/Sl9Ix33184_r_3.gif', '10/10/2050','right'),
new banner('Paid Surveys', 'http://ee696p9hej-l5qvqtyq-4r8v6f.hop.clickbank.net/', 'http://d1pr3sk5xr0dce.cloudfront.net/banners/160x600_static.jpg', '10/10/2050','right'),
new banner('Survival Guide', 'http://ba2d4d8nmdztxqt7pnjj0z0u86.hop.clickbank.net/', 'http://ruralsurvival.info/images/BookTopSeller.gif', '10/10/2050','right'),
new banner('Survival Guide', 'http://692b7h3cfjyjvtrf4fq9-j8nw1.hop.clickbank.net/', 'http://www.ruralsurvival.info/sources/images/HealthAddict2.jpg', '10/10/2050','right'),
new banner('RuralSurvivaL.Info Official Gear', 'http://www.cafepress.com/RuralSurvival', 'http://www.ruralsurvival.info/images/RSI_CafePress_160x600.png', '10/10/2050','right'),
new banner('Cut Home Energy Bills by 80%', 'http://4a4d1myfee0f5tn-laybybmnb0.hop.clickbank.net/', 'http://www.homemadepowerplant.com/aff/banners/green/160x600.jpg', '10/10/2050','right'),
new banner('Cut Home Energy Bills by 80%', 'http://4a4d1myfee0f5tn-laybybmnb0.hop.clickbank.net/', 'http://www.homemadepowerplant.com/aff/banners/160x600/160x600.gif', '10/10/2050','right'),
new banner('Secret Seduction Files', 'http://a9fbam4ipaul1nogn54901m7rt.hop.clickbank.net/', 'http://www.secretseductionfiles.com/images/banners/banner7.gif', '10/10/2050','right'),
new banner('FOREX Signals', 'http://9a25cizlb8viyom0bx-90kqm6p.hop.clickbank.net/', 'http://cdn2.forexambush.com/ForexAmbush/banners/120x600.gif', '10/10/2050','right'),
]

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

