/*!
 * General plugin initialisation
 */
 
 
 
// Initialize Button plugin
	$(function() {
		$(".containerNavigationLocalisation fieldset").buttonset();
	});
	
// Initialize speech bubble
	if(window.jQuery){jQuery(function(){
		(function(){ var target = jQuery('.speechBubble'); target.append('<div class="pointer"></div>'); })();
	})};
	
// Initialize speech bubble
	if(window.jQuery){jQuery(function(){
		(function(){ var target = jQuery('tr.addresses td'); target.prepend('<div class="marker">YES</div>'); })();
	})};
	
// Initialize browser check
	$(document).ready(function(){
		if($.browser.msie) {
			(function(){ var target = jQuery('.browserVendor'); target.append('You are using Internet Explorer. '); })();
			if($.browser.version<8)
			{
				(function(){ var target = jQuery('.browserVendor'); target.append('However it is not the latest version - please update to avoid security issues. Internet Explorer 6 has been discontinued for development. Microsoft recommends all users to upgrade their browsers for security reasons.'); })();
			}
			if($.browser.version<7)
			{
				(function(){ var target = jQuery('body'); target.prepend('<div style="width:270px; padding:20px; margin:30px auto; border:1px solid #F00; background:#FFF;"><h3>Warning</h3><p>You are using Internet Explorer 6. Microsoft recommends upgrading for security reasons.</p><p><a target="_blank" href="http://www.microsoft.com/windows/internet-explorer" class="iconArrowRight">Microsoft Internet Explorer</a><br><a target="_blank" href="http://www.mozilla.com/firefox" class="iconArrowRight">Mozilla Firefox</a><br><a target="_blank" href="http://www.apple.com/safari" class="iconArrowRight">Apple Safari</a><br><a target="_blank" href="http://www.google.com/chrome" class="iconArrowRight">Google Chrome</a></p></div>'); })();
			}
		}
		else if($.browser.mozilla) {
			(function(){ var target = jQuery('.browserVendor'); target.append('You are using Mozilla Firefox. This is an excellent browser.'); })();
		}
		else if($.browser.webkit) {
			(function(){ var target = jQuery('.browserVendor'); target.append('You are using Google Chrome. This is an excellent browser.'); })();
		}
		else if($.browser.safari) {
			(function(){ var target = jQuery('.browserVendor'); target.append('You are using Apple Safari. This is an excellent browser.'); })();
		}
		else {
			(function(){ var target = jQuery('.browserVendor'); target.append('You are using an unknown browser.'); })();
		}
	});
	
	
// Slider - Feedback form
	jQuery(document).ready(function(){
		var button = $('.feedback'), slideObject = jQuery('#containerFeedback'), slideContent = jQuery('#contentFeedback'), closedWidth = 47, openWidth = 670, speed = 500;
		jQuery(button).toggle(
			function(){
				// Show content before animating
				jQuery(slideContent).show();
				// Animate - open
				jQuery(slideObject).animate({
					width: openWidth}, {duration: speed});
					return false;
			},
			function(){
				// Animate - close and on completion hide content
				jQuery(slideObject).animate({
					width: closedWidth}, {duration: speed, complete: function(){slideContent.hide();}});
					return false;
			}
		);
	});
	
	
	jQuery(document).ready(function(){	
		
		var slideObject = jQuery('#containerFeedback'), slideContent = jQuery('#contentFeedback'), closedWidth = 47, openWidth = 670, speed = 500;
		
		$('#contentFeedback').bind( 'clickoutside', function() {
		 // Animate - close and on completion hide content
				jQuery(slideObject).animate({
					width: closedWidth}, {duration: speed, complete: function(){slideContent.hide();}});
					return false;
		 });				
	}); 
