var ua=navigator.userAgent.toLowerCase();var isGecko=(ua.indexOf("gecko")!=-1);var isOpera=window.opera;var isIE=((ua.indexOf("msie")!=-1)&&(ua.indexOf("opera")==-1)&&(ua.indexOf("webtv")==-1))?true:false;var isIE5=(isIE&&ua.indexOf("msie 5")!=-1);var remoteLoader;var descArr=[];var h;if(!Function.prototype.call){Function.prototype.call=function(){var a=new Array();for(var i=1;i<arguments.length;i++)a[a.length]='arguments['+i+']';var o=arguments[0];o._thisFun=this;eval('o._thisFun('+a.join(',')+')');o._thisFun=null}}function getOpacity(a){var b;if(b=a.style.opacity)return parseFloat(b);if(b=(a.style.filter||'').match(/alpha\(opacity=(.*)\)/))if(b[1])return parseFloat(b[1])/100;if(b=a.style.MozOpacity)return parseFloat(b);if(b=a.style.KhtmlOpacity)return parseFloat(b);return 1.0};function setImgOpacity(b){var i=0;var c=document.getElementById('portfolio');var d=c.getElementsByTagName('IMG');while(i<d.length){d[i].onmouseout=function(e){myfx.fade(this,100,b,1,null)};d[i].onmouseover=function(e){myfx.fade(this,b,100,5,null)};d[i].onmouseout.apply(d[i]);d[i].parentNode.onmouseout=function(e){var a=this.getElementsByTagName('IMG')[0];a.onmouseout.apply(a)};d[i].parentNode.onmouseover=function(e){var a=this.getElementsByTagName('IMG')[0];a.onmouseover.apply(a)};i++}};var showtimeout;function menuHoverDelay(d){if(isNaN(d))d=700;var f=function(){var a=k.length;for(var j=0;j<a;j++){if(k[j].style.visibility!='hidden'&&k[j].launch&&k[j]!=this)g.apply(k[j])}this.launch=true;var b=this.getElementsByTagName('UL');if(b.length==1)showtimeout=setTimeout(function(){b[0].style.visibility='visible'},d)};var g=function(){clearTimeout(showtimeout);var a=this.getElementsByTagName('UL');if(a.length==1){/*@cc_on/*@if(@_jscript_version>=5)a[0].style.visibility='hidden';@else@*/if(getOpacity(a[0])<1.0)return;myfx.fade(a[0],100,0,3,function(){a[0].style.visibility='hidden';myfx.alpha(a[0],100);this.launch=false});/*@end@*/}};var h=function(e){if(e&&e.target)oNode=e.target;else if(window.event)oNode=window.event.srcElement;var a=false;var b=oNode.parentNode;if(!b||b.nodeType!=1)return;while(b.tagName.toUpperCase()!='UL'&&b.tagName.toUpperCase()!='BODY'){b=b.parentNode}if(b.tagName.toUpperCase()=='BODY'){var c=k.length;for(var j=0;j<c;j++){if(k[j].style.visibility!='hidden'&&k[j].launch)g.apply(k[j])}}};var k=[];var l=document.getElementById('mainmenu').childNodes;var m=l.length;for(var i=0;i<m;i++){if(l[i].nodeType==1&&l[i].tagName.toUpperCase()=='LI'){var n=l[i].getElementsByTagName('UL');if(n.length==1){n[0].style.visibility='hidden'}myfx.$event(l[i],'onmouseover',f);k[k.length]=l[i]}}myfx.$event(document,'onmouseover',h)}function initPortfolio(){function callback(a,b){var c=a.getElementsByTagName('LI');switch(b){case'first':var d=c[0];a.appendChild(d);c=a.getElementsByTagName('LI');d.style.width=(a.childWidth)+'px';d.style.height=(a.childHeight)+'px';fimg=d.getElementsByTagName('IMG')[0];cimg=c[0].getElementsByTagName('IMG')[0];fimg.src=cimg.src;fimg.alt=cimg.alt;fimg.parentNode.title=cimg.parentNode.title;fimg.parentNode.href=cimg.parentNode.href;fimg.parentNode.oldhref=cimg.parentNode.oldhref;break;case'last':var e=c[a.nbChild-1];a.insertBefore(e,c[0]);c=a.getElementsByTagName('LI');limg=e.getElementsByTagName('IMG')[0];cimg=c[a.nbChild-1].getElementsByTagName('IMG')[0];limg.src=cimg.src;limg.alt=cimg.alt;limg.parentNode.title=cimg.parentNode.title;limg.parentNode.href=cimg.parentNode.href;limg.parentNode.oldhref=cimg.parentNode.oldhref;break;default:break}};var f=5;if(!document.getElementById('portfolio'))return;remoteLoader=new RemoteFileLoader('remoteLoader');var g=document.getElementById('portfolio').getElementsByTagName('UL')[0];g.style.visibility='hidden';var h=g.getElementsByTagName('LI');g.nbChild=h.length+1;g.childWidth=h[0].offsetWidth;g.childHeight=h[0].offsetHeight;if(h.length>f){g.style.width=(g.nbChild*g.childWidth)+'px';g.parentNode.style.width=(g.parentNode.offsetWidth-8)+'px';var j=h[g.nbChild-2].cloneNode(true);g.insertBefore(j,h[0]);g.style.left='-'+g.childWidth+'px';document.getElementById('ra').onclick=function(e){var a=g.getElementsByTagName('LI');myfx.size(a[0],{width:0,height:0},(isGecko)?30:10,function(){callback(g,'first')})};document.getElementById('la').onclick=function(e){var a=g.getElementsByTagName('LI');var b=a.length;a[b-1].style.width=a[b-1].style.height='0px';callback(g,'last');myfx.size(a[0],{width:g.childWidth,height:g.childHeight},(isGecko)?30:10)}}else{var k=f-h.length,toaddContent='';for(var i=0;i<k;i++){toaddContent+='<li><a><img src="rfiles/main/icons/empty.gif" alt=""/></a></li>'}g.innerHTML+=toaddContent;document.getElementById('la').style.visibility=document.getElementById('ra').style.visibility='hidden'}/*@cc_on if(!window.XMLHttpRequest){var m=document.getElementById('la');for(var i=0;i<g.nbChild-1;i++)m.click()}@*/g.style.visibility='visible';setImgOpacity(50);var n=g.getElementsByTagName('A');var l=n.length,i=0;while(i<l){n[i].oldhref=n[i].href;n[i].href=(n[i].href.replace(/(.*)\/(.*)/,'$1#$2')).replace(/#client/,'');myfx.$event(n[i],'onclick',hListener);i++}};function hListener(){var a=document.getElementById('portfolio').getElementsByTagName('UL')[0];var b=a.getElementsByTagName('A');var l=b.length,i=0;var c;var d;if(this.href){d=this.href.split('#');if(d.length==2)d=d[1];else d='';c='Mastriasoft » Portfolio » '+this.title;/*@cc_on var e=document.frames[0];if(e.contentDocument)iframedoc=e.contentDocument;else if(e.contentWindow)iframedoc=e.contentWindow.document;else if(e.document)iframedoc=e.document;iframedoc.title=c;@*/h.addState(d)}var f=h.getCurrentLocation();if(f!=''){while(i<l){var g=b[i].href.match(eval('/#'+f+'/'));if(g)break;i++}if(i<l&&b[i].oldhref){var j=document.getElementById('portfoliocontent');var k='<h4 class="portfolio">Chargement en cours</h4><div style="border:1px solid #FFF; padding:6px;margin:0 6px 6px 6px;">';k+='<div style="height:250px;">Patience...</div>';k+='</div>';j.innerHTML=k;var m=remoteLoader.loadInto(b[i].oldhref.replace(/#client/,'/only-content'),'portfoliocontent');if(m){c='Mastriasoft » Portfolio » '+b[i].title;document.title=c}}}};function descSetup(){var a=document.getElementById('mslogan');if(a){if(isIE5)a.style.left='297px';descArr[descArr.length]=a}for(var h=0;h<descArr.length;h++){var b=descArr[h],text=b.getElementsByTagName('span')[0].firstChild.nodeValue;b.removeChild(b.getElementsByTagName('span')[0]);b.animNodes=[];for(var i=0;i<text.length;i++){var c=document.createElement('span');c.appendChild(document.createTextNode(text.substring(i,i+1)));b.appendChild(c);b.animNodes[b.animNodes.length]=c}b.animCount=0;b.animTimer=setInterval('descAnim('+h+')',50)}};function descAnim(h){var a=[56,54,86];var b=descArr[h],c=b.animCount++,noAnim=1;for(var i=0;i<b.animNodes.length;i++){var s=b.animNodes[i];var d=Math.max(0,Math.min(1,(c-i)/10));if(s.animDone)continue;noAnim=0;s.style.color='rgb('+parseInt(24+a[0]*d)+','+parseInt(23+a[1]*d)+','+parseInt(39+a[2]*d)+')';if(d==1){s.style.marginLeft='auto';s.animDone=1}else if(d>0)s.style.marginLeft=0.6*(1-d)+'em'}if(noAnim)clearInterval(b.animTimer);b.style.visibility='visible'};function equalHeightSB(){var a=document.getElementById('center');var b=a.getElementsByTagName('DIV');var l=b.length;var c,heightBB;var d=0;var e=0;var f=0;var g=0;for(var i=0;i<l;i++){if(b[i].className.indexOf("smallbox")>0){c=b[i];f++;d+=b[i].offsetHeight}else if(b[i].className.indexOf("bigbox")>0){heightBB=b[i];g++;e+=b[i].offsetHeight}}if(c&&heightBB){var h=((d>e)?d-e:e-d);var j=((d>e)?heightBB:c).getElementsByTagName('DIV');var k;var x=0;l=j.length;while(x<l){if(j[x].className=='text')k=j[x];x++}if(k){var m=k.offsetHeight+h;if(!isIE5)m-=(((d>e)?g:f)+1)*4;k.style.height=m+'px'}}};myfx.$event(window,"onload",function(){initPortfolio();equalHeightSB();descSetup();menuHoverDelay(700);if(typeof(onLoad)=='function')onLoad();if(typeof(HistoryManager)!='undefined'){h=new HistoryManager();h.addEvent('onHistoryChange',hListener);hListener()}});