
jQuery(document).ready(function ($) {
	
	if ( window.location.href.indexOf('#newsletterok') > 0 ) {
		alert('Thank you for signing up to receive the Loveland newsletter!');
	}
	
	$('input.labelinside,textarea.labelinside').labelToggle();

	$('.clickable').each(function () {
		
		$(this).css('cursor','pointer');
		$(this).click(function () {
			
			dest = $('a', $(this)).attr('href');

			window.location=dest;


		});
		
	});
	
	
});



jQuery.fn.labelToggle = function() {

	return this.each(function () {
		
		jQuery(this).focus(function () {
			if ( !jQuery(this).attr('data-label') ) {
				jQuery(this).attr('data-label', jQuery(this).val() );
			}

			if ( jQuery(this).val() == jQuery(this).attr('data-label') ) {
				jQuery(this).val('')
			}
			

		});
		
		jQuery(this).blur(function () {
			if ( jQuery(this).val() == '' && jQuery(this).attr('data-label') ) {
				 jQuery(this).val( jQuery(this).attr('data-label') ) 
			}
		});
		
	});
	
};


function photoset_openphoto(blogid, postid, photoid) {
	jQuery.fn.colorbox({
		width: '865px',
		height: '660px',
		href:'/wp-content/mu-plugins/loveland/photoviewer/?blogid='+blogid+'&postid='+postid + '&photoid=' + photoid,
		onComplete: function () {
			swfobject.switchOffAutoHideShow();
			swfobject.registerObject("photoviewer_flash", "10.0", "/wp-content/mu-plugins/loveland/swfobject/expressInstall.swf");
		}
	});
}

function photoset_open(blogid, postid) {
	
	jQuery.fn.colorbox({
		width: '865px',
		height: '660px',
		href:'/wp-content/mu-plugins/loveland/photoviewer/?blogid='+blogid+'&postid='+postid,
		onComplete: function () {
			swfobject.switchOffAutoHideShow();
			swfobject.registerObject("photoviewer_flash", "10.0", "/wp-content/mu-plugins/loveland/swfobject/expressInstall.swf");
		}
	});
	
}

function video_open(blogid, postid) {
	jQuery.fn.colorbox({
		width:829,
		height: 585,
		href:'/wp-content/mu-plugins/loveland/videoviewer/?blogid='+blogid+'&postid='+postid,
		onComplete: function () {
			swfobject.switchOffAutoHideShow();
			swfobject.registerObject("videoviewer_flash", "10.0", "/wp-content/mu-plugins/loveland/swfobject/expressInstall.swf");

		}
	});
}