/*
	Share Our Strength scripts (utilizing jQuery 1.2.6)
	Developed by Saforian
*/

/* --- Initialize page --- */
$(document).ready(function(){



	/* cycle box */
	$('#cyclemessage')
		.after('<div id="cyclenumbers">')
		.cycle({
			fx: 'fade',
			speed: '900',
			timeout: 5000,
			pause: true,
			pager: '#cyclenumbers',
			// callback fn that creates a thumbnail to use as pager anchor 
			pagerAnchorBuilder: function(idx, slide) { 
        return '<a href="#" class="cyclethumb" id="cyclethumb' + slide.id + '"></a>'; 
    } 
		});


/*
mp3 player
*/

$(".mp3").jmp3({
			backcolor: "FB6800",
			forecolor: "ffffff",
			width: 85,
			showdownload: "false"
		});

/*
png transparency fix for bg images
*/
$('.cyclethumb').supersleight();

/* youtube overlay */
	$("a.youtube").each(function(){
		$(this).colorbox({width:"685px", height:"461px", inline:true, href:$(this).attr("href")});
	});

});

/* --- IE6 PNG fix --- */
function iepngfix() {

	// IE 5.5 and 6.0 PNG filter support (derived from youngpup.net)
	$("img[src$=png]").each(function(){
		var src = this.src;
		var div = document.createElement("div");

		// Set replacement div properties
		div.id = this.id;
		div.className = this.className;
		div.title = this.title || this.alt;
		div.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizing='scale')";
		div.style.width = this.width + "px";
		div.style.height = this.height + "px";

		// Replace image with transparent div
		this.replaceNode(div);
	});
}