// JavaScript Document

    // Extends Feature Browser detection for Internet Explorer version.
    Object.extend(Prototype.Browser, {
        isIE6: (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) ? (Number(RegExp.$1) == 6 ? true : false) : false,
        isIE7: (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) ? (Number(RegExp.$1) == 7 ? true : false) : false,
        isIE8: (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) ? (Number(RegExp.$1) == 8 ? true : false) : false,
        isIE9: (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) ? (Number(RegExp.$1) == 9 ? true : false) : false
    });


/* This section is reserved to load or instancy components */


	// Exclude framesetting
	//if (window!=top) {top.location=window.location;}
	
	var js_session_date = new Date();
	
	
	//Init Cooking session controler <CookieJar> // expires in seconds !
	if( typeof(CookieJar) != 'undefined' ){ jar = new CookieJar({ expires:3600, path: '/' }); };

    var AppGarbageCollector = {};

	var UI_MINIMAL_HEIGHT_SIZE = 524; // px
	var UI_FOOTER_LINK_INIT_HEIGHT_SIZE = 0; // px
	var UI_SELECTED_TABPANE_HEIGHT_SIZE = 0; // px
	var UI_EXPANDED_TABPANE_HEIGHT_SIZE = 220; // px
	var UI_VERTICAL_TABCONTENT_HEIGHT_SIZE = 0; // px
	var UI_VERTICAL_TABS_HEIGHT_SIZE = 0; // px
	
	var MENU_ITEM_SELECTED = false;

	var scrolling = false;
	var UI_RAPIDLINK_FX_SCROLLING = null; // Morph Fx obj
	var UI_RAPIDLINK_FX_EXPANDING = null; // Morph Fx obj
	var UI_NAVMENU_FX_HITEFFECT = null; // FadeInOut Hit Fx obj

	var I_NAVBAR_TIMER = null;
	

/* The following section allows to init and launch instancied components
   (only if DOM il completly loaded) */

	// So, when DOM is ready.
	Event.observe(document, 'dom:loaded', function(event)
    {
		

    //console.log("twm Some inits... !");
		UI_FOOTER_LINK_INIT_HEIGHT_SIZE = $('area_rapidlink').getHeight();
		new Effect.Morph($('area_rapidlink'), { style: "height:0px;", duration: 0.3, transition:Effect.Transitions.EaseFromTo });


		
        
        // Manage cookie garbage
    //console.log("twm CookieJar !");
		if( typeof(CookieJar) != 'undefined' )
		{
			/*
			ui_data = jar.get('ui_data');
			if(ui_data == null) { jar.put('ui_data', {mode: 'ui_data_mode'}); }
			*/
		};




		// Make UI beautiful to prevent any problems.
    //console.log("twm Make UI beautiful !");
		if( parseInt($$('#content').length) == 1 )
		{
			if( $('header').getHeight() + $('content').getHeight() < UI_MINIMAL_HEIGHT_SIZE ){ $('content').setStyle( {'height': UI_MINIMAL_HEIGHT_SIZE - $('header').getHeight() +'px'}); };
		};




        // Initialize a single carousel through an element ID - ensure that the dom element exists !
    //console.log("twm Make UI beautiful !");
        if( parseInt($$('#carousel-1').length) == 1 )
        {
            new Pluit.Carousel('#carousel-1', {
				circular: true,
				usePrevNextNav: false,
				animDuration: 0.6,
				autoPlay: true,
				slideDuration: 5,
                useViewportClick: false,
                navCtrlInformations : [
                    {title:"Solutions Informatiques Innovantes - Cloud Computing",href:'#Cloud_computing',hreflang:'fr',lang:'fr'},
                    {title:"BOOST soutient Cyprien Richard...",href:'#Priou_2012',hreflang:'fr',lang:'fr'},
                    {title:"BOOST Media - Le Logiciel Web 2.0",href:'#BOOST_Media',hreflang:'fr',lang:'fr'}
                ]
			});
            AppGarbageCollector.PluitCarouselCollection = Pluit.CarouselCollection;
            $($$('li.playpause a')[0]).observe( 'click' , function(){ AppGarbageCollector.PluitCarouselCollection['element_0'].togglePause(); }.bindAsEventListener(this) );
        }
		




		// Push an URL Anchor Listener <gan>
    //console.log("URL listener 'Nous_Contacter'");
		(function(){ 
			if( gan('Nous_Contacter')!="" ){

				 Shadowbox.open({
					  content:	"/Essai_Gratuit_Contact.htm",
					  player:	"iframe",
					  title:	"Contactez-nous pour un conseil gratuit",
					  height:	558,
					  width:	650
				 });
				 
			}
		}).delay(0.2);



		// Push an URL Anchor Listener <gan>
    //console.log("URL listener 'Inscription_Newsletter'");
		(function(){ 
			if( gan('Inscription_Newsletter')!="" ){

				 Shadowbox.open({
					  content:	"/Inscription_Newsletter.htm",
					  player:	"iframe",
					  title:	"Inscrivez-vous &agrave; la newsletter BOOST !",
					  height:	310,
					  width:	650
				 });
				 
			}
		}).delay(0.3);



		// Push an URL Anchor Listener <gan>
    //console.log("URL listener 'Skype'");
		(function(){ 
			if( gan('Skype')!="" ){

				 if(_gaq){
					 _gaq.push(['_trackEvent', 'Module', 'Skype', 'SBR']);
				 }
				 
			}
		}).delay(0.3);

		
		



		// Embed Flash Content with swfObject, only if the browser support shocwave object.
    //console.log("Piecemaker @Home");
		if( (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPad/i)) ){ /*Do not change - leave the replacement image */ }
		else{
			
			if( typeof(swfobject) == 'object' )
			{
			    /*
            	// Embed « piecemaker Home »
				if( parseInt($$('#piecemaker_home').length) == 1 )
				{
					var flashvars = {};
					flashvars.cssSource = "css/piecemaker.css";
					flashvars.xmlSource = "xml/piecemaker_home.xml?"+js_session_date.getFullYear() +'-'+ (1+js_session_date.getMonth()) +'-'+ js_session_date.getDate();
					
					var params = {};
					params.play = "true";
					params.menu = "false";
					params.scale = "showall";
					params.wmode = "transparent";
					params.allowfullscreen = "true";
					params.allowscriptaccess = "always";
					params.allownetworking = "all";
					
					swfobject.embedSWF('swf/piecemaker.swf', 'piecemaker_home', '950', '350', '10', null, flashvars, params, null);
				}
                /**/
			}
	
		}



		// Menu items highlighting
    //console.log("twm highlight active item !");
		$$('ul#area_navbar li a').each(function(o){
			
			o.removeClassName('selected');
			
			//alert("href item vérifié : "+o.readAttribute('href')+"\n"+" href testé : "+window.location.pathname+window.location.hash)
			if(o.readAttribute('href') == window.location.pathname+window.location.hash )
			{
				o.addClassName('selected');
				MENU_ITEM_SELECTED = true;
			}
			
		});
		



		// Stop the event bubbling in the event stack <stopbubling>
    //console.log("twm stopbubling !");
		$$('.overlighted').each(function(o,i)
		{
			o.observe('click',function(e)
			{
				if( o.hasClassName('stopbubling') ){ Event.stop(e); }
				
				
			});
		});

		
		


		// Rapid Links handle (expand/collapse)
    //console.log("twm Search Focus !");
		if( parseInt( $$('#handle_rl').length ) == 1 ) // This control exists !
		{
			
            $('handle_rl').observe('click', function(e){

				Event.stop(e);
				s = $(Event.element(e)).readAttribute('rel'); s = (s=='')? 0 : parseInt(s); s = 1 - s; // s=0:collapse,s=1:expand
				styleheight = (s==0)? "height:0px;" : "height:"+UI_FOOTER_LINK_INIT_HEIGHT_SIZE+"px;";
				$(Event.element(e)).writeAttribute('rel',s);
				
				var anchor = String($('handle_rl').readAttribute('href')).replace(/#/,"");
				UI_RAPIDLINK_FX_EXPANDING = new Effect.Morph($('area_rapidlink'), { 
					style: styleheight, 
					duration: 0.3, 
					transition:Effect.Transitions.EaseFromTo, 
					afterFinish: function(){
						scrollToEasing(anchor,e);
					}
				});
				
			});



		    // Rapid Links handle (blind-down shake)
            var HANDLE_RL_PLAYING = null;
            var HANDLE_RL_PLAYING_MOTION = null;

            $('handle_rl').observe('mouseenter', function(e)
            {
	            var T,d,h = parseInt($('area_rapidlink').getStyle('height').toString().replace(/px/,''));
	            if(h<=10)
	            {
		            Event.stop(e);
		            HANDLE_RL_PLAYING = null;
                    if(HANDLE_RL_PLAYING_MOTION != null){HANDLE_RL_PLAYING_MOTION.cancel()}
		            h = 10; T = Effect.Transitions.Elastic; d = 0.8;
		            HANDLE_RL_PLAYING_MOTION = new Effect.Morph($('area_rapidlink'), { style: "height:"+h+"px;", duration: d, transition:T });
	            }
	
            });

            $('handle_rl').observe('mouseleave', function(e)
            {
	            var T,d,h = parseInt($('area_rapidlink').getStyle('height').toString().replace(/px/,''));
	            if(h<=10)
	            {
		            Event.stop(e);
		            HANDLE_RL_PLAYING = null;
                    if(HANDLE_RL_PLAYING_MOTION != null){HANDLE_RL_PLAYING_MOTION.cancel()}
		            h = 0; T = Effect.Transitions.EaseFromTo; d = 0.3;
		            HANDLE_RL_PLAYING_MOTION = new Effect.Morph($('area_rapidlink'), { style: "height:"+h+"px;", duration: d, transition:T });
	            }
	
            });

		}
        
        
        
        $('ui_handle_oseo').observe('click', function(e){ window.open("http://www.excellence.oseo.fr/Annuaire-entreprises/BOOST"); });



		
		
		


        // Special IE Cool Motion TextShadowing as the Gecko/Chrome effect - Special Motion FX By Sébastien Brémond (http://www.tocra.org)
        if( Prototype.Browser.isIE7 || Prototype.Browser.isIE8 )
        {

            if( parseInt($$('.homepitch').length) == 1 ){

                var PitchSrcBox = $($$('.homepitch')[0]);
                var PitchCizelFx = Element.clone(PitchSrcBox, true);

                Element.clonePosition(PitchCizelFx, PitchSrcBox);
                PitchCizelFx.id = "PitchCizelFx";
                PitchCizelFx.setAttribute('id','PitchCizelFx');
                PitchCizelFx.hide();
                PitchCizelFx.setStyle({display:'none', position:'absolute', top:0, left:0, backgroundImage:'none'});

                PitchSrcBox.insert({ after: PitchCizelFx });

                PitchCizelFx.setStyle({top:'-1px'});
                PitchSrcBox.setStyle({color:'#fcfcfc'});
                PitchCizelFx.show();
            }

            if( parseInt($$('.actualites').length) == 1 ){

                var ActusSrcBox = $($$('.actualites')[0]);
                var ActusCizelFx = Element.clone(ActusSrcBox, true);

                Element.clonePosition(ActusCizelFx, ActusSrcBox);
                ActusCizelFx.id = "ActusCizelFx";
                ActusCizelFx.setAttribute('id','ActusCizelFx');
                ActusCizelFx.hide();
                ActusCizelFx.setStyle({display:'none', position:'absolute', top:0, left:0, backgroundImage:'none'});

                ActusSrcBox.insert({ after: ActusCizelFx });

                ActusCizelFx.setStyle({top:'-1px'});
                ActusSrcBox.select('a').each(function(o){ o.setStyle({color:'#fcfcfc'}); })
                ActusCizelFx.show();

            }


            /*
            var CizelSrcCollection = $$('ul.cizelMotion');
            if( parseInt(CizelSrcCollection.length) > 0 ){

                CizelSrcCollection.each(function(CizelSrcBox,idx){

                    CizelSrcBox.absolutize();
                    CizelTargetBox = Element.clone(CizelSrcBox, true);
                    Element.clonePosition(CizelTargetBox , CizelSrcBox);
                    id = "CizelSrcBox_"+idx;
                    CizelTargetBox.id = id;
                    CizelTargetBox.setAttribute('id',id);
                    CizelTargetBox.addClassName('motionCizel');
                    CizelTargetBox.hide();
                    CizelTargetBox.absolutize();
                    CizelTargetBox = $(CizelTargetBox);
                    CizelTargetBox.setStyle({display:'none', position:'absolute', backgroundImage:'none'});
                    CizelSrcBox.insert({ after: CizelTargetBox});
                    CizelTargetBox.setStyle({top:(parseInt($(CizelSrcBox).getStyle('top'))-1)+'px'});
                    CizelTargetBox.setStyle({left: parseInt(String($(CizelSrcBox).getStyle('left')).replace(/px/,''))+'px'});
                    CizelSrcBox.select('a').each(function(o){ o.setStyle({color:'#fcfcfc'}); })
                    CizelTargetBox.show();

                });
            }
            /**/


        }// End of cizelMotion


		// Handle behavior on embeded search engine
    //console.log("twm Search Focus !");
		$('txt_search').observe('focus',function(e){
			Event.stop(e);
			/*Try.these(
				this.select(),
				this.focus()
			);/**/
			$('txt_search').up('#area_searchbox').addClassName('active');
			if( $('txt_search').value=="Rechercher" ){ $('txt_search').value=""; }
		});

		$('txt_search').observe('blur',function(e){
			Event.stop(e);
			/*Try.these(
				this.select(),
				this.focus()
			);/**/
			$('txt_search').up('#area_searchbox').removeClassName('active');
			if( $('txt_search').value=="" ){ $('txt_search').value="Rechercher"; }
		});



		
		// Adjust the minimal height size for vertical tab content.
    //console.log("twm pane_infodetail !");
		if( parseInt($$('#pane_infodetail').length) == 1 ){
			
			(function(){ 
				
				UI_VERTICAL_TABS_HEIGHT_SIZE = $$('.vertical_tab_bar ul li').length * ((parseInt($$('.vertical_tab_bar ul li').length)>0)? $($$('.vertical_tab_bar ul li')[0]).getHeight() : 0);

				UI_VERTICAL_TABCONTENT_HEIGHT_SIZE = parseInt($('pane_infodetail').getHeight()) + parseInt($('pane_infodetail').getStyle('marginTop').replace(/px/,'')) + parseInt($('pane_infodetail').getStyle('marginBottom').replace(/px/,''));
				
				$($('pane_infodetail').up('div.embedbox_shortwhite_content')).setStyle({ overflow: 'hidden' });

				new Effect.Morph($('pane_infodetail'), { 
					style: 'height:'+UI_VERTICAL_TABS_HEIGHT_SIZE+'px;', 
					duration: 0.1, 
					transition:Effect.Transitions.EaseFromTo,
					afterFinish: function(){
						
						UI_VERTICAL_SWINGPANEL_HEIGHT_SIZE = Math.max(UI_VERTICAL_TABCONTENT_HEIGHT_SIZE,UI_VERTICAL_TABS_HEIGHT_SIZE);

						new Effect.Morph($('pane_infodetail'), { 
							style: 'height:'+UI_VERTICAL_SWINGPANEL_HEIGHT_SIZE+'px;', 
							duration: 0.3, 
							transition:Effect.Transitions.EaseFromTo
						});
						
					}
					
				});
				
			}).delay(0.4);
			

		}
		
		
		// Vertical Tab controler - Apply a kind of content preloading.
    //console.log("twm vertical_tab_bar !");
		$$('.vertical_tab_bar ul li a').each(function(vtab){
		
			vtab.observe('click', function(e){
				Event.stop(e);
				
				$('pane_infodetail').addClassName('contentloading');
				$('pane_infodetail').setOpacity(0);
				$('pane_infodetail').setStyle({ overflow: 'hidden' });
				
				new Effect.Morph($('pane_infodetail'), { 
					style: 'height:'+UI_VERTICAL_TABS_HEIGHT_SIZE+'px;', 
					duration: 0.6, 
					transition:Effect.Transitions.EaseFromTo,
					afterFinish: function(){

						$('pane_infodetail').update('');
						$('pane_infodetail').setStyle({ overflow: 'auto' });
						$('pane_infodetail').setOpacity('100');
		
						var loaderBox = Builder.node('div',{ id:'loaderBox', style: 'height:'+UI_VERTICAL_TABS_HEIGHT_SIZE+'px; line-height:'+UI_VERTICAL_TABS_HEIGHT_SIZE+'px; text-align:center;' }, "" )
						$('pane_infodetail').appendChild( loaderBox );
						
						
						(function(){ window.location = vtab.readAttribute('href') }).delay(0.6);

					}
					
				});
				
			});
		
		});
		
		
		



		// Pane controler (show/hide tab_pane)
		// ... map behavior on each related panes (synchronized with its tab item)
    //console.log("twm showPane !");
		var showPane = function(p,ph)
		{
			ph.select('.tab_pane').each(function(pane){
			//
				pane.addClassName('hidded');
			});
			p.setOpacity(0.01);
			p.removeClassName('hidded');
			
			new Effect.Appear(p, { duration: 1.3,  transition: Effect.Transitions.EaseFromTo });
		};
		
		

		
		
		
		// twm Accordion !
		// TODO : Create an expressive javascript Class for Prototype...
    //console.log("twm Accordion !");
        if( parseInt($$('.accordion_handle').length) > 0 ){

            $$('.accordion_handle').each(function(o){
		
			    o.observe('click',function(){
		
				    if( $(o.readAttribute('rel')).getStyle('height') == '1px' ){
				
					    if($$('.accordion_handle').length > 1)
					    {
						    $$('.accordion_handle').each(function(elm){
						
							    $(elm).addClassName('collapsed');
							    $(elm).removeClassName('expanded');
							
							    if( $(elm.readAttribute('rel')).getStyle('height') != '1px' )
							    {
								    _duration = (parseInt(String($(elm.readAttribute('rel')).getStyle('height')).replace(/px/,'')) > 1500)?  1.80 : ((0.25)*(parseInt( String($(elm.readAttribute('rel')).getStyle('height')).replace(/px/,'') )/300));
								    $(elm.readAttribute('rel')).morph("height:1px;" , {duration: _duration });
							    }
						
						    });
					    }
				  
					    $(o.readAttribute('rel')).hide();
					    $(o.readAttribute('rel')).setStyle({'height':'auto'});
					    var h = $(o.readAttribute('rel')).getHeight();
					    $(o.readAttribute('rel')).setStyle({'height':'1px'});
					    $(o).addClassName('expanded');
					    $(o).removeClassName('collapsed');
					    $(o.readAttribute('rel')).show();
					    _duration = (h > 1500)? 1.80 : ((0.20)*(h/300));
					    $(o.readAttribute('rel')).morph('height:'+h+'px' , {duration: _duration});
				
				    }
				    else{
					    if($$('.accordion_handle').length > 1)
					    {
						    $$('.accordion_handle').each(function(elm){
							    $(elm).addClassName('collapsed');
							    $(elm).removeClassName('expanded');
						    });
					    }
				
					    $(o).addClassName('collapsed');
					    $(o).removeClassName('expanded');
					    _duration = (parseInt(String($(o.readAttribute('rel')).getStyle('height')).replace(/px/,'')) > 1500)?  1.80 : ((0.25)*(parseInt( String($(o.readAttribute('rel')).getStyle('height')).replace(/px/,'') )/300));
					    $(o.readAttribute('rel')).morph("height:1px;" , {duration: _duration });
				    }
		
			    });
		
		    });		
        }
		


	    





		// twm Src Rollup !
		// TODO : Create an expressive javascript Class for Prototype...
    //console.log("twm srcRollUp !");
		if( typeof(srcRollUp) == 'object' || typeof(srcRollUp) == 'function' )
		{
			srcRollUp();
		}

		
		
		

		


		// Ensure that the HTML DOM in the page has a UL Element with a specified classname 'fadeableviewer', so create a new instance of FadeableViewer.
    //console.log("twm fadeableviewer !");
		var fvCollection = $$('ul.fadeableviewer_refclients');
		if( parseInt(fvCollection.length) == 1 ) // This control exists only one time
		{
			// Control and Class exists ?
			if( typeof( FadeableViewer ) != "undefined" )
			{
				var myFadeableViewer = new FadeableViewer('fadeableviewer_refclients', { delay:4.8, duration:0.4, randomized:false });
			}
		}





        // SubNav manager ! (V2.0 downgrade)
            $$('ul li .menu_item').each(function(o){
                
                o.observe('mouseenter',function(event){
				    window.clearTimeout(I_NAVBAR_TIMER);
				    $$('ul li .menu_item').each(function(itm){ 
                        itm.removeClassName('highlighted'); 
                        if( String(itm.next('.item_panel')) != "undefined" ){
                            
                            if( String(o.next('.item_panel')) != "undefined" && $(itm.next('.item_panel')).readAttribute('ns:related') == $(o.next('.item_panel')).readAttribute('ns:related') )
                            {
                                o.addClassName('highlighted');

                                if( String(o.next('.item_panel')) != "undefined" ){
                                    o.next('.item_panel').removeClassName('hidded');
                                    o.next('.item_panel').appear({ duration: 0.25 });
                                }
                            
                            }else{
                                itm.next('.item_panel').hide();
                                itm.next('.item_panel').addClassName('hidded');
                            }

                        }
                    });
                });

                
                o.observe('mouseout',function(event){
				    I_NAVBAR_TIMER = window.setTimeout(function(){
                        
                        o.removeClassName('highlighted');
                        if( String(o.next('.item_panel')) != 'undefined'){ 
                            o.next('.item_panel').fade({ duration: 0.35 });
                        } 
                        
				    },180);
                });
                

                if(o.next('.item_panel') != 'undefined'){ 
                    $(o.next('.item_panel')).observe('mouseover',function(){ window.clearTimeout(I_NAVBAR_TIMER); });
                    $(o.next('.item_panel')).observe('mouseout',function(){ 
                        I_NAVBAR_TIMER = window.setTimeout(function(){

                            o.removeClassName('highlighted');
                            if( String(o.next('.item_panel')) != 'undefined'){ 
                                o.next('.item_panel').fade({ duration: 0.35 });
                            } 

                        },450);
                    });
                }

            });





        // Tipsy
        if( parseInt($$('.tipsy').length) > 0 ){ $($$('.tipsy')[0]).hide(); } /* Tipsy is ready */
        
        AppGarbageCollector.Tipsy = {
            selector: '.tipsyme',
            dataAttribute: 'tipsy-data',
            motionFx: null
        };
        

        /*
        $$( AppGarbageCollector.Tipsy.selector ).each(function(o){
            
            o.observe('mouseover', function(e){
                hndOffsets = Element.viewportOffset(o);
                docOffsets = document.viewport.getScrollOffsets();

                $($$('.tipsy')[0]).select('.tipsy-inner')[0].update( o.readAttribute(AppGarbageCollector.Tipsy.dataAttribute) );

                $($$('.tipsy')[0]).setStyle({top: parseInt(docOffsets.top + hndOffsets.top - $($$('.tipsy')[0]).getHeight() )+'px', left: parseInt(docOffsets.left + hndOffsets.left + ( parseInt((o.getWidth()).replace(/px/,''))/2) ) +'px'});

                if( AppGarbageCollector.Tipsy.motionFx !=null){ AppGarbageCollector.Tipsy.motionFx.cancel() }
                AppGarbageCollector.Tipsy.motionFx = new Effect.Appear( $($$('.tipsy')[0]) , {duration:.20});
            });


            o.observe('mouseover', function(e){
                if( AppGarbageCollector.Tipsy.motionFx !=null){ AppGarbageCollector.Tipsy.motionFx.cancel() }
                $($$('.tipsy')[0]).hide();
            });

        });
        /**/




		// FBLike
		$("fbs").observe('click', function(e){
			Event.stop(e);
			$(Event.element(e)).writeAttribute('target','_blank');
			u	= location.href;
			t	= document.title;
			n	= "sharer";
		//	su	= "http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t);
			su = $(Event.element(e)).readAttribute('href');
			options = { height:740, width:1000, scrollbars:'yes', toolbar:0, status:0 };
			window[n] = openCTKFORMPopup(su,n,options);
		});


		// Tweet
		$("tws").observe('click', function(e){
			Event.stop(e);
			u	= location.href;
			t	= document.title;
			n	= "sharer";
			maxLength = 140 - (u.length + 1);
			if (t.length > maxLength) { t = t.substr(0, (maxLength - 3))+'...'; }

			su	= "http://twitter.com/home?status="+encodeURIComponent(t + ' ' + u);
			options = { height:550, width:1000, scrollbars:'auto', toolbar:0, status:0 };
			window[n] = openCTKFORMPopup(su,n,options);
		});


		// LinkedIn
		$("lis").observe('click', function(e){
			Event.stop(e);
			u	= location.href;
			t	= document.title;
			n	= "sharer";

			su	= "http://www.linkedin.com/company/boost-cloud#"+encodeURIComponent(t);
			window[n] = window.open(su);
		});






	});
	// End DocumentReady




	// Script to scroll to the required anchor with easing transition.
	var scrollToEasing = function(anchor,event)
	{
		selectedPane = $(anchor);
		if(scrolling){ return false;}
		scrolling = true;
		
		UI_RAPIDLINK_FX_SCROLLING = new Effect.ScrollTo(selectedPane,{
			duration:0.8,
			transition:Effect.Transitions.EaseFromTo,
			afterFinish:function(){
				scrolling=false;
				window.location.hash = '#'+anchor;
			}
		});
		//Event.stop(e);
		return false;	
	};
 
 
 
	// Function to setup 
	function setupDemos()
	{
		 Shadowbox.setup('a.swfvideo', {
			  width: 340,
			  height: 356,
			  flashParams: {
					AllowScriptAccess: "always",
					allowFullScreen: "true"
			  }
		 });
	}



	Shadowbox.init({
		 overlayOpacity: 0.8,
		 handleOversize: "drag",
		 handleUnsupported: "remove"
	}, setupDemos);
	
	
	
	// Internal Search Engine
	var handleDoSearch = function()
	{
		if($('txt_search').value.strip()!="")
		{
			if( $('txt_search').hasClassName('disabled') ){return false;}
			

			window.location = "http://" + window.location.host + "/Rechercher.html" + "?q="+encodeURIComponent( $('txt_search').value.strip() );
		}
	}
	
	var handleEnterSearch = function(evt)
	{
		if($('txt_search').value.strip()!="")
		{
			if( $('txt_search').hasClassName('disabled') ){return false;}
			//IE fix
			if (typeof evt == "undefined"){ evt = window.event; }
			
			var keycode = evt.keyCode || evt.which;
			if (keycode == 13)
			{
				window.location = "http://" + window.location.host + "/Rechercher.html" + "?q="+encodeURIComponent( $('txt_search').value.strip() );
			}
			
		}
	}






	
	
	
	/*{twm}, 2009. Packed GUP*/function gup(name){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)return "";else return results[1];}
	
	/*{twm}, 2009. Packed GAN*/function gan(name){name=name.replace("#","");var regexS=""+name+"";var regex=new RegExp(regexS);var results=regex.exec(window.location.hash);if(results==null)return "";else return results[1];}
	
	
	/*****************************************************
	* popup
	* 19/08/2001
	*
	* Open a simple nice popup window with url,width, height, centered
	*
	* --Sébastien Brémond--
	* http://www.tocra.org
	*****************************************************/
	function openCTKFORMPopup(sURI,sWinName,o){
		FULLSCREEN_const = 'no';
		sh = parseInt(screen.availHeight || screen.width);
		sw = parseInt(screen.availWidth || screen.height);
		pH = o.height;
		pW = o.width;
		hasSB = o.scrollbars;
		hasTB = o.toolbar;
		hasS	= o.status;
		return open(sURI,sWinName,'top='+((sh-pH)/2)+',left='+((sw-pW)/2)+',width='+pW+',height='+pH+',scrollbars='+hasSB+',toolbar='+hasTB+',status='+hasS+',fullscreen='+FULLSCREEN_const);
	}
	
