	
	function changeField(a) {
		var x=document.getElementsById(a);
		document.getElementById(a).value = a;
	}  
		
	function popItUp(url) {
		newwindow=window.open(url,'name');
		if (window.focus) {
			newwindow.focus();
		}
			return false;
	}
	
	function podcastPlayer(url) {
		newwindow=window.open(url,'name','width=300,height=85,menubar=no,status=no');
		if (window.focus) {
			newwindow.focus();
		}
			return false;
	}
		
	function popAlertUp() {
		Alert("Sorry. We are working on this section. Please try later."); 
	}
	
	function soundCloudObjectAlbum(set) {
		document.write('<embed allowscriptaccess="always" height="225" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%');
		document.write(set);
		document.write('&amp;auto_play=false&amp;show_playcount=true&amp;show_artwork=true&amp;color=001421" type="application/x-shockwave-flash" width="100%"></embed>');
	}
	
	function soundCloudObjectPodcast(tracks) {
		document.write('<embed allowscriptaccess="always" height="85" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%');
		document.write(tracks);
		document.write('&amp;show_comments=true&amp;auto_play=false&amp;color=001421" type="application/x-shockwave-flash" width="100%"></embed>');
	}
		
	$(document).ready(function() {
	
		Cufon.replace('h1'); // Works without a selector engine
		Cufon.replace('h2'); // Works without a selector engine
		Cufon.replace('h3'); // Works without a selector engine
		Cufon.replace('h4'); // Works without a selector engine
		Cufon.replace('span'); // Works without a selector engine
		Cufon.replace('p'); // Requires a selector engine for IE 6-7, see above
		Cufon.replace('li'); // Requires a selector engine for IE 6-7, see above
	
		$('#slide').cycle({
			fx: 'fade',
			animation: 'slow',
			timeout: '8000',
			speed: '4000',
			next: '#next', 
			prev: '#prev',
			cleartype: 1,
			cleartypeNoBg: 'true',
			pause: 1
		});
	
		$('#contact-form-body').validate({
			messages:{
				 name: "Required!",
				 email: "Required!",
				 message: "Required!"
			}
		});
			
		$("a.img_gallery").fancybox();

		$(function() {
			var $elem = $('#wrapper');
			$('#nav_up').fadeIn('slow');
			$('#nav_down').fadeIn('slow');  
			
			$(window).bind('scrollstart', function(){
				$('#nav_up,#nav_down').stop().animate({'opacity':'0.2'});
			});
			$(window).bind('scrollstop', function(){
				$('#nav_up,#nav_down').stop().animate({'opacity':'1'});
			});
			
			$('#nav_down').click(
				function (e) {
					$('html, body').animate({scrollTop: $elem.height()}, 800);
				}
			);
					
			$('#nav_up').click(
				function (e) {
					$('html, body').animate({scrollTop: '0px'}, 800);
				}
			);
			
			$('#contact_btn').click(
				function (e) {
					$('html, body').animate({scrollTop: $elem.height()}, 800);
				}
			);
		});
		
	});
		


