Cufon.replace('#mnav-splash a, #mnav a, #snav li', {
				fontFamily: 'Helvetica',
				hover: true
			});
			
			Cufon.replace('.posttitle, #tagline', {
				fontFamily: 'Caslon',
				hover: true
			});

/*set up no conflict for jQuery*/
var $j = jQuery.noConflict();

$j(document).ready(function() {
	/* Got rid of extra space created by this code (yoh 9/15/09)
	if($j('#videoplayer').length == 0){
		$j('#footer').after('<div id="videoplayer"></div><div id="videowallcurtain"></div><div id="videowall"><div class="clear"></div>	</div>');
	};
	*/
	
	//imgBand flickr Functions
	/*if($j('#imgBand').length > 0){
		
		$j(function(){
		
	    //assign your api key equal to a variable
	    var apiKey = 'c0d89f7afc43d4a04ad9d755cfafa3ee';
			
	    //the initial json request to flickr
			$j.getJSON('http://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' + apiKey + '&group_id=1225015%40N21&tags=splash&format=json&per_page=5&page=1&jsoncallback=?',
					function(data){
					
		    //loop through the results with the following function
		    $j.each(data.photos.photo, function(i,item){
						i = i + 1;
						var imgbanddiv = '.imgband' + i;
		        //build the url of the photo in order to link to it
		        var photoURL = 'http://farm' + item.farm + '.static.flickr.com/' + item.server + '/' + item.id + '_' + item.secret + '_m.jpg'
		        
		        $j(imgbanddiv).append('<img src="' + photoURL + '" />');
		        		        
	        });
	     });
     });	
	};*/
	
	//this generates a random # for image grabbing
	Math.RandomInteger = function(n, m) {
		if (! m) {m = 1;} // default range starts at 1
		var max = n > m ? n : m; // doesn't matter which value is min or max
		var min = n === max ? m : n; // min is value that is not max
		var d = max - min + 1; // distribution range
		return Math.floor(Math.random() * d + min);
	};
	
	//main gallery flickr Functions
	if($j('#dynamedia').length > 0){
	
		$j(function(){
	    //assign your api key equal to a variable
	    var apiKey = 'c0d89f7afc43d4a04ad9d755cfafa3ee';
	
	    //the initial json request to flickr
			$j.getJSON('http://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' + apiKey + '&group_id=1225015%40N21&tags=splash&format=json&per_page=100&page=1&jsoncallback=?',
					function(data){
					
					var f_random = Math.RandomInteger(1, 100)
	
		    //loop through the results with the following function
		    var i = 2;
		    $j('#dynamedia div div:not(#dyna1)').each(function(){
		    	var dynadiv = '#dyna' + i;
		    	var f_random = Math.RandomInteger(1, 100)
		    	var f_item = data.photos.photo[f_random];
		    	var f_url ='http://farm' + f_item.farm + '.static.flickr.com/' + f_item.server + '/' + f_item.id + '_' + f_item.secret + '_m.jpg'
		    	
		    	$j(dynadiv).children('img').replaceWith('<img src="' + f_url + '" alt="" />');
		    	i++;
		    });
		    
		    //old function in case we need to reuse
		    /*$j.each(data.photos.photo, function(i,item){
						i = i +2;
						var dynadiv = '#dyna' + i;
		        //build the url of the photo in order to link to it
		        var photoURL = 'http://farm' + item.farm + '.static.flickr.com/' + item.server + '/' + item.id + '_' + item.secret + '_m.jpg'
		        //$j(dynadiv).append('<a href="' + photoURL + '"><img src="' + photoURL + '" /></a>');
		        $j(dynadiv + ' img').replaceWith('<img src="' + photoURL + '" />');
	        });*/
	        
	     });
     });	
	};
	
	//Resize Flickr Img Band using Badge.gne
		$j('.second #imgBand .flickr_badge_image img').each(function(){
			var h = $j(this).height();
			var w = $j(this).width();
			
			$j(this).width(159);
			$j(this).height(159*(h/w));

		});
     
});