<!--
	///////////////////////////////////////////////////////////
	/// Magic Image Rotation								///
	///	v 1.0.1												///
	/// Copyright 2007, Loyce Bradley Petrey				///
	///	All Rights Reserved.								///
	/// http://www.EchoChrist.com/MagicImage				///
	/// webmaster@EchoChrist.com							///
	///														///
	///	This script is free to use as long as this notice 	///
	/// remains unchanged and intact.					 	///
	///														///
	/// 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. 								///
	///														///
	/// 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.  					///
	/// 													///
	/// Be Imitators of God as dear children and walk		///
	/// in love as Christ also loved us.					///
	///	Ephesians 5:1-2										///
	///////////////////////////////////////////////////////////

	var ImageLoad = 
	[
	['index.htm', 	'banners/b1.swf', 	'Blue Flower'			],		//  ['URL to linked page', 'URL to image', 'Caption under picture']	//
	['index.htm', 	'banners/b2.swf', 	'Distant Rainstorm'		],		//  The caption is not required and may be left blank like this:		//
	['index.htm', 	'banners/b3.swf', 	'Raindrops on a Leaf'	],		//  ['URL to linked page', 'URL to image', '']							//
	];

	var ImageCount		= 6;			//  *****  Change this to the total number of images loaded above  ***** 		//	
	var ImageDelay		= 20000;			//  *****  Set this to the delay interval desired.  5000 = 5 seconds.			// 
	var LinkTarget		= "_self"		//  *****  Defines where you want linked page to open. _self, _blank, _top, etc	//
	var ImageIndex		= 0;			//  DO NOT ALTER	//
	var FirstLoad 		= 0;			//  DO NOT ALTER	//
	var QuickStartID 	= 0;  			//  DO NOT ALTER	//
	var htmlString 		= ""			//  DO NOT ALTER 	//

	var FlashFile = "";
	var characterToCount = ",";
	var counter = 0;

	function FlashChange()
	{

		htmlString = htmlString + '<OBJECT '
		htmlString = htmlString + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
		htmlString = htmlString + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
		htmlString = htmlString + 'WIDTH="905" '
		htmlString = htmlString + 'HEIGHT="100" '
		htmlString = htmlString + 'id="bnr1" '
		htmlString = htmlString + 'ALIGN="" '
		htmlString = htmlString + 'VIEWASTEXT>'
		htmlString = htmlString + '<PARAM NAME=movie VALUE="http://situsindonesia.biz/swf/'+FlashFile[ImageIndex] + '">'
		htmlString = htmlString + '<PARAM NAME=quality VALUE=high>'
		htmlString = htmlString + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
		htmlString = htmlString + '<EMBED ';
		htmlString = htmlString + 'src="http://situsindonesia.biz/swf/'+FlashFile[ImageIndex]+'" '
		htmlString = htmlString + 'quality=high '
	//			str = str + 'bgcolor=#FFFCDA '
		htmlString = htmlString + 'WIDTH="905" '
		htmlString = htmlString + 'HEIGHT="100" '
		htmlString = htmlString + 'id="bnr1" '
		htmlString = htmlString + 'ALIGN="center" '
		htmlString = htmlString + 'TYPE="application/x-shockwave-flash" '
		htmlString = htmlString + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
		htmlString = htmlString + '</EMBED>'
		htmlString = htmlString + '</OBJECT>'


		document.getElementById('MagicImage').innerHTML = htmlString; 	
		htmlString = "";			

		if(ImageIndex == ImageCount - 1)		//  This statement increments image displayed and resets if displaying last image  //
		{										
		ImageIndex= 0;																				
		}																								
		else																							
		{																								
		ImageIndex++;																					
		}																										

		if(FirstLoad == 0)						//  Determins if this is the first time function has run.   // 
		{
		SlowFinish();
		}

	}

	//  End Funtion  //

	//  This function ensures first banner is displayted without a delay  //
	function  QuickStart(inFlash)
	{
		FlashFile =inFlash.split(",");
		for (i=0;i<FlashFile.length;i++)
		{
			counter++;
		}
		//alert(counter);
		ImageCount = counter;
		

		QuickStartID=setInterval("FlashChange()", 1000);
	}
	//  End Funtion  //																		

	//  This function sets display rate to user defined speed  //
	function SlowFinish()
	{
		clearInterval(QuickStartID);
		FirstLoad = 1;
		setInterval("FlashChange()", ImageDelay);	 
	}	
	
	/////////////////////////////////
	// File Name: mBanner.js       //
	// By: Manish Kumar Namdeo     //
	/////////////////////////////////

	// BANNER OBJECT
	function Banner(objName){
		this.obj = objName;
		this.aNodes = [];
		this.currentBanner = 0;
		
	};

	// ADD NEW BANNER
	Banner.prototype.add = function(bannerType, bannerPath, bannerDuration, height, width, hyperlink) {
		this.aNodes[this.aNodes.length] = new Node(this.obj +"_"+ this.aNodes.length, bannerType, bannerPath, bannerDuration, height, width, hyperlink);
	};

	// Node object
	function Node(name, bannerType, bannerPath, bannerDuration, height, width, hyperlink) {
		this.name = name;
		this.bannerType = bannerType;
		this.bannerPath = bannerPath;
		this.bannerDuration = bannerDuration;
		this.height = height
		this.width = width;
		this.hyperlink= hyperlink;
	//	alert (name +"|" + bannerType +"|" + bannerPath +"|" + bannerDuration +"|" + height +"|" + width + "|" + hyperlink);
	};

	// Outputs the banner to the page
	Banner.prototype.toString = function() {
		var str = ""
		for (var iCtr=0; iCtr < this.aNodes.length; iCtr++){
			str = str + '<span name="'+this.aNodes[iCtr].name+'" '
			str = str + 'id="'+this.aNodes[iCtr].name+'" ';
			str = str + 'class="m_banner_hide" ';
			str = str + 'bgcolor="#FFFCDA" ';	// CHANGE BANNER COLOR HERE
			str = str + 'align="center" ';
			str = str + 'valign="top" >\n';
			if (this.aNodes[iCtr].hyperlink != ""){
				str = str + '<a href="'+this.aNodes[iCtr].hyperlink+'">';
			}
				
			if ( this.aNodes[iCtr].bannerType == "FLASH" ){
				str = str + '<OBJECT '
				str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
				str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
				str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
				str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
				str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" '
				str = str + 'ALIGN="" '
				str = str + 'VIEWASTEXT>'
				str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">'
				str = str + '<PARAM NAME=quality VALUE=high>'
				str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
				str = str + '<EMBED ';
				str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" '
				str = str + 'quality=high '
	//			str = str + 'bgcolor=#FFFCDA '
				str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
				str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
				str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" '
				str = str + 'ALIGN="center" '
				str = str + 'TYPE="application/x-shockwave-flash" '
				str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
				str = str + '</EMBED>'
				str = str + '</OBJECT>'
			}else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
				str = str + '<img src="'+this.aNodes[iCtr].bannerPath+'" ';
				str = str + 'border="0" ';
				str = str + 'height="'+this.aNodes[iCtr].height+'" ';
				str = str + 'width="'+this.aNodes[iCtr].width+'">';
			}

			if (this.aNodes[iCtr].hyperlink != ""){
				str = str + '</a>';
			}

			str += '</span>';
		}
		return str;
	};

	// START THE BANNER ROTATION
	Banner.prototype.start = function(){
		this.changeBanner();
		var thisBannerObj = this.obj;
		// CURRENT BANNER IS ALREADY INCREMENTED IN cahngeBanner() FUNCTION
		setTimeout(thisBannerObj+".start()", this.aNodes[this.currentBanner].bannerDuration * 1000);
	}

	// CHANGE BANNER
	Banner.prototype.changeBanner = function(){
		var thisBanner;
		var prevBanner = -1;
		if (this.currentBanner < this.aNodes.length ){
			thisBanner = this.currentBanner;
			if (this.aNodes.length > 1){
				if ( thisBanner > 0 ){
					prevBanner = thisBanner - 1;
				}else{
					prevBanner = this.aNodes.length-1;
				}
			}
			if (this.currentBanner < this.aNodes.length - 1){
				this.currentBanner = this.currentBanner + 1;
			}else{
				this.currentBanner = 0;
			}
		}
		

		if (prevBanner >= 0){
			document.getElementById(this.aNodes[prevBanner].name).className = "m_banner_hide";
		}
		document.getElementById(this.aNodes[thisBanner].name).className = "m_banner_show";
	}

		
	
	
	// POPUP WINDOW
	function openpopup(popurl, w, h, sizable) {
		str = 'width='+(w+20)+',height='+(h+30);
		if ( sizable != true ) {
			str = str + ',scrollbars=no,resizable=no,status=no';
		} else {
			str = str + ',scrollbars=yes,resizable=yes,status=yes';
		}
		window.open(popurl,'',str);
	}
	
	// ARRAY PROTOTYPES
	Array.prototype.contains = function (element) {
		for ( var i=0; i<this.length; i++ ) {
			if ( this[i]==element ) {
				return i;
			}
		}
		return false;
	}
	
	Array.prototype.remove = function (element) {
		var result = false;
		var array = [];
		for (var i = 0; i < this.length; i++) {
			if (this[i] == element) {
				result = true;
			} else {
				array.push(this[i]);
			}
		}
		this.length = 0;
		for (var i = 0; i < array.length; i++) {
			this.push(array[i]);
		}
		array = null;
		return result;
	};
	
	Array.prototype.addUnique = function (element) {
		if (this.contains(element) === false) {
			this.push(element);
		}
	};
	
	// Read the JavaScript cookies tutorial at:
	// http://www.netspade.com/articles/javascript/cookies.xml
	
	// SET COOKIE
	function setCookie(name, value, days, expires, path, domain, secure) {
		if (days) {
			expires = new Date();
			expires.setTime(expires.getTime()+(days*24*60*60*1000));
		}
		
		document.cookie= name + "=" + escape(value) +
			((expires) ? "; expires=" + expires.toGMTString() : "") +
			((path) ? "; path=" + path : "") +
			((domain) ? "; domain=" + domain : "") +
			((secure) ? "; secure" : "");
	}
	
	// GET COOKIE
	function getCookie(name) {
		var dc = document.cookie;
		var prefix = name + "=";
		var begin = dc.indexOf("; " + prefix);
		if (begin == -1) {
			begin = dc.indexOf(prefix);
			if (begin != 0) return null;
		} else {
			begin += 2;
		}
		var end = document.cookie.indexOf(";", begin);
		if (end == -1) {
			end = dc.length;
		}
		return unescape(dc.substring(begin + prefix.length, end));
	}
	
	// DELETE COOKIE
	function deleteCookie(name, path, domain) {
		if (getCookie(name)) {
			document.cookie = name + "=" + 
				((path) ? "; path=" + path : "") +
				((domain) ? "; domain=" + domain : "") +
				"; expires=Thu, 01-Jan-70 00:00:01 GMT";
		}
	}
	
	// TOGGLE BLOCK
	function toggleBlock(id, forceHidden) {
		forceHidden = (forceHidden==undefined) ? false : forceHidden;
		
		// Variables
		var toggleObj;
		var linkObj;
		
		// Get Element
		if (document.getElementById) {
			// this is the way the standards work: Safari, FireFox
			toggleObj = document.getElementById('toggle'+id);
			linkObj = document.getElementById('link'+id);
		} else if (document.all) {
			// this is the way old msie versions work
			toggleObj = document.all['toggle'+id];
			linkObj = document.all['link'+id];
			
		} else if (document.layers) {
			// this is the way nn4 works
			toggleObj = document.layers['toggle'+id];
			linkObj = document.layers['link'+id];
		}
		
		// Toggle
		var cookieStr = getCookie('toggledItems');
		var toggleArr = Array();
		if (cookieStr) {
			toggleArr = cookieStr.split(',');
		}
		
		if (toggleObj) {
			styleObj = toggleObj.style;
			if (styleObj.display != "none" || forceHidden==true) {
				// HIDE
				toggleArr.addUnique(id);
				styleObj.display = "none";
				if (linkObj) {
					twistyObj = linkObj.getElementsByTagName('img')[0];
					
					if (twistyObj) {
						twistyObj.setAttribute('src', blogSettings['img_path'] + 'plus.gif');
						twistyObj.setAttribute('alt','[+]');
					} else {
						linkObj.innerHTML = "[+]";
					}
				}
			} else {
				// SHOW
				toggleArr.remove(id);
				styleObj.display = "block";
				if (linkObj) {
					twistyObj = linkObj.getElementsByTagName('img')[0];
					
					if (twistyObj) {
						twistyObj.setAttribute('src', blogSettings['img_path'] + 'minus.gif');
						twistyObj.setAttribute('alt','[-]');
					} else {
				linkObj.innerHTML = "[-]";
			}
				}
			}
			setCookie('toggledItems', toggleArr.toString(),30);
		}	
	}
	
	// DEFAULT PAGE INIT FUNCTION
	function init() {
		var cookieStr = getCookie('toggledItems');
		var toggleArr = Array();
		
		if (cookieStr) {
			toggleArr = cookieStr.split(',');
			for ( var i=0; i<toggleArr.length; i++ ) {
				toggleBlock(toggleArr[i], true);
			}
		}
	}
	
	function addEvent(elm, evType, fn, useCapture){
		if (elm.addEventListener) {
			elm.addEventListener(evType, fn, useCapture);
			return true;
		} else if (elm.attachEvent) {
			var r = elm.attachEvent('on' + evType, fn);
			return r;
		} else {
			elm['on' + evType] = fn;
		}
	}
	
	addEvent(window, 'load', init, false);
-->