// embeds a Flash movie
	function embedFlash(path, width, height, bgcolor) {
		if (! bgcolor) {
			bgcolor = "ffffff";
		}
		document.write("<OBJECT ");
			document.write("classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ");
			document.write("width=" + width + " height=" + height + ">");
			document.write("<param name=movie value='" + path + "'>");
			document.write("<param name=quality value=high>");
			document.write("<param name=menu value='false'>");
			document.write("<param name=wmode value='transparent'>");
		document.write("<embed src='" + path + "' quality=high bgcolor='" + bgcolor + "' width=" + width + " height=" + height + " ");
			document.write("type='application/x-shockwave-flash' ");
			document.write("menu='false' wmode='transparent'");
			document.write("PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'>");
		document.write("</embed>");
		document.write("</object>");
	}

$(document).ready(function() {
	/// Auto-Replace text for Input Fields
	$('input[type="text"]').addClass("idleField");
		$('input[type="text"]').focus(function() {
			$(this).removeClass("idleField").addClass("focusField");
	    if (this.value == this.defaultValue){ 
	    	this.value = '';
		}
		if(this.value != this.defaultValue){
			this.select();
		}
	});
	$('input[type="text"]').blur(function() {
		$(this).removeClass("focusField").addClass("idleField");
	    if ($.trim(this.value) == ''){
	    	this.value = (this.defaultValue ? this.defaultValue : '');
		}
	});
	
	$("a.iframe").fancybox({
		width: 250,
		height: 200,
		centerOnScroll:	true,
		overlayOpacity:	0.6,
		overlayColor: '#000'
	});    

	// Galleria
	Galleria.loadTheme('js/galleria/src/themes/wciu/galleria.wciu.js');
	
	// run galleria and add some options
    $('#features').galleria({
        extend: function() {
        this.play(5000); // will advance every 4th second
    	},
        image_crop: true,
        transition: 'slidefade',
        carousel: false,
        image_margin: '0',
        data_config: function(img) {
            return {
                description: $(img).next('p').html()
            };
        }
         
    });
});		
