// LAIDMAN LAKE ECOLODGE GLOBAL JQUERY FUNCTIONS
// Author: Netgen

$(document).ready(function() {   

$('#weatherConditions').weatherfeed(['CAXX1110']);

			//Examples of how to assign the ColorBox event to elements
			$("a[rel='example1']").colorbox();
			$("a[rel='example2']").colorbox({transition:"fade"});
			$("a[rel='example3']").colorbox({transition:"none", width:"75%", height:"75%"});
			$("a[rel='example4']").colorbox({slideshow:true});
			$(".example5").colorbox();
			$(".example6").colorbox({iframe:true, innerWidth:700, innerHeight:450});
			$(".modalVid").colorbox({iframe:true, innerWidth:640, innerHeight:390});
			$("a[rel='weatherFrame']").colorbox({width:"80%", height:"80%", iframe:true});
			$(".example7").colorbox({width:"80%", height:"80%", iframe:true});
			$(".example8").colorbox({width:"50%", inline:true, href:"#inline_example1"});
			$(".example9").colorbox({
				onOpen:function(){ alert('onOpen: colorbox is about to open'); },
				onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
				onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
				onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
				onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
			});
			//Example of preserving a JavaScript event for inline calls.
			$("#click").click(function(){ 
				$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
				return false;
			});
			
			
///////////////// TOGGLE WEATHER PANEL /////////////////	
  $("#subLinks a#toggleWeatherPanel").click(function() {
  		$("#weatherPanel").slideToggle('0');
		  return false;
  	});
  	
///////////////// CLOSE WEATHER PANEL /////////////////	
  $("#weatherPanel p a#hide").click(function() {
  		$("#weatherPanel").slideUp('0');
		  return false;
  	});

	
	
    
///////////////// FLICKR FEED /////////////////
$('#latest-flickr-images').jflickrfeed({
		limit: 6,
		qstrings: {
			id: '61810575@N08'
		},
		itemTemplate: '<li>'+
						'<a rel="colorbox" href="{{image}}" title="{{title}}">' +
							'<img src="{{image_s}}" alt="{{title}}" />' +
						'</a>' +
					  '</li>'
	}, function(data) {
		$('#latest-flickr-images a').colorbox();
	});
	
	

	///////////////// INITIALIZE JQUERY.TWEET /////////////////
	$(".tweet").tweet({
		username: "LaidmanLake",
    	join_text: "auto",
    	avatar_size: 55,
    	count: 1,
    	auto_join_text_default: "we said,",
    	auto_join_text_ed: "we",
    	auto_join_text_ing: "we were",
    	auto_join_text_reply: "we replied to",
    	auto_join_text_url: "we were checking out",
    	loading_text: "loading tweets..."
    });	
	
	// Opens all external links in a new window automatically	
	$("a[href^='http']").attr('target','_blank');


$("#contactform").validate({
messages: {
name: "Please specify your name",
email: {
required: "We need your email address to contact you",
email: "Your email address must be in the format of name@domain.com"
},
subject: "Please enter a subject",
message: "Please enter your message"
}
})

    
}); //END JQUERY DOM
