var cssFix = function(){

var u = navigator.userAgent.toLowerCase(),

addClass = function(el, val){

if(! el.className) {

el.className = val;

} else {

var newCl = el.className;

newCl+=(" "+val);

el.className = newCl;

}

},

is = function(t){return (u.indexOf(t)!=-1)};

addClass(document.getElementsByTagName('html')[0],[

(!(/opera|webtv/i.test(u))&&/msie (\d)/.test(u))?('ie ie'+RegExp.$1)

: is('firefox/2')?'gecko ff2'

: is('firefox/3.5')?'gecko ff35'

: is('firefox/3')?'gecko ff3'

: is('gecko/')?'gecko'

: is('chrome/')?'chrome'

: is('opera/9')?'opera opera9':/opera (\d)/.test(u)?'opera opera'+RegExp.$1

: is('konqueror')?'konqueror'

: is('applewebkit/')?'webkit safari'

: is('mozilla/')?'gecko':'',

(is('x11')||is('linux'))?' linux'

: is('mac')?' mac'

: is('win')?' win':''

].join(" "));

}();


(function($) {
$(function() {
		   
	// Default Value
	$.fn.defaultvalue=function(){var elements=this;var args=arguments;var c=0;return(elements.each(function(){var el=$(this);var def=args[c++];el.val(def).focus(function(){if(el.val()==def){el.val("");}el.blur(function(){	    if(el.val()==""){el.val(def);}});});}));}	   
		   
	// Search
    $('.headSearch .input').defaultvalue('Поиск'); 	   
		   
	$(".topMenu li:last").css({"padding-right":0, "border":"none", margin:0});
	
	$(".mbWorks .item:last, .mbNews .item:last").css("margin","0");
	
	$(".bottmMenu ul").each(function(){
					    $(this).find("li:last").css("border", "none");			 
									 });
	$(".spContent .spTeamCol:nth-child(3n), .spContent .spProjPhotoItem:nth-child(3n)").css("margin-right", "0");
	
	
	maxh = 0;
	$(".spTeamCol").each(function(){
					elemh = $(this).height();
					if(elemh>maxh) {maxh = elemh;}
					return maxh;
								  });
	$(".spTeamCol").height(maxh);
	
	$(".item .photo img, .spProjPhotoItem img").css("opacity", 0.6);
	$(".item, .spProjPhotoItem").hover(function(){
						 $(this).find("img").animate({opacity: 1}, 400);				 
										 }, function(){
						$(this).find("img").animate({opacity: 0.6}, 400);				 
											 });	
	$(".sliderWrapper").scrollable({
					  items: ".slider",
					  keyboard: false,
					  size: 1
								  }).navigator();
	
});
})(jQuery);
