$('document').ready(function() {
	if(jQuery('#sendToFriendA').length > 0){
		$('#sendToFriendA').click(function() {
			if($('#sendToFriendDiv').is(':hidden')){
				$('#sendToFriendDiv').slideDown();
			}
			return false;
		});
	}
	
	if(jQuery('#textSmall').length > 0){
		$('#textSmall, #textLarge').hover(
			function() {
				$(this).css('cursor','pointer');
			},
			function() {
				$(this).css('cursor','default');
			}
		);
	}
	if(jQuery('#textSmall').length > 0){
		$('#textSmall').click(function(){
			var currentSize = $('#listingBox p').css('font-size');
			currentSize = parseInt(currentSize);
			currentSize = currentSize - 2;
			currentSize = currentSize + 'px';
			
			$('#listingBox p, div.asset-body').css('font-size',currentSize);
		});
	}
	
	if(jQuery('#textLarge').length > 0){
		$('#textLarge').click(function(){
			var currentSize = $('#listingBox p').css('font-size');
			currentSize = parseInt(currentSize);
			currentSize = currentSize + 2;
			currentSize = currentSize + 'px';
			
			$('#listingBox p, div.asset-body').css('font-size',currentSize);
		});
	}
	
	if(jQuery('div.asset-body form.mt-enclosure-image').length > 0){
		$('div.asset-body form.mt-enclosure-image').css('float','left');
	}
	
	if(jQuery('#slideshow').length > 0){
		var images = $('#slideshow').children().size();
	}
	if(jQuery('span#spanInfo').length > 0){
		var spanInfo = $('span#spanInfo').attr('rel');
	}
	if(jQuery('#slideshow').length > 0){
		$('#slideshow').after('<ul id="slideshow-nav">').cycle({ 
			fx:     'fade', 
			speed:  1000, 
			timeout: 7000, 
			pager:  '#slideshow-nav',
			pause: 1 // killed b/c of conflict with play/pause button
			
			// pagerAnchorBuilder: function(idx, slide) {
				// count++;
				// var markup = '<li><a href="#">' + count + '</a></li>'
				// if (count == images && spanInfo != 'noMore') {
					// markup += '<li>&nbsp; <a id="slideshowPlayPause" href="">Play/Pause</a></li>';
					// markup += '<li>&nbsp; <a id="photoGalleryLink" href="/photo-gallery.cfm">View All</a></li>'; // this adds view all link
				// }
				// return markup;
			// } 
		});
	}
	
	var pause = 0;
	if(jQuery('#slideshowPlayPause').length > 0){
		$('#slideshowPlayPause').click(function() {
			if (pause == 0) {
				$('#slideshow').cycle('pause');
				pause = 1;
				return false;
			} else if (pause == 1) {
				$('#slideshow').cycle('resume');
				pause = 0;
				return false;
			}
		});
	}
});