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
    $(".yourComment #author").defaultvalue("ФИО");
	$("#contfio").defaultvalue("ФИО");
	$(".yourComment #email").defaultvalue("E-mail");
	$("#contemail").defaultvalue("E-mail");
	$("#contphone").defaultvalue("Контактный телефон");
	$("#contcaptcha").defaultvalue("Введите символы, расположенные выше");
	

	$(".headMenu > li > a:first").prepend("<span>1. </span>");
	$(".headMenu > li > a:eq(1)").prepend("<span>2. </span>");
	$(".headMenu > li > a:eq(2)").prepend("<span>3. </span>");
	$(".headMenu > li > a:eq(3)").prepend("<span>4. </span>");
	$(".headMenu ul:first li:last a").css("color", "#F5C280");
	
	$(".headMenu > li:last").css("margin-right","0");
	
	$(".scrollable").scrollable({
    size: 3,
	speed: 600,
	clickable: false
});
	$(".scrollable a div").hide();
	$(".scrollable a").bind("mouseover", function(){
							$(this).children().filter("div").show();
											  });
	$(".scrollable a").bind("mouseout", function(){
							$(this).children().filter("div").hide();
											  });
	$(".secClientList .secClientOneBlock:nth-child(4n)").css("margin-right","0");
	
	$(".mArch_list a:eq(0), .secPortfArchBlock a:eq(0)").addClass("fs20");
	$(".mArch_list a:eq(1), .secPortfArchBlock a:eq(1)").addClass("fs17");
	$(".mArch_list a:eq(2), .secPortfArchBlock a:eq(2)").addClass("fs16");
	$(".mArch_list a:eq(3), .secPortfArchBlock a:eq(3)").addClass("fs14");
	$(".mArch_list a:eq(4), .secPortfArchBlock a:eq(4)").addClass("fs14");
	$(".mArch_list a:eq(5), .secPortfArchBlock a:eq(5)").addClass("fs12");
	$(".mArch_list a:eq(6), .secPortfArchBlock a:eq(6)").addClass("fs11");
	
	$(".yourMindBlock a").bind("click", function(){
      $(".yourComment").position({ my: "center", at:"center", of: $(this), collision: "none" }).show();
		return false;
 	  });
	$(".youInterestBlock a").bind("click", function(){
      $(".makeOrder").position({ my: "center", at:"center", of: $(this), collision: "none" }).show();
		return false;
 	  });
    $(".yourComment .close").bind("click", function(){
      $(".yourComment").hide();
      return false;
    }); 
	$(".makeOrder .close").bind("click", function(){
      $(".makeOrder").hide();
      return false;
    }); 
	
});
})(jQuery);
