var quotes = new Array(
	"Still haven't found what you're looking for?", 
	"<br />2011 home ideas everyday",
	"One home idea after another... after another... after another...",
	"100% off every single home idea.",
	"<br />Renovators' Heaven",
	"<br />Time for another visit",
	"Surprise, surprise, it's full of home ideas."
	);
	
	
	function initImage() {
		imageId = "quote";
		image = document.getElementById(imageId);
		setOpacity(image, 100);
		image.style.visibility = 'visible';
		
		change_quote();
		
		fadeIn(imageId,0);
		
	}
	
	function change_quote() {
		rnd_Quote = Math.floor(Math.random()*quotes.length);
		document.getElementById('quote').innerHTML = "<div id=\"text\">" + quotes[rnd_Quote] +"</div>";
	}
	
	function fadeOut(objId,opacity) {
		if (document.getElementById) {
			obj = document.getElementById(objId);
			if (opacity >= 0) {
				setOpacity(obj, opacity);
				opacity -= 5;
				window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 50);
			} else {
				// Hide the layer so the page actually works
				//obj.style.zIndex = -300;
				//obj.style.visibility = 'hidden';
				//quote = quotes[Math.floor(Math.random()*quotes.length)];
				//document.getElementById('quote').innerHTML = "<br /><br /><br />" + quote;
				change_quote();
				window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 3000);
			}
		}
	}
	
	function fadeIn(objId,opacity) {
		if (document.getElementById) {
			obj = document.getElementById(objId);
			if (opacity <= 100) {
				setOpacity(obj, opacity);
				opacity += 5;
				window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 75);
			} else {
				// Hide the layer so the page actually works
				//obj.style.zIndex = -300;
				//obj.style.visibility = 'hidden';
				window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 4000);
			}
		}
	}
	
	function setOpacity(obj, opacity) {
		opacity = (opacity == 100)?99.999:opacity;
		// IE/Win
		obj.style.filter = "alpha(opacity:"+opacity+")";
		// Safari<1.2, Konqueror
		obj.style.KHTMLOpacity = opacity/100;
		// Older Mozilla and Firefox
		obj.style.MozOpacity = opacity/100;
		// Safari 1.2, newer Firefox and Mozilla, CSS3
		obj.style.opacity = opacity/100;
	}
	
	
	// used to pause for a few seconds 
	function pausecomp(millis) {
		var date = new Date();
		var curDate = null;

		do { curDate = new Date(); }
		while(curDate-date < millis);
	} 

