var jQueryScriptOutputted = false;

function initJQuery() {
	//if the jQuery object isn't available
	if (typeof(jQuery) == 'undefined') {
		if (! jQueryScriptOutputted) {
			//only output the script once..
			jQueryScriptOutputted = true;
			//output the script (load it from google api)
			document.write('<scr' + 'ipt type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></scr' + 'ipt>'); 
		}
		setTimeout("initJQuery()", 50);
	} else {
		$(function() {
			$('#cr8innerdiv').append('<div><img src="http://ny-image1.etsy.com/il_170x135.122793437.jpg" width="150"  /><br/><strong>Price:</strong>$3.75&nbsp;&nbsp;&nbsp; <a target="_blank" style="color:#990000;" href="http://www.etsy.com/add_to_cart.php?listing_id=40520945">Buy</a><span style="margin-top:5px; font-size:10px;line-height:11px;"><br />Pink brads/paper fasteners...</span> <br /><a target="_blank" style="color:#990000;" href="http://www.etsy.com/view_listing.php?listing_id=40520945&ref=Cr8tivity_widget">[ more info ]</a></div> ');
$('#cr8innerdiv').append('<div><img src="http://ny-image3.etsy.com/il_170x135.52501795.jpg" width="150"  /><br/><strong>Price:</strong>$3.50&nbsp;&nbsp;&nbsp; <a target="_blank" style="color:#990000;" href="http://www.etsy.com/add_to_cart.php?listing_id=16011735">Buy</a><span style="margin-top:5px; font-size:10px;line-height:11px;"><br />12 Oval Scalloped Tags...</span> <br /><a target="_blank" style="color:#990000;" href="http://www.etsy.com/view_listing.php?listing_id=16011735&ref=Cr8tivity_widget">[ more info ]</a></div> ');
$('#cr8innerdiv').append('<div><img src="http://ny-image2.etsy.com/il_170x135.117100686.jpg" width="150"  /><br/><strong>Price:</strong>$3.00&nbsp;&nbsp;&nbsp; <a target="_blank" style="color:#990000;" href="http://www.etsy.com/add_to_cart.php?listing_id=38848073">Buy</a><span style="margin-top:5px; font-size:10px;line-height:11px;"><br />5 yards green double-sided polka dot ribbon...</span> <br /><a target="_blank" style="color:#990000;" href="http://www.etsy.com/view_listing.php?listing_id=38848073&ref=Cr8tivity_widget">[ more info ]</a></div> ');
$('#cr8innerdiv').append('<div><img src="http://ny-image2.etsy.com/il_170x135.116453950.jpg" width="150"  /><br/><strong>Price:</strong>$3.00&nbsp;&nbsp;&nbsp; <a target="_blank" style="color:#990000;" href="http://www.etsy.com/add_to_cart.php?listing_id=38658132">Buy</a><span style="margin-top:5px; font-size:10px;line-height:11px;"><br />5 yards pink double-sided polka dot ribbon...</span> <br /><a target="_blank" style="color:#990000;" href="http://www.etsy.com/view_listing.php?listing_id=38658132&ref=Cr8tivity_widget">[ more info ]</a></div> ');
$('#cr8innerdiv').append('<div><img src="http://ny-image0.etsy.com/il_170x135.143585856.jpg" width="150"  /><br/><strong>Price:</strong>$7.50&nbsp;&nbsp;&nbsp; <a target="_blank" style="color:#990000;" href="http://www.etsy.com/add_to_cart.php?listing_id=46673256">Buy</a><span style="margin-top:5px; font-size:10px;line-height:11px;"><br />First Haircut Keepsake card-boy...</span> <br /><a target="_blank" style="color:#990000;" href="http://www.etsy.com/view_listing.php?listing_id=46673256&ref=Cr8tivity_widget">[ more info ]</a></div> ');
$('#cr8innerdiv').append('<div><img src="http://ny-image2.etsy.com/il_170x135.86673574.jpg" width="150"  /><br/><strong>Price:</strong>$7.50&nbsp;&nbsp;&nbsp; <a target="_blank" style="color:#990000;" href="http://www.etsy.com/add_to_cart.php?listing_id=29805120">Buy</a><span style="margin-top:5px; font-size:10px;line-height:11px;"><br />First Haircut Keepsake card-girl...</span> <br /><a target="_blank" style="color:#990000;" href="http://www.etsy.com/view_listing.php?listing_id=29805120&ref=Cr8tivity_widget">[ more info ]</a></div> ');
			$.getScript("http://Cr8tivity.com/js/jQueryCycle.js",function(){
					$('#cr8innerdiv').cycle({
						fx:     'scrollHorz',
						timeout: 6000,
						delay:  -2000,
						next:   '#cr8next', 
						prev:   '#cr8prev',
						pause:  1,
						before: onBefore
					});
				});
			
			//$('#cr8outerdiv').show('slow');
		});
	}
}
initJQuery();
function onBefore(curr, next, opts) { 
			$('#cr8outerdiv').fadeIn('slow');
}
function start_slideshow(){
	$('#cr8innerdiv').cycle({
				fx:     'scrollRight',
				timeout: 6000,
				delay:  -2000,
				pause: 1
		});
}		