function is_ie6(){return ((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined));} if (is_ie6()) { var DD_belatedPNG={ns:"DD_belatedPNG",imgSize:{},delay:10,nodesFixed:0,createVmlNameSpace:function(){document.namespaces&&!document.namespaces[this.ns]&&document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml")},createVmlStyleSheet:function(){var a;a=document.createElement("style");a.setAttribute("media","screen");document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);if(a.styleSheet){a=a.styleSheet;a.addRule(this.ns+"\\:*","{behavior:url(#default#VML)}"); a.addRule(this.ns+"\\:shape","position:absolute;");a.addRule("img."+this.ns+"_sizeFinder","behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;");this.screenStyleSheet=a;a=document.createElement("style");a.setAttribute("media","print");document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);a=a.styleSheet;a.addRule(this.ns+"\\:*","{display: none !important;}");a.addRule("img."+this.ns+"_sizeFinder","{display: none !important;}")}}, readPropertyChange:function(){var a,c,b;a=event.srcElement;if(a.vmlInitiated){if(event.propertyName.search("background")!=-1||event.propertyName.search("border")!=-1)DD_belatedPNG.applyVML(a);if(event.propertyName=="style.display"){c=a.currentStyle.display=="none"?"none":"block";for(b in a.vml)if(a.vml.hasOwnProperty(b))a.vml[b].shape.style.display=c}event.propertyName.search("filter")!=-1&&DD_belatedPNG.vmlOpacity(a)}},vmlOpacity:function(a){if(a.currentStyle.filter.search("lpha")!=-1){var c=a.currentStyle.filter; c=parseInt(c.substring(c.lastIndexOf("=")+1,c.lastIndexOf(")")),10)/100;a.vml.color.shape.style.filter=a.currentStyle.filter;a.vml.image.fill.opacity=c}},handlePseudoHover:function(a){setTimeout(function(){DD_belatedPNG.applyVML(a)},1)},fix:function(a){if(this.screenStyleSheet){var c;a=a.split(",");for(c=0;c<a.length;c++)this.screenStyleSheet.addRule(a[c],"behavior:expression(DD_belatedPNG.fixPng(this))")}},applyVML:function(a){a.runtimeStyle.cssText="";this.vmlFill(a);this.vmlOffsets(a);this.vmlOpacity(a); a.isImg&&this.copyImageBorders(a)},attachHandlers:function(a){var c,b,e,d,f;c=this;b={resize:"vmlOffsets",move:"vmlOffsets"};if(a.nodeName=="A"){e={mouseleave:"handlePseudoHover",mouseenter:"handlePseudoHover",focus:"handlePseudoHover",blur:"handlePseudoHover"};for(d in e)if(e.hasOwnProperty(d))b[d]=e[d]}for(f in b)if(b.hasOwnProperty(f)){e=function(){c[b[f]](a)};a.attachEvent("on"+f,e)}a.attachEvent("onpropertychange",this.readPropertyChange)},giveLayout:function(a){a.style.zoom=1;if(a.currentStyle.position== "static")a.style.position="relative"},copyImageBorders:function(a){var c,b;c={borderStyle:true,borderWidth:true,borderColor:true};for(b in c)if(c.hasOwnProperty(b))a.vml.color.shape.style[b]=a.currentStyle[b]},vmlFill:function(a){if(a.currentStyle){var c,b,e,d;c=a.currentStyle;for(b in a.vml)if(a.vml.hasOwnProperty(b))a.vml[b].shape.style.zIndex=c.zIndex;a.runtimeStyle.backgroundColor="";a.runtimeStyle.backgroundImage="";b=true;if(c.backgroundImage!="none"||a.isImg){if(a.isImg)a.vmlBg=a.src;else{a.vmlBg= c.backgroundImage;a.vmlBg=a.vmlBg.substr(5,a.vmlBg.lastIndexOf('")')-5)}e=this;if(!e.imgSize[a.vmlBg]){b=document.createElement("img");e.imgSize[a.vmlBg]=b;b.className=e.ns+"_sizeFinder";b.runtimeStyle.cssText="behavior:none; position:absolute; left:-10000px; top:-10000px; border:none; margin:0; padding:0;";d=function(){this.width=this.offsetWidth;this.height=this.offsetHeight;e.vmlOffsets(a)};b.attachEvent("onload",d);b.src=a.vmlBg;b.removeAttribute("width");b.removeAttribute("height");document.body.insertBefore(b, document.body.firstChild)}a.vml.image.fill.src=a.vmlBg;b=false}a.vml.image.fill.on=!b;a.vml.image.fill.color="none";a.vml.color.shape.style.backgroundColor=c.backgroundColor;a.runtimeStyle.backgroundImage="none";a.runtimeStyle.backgroundColor="transparent"}},vmlOffsets:function(a){var c,b,e,d,f,h;c=a.currentStyle;b={W:a.clientWidth+1,H:a.clientHeight+1,w:this.imgSize[a.vmlBg].width,h:this.imgSize[a.vmlBg].height,L:a.offsetLeft,T:a.offsetTop,bLW:a.clientLeft,bTW:a.clientTop};e=b.L+b.bLW==1?1:0;d=function(g, l,m,i,j,k){g.coordsize=i+","+j;g.coordorigin=k+","+k;g.path="m0,0l"+i+",0l"+i+","+j+"l0,"+j+" xe";g.style.width=i+"px";g.style.height=j+"px";g.style.left=l+"px";g.style.top=m+"px"};d(a.vml.color.shape,b.L+(a.isImg?0:b.bLW),b.T+(a.isImg?0:b.bTW),b.W-1,b.H-1,0);d(a.vml.image.shape,b.L+b.bLW,b.T+b.bTW,b.W,b.H,1);d={X:0,Y:0};if(a.isImg){d.X=parseInt(c.paddingLeft,10)+1;d.Y=parseInt(c.paddingTop,10)+1}else for(f in d)d.hasOwnProperty(f)&&this.figurePercentage(d,b,f,c["backgroundPosition"+f]);a.vml.image.fill.position= d.X/b.W+","+d.Y/b.H;f=c.backgroundRepeat;h={T:1,R:b.W+e,B:b.H,L:1+e};c={X:{b1:"L",b2:"R",d:"W"},Y:{b1:"T",b2:"B",d:"H"}};if(f!="repeat"||a.isImg){d={T:d.Y,R:d.X+b.w,B:d.Y+b.h,L:d.X};if(f.search("repeat-")!=-1){f=f.split("repeat-")[1].toUpperCase();d[c[f].b1]=1;d[c[f].b2]=b[c[f].d]}if(d.B>b.H)d.B=b.H;a.vml.image.shape.style.clip="rect("+d.T+"px "+(d.R+e)+"px "+d.B+"px "+(d.L+e)+"px)"}else a.vml.image.shape.style.clip="rect("+h.T+"px "+h.R+"px "+h.B+"px "+h.L+"px)"},figurePercentage:function(a,c,b, e){var d,f;f=true;d=b=="X";switch(e){case "left":case "top":a[b]=0;break;case "center":a[b]=0.5;break;case "right":case "bottom":a[b]=1;break;default:if(e.search("%")!=-1)a[b]=parseInt(e,10)/100;else f=false}a[b]=Math.ceil(f?c[d?"W":"H"]*a[b]-c[d?"w":"h"]*a[b]:parseInt(e,10));a[b]%2===0&&a[b]++;return a[b]},fixPng:function(a){a.style.behavior="none";var c,b,e,d,f;if(!(a.nodeName=="BODY"||a.nodeName=="TD"||a.nodeName=="TR")){a.isImg=false;if(a.nodeName=="IMG")if(a.src.toLowerCase().search(/\.png$/)!= -1){a.isImg=true;a.style.visibility="hidden"}else return;else if(a.currentStyle.backgroundImage.toLowerCase().search(".png")==-1)return;c=DD_belatedPNG;a.vml={color:{},image:{}};b={shape:{},fill:{}};for(d in a.vml)if(a.vml.hasOwnProperty(d)){for(f in b)if(b.hasOwnProperty(f)){e=c.ns+":"+f;a.vml[d][f]=document.createElement(e)}a.vml[d].shape.stroked=false;a.vml[d].shape.appendChild(a.vml[d].fill);a.parentNode.insertBefore(a.vml[d].shape,a)}a.vml.image.shape.fillcolor="none";a.vml.image.fill.type="tile"; a.vml.color.fill.on=false;c.attachHandlers(a);c.giveLayout(a);c.giveLayout(a.offsetParent);a.vmlInitiated=true;c.applyVML(a)}}};try{document.execCommand("BackgroundImageCache",false,true)}catch(r){}DD_belatedPNG.createVmlNameSpace();DD_belatedPNG.createVmlStyleSheet(); }
/* jcarousellite */
(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var b=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var c=$(this),ul=$("ul",c),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v}var f=$("li",ul),itemLength=f.size(),curr=o.start;c.css("visibility","visible");f.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});c.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var g=o.vertical?height(f):width(f);var h=g*itemLength;var j=g*v;f.css({width:f.width(),height:f.height()});ul.css(sizeCss,h+"px").css(animCss,-(curr*g));c.css(sizeCss,j-2+"px");if(o.btnPrev)$(o.btnPrev).click(function(){return go(curr-o.scroll)});if(o.btnNext)$(o.btnNext).click(function(){return go(curr+o.scroll)});if(o.btnGo)$.each(o.btnGo,function(i,a){$(a).click(function(){return go(o.circular?o.visible+i:i)})});if(o.mouseWheel&&c.mousewheel)c.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)});if(o.auto)setInterval(function(){go(curr+o.scroll)},o.auto+o.speed);function vis(){return f.slice(curr).slice(0,v)};function go(a){if(!b){if(o.beforeStart)o.beforeStart.call(this,vis());if(o.circular){if(a<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*g)+"px");curr=a==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else if(a>=itemLength-v+1){ul.css(animCss,-((v)*g)+"px");curr=a==itemLength-v+1?v+1:v+o.scroll}else curr=a}else{if(a<0||a>itemLength-v)return;else curr=a}b=true;ul.animate(animCss=="left"?{left:-(curr*g)}:{top:-(curr*g)},o.speed,o.easing,function(){if(o.afterEnd)o.afterEnd.call(this,vis());b=false});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}})};function css(a,b){return parseInt($.css(a[0],b))||0};function width(a){return a[0].offsetWidth+css(a,'marginLeft')+css(a,'marginRight')};function height(a){return a[0].offsetHeight+css(a,'marginTop')+css(a,'marginBottom')}})(jQuery);
/* mousewheel 3.0.2 */
(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);
function equalWidth(a){tallest=0;a.each(function(){thisWidth=$(this).width();if(thisWidth>tallest)tallest=thisWidth});a.width(tallest)};

$(document).ready(function(){

	/*  IE6: pngfix */
	if($.browser.msie && $.browser.version <= '6.0') {
		DD_belatedPNG.fix('div.files .img img, #bigmap, #bigmap .inner');
	
		$('#menu li:first').filter('.active').css('margin-left', '12px');
	}

	/*  Mainpage */
	$('#editorial div.item').hide().filter(':first').show();
	$('#editorial ul.e-news li').click(function(){
		if ($(this).not('.active').size()) {
			$(this).addClass('active').siblings('li').removeClass('active');
			var index = $('li', $(this).parent()).index(this);
			$('#editorial div.item:visible').fadeOut(222, function(){
				$('#editorial div.item').filter(':eq('+ index +')').fadeIn(333);
			})
		}
	});
	
	$('#mainpage #popular li:first').addClass('active').find('.text p, .text .section, .img').show();
	$('#popular li').hover(function(){
		$(this).addClass('active').siblings('li').removeClass('active').find('.text p, .text .section, .img', $(this)).animate({
			height: 'hide'
		});
		$('.text p, .text .section, .img', $(this)).animate({
			height: 'show'
		})
	});
	
	/* Photo Slider */
	if ($('#photoSlider').size()) {
		var pSlide = $('#photoSlider');
		var pUl = pSlide.find('ul');
		var pUlChild =  pUl.children('li');
		var liSize = pUl.children('li').size();
		var currNum = 1;
		pUl.width(liSize * pUlChild.width());
		$('#currPhoto .curr', pSlide).text(currNum);
		$('#currPhoto .all', pSlide).text(liSize);
		$('#sliderTip span').text(pUlChild.eq(currNum-1).children('small').text());
		
		jQuery.fn.slideUl = function(vect) {
			if (vect) {
				if (currNum < liSize) currNum += 1;
				else currNum = 1;
			} else {
				if (currNum > 1) currNum -= 1;
				else currNum = liSize;
			}
			$('#currPhoto .curr', pSlide).text(currNum);
			$('#sliderTip span').text(pUlChild.eq(currNum-1).children('small').text());
			pUl.animate({
				left : -(currNum-1) * pUlChild.width()
			});
			return currNum;
		}
		pSlide.find('.arr-right').click(function(){ currNum = $(this).slideUl(true) });
		pSlide.find('.arr-left').click(function(){ currNum = $(this).slideUl(false) });
	}
	
	/* Contacts */
	$('#map a').click(function(){
		$('#bigmap').animate({
			width : 'show',
			height : 'show'
		});
		return false;
	});
	$('#bigmap').click(function(){
		$('#bigmap').hide();
	});
	
	
	/* Forms */
	jQuery.fn.placeholder = function(lP) {
		var pI = $('#' + lP.attr('for'));
		if (pI.attr('value') != '') lP.hide();
		pI.focusin(function(){ lP.hide(); });
		pI.focusout(function(){ if (pI.attr('value') == '') lP.show(); });
	}
	$('label.placeholder').each(function(){
		$(this).placeholder($(this));
	});
	
	/* 404 */
	$('#service h2.er404').css('margin-top', (($(window).height()-355) / 2)-130);
	
	
	
	
	/* footer: partners */
	equalWidth($('#footPartners li'));
	$('#footPartners').jCarouselLite({
		btnPrev: ".arr-prev",
		btnNext: ".arr-next",
		visible: 3
	});

});
