/*
	Site:		CreativeLynx: Website
	File:		/assets/scripts/global.js
	Version:	2009-06-01
	Author: 	
----------------------------------------------- */

/*	Global Configuration
----------------------------------------------- */
jQuery.noConflict();
var $j = jQuery;
var isIE6 = false;
var isSafari = false;

/*	Global Literal Object: Site-wide functions
----------------------------------------------- */
var Global = {

	/* Configuration */

	/* jQuery Object References to the Elements this speeds up the DOM */
	jONavigationPrimary: null,

	/* Utility: Browser Tests / Specific Fixes/Hooks */
	utilBrowserTests : function() {

		/* Detect if User Agent is IE6 using object detection, apply fix for background flicker bug */
		if (typeof document.body.style.maxHeight == 'undefined') { isIE6 = true; try { document.execCommand('BackgroundImageCache', false, true); } catch(e) { } }

		/* Detect if User Agent is Safari, add class '.safari' to div#Container */
		if ($j.browser.safari) { isSafari = true; $j('div#Container').addClass('safari'); }

	},

	/* Utility: External Links */
	utilExternalLinks : function() {
		$j('a.external').each(function() {
			var jOThis = $j(this);
			jOThis.click(function() {
				return !window.open(jOThis.attr('href'));
			});
		});
	},

	/* Utility: Navigation Primary li:hover */
	effectsNavigationPrimary : function() {

		/* Class Context */
		var cc = this;

		$j('span:not(.active span)', cc.jONavigationPrimary).hide();

		$j('a:not(.active)', cc.jONavigationPrimary).hover(function() {
			var jOThis = $j(this);
			$j('span', jOThis).animate({opacity: 'show'}, 400);
		}, function() {
			var jOThis = $j(this);
			$j('span', jOThis).hide();
		});
		
	},

	/* Initialise */ 
	init : function() {

		/* Class Context */
		var cc = this;

		/* Configuration */

		/* jQuery Object References to the Elements this speeds up the DOM */
		cc.jONavigationPrimary = $j('div#NavigationPrimary');

		cc.utilBrowserTests();
		cc.effectsNavigationPrimary();

	}

};

/*	Plugins Literal Object: jQuery Plugins
----------------------------------------------- */
var Plugins = {
	
	jDelay : function() {

		/*	jQuery Plugin: delay
			http://james.padolsey.com/javascript/jquery-delay-plugin/
		----------------------------------------------- */
		jQuery.fn.delay = function(time, callback){
			jQuery.fx.step.delay = function(){};
			return this.animate({delay:1}, time, callback);
		}

	},
		
	jMouseWheel : function() {

/*	jQuery Plugin: mousewheel v3.0.2
	Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
	Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
	and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
----------------------------------------------- */
(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);

	},

	jScrollPane : function() {

/*	jQuery Plugin: jScrollPane v1.2.3
	Copyright (c) 2006 Kelvin Luck (kelvin AT kelvinluck DOT com || http://www.kelvinluck.com)
	Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
	and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
	See http://kelvinluck.com/assets/jquery/jScrollPane/
----------------------------------------------- */
		(function(A){A.jScrollPane={active:[]};A.fn.jScrollPane=function(C){C=A.extend({},A.fn.jScrollPane.defaults,C);var B=function(){return false};return this.each(function(){var O=A(this);O.css("overflow","hidden");var X=this;if(A(this).parent().is(".jScrollPaneContainer")){var Ac=C.maintainPosition?O.position().top:0;var L=A(this).parent();var d=L.innerWidth();var Ad=L.outerHeight();var M=Ad;A(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",L).remove();O.css({top:0})}else{var Ac=0;this.originalPadding=O.css("paddingTop")+" "+O.css("paddingRight")+" "+O.css("paddingBottom")+" "+O.css("paddingLeft");this.originalSidePaddingTotal=(parseInt(O.css("paddingLeft"))||0)+(parseInt(O.css("paddingRight"))||0);var d=O.innerWidth();var Ad=O.innerHeight();var M=Ad;O.wrap(A("<div></div>").attr({className:"jScrollPaneContainer"}).css({height:Ad+"px",width:d+"px"}));A(document).bind("emchange",function(Ae,Af,p){O.jScrollPane(C)})}if(C.reinitialiseOnImageLoad){var N=A.data(X,"jScrollPaneImagesToLoad")||A("img",O);var G=[];if(N.length){N.each(function(p,Ae){A(this).bind("load",function(){if(A.inArray(p,G)==-1){G.push(Ae);N=A.grep(N,function(Ag,Af){return Ag!=Ae});A.data(X,"jScrollPaneImagesToLoad",N);C.reinitialiseOnImageLoad=false;O.jScrollPane(C)}}).each(function(Af,Ag){if(this.complete||this.complete===undefined){this.src=this.src}})})}}var o=this.originalSidePaddingTotal;var l={height:"auto",width:d-C.scrollbarWidth-C.scrollbarMargin-o+"px"};if(C.scrollbarOnLeft){l.paddingLeft=C.scrollbarMargin+C.scrollbarWidth+"px"}else{l.paddingRight=C.scrollbarMargin+"px"}O.css(l);var m=O.outerHeight();var i=Ad/m;if(i<0.99){var H=O.parent();H.append(A("<div></div>").attr({className:"jScrollPaneTrack"}).css({width:C.scrollbarWidth+"px"}).append(A("<div></div>").attr({className:"jScrollPaneDrag"}).css({width:C.scrollbarWidth+"px"}).append(A("<div></div>").attr({className:"jScrollPaneDragTop"}).css({width:C.scrollbarWidth+"px"}),A("<div></div>").attr({className:"jScrollPaneDragBottom"}).css({width:C.scrollbarWidth+"px"}))));var z=A(">.jScrollPaneTrack",H);var P=A(">.jScrollPaneTrack .jScrollPaneDrag",H);if(C.showArrows){var g;var Ab;var S;var r;var j=function(){if(r>4||r%4==0){y(u+Ab*b)}r++};var K=function(p){A("html").unbind("mouseup",K);g.removeClass("jScrollActiveArrowButton");clearInterval(S)};var Z=function(){A("html").bind("mouseup",K);g.addClass("jScrollActiveArrowButton");r=0;j();S=setInterval(j,100)};H.append(A("<a></a>").attr({href:"javascript:;",className:"jScrollArrowUp"}).css({width:C.scrollbarWidth+"px"}).html("Scroll up").bind("mousedown",function(){g=A(this);Ab=-1;Z();this.blur();return false}).bind("click",B),A("<a></a>").attr({href:"javascript:;",className:"jScrollArrowDown"}).css({width:C.scrollbarWidth+"px"}).html("Scroll down").bind("mousedown",function(){g=A(this);Ab=1;Z();this.blur();return false}).bind("click",B));var Q=A(">.jScrollArrowUp",H);var J=A(">.jScrollArrowDown",H);if(C.arrowSize){M=Ad-C.arrowSize-C.arrowSize;z.css({height:M+"px",top:C.arrowSize+"px"})}else{var s=Q.height();C.arrowSize=s;M=Ad-s-J.height();z.css({height:M+"px",top:s+"px"})}}var w=A(this).css({position:"absolute",overflow:"visible"});var D;var Y;var b;var u=0;var V=i*Ad/2;var a=function(Ae,Ag){var Af=Ag=="X"?"Left":"Top";return Ae["page"+Ag]||(Ae["client"+Ag]+(document.documentElement["scroll"+Af]||document.body["scroll"+Af]))||0};var f=function(){return false};var v=function(){n();D=P.offset(false);D.top-=u;Y=M-P[0].offsetHeight;b=2*C.wheelSpeed*Y/m};var E=function(p){v();V=a(p,"Y")-u-D.top;A("html").bind("mouseup",T).bind("mousemove",h);if(A.browser.msie){A("html").bind("dragstart",f).bind("selectstart",f)}return false};var T=function(){A("html").unbind("mouseup",T).unbind("mousemove",h);V=i*Ad/2;if(A.browser.msie){A("html").unbind("dragstart",f).unbind("selectstart",f)}};var y=function(Ae){Ae=Ae<0?0:(Ae>Y?Y:Ae);u=Ae;P.css({top:Ae+"px"});var Af=Ae/Y;w.css({top:((Ad-m)*Af)+"px"});O.trigger("scroll");if(C.showArrows){Q[Ae==0?"addClass":"removeClass"]("disabled");J[Ae==Y?"addClass":"removeClass"]("disabled")}};var h=function(p){y(a(p,"Y")-D.top-V)};var q=Math.max(Math.min(i*(Ad-C.arrowSize*2),C.dragMaxHeight),C.dragMinHeight);P.css({height:q+"px"}).bind("mousedown",E);var k;var R;var I;var t=function(){if(R>8||R%4==0){y((u-((u-I)/2)))}R++};var Aa=function(){clearInterval(k);A("html").unbind("mouseup",Aa).unbind("mousemove",e)};var e=function(p){I=a(p,"Y")-D.top-V};var U=function(p){v();e(p);R=0;A("html").bind("mouseup",Aa).bind("mousemove",e);k=setInterval(t,100);t()};z.bind("mousedown",U);H.bind("mousewheel",function(Ae,Ag){v();n();var Af=u;y(u-Ag*b);var p=Af!=u;return !p});var F;var W;function c(){var p=(F-u)/C.animateStep;if(p>1||p<-1){y(u+p)}else{y(F);n()}}var n=function(){if(W){clearInterval(W);delete F}};var x=function(Af,p){if(typeof Af=="string"){$e=A(Af,O);if(!$e.length){return}Af=$e.offset().top-O.offset().top}H.scrollTop(0);n();var Ae=-Af/(Ad-m)*Y;if(p||!C.animateTo){y(Ae)}else{F=Ae;W=setInterval(c,C.animateInterval)}};O[0].scrollTo=x;O[0].scrollBy=function(Ae){var p=-parseInt(w.css("top"))||0;x(p+Ae)};v();x(-Ac,true);A("*",this).bind("focus",function(Ah){var Ag=A(this);var Aj=0;while(Ag[0]!=O[0]){Aj+=Ag.position().top;Ag=Ag.offsetParent()}var p=-parseInt(w.css("top"))||0;var Ai=p+Ad;var Af=Aj>p&&Aj<Ai;if(!Af){var Ae=Aj-C.scrollbarMargin;if(Aj>p){Ae+=A(this).height()+15+C.scrollbarMargin-Ad}x(Ae)}});if(location.hash){x(location.hash)}A(document).bind("click",function(Ae){$target=A(Ae.target);if($target.is("a")){var p=$target.attr("href");if(p.substr(0,1)=="#"){x(p)}}});A.jScrollPane.active.push(O[0])}else{O.css({height:Ad+"px",width:d-this.originalSidePaddingTotal+"px",padding:this.originalPadding});O.parent().unbind("mousewheel")}})};A.fn.jScrollPane.defaults={scrollbarWidth:15,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:16,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false,reinitialiseOnImageLoad:false};A(window).bind("unload",function(){var C=A.jScrollPane.active;for(var B=0;B<C.length;B++){C[B].scrollTo=C[B].scrollBy=null}})})(jQuery);

	},

	init : function(){

		/* Class Context */
		var cc = this;

		cc.jDelay();
		cc.jMouseWheel();
		cc.jScrollPane();


	}

}

/*	Section: Sectors
----------------------------------------------- */
var SectionSectors = {

	/* Configuration */
	cCaseStudyImagesCount : null,
	cCaseStudyImagesCurrent : null,
	cCaseStudyActive : null,
	cCaseStudyActionTextActive : null,
	cCaseStudyActionTextInActive : null,
	cCaseStudyActionLeftActive : null,
	cCaseStudyActionLeftInActive : null,
	cCaseStudyNavigationNext : null,

	/* jQuery Object References to the Elements this speeds up the DOM */
	jOListingCaseStudies : null,
	jOCaseStudyImages : null,
	jOCaseStudy : null,
	jOCaseStudyContent : null,
	jOCaseStudyAction : null,
	jOCaseStudyNavigation : null,

	toggleListingCaseStudies : function() {

		/* Class Context */
		var cc = this;

		cc.jOListingCaseStudiesHeader = $j('.c-h', cc.jOListingCaseStudies);
		cc.jOListingCaseStudiesBody = $j('.c-b', cc.jOListingCaseStudies);

		$j('li', cc.jOListingCaseStudiesHeader).hover(function() {
			var jOThisClass = $j(this).attr('class');
			/* Show li in .c-b that matches class */
			$j('li.' + jOThisClass, cc.jOListingCaseStudiesBody).show();
		}, function() {
			var jOThisClass = $j(this).attr('class');
			/* Hide li in .c-b that matches class */
			$j('li.' + jOThisClass, cc.jOListingCaseStudiesBody).hide();
		});

	},

	rotateCaseStudyImages : function() {

		/* Class Context */
		var cc = this;

		cc.cCaseStudyImagesCurrent = parseInt(cc.cCaseStudyImagesCurrent, 10);

		if (cc.cCaseStudyImagesCount == cc.cCaseStudyImagesCurrent) {
			/* Rebuild navigation */
			cc.jOCaseStudyNavigation.html('<ul><li class="c-case-study-navigation-previous"><a class="case-study-navigation-internal case-study-image-' + (cc.cCaseStudyImagesCurrent - 1) + '" href="#"></li><li class="c-case-study-navigation-next"><a href="' + cc.cCaseStudyNavigationNext + '">Next Project &gt;</a></li></ul>');
		} else if (cc.cCaseStudyImagesCurrent == '1') {
			cc.jOCaseStudyNavigation.html('<ul><li class="c-case-study-navigation-next"><a class="case-study-navigation-internal case-study-image-' + (cc.cCaseStudyImagesCurrent + 1) + '" href="#">Next Image &gt;</a></li></ul>');
		} else {
			/* Rebuild navigation */
			cc.jOCaseStudyNavigation.html('<ul><li class="c-case-study-navigation-previous"><a class="case-study-navigation-internal case-study-image-' + (cc.cCaseStudyImagesCurrent - 1) + '" href="#">&lt; Previous Image</a></li><li class="c-case-study-navigation-next"><a class="case-study-navigation-internal case-study-image-' + (cc.cCaseStudyImagesCurrent + 1) + '" href="#">Next Image &gt;</a></li></ul>');
		}

		/* Bind click events if the link is internal (not the next project) */
		$j('li a.case-study-navigation-internal', cc.jOCaseStudyNavigation).click(function() {

			var jOEThis = $j(this);
			var cssClassesStr = jOEThis.attr('class').toString();
			var cssClasses = cssClassesStr.split('case-study-navigation-internal case-study-image-');

			/* FadeOut current image */
			$j('.case-study-image-' + cc.cCaseStudyImagesCurrent, cc.jOCaseStudyImages).fadeOut(400, function() {
				/* FadeIn next image */
				cc.cCaseStudyImagesCurrent = cssClasses[1];
				$j('.case-study-image-' + cc.cCaseStudyImagesCurrent, cc.jOCaseStudyImages).fadeIn(400, function() {
					/* Rebind roate */
					cc.rotateCaseStudyImages();
				});
			});

			return false;

		});

	},

	buildCaseStudyImages : function() {

		/* Class Context */
		var cc = this;

		/* Only run case study has more than 1 image, enable change image arrows */
		if (cc.cCaseStudyImagesCount > 1 ) {

			/* Assign next link */
			cc.cCaseStudyNavigationNext = $j('.c-case-study-navigation-next a', cc.jOCaseStudyNavigation).attr('href');

			/* Initialise image rotation */
			cc.rotateCaseStudyImages();

		}

		/* FadeIn first image */
		$j('.case-study-image-' + cc.cCaseStudyImagesCurrent, cc.jOCaseStudyImages).fadeIn();

	},

	toggleCaseStudy : function() {

		/* Class Context */
		var cc = this;

		if (cc.cCaseStudyActive) {

			/* Set state to inactive */
			cc.cCaseStudyActive = false;

			/* Fade case study content out */
			cc.jOCaseStudyContent.fadeOut('fast', function() {
				/* Animate width of .c-case-study to 24px (inactive state) */
				cc.jOCaseStudy.animate({ width: "24px"}, 400, function() {
					/* Update Action alternative text and set background image to inactive state */
					if ($j.browser.msie) {
						cc.jOCaseStudyAction.hide().css({backgroundPosition: 'right top', left: cc.cCaseStudyActionLeftInActive}).text(cc.cCaseStudyActionTextInActive).show();
					} else {
						cc.jOCaseStudyAction.hide().css({backgroundPosition: 'right top', left: cc.cCaseStudyActionLeftInActive}).text(cc.cCaseStudyActionTextInActive).fadeIn(200);
					}
				});
			});

		} else {

			/* Set state to active */
			cc.cCaseStudyActive = true;
			cc.jOCaseStudyAction.hide();
			/* Animate width of .c-case-study to 290px (active state) */
			cc.jOCaseStudy.animate({ width: "290px"}, 400, function() {
				/* Update Action alternative text and set background image to active state */
				if ($j.browser.msie) {
					cc.jOCaseStudyAction.css({backgroundPosition: 'left top', left: cc.cCaseStudyActionLeftActive}).text(cc.cCaseStudyActionTextActive).show();
				} else {
					cc.jOCaseStudyAction.css({backgroundPosition: 'left top', left: cc.cCaseStudyActionLeftActive}).text(cc.cCaseStudyActionTextActive).fadeIn(800);
				}
				/* Fade case study content in */
				cc.jOCaseStudyContent.fadeIn();
			});

		}

	},
	
	eventsCaseStudy : function() {

		/* Class Context */
		var cc = this;

		cc.jOCaseStudyContent = $j('.c-h, .c-b', cc.jOCaseStudy);
		cc.jOCaseStudyAction = $j('<a class="c-action" href="#Content">Show Case Study Details</a>');
		cc.jOCaseStudyAction.hide();
		cc.jOCaseStudy.append(cc.jOCaseStudyAction);

		cc.jOCaseStudyAction.click(function() {

			/* Toggle Case Study detail */
			cc.toggleCaseStudy();

		});

	},

	/* Initialise */ 
	init : function() {

		/* Class Context */
		var cc = this;

		/* jQuery Object References to the Elements this speeds up the DOM */
		cc.jOListingCaseStudies = $j('div.c-listing-case-studies');
		cc.jOCaseStudy = $j('div.c-case-study');
		cc.jOCaseStudyImages = $j('div.c-case-study-images');
		cc.jOCaseStudyNavigation = $j('div.c-case-study-navigation');

		/* If cc.jOContent exisits initialise component functions */
		if (cc.jOListingCaseStudies) {
/*			cc.toggleListingCaseStudies();*/
		}

		/* If cc.jOCaseStudyImages exisits initialise component functions */
		if (cc.jOCaseStudyImages) {

			cc.cCaseStudyImagesCount = 0;
			cc.cCaseStudyImagesCurrent = 1;

			$j('li', cc.jOCaseStudyImages).each(function() {
				var jOEThis = $j(this);
				cc.cCaseStudyImagesCount++;
				jOEThis.addClass('case-study-image-' + cc.cCaseStudyImagesCount + '');
			});

			cc.buildCaseStudyImages();

		}

		/* If cc.jOCaseStudy exisits initialise component functions */
		if (cc.jOCaseStudy) {

			/* Setup case study detail */ 
			cc.cCaseStudyActive = false;
			cc.cCaseStudyActionTextActive = 'Hide Case Study Details';
			cc.cCaseStudyActionTextInActive = 'Show Case Study Details';
			
			if ($j.browser.msie) {
				cc.cCaseStudyActionLeftActive = '288px';
				cc.cCaseStudyActionLeftInActive = '22px';
			} else if (isSafari) {
				cc.cCaseStudyActionLeftActive = '288px';
				cc.cCaseStudyActionLeftInActive = '22px';
			} else { 
				cc.cCaseStudyActionLeftActive = '558px';
				cc.cCaseStudyActionLeftInActive = '292px';
			}
			
			/* Bind events for case study */
			cc.eventsCaseStudy();
			
			/* Toggle case study (hides on DOM load) */
			cc.jOCaseStudy.delay(2000, function() {
			cc.toggleCaseStudy();
			});

		}

	}

};

/*	Section: News
----------------------------------------------- */
var SectionNews = {

	/* Configuration */

	/* jQuery Object References to the Elements this speeds up the DOM */
	
	jOJScrollPane: null,
	
	applyJScrollerPane : function() {

		/* Class Context */
		var cc = this;

		cc.jOJScrollPane.jScrollPane();

	},
	

	/* Initialise */
	init : function() {

		/* Class Context */
		var cc = this;

		/* jQuery Object References to the Elements this speeds up the DOM */
		cc.jOJScrollPane = $j('div#JScrollPane');

		/* If cc.jOContent exisits initialise component functions  */
		if (cc.jOJScrollPane) {
			cc.applyJScrollerPane();
		} 
		
	}

};

/*	Section: Info
----------------------------------------------- */
var SectionInfo = {

	/* Configuration */

	/* jQuery Object References to the Elements this speeds up the DOM */
	jOComponentMap: null,
	jOComponentMapHeader: null,
	jOComponentMapHeaderText: null,
	jOComponentMapBody: null,
	jOComponentMapBodyClose: null,

	buildLocationMap : function() {

		/* Class Context */
		var cc = this;

		/* jQuery Object References to the Elements this speeds up the DOM */
		cc.jOComponentMapHeader = $j('.c-h', cc.jOComponentMap);
		cc.jOComponentMapHeaderText = cc.jOComponentMapHeader.children();
		cc.jOComponentMapBody = $j('.c-b', cc.jOComponentMap);
		cc.jOComponentMapBodyClose = $j('<p class="js-close"><a href="#Content">Close</a></p>');

		/* Hide component body that contains map */
		cc.jOComponentMapBody.hide();

		/* Prepend 'View' and anchor to component header */
		cc.jOComponentMapHeaderText.html('<a href="#">Map</a>');

		/* On click of component header show body */
		cc.jOComponentMapHeader.click(function() {
			var tmpThis = $j(this);
			cc.jOComponentMapBodyClose.appendTo(cc.jOComponentMapBody);
			tmpThis.next().show();
		//	cc.jOComponentMapBody.show();
			return false;
		});

		/* On click of component header show body */
		cc.jOComponentMapBodyClose.click(function() {
			cc.jOComponentMapBody.hide();
			return false;
		});
		

		/* Show map as we hide this using the CSS .hasJS .c-map */
		cc.jOComponentMap.addClass('c-map-js').show();

	},

	/* Initialise */ 
	init : function() {

		/* Class Context */
		var cc = this;

		/* jQuery Object References to the Elements this speeds up the DOM */
		cc.jOComponentMap = $j('div.c-map');

		/* If map component exisits initialise component functions */
		if (cc.jOComponentMap) {
			cc.buildLocationMap();
		}

	}

};

/*	DOM Ready events
----------------------------------------------- */
$j(function() {

	/* Initialise Global */
	Global.init();

	/* Initialise Plugins */
	Plugins.init();

	/* If body.info initialise functions */
	if ($j('body.sectors').length) {
		SectionSectors.init();
	}

	/* If body.info initialise functions */
	if ($j('body.news').length) {
		SectionNews.init();
	}

	/* If body.info initialise functions */
	if ($j('body.info').length) {
		SectionInfo.init();
	}

	/* Fire Global.utilExternalLinks() last so any external links added via DOM during local page initialization will be activated */
	Global.utilExternalLinks();

});


  