	var animation_start;
	var animation_stop;
	var newsItemFade;
	var finished = true;
	var faded = false;
	var n = -1;
	var news_img = new Array();
	var news_txt = new Array();
	var curImg = "../../graphics/wait2.gif";
	var curTxt = "";
	var curHt = 500;
	var IE = /*@cc_on!@*/false;
	var scaled = false;
	var chk;

	news_img[0] = "jcpcover.jpg";
	news_img[1] = "books.jpg";
	//news_img[2] = "award.jpg";
	news_img[2] = "shortart.jpg";
	news_img[3] = "ftimes.jpg";

	news_txt[0] = "JCP's new cover design was announced at our 2012 conference.";
	news_txt[1] = "SCP Members...<br /><br />Save 30% on these SCP books published by M.E. Sharpe<br /><br /><a href=\"publication.aspx\">Further Details</a>.";
	//news_txt[2] = "The Society for Consumer Psychology announces a Call for Nominations for an Early Career Award for Distinguished Scientific Contribution to Consumer Psychology and the Society's Distinguished Scientific Achievement Award. Nomination information is available <a href=\"society_honorees.aspx\">here</a>.";
	news_txt[2] = "JCP has published its first few Research Reports, which focus on novel and interesting ideas and/or novel and interesting findings.  Check out the Research Reports <a href=\"jcp_shortart.aspx\">here</a>.<br /><br />";
	news_txt[3] = "JCP has been added to the list of top research journals <a href=\"pdf/JCP%20Editorial%20July-2010.pdf\" class=\"icon pdf-file\">recognized by the Financial Times</a>!<br /><br />"; 
	Spry.Effect.FadeSlide = function(element, options)
	{
		Spry.Effect.Cluster.call(this, options);
		
		this.name = 'FadeSlide';
		var duration = 1000;
		var doToggle = false;
		var from = 100;
		var to = 0;
	
		if (options)
		{
			if (options.duration) duration = options.duration;
			if (options.toggle) doToggle = options.toggle;
			if (options.from) from = options.from;
			if (options.to) to = options.to;
		}
	
		var options = {duration: duration, from: from, to: to, toggle: doToggle};
		var slide = new Spry.Effect.Slide(element, options);
		this.addParallelEffect(slide);
	
		var options = {duration: duration, from: from, to: to, toggle: doToggle};
		var fade = new Spry.Effect.Fade(element, options);
		this.addParallelEffect(fade);
	};
	
	Spry.Effect.FadeSlide.prototype = new Spry.Effect.Cluster();
	Spry.Effect.FadeSlide.prototype.constructor = Spry.Effect.FadeSlide;	
	

	function setupFade() {
	    if (document.getElementById("wnTxtCnt") != null) {
		    document.getElementById("wnTxtCnt").innerHTML = "LOADING NEWS...";
		    document.getElementById("wnImgCnt").innerHTML = "<img src=\"graphics/news/" + curImg + "\" class=\"wnImg\" id=\"wn_img\" />";
		    getNextNewsItem();
		}
	}
	
	function getNextNewsItem(flag) {
	    if (finished == true) {
		    fadeOut();		
		}
	}

	function fadeOut() {
	    finished = false;
		if (document.getElementById("wn_img")) {
			curHt = document.getElementById("wn_img").height;
		}
		
		fadeOut_start = function(){
			//document.getElementById("wnTxtCnt").innerHTML = "";
		}
		fadeOut_end = function(){
			getNextImg();
			chk = setInterval(chkIfLoaded, 100);
		}
		
		newsItemFade = new Spry.Effect.FadeSlide('wnImgCnt', {setup: fadeOut_start, finish:fadeOut_end, duration: 1000, from: curHt, to: 0, toggle:true});
		newsItemFade.start();
	}
	
	function chkIfLoaded() {
	    //check if image has size properties (indicating it has loaded)...if so, clear interval and do fadeIn()
	    if (document.getElementById("wn_img").width > 0) {
	        clearInterval(chk);
	        setTimeout(getNextNewsItem, 12000);
	        fadeIn();
	    } else {
	    }
	}
	
	function fadeIn() {
		scaleImg();
		
		fadeIn_start = function(){
		    finished = false;
			document.getElementById("wnTxtCnt").innerHTML = "<br /><span class=\"wnTxt\">" + curTxt + "</span>";
		}
		fadeIn_end = function(){
		    finished = true;
		}
		
		newsItemFade = new Spry.Effect.FadeSlide('wnImgCnt', {setup: fadeIn_start, finish:fadeIn_end, duration: 1000, from: 0, to: curHt, toggle:true});
		newsItemFade.start();
	}

	function getNextImg() {
		n++;
		if (n >= news_txt.length) {
			n = 0;
		}
	
		curImg = news_img[n];
		curTxt = news_txt[n];

		document.getElementById("wnImgCnt").innerHTML = "<img src=\"graphics/news/" + curImg + "\" class=\"wnImg\" id=\"wn_img\" />";
		
	}
	
	function scaleImg() {
		document.getElementById("wn_img").style.width = document.getElementById("wnImgCnt").style.width;
		document.getElementById("wn_img").style.height = 'auto'

		//if this is IE, we'll also have to scale resolution
		//if(IE && !scaled) {
			//ScaleItem(document.getElementById("wn_img"));
			//scaled = true;
		//}
		
		document.getElementById("wnImgCnt").style.width = document.getElementById("wn_img").width + 'px';
		document.getElementById("wnTxtCnt").style.width = document.getElementById("wnImgCnt").style.width;
		document.getElementById("wnImgCnt").style.height = document.getElementById("wn_img").height + 'px';
		
		document.getElementById("wnContentCnt").style.width = (document.getElementById("wn_img").width + 16) + 'px';
		document.getElementById("whatsnew").style.width = (document.getElementById("wn_img").width + 16) + 'px';
		
		curHt =  document.getElementById("wn_img").height;
	}
