//ColorBox
(function(b,gb){var v="none",t="click",N="LoadedContent",d=false,x="resize.",o="y",u="auto",f=true,M="nofollow",q="on",n="x";function e(a,c){a=a?' id="'+k+a+'"':"";c=c?' style="'+c+'"':"";return b("<div"+a+c+"/>")}function p(a,b){b=b===n?m.width():m.height();return typeof a==="string"?Math.round(a.match(/%/)?b/100*parseInt(a,10):parseInt(a,10)):a}function Q(c){c=b.isFunction(c)?c.call(h):c;return a.photo||c.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function cb(){for(var c in a)if(b.isFunction(a[c])&&c.substring(0,2)!==q)a[c]=a[c].call(h);a.rel=a.rel||h.rel||M;a.href=a.href||b(h).attr("href");a.title=a.title||h.title}function db(d){h=d;a=b.extend({},b(h).data(r));cb();if(a.rel!==M){i=b("."+H).filter(function(){return (b(this).data(r).rel||this.rel)===a.rel});g=i.index(h);if(g===-1){i=i.add(h);g=i.length-1}}else{i=b(h);g=0}if(!w){w=F=f;R=h;try{R.blur()}catch(e){}b.event.trigger(hb);a.onOpen&&a.onOpen.call(h);y.css({opacity:+a.opacity,cursor:a.overlayClose?"pointer":u}).show();a.w=p(a.initialWidth,n);a.h=p(a.initialHeight,o);c.position(0);S&&m.bind(x+O+" scroll."+O,function(){y.css({width:m.width(),height:m.height(),top:m.scrollTop(),left:m.scrollLeft()})}).trigger("scroll."+O)}T.add(I).add(J).add(z).add(U).hide();V.html(a.close).show();c.slideshow();c.load()}var eb={transition:"elastic",speed:300,width:d,initialWidth:"600",innerWidth:d,maxWidth:d,height:d,initialHeight:"450",innerHeight:d,maxHeight:d,scalePhotos:f,scrolling:f,inline:d,html:d,iframe:d,photo:d,href:d,title:d,rel:d,opacity:.7,preloading:f,current:"image {current} of {total}",previous:"previous",next:"next",close:"закрыть",open:d,loop:f,slideshow:d,slideshowAuto:f,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:d,onLoad:d,onComplete:d,onCleanup:d,onClosed:d,overlayClose:f,escKey:f,arrowKey:f},r="colorbox",k="cbox",hb=k+"_open",P=k+"_load",W=k+"_complete",X=k+"_cleanup",fb=k+"_closed",G=b.browser.msie&&!b.support.opacity,S=G&&b.browser.version<7,O=k+"_IE6",y,j,E,s,Y,Z,ab,bb,i,m,l,K,L,U,T,z,J,I,V,C,D,A,B,h,R,g,a,w,F,c,H=k+"Element";c=b.fn[r]=b[r]=function(c,d){var a=this;if(!a[0]&&a.selector)return a;c=c||{};if(d)c.onComplete=d;if(!a[0]||a.selector===undefined){a=b("<a/>");c.open=f}a.each(function(){b(this).data(r,b.extend({},b(this).data(r)||eb,c)).addClass(H)});c.open&&db(a[0]);return a};c.init=function(){var h="hover";m=b(gb);j=e().attr({id:r,"class":G?k+"IE":""});y=e("Overlay",S?"position:absolute":"").hide();E=e("Wrapper");s=e("Content").append(l=e(N,"width:0; height:0"),L=e("LoadingOverlay").add(e("LoadingGraphic")),U=e("Title"),T=e("Current"),J=e("Next"),I=e("Previous"),z=e("Slideshow"),V=e("Close"));E.append(e().append(e("TopLeft"),Y=e("TopCenter"),e("TopRight")),e().append(Z=e("MiddleLeft"),s,ab=e("MiddleRight")),e().append(e("BottomLeft"),bb=e("BottomCenter"),e("BottomRight"))).children().children().css({"float":"left"});K=e(d,"position:absolute; width:9999px; visibility:hidden; display:none");b("body").prepend(y,j.append(E,K));s.children().hover(function(){b(this).addClass(h)},function(){b(this).removeClass(h)}).addClass(h);C=Y.height()+bb.height()+s.outerHeight(f)-s.height();D=Z.width()+ab.width()+s.outerWidth(f)-s.width();A=l.outerHeight(f);B=l.outerWidth(f);j.css({"padding-bottom":C,"padding-right":D}).hide();J.click(c.next);I.click(c.prev);V.click(c.close);s.children().removeClass(h);b("."+H).live(t,function(a){if(a.button!==0&&typeof a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)return f;else{db(this);return d}});y.click(function(){a.overlayClose&&c.close()});b(document).bind("keydown",function(b){if(w&&a.escKey&&b.keyCode===27){b.preventDefault();c.close()}if(w&&a.arrowKey&&!F&&i[1])if(b.keyCode===37&&(g||a.loop)){b.preventDefault();I.click()}else if(b.keyCode===39&&(g<i.length-1||a.loop)){b.preventDefault();J.click()}})};c.remove=function(){j.add(y).remove();b("."+H).die(t).removeData(r).removeClass(H)};c.position=function(f,b){function c(a){Y[0].style.width=bb[0].style.width=s[0].style.width=a.style.width;L[0].style.height=L[1].style.height=s[0].style.height=Z[0].style.height=ab[0].style.height=a.style.height}var e,h=Math.max(m.height()-a.h-A-C,0)/2+m.scrollTop(),g=Math.max(m.width()-a.w-B-D,0)/2+m.scrollLeft();e=j.width()===a.w+B&&j.height()===a.h+A?0:f;E[0].style.width=E[0].style.height="9999px";j.dequeue().animate({width:a.w+B,height:a.h+A,top:h,left:g},{duration:e,complete:function(){c(this);F=d;E[0].style.width=a.w+B+D+"px";E[0].style.height=a.h+A+C+"px";b&&b()},step:function(){c(this)}})};c.resize=function(b){if(w){b=b||{};if(b.width)a.w=p(b.width,n)-B-D;if(b.innerWidth)a.w=p(b.innerWidth,n);l.css({width:a.w});if(b.height)a.h=p(b.height,o)-A-C;if(b.innerHeight)a.h=p(b.innerHeight,o);if(!b.innerHeight&&!b.height){b=l.wrapInner("<div style='overflow:auto'></div>").children();a.h=b.height();b.replaceWith(b.children())}l.css({height:a.h});c.position(a.transition===v?0:a.speed)}};c.prep=function(o){var d="hidden";function n(t){var o,q,s,n,d=i.length,e=a.loop;c.position(t,function(){function t(){G&&j[0].style.removeAttribute("filter")}if(w){G&&p&&l.fadeIn(100);a.iframe&&b("<iframe frameborder=0"+(a.scrolling?"":" scrolling='no'")+(G?" allowtransparency='true'":"")+"/>").attr({src:a.href,name:(new Date).getTime()}).appendTo(l);l.show();U.show().html(a.title);if(d>1){T.html(a.current.replace(/\{current\}/,g+1).replace(/\{total\}/,d)).show();J[e||g<d-1?"show":"hide"]().html(a.next);I[e||g?"show":"hide"]().html(a.previous);o=g?i[g-1]:i[d-1];s=g<d-1?i[g+1]:i[0];if(a.slideshow){z.show();g===d-1&&!e&&j.is("."+k+"Slideshow_on")&&z.click()}if(a.preloading){n=b(s).data(r).href||s.href;q=b(o).data(r).href||o.href;if(Q(n))b("<img/>")[0].src=n;if(Q(q))b("<img/>")[0].src=q}}L.hide();a.transition==="fade"?j.fadeTo(f,1,function(){t()}):t();m.bind(x+k,function(){c.position(0)});b.event.trigger(W);a.onComplete&&a.onComplete.call(h)}})}if(w){var p,f=a.transition===v?0:a.speed;m.unbind(x+k);l.remove();l=e(N).html(o);l.hide().appendTo(K.show()).css({width:function(){a.w=a.w||l.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}(),overflow:a.scrolling?u:d}).css({height:function(){a.h=a.h||l.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}()}).prependTo(s);K.hide();b("#"+k+"Photo").css({cssFloat:v});S&&b("select").not(j.find("select")).filter(function(){return this.style.visibility!==d}).css({visibility:d}).one(X,function(){this.style.visibility="inherit"});a.transition==="fade"?j.fadeTo(f,0,function(){n(0)}):n(f)}};c.load=function(){var j,d,q,m=c.prep;F=f;h=i[g];a=b.extend({},b(h).data(r));cb();b.event.trigger(P);a.onLoad&&a.onLoad.call(h);a.h=a.height?p(a.height,o)-A-C:a.innerHeight&&p(a.innerHeight,o);a.w=a.width?p(a.width,n)-B-D:a.innerWidth&&p(a.innerWidth,n);a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=p(a.maxWidth,n)-B-D;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=p(a.maxHeight,o)-A-C;a.mh=a.h&&a.h<a.mh?a.h:a.mh}j=a.href;L.show();if(a.inline){e("InlineTemp").hide().insertBefore(b(j)[0]).bind(P+" "+X,function(){b(this).replaceWith(l.children())});m(b(j))}else if(a.iframe)m(" ");else if(a.html)m(a.html);else if(Q(j)){d=new Image;d.onload=function(){var e;d.onload=null;d.id=k+"Photo";b(d).css({margin:u,border:v,display:"block",cssFloat:"left"});if(a.scalePhotos){q=function(){d.height-=d.height*e;d.width-=d.width*e};if(a.mw&&d.width>a.mw){e=(d.width-a.mw)/d.width;q()}if(a.mh&&d.height>a.mh){e=(d.height-a.mh)/d.height;q()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";setTimeout(function(){m(d)},1);i[1]&&(g<i.length-1||a.loop)&&b(d).css({cursor:"pointer"}).click(c.next);if(G)d.style.msInterpolationMode="bicubic"};d.src=j}else e().appendTo(K).load(j,function(c,a,b){m(a==="error"?"Request unsuccessful: "+b.statusText:this)})};c.next=function(){if(!F){g=g<i.length-1?g+1:0;c.load()}};c.prev=function(){if(!F){g=g?g-1:i.length-1;c.load()}};c.slideshow=function(){function f(){z.text(a.slideshowStop).bind(W,function(){d=setTimeout(c.next,a.slideshowSpeed)}).bind(P,function(){clearTimeout(d)}).one(t,function(){e()});j.removeClass(b+"off").addClass(b+q)}var e,d,b=k+"Slideshow_";z.bind(fb,function(){z.unbind();clearTimeout(d);j.removeClass(b+"off "+b+q)});e=function(){clearTimeout(d);z.text(a.slideshowStart).unbind(W+" "+P).one(t,function(){f();d=setTimeout(c.next,a.slideshowSpeed)});j.removeClass(b+q).addClass(b+"off")};if(a.slideshow&&i[1])a.slideshowAuto?f():e()};c.close=function(){if(w){w=d;b.event.trigger(X);a.onCleanup&&a.onCleanup.call(h);m.unbind("."+k+" ."+O);y.fadeTo("fast",0);j.stop().fadeTo("fast",0,function(){j.find("iframe").attr("src","about:blank");l.remove();j.add(y).css({opacity:1,cursor:u}).hide();try{R.focus()}catch(c){}setTimeout(function(){b.event.trigger(fb);a.onClosed&&a.onClosed.call(h)},1)})}};c.element=function(){return b(h)};c.settings=eb;b(c.init)})(jQuery,this)

//CSS menu (для IE)
function cssmenuhover()
{
        if(!document.getElementById("cssmenu"))
                return;
        var lis = document.getElementById("cssmenu").getElementsByTagName("LI");
        for (var i=0;i<lis.length;i++)
        {
                lis[i].onmouseover=function(){this.className+=" iehover";}
                lis[i].onmouseout=function() {this.className=this.className.replace(new RegExp(" iehover\\b"), "");}
        }
}
if (window.attachEvent) window.attachEvent("onload", cssmenuhover);

navHover = function() {
	var lis = document.getElementById("prodmenu").getElementsByTagName("table");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", navHover);

//jGrowl
(function($){$.jGrowl=function(m,o){if($('#jGrowl').size()==0)
$('<div id="jGrowl"></div>').addClass((o&&o.position)?o.position:$.jGrowl.defaults.position).appendTo('body');$('#jGrowl').jGrowl(m,o);};$.fn.jGrowl=function(m,o){if($.isFunction(this.each)){var args=arguments;return this.each(function(){var self=this;if($(this).data('jGrowl.instance')==undefined){$(this).data('jGrowl.instance',$.extend(new $.fn.jGrowl(),{notifications:[],element:null,interval:null}));$(this).data('jGrowl.instance').startup(this);}
if($.isFunction($(this).data('jGrowl.instance')[m])){$(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'),$.makeArray(args).slice(1));}else{$(this).data('jGrowl.instance').create(m,o);}});};};$.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:'',group:'',sticky:false,position:'top-right',glue:'after',theme:'default',themeState:'highlight',corners:'10px',check:250,life:3000,closeDuration:'normal',openDuration:'normal',easing:'swing',closer:true,closeTemplate:'&times;',closerTemplate:'<div>[ close all ]</div>',log:function(e,m,o){},beforeOpen:function(e,m,o){},afterOpen:function(e,m,o){},open:function(e,m,o){},beforeClose:function(e,m,o){},close:function(e,m,o){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},notifications:[],element:null,interval:null,create:function(message,o){var o=$.extend({},this.defaults,o);if(typeof o.speed!=='undefined'){o.openDuration=o.speed;o.closeDuration=o.speed;}
this.notifications.push({message:message,options:o});o.log.apply(this.element,[this.element,message,o]);},render:function(notification){var self=this;var message=notification.message;var o=notification.options;var notification=$('<div class="jGrowl-notification '+o.themeState+' ui-corner-all'+
((o.group!=undefined&&o.group!='')?' '+o.group:'')+'">'+'<div class="jGrowl-close">'+o.closeTemplate+'</div>'+'<div class="jGrowl-header">'+o.header+'</div>'+'<div class="jGrowl-message">'+message+'</div></div>').data("jGrowl",o).addClass(o.theme).children('div.jGrowl-close').bind("click.jGrowl",function(){$(this).parent().trigger('jGrowl.close');}).parent();$(notification).bind("mouseover.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",true);}).bind("mouseout.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",false);}).bind('jGrowl.beforeOpen',function(){if(o.beforeOpen.apply(notification,[notification,message,o,self.element])!=false){$(this).trigger('jGrowl.open');}}).bind('jGrowl.open',function(){if(o.open.apply(notification,[notification,message,o,self.element])!=false){if(o.glue=='after'){$('div.jGrowl-notification:last',self.element).after(notification);}else{$('div.jGrowl-notification:first',self.element).before(notification);}
$(this).animate(o.animateOpen,o.openDuration,o.easing,function(){if($.browser.msie&&(parseInt($(this).css('opacity'),10)===1||parseInt($(this).css('opacity'),10)===0))
this.style.removeAttribute('filter');$(this).data("jGrowl").created=new Date();$(this).trigger('jGrowl.afterOpen');});}}).bind('jGrowl.afterOpen',function(){o.afterOpen.apply(notification,[notification,message,o,self.element]);}).bind('jGrowl.beforeClose',function(){if(o.beforeClose.apply(notification,[notification,message,o,self.element])!=false)
$(this).trigger('jGrowl.close');}).bind('jGrowl.close',function(){$(this).data('jGrowl.pause',true);$(this).animate(o.animateClose,o.closeDuration,o.easing,function(){$(this).remove();var close=o.close.apply(notification,[notification,message,o,self.element]);if($.isFunction(close))
close.apply(notification,[notification,message,o,self.element]);});}).trigger('jGrowl.beforeOpen');if(o.corners!=''&&$.fn.corner!=undefined)$(notification).corner(o.corners);if($('div.jGrowl-notification:parent',self.element).size()>1&&$('div.jGrowl-closer',self.element).size()==0&&this.defaults.closer!=false){$(this.defaults.closerTemplate).addClass('jGrowl-closer ui-state-highlight ui-corner-all').addClass(this.defaults.theme).appendTo(self.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().trigger("jGrowl.beforeClose");if($.isFunction(self.defaults.closer)){self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);}});};},update:function(){$(this.element).find('div.jGrowl-notification:parent').each(function(){if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+parseInt($(this).data("jGrowl").life))<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl.pause")==undefined||$(this).data("jGrowl.pause")!=true)){$(this).trigger('jGrowl.beforeClose');}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()<this.defaults.pool))
this.render(this.notifications.shift());if($(this.element).find('div.jGrowl-notification:parent').size()<2){$(this.element).find('div.jGrowl-closer').animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){$(this).remove();});}},startup:function(e){this.element=$(e).addClass('jGrowl').append('<div class="jGrowl-notification"></div>');this.interval=setInterval(function(){$(e).data('jGrowl.instance').update();},parseInt(this.defaults.check));if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"]){$(this.element).addClass('ie6');}},shutdown:function(){$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();clearInterval(this.interval);},close:function(){$(this.element).find('div.jGrowl-notification').each(function(){$(this).trigger('jGrowl.beforeClose');});}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;})(jQuery);

function isValidEmail (email, strict)
{
 if ( !strict ) email = email.replace(/^\s+|\s+$/g, '');
 return (/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i).test(email);
}

$(document).ready(function(){
	
	$(document).keyup(function(e){
		//alert('ssss');
		if(e.keyCode == 27)
		{
			$('.ngrzclose').click();
			if($('.userkey').attr('rel') == '1')
			{
				$('.userkey').click();
			}
			if($('.userkey2').attr('rel') == '1')
			{
				$('.userkey2').click();
			}
		}
	});	
	
	// $("#trh1").css('display','');
	// $("#trm1").css('display','');
	// $("#trb1").css('display','');
	
	$("#trh1").attr('class', 'trdi');
	$("#trm1").attr('class', 'trdi');
	$("#trb1").attr('class', 'trdi');	
	
	$('.userkey').click(function(){
		if($(this).attr('rel') == '1')
		{
			$(this).attr('rel', '0');
			$('.userblock1').css('display', 'none');
			$('.userblock2').css('display', 'none');
			$('.userblock3').css('display', 'none');
			$('.toregistration').attr('id', '');
			$('.torecpassw').attr('id', '');			
		}else{
			$(this).attr('rel', '1');
			$('.userblock1').css('display', 'block');
		}
	});
	
	$('.userkey2').click(function(){
		if($(this).attr('rel') == '1')
		{
			$(this).attr('rel', '0');
			$('.userblock1').css('display', 'none');
			$('.userblock2').css('display', 'none');
			$('.toregistration').attr('id', '');
			$('.torecpassw').attr('id', '');			
		}else{
			$(this).attr('rel', '1');
			$('.userblock1').css('display', 'block');
		}
	});
	
	$('#blockuserbut2').live('click', function(){
		$.get('js/funcajax.php', { 'exituser': '1' }, function(data){ if(data == '1') {location.replace(location.href); }else{	alert(data);	} });
	});
	
	$('#blockuserbut3').live('click', function(){
		var err = 0;
		var arrrec = new Array();		
		$('.userblock3 input').css('border-color', '#236C97');
		$(".userblock3 input").each(function() {
			if(!$(this).attr('value') || $(this).attr('value') == $(this).attr('title'))
			{
				$(this).css('border-color', '#C9181E');
				err = 1;
			}else{
				arrrec[$(this).attr('name')+''] = $(this).attr('value');
			}
		});	
		if(arrrec['blockrecmail'] == 'неверный формат email')
		{
			$("input[name=blockrecmail]").css('border-color', '#C9181E');
			return false;
		}
		
		if(isValidEmail(arrrec['blockrecmail']) == false)
		{
			$("input[name=blockrecmail]").attr('value', 'неверный формат email');
			$("input[name=blockrecmail]").css('border-color', '#C9181E');
			return false;
		}
		if(err == 1)
		{
			return false;
		}else{
			$.get("js/funcajax.php", { 		'racoverpassw': '1',
											'gmail': arrrec['blockrecmail']
									}, function(data){
										//alert(data);
										if(data == '1')
										{
											location.replace('/cart.php?status=remailya');
										}else
										if(data == 'email')
										{
											location.replace('/cart.php?status=remailno');
										}
									});
		}
	});
	
	$('#blockuserbut1').live('click', function(){
		var err = 0;
		var arrreg = new Array();	
		$('.userblock2 input').css('border-color', '#236C97');
		$(".userblock2 input").each(function() {
			if(!$(this).attr('value') || $(this).attr('value') == $(this).attr('title'))
			{
				$(this).css('border-color', '#C9181E');
				err = 1;
			}else{
				arrreg[$(this).attr('name')+''] = $(this).attr('value');
			}
		});
		
		if(arrreg['blockregmail'] == 'неверный формат email')
		{
			$("input[name=blockregmail]").css('border-color', '#C9181E');
			return false;
		}
		
		if(isValidEmail(arrreg['blockregmail']) == false)
		{
			$("input[name=blockregmail]").attr('value', 'неверный формат email');
			$("input[name=blockregmail]").css('border-color', '#C9181E');
			return false;
		}
		if(err == 1)
		{
			return false;
		}else{
			$.get("js/funcajax.php", { 		'authreg': '1', 
											'name': arrreg['blockregname'], 
											'gmail': arrreg['blockregmail']
									}, function(data){
										//alert(data);
										if(data == '1')
										{
											$(".userblock2").empty();
											$(".userblock2").append('<p class="userpa">Поздравляем, Вы успешно зарегистрированны, данные для входа высланы Вам на email.</p>');
										}else
										if(data == 'cookie')
										{
											$(".userblock2").empty();
											$(".userblock2").append('<p class="userpa">Вы пытались зарегистрироваться с неверными данными более 5 раз в течении минуты, обратитесь в техподдержку.</p>');
										}else
										if(data == 'user')
										{
											$("input[name=blockregmail]").attr('value', 'такой email зарегистрирован');
											$("input[name=blockregmail]").css('border-color', '#C9181E');
											//$(".userblock2").append('<p>Вы пытались зайти с неверными данными более 5 раз в течении минуты, попробуйте <a href="#">восстановить пароль</a>.</p>');										
										}
									});
		}
	});
	
	$('#blockuserbut').live('click', function(){
		var err = 0;
		var arrauth = new Array();	
		$('.userblock1 input').css('border-color', '#236C97');
		$(".userblock1 input").each(function() {
			if(!$(this).attr('value') || $(this).attr('value') == $(this).attr('title'))
			{
				$(this).css('border-color', '#C9181E');
				err = 1;
			}else{
				arrauth[$(this).attr('name')+''] = $(this).attr('value');
			}
		});
		if(err == 1)
		{
			return false;
		}else{
			$.get("js/funcajax.php", { 		'authuser': '1', 
											'email': arrauth['blocklogin'], 
											'passw': arrauth['blockpassw']
											
									}, function(data){
										//alert(data);
										// return false;
										if(data == '1')
										{
											// $(".userblock1").empty();
											// $(".userblock1").append('<p>Добро пожаловать! <br /><br /> Для продолжения заказа перейдите в <a hrfe="cart.php">корзину</a>.</p>');
											location.replace(location.href);
										}else
										if(data == 'cookie')
										{
											$(".userblock1").empty();
											//$(".userblock1").append('<p class="userpa">Вы пытались зайти с неверными данными более 5 раз в течении минуты, попробуйте <a class="torecpassw">восстановить пароль</a>.</p>');
											$(".userblock1").append('<p class="userpa">Если вы забыли пароль, попробуйте <a class="torecpassw">восстановить пароль</a> его.</p>');
											
										}else
										if(data == 'emya')
										{
											$('input[name=blockpassw]').attr('value', 'неправильный пароль');
										}else
										if(data == 'emno')
										{
											$('input[name=blocklogin]').attr('value', 'логин отсутствует');
											$('input[name=blockpassw]').attr('value', '');
										}
									});
		}
	});
	
	$(".userblock1 input[type=text]").each(function() { $(this).attr('value', $(this).attr('title')); 	});
	$(".userblock2 input[type=text]").each(function() { $(this).attr('value', $(this).attr('title')); 	});
	$(".userblock3 input[type=text]").each(function() { $(this).attr('value', $(this).attr('title')); 	});
	
	$('.userblock1 input[type=text]').live('focus', function(){
		if($(this).attr('value') == $(this).attr('title'))
		{
			$(this).attr('value', '');
		}
		if($(this).attr('value') == 'неправильный пароль')
		{
			$(this).attr('value', '');
		}
		if($(this).attr('value') == 'логин отсутствует')
		{
			$(this).attr('value', '');
		}		
	});
	
	$('.userblock1 input[type=text]').live('focusout', function(){
		if(!$(this).attr('value'))
		{
			$(this).attr('value', $(this).attr('title')); 
		}
	});

	$('.userblock3 input[type=text]').live('focus', function(){
		if($(this).attr('value') == $(this).attr('title'))
		{
			$(this).attr('value', '');
		}
		if($(this).attr('value') == 'неверный формат email')
		{
			$(this).attr('value', '');
		}
	});
	
	$('.userblock3 input[type=text]').live('focusout', function(){
		if(!$(this).attr('value'))
		{
			$(this).attr('value', $(this).attr('title')); 
		}
	});
	
	$('.userblock2 input[type=text]').live('focus', function(){
		if($(this).attr('value') == $(this).attr('title'))
		{
			$(this).attr('value', '');
		}
		if($(this).attr('value') == 'неверный формат email')
		{
			$(this).attr('value', '');
		}
	});
	
	$('.userblock2 input[type=text]').live('focusout', function(){
		if(!$(this).attr('value'))
		{
			$(this).attr('value', $(this).attr('title')); 
		}
	});	
	
	$('.toregistration').click(function(){
		$('.torecpassw').attr('id', '');
		$('.userblock2').css('display', 'block');
		$('.userblock3').css('display', 'none');	
		if($('.toregistration').attr('id') != 'actblockf')
		{
			$('.toregistration').attr('id', 'actblockf');
		}else{
			$('.userblock2').css('display', 'none');
			$('.toregistration').attr('id', '');
		}
	});
	
	$('.torecpassw').live('click', function(){
		$('.toregistration').attr('id', '');
		$('.userblock2').css('display', 'none');
		$('.userblock3').css('display', 'block');		
		if($('.torecpassw').attr('id') != 'actblockf')
		{
			$('.torecpassw').attr('id', 'actblockf');
		}else{
			$('.userblock3').css('display', 'none');
			$('.torecpassw').attr('id', '');
		}
	});
	
	$(".navlisttr").click(function(){
		var t = $(this).attr('rel');
		$(".trdi").attr('class', 'trd');
		$("#trh"+t).attr('class', 'trdi');
		$("#trm"+t).attr('class', 'trdi');
		$("#trb"+t).attr('class', 'trdi');
		
		if(t > 1)
		{
			$('#nanext').css('display', 'inline');
			$('#naback').css('display', 'inline');
			bt = parseInt(t) - 1;
			
			nt = parseInt(t);
			
			if($('.counttr').attr('rel') != nt)
			{
				nt = parseInt(t) + 1;
			}else{
				$('#nanext').css('display', 'none');
			}
			
			$('#naback').attr('rel', bt);
			$('#nanext').attr('rel', nt);
		}else{
			$('#nanext').css('display', 'inline');
			$('#naback').css('display', 'none');
			$('#nanext').attr('rel', 2);
		}
		
		//alert(t);
	});
	
	$('#searchtext').focus(function(){
		if($('#searchtext').attr('value') == $('#searchtext').attr('title'))	$('#searchtext').attr('value', '');
	});
	
	$('#searchtext').focusout(function(){
		if(!$('#searchtext').attr('value'))	$('#searchtext').attr('value', $('#searchtext').attr('title'));
	});	

	$('.clubcard').live('click', function(){
		$('.clubcard2').css('display', 'block');
		$('#howcluprice').css('display', 'none');
		$('.clubcard').css('display', 'none');
	});
	
	$("#companyInfoFields input.text").each(function() { $(this).attr('value', $(this).attr('title')); 	});
	$("#companyInfoFields input.text").focus(function(){
		//$(this).css({'font-size': '11px', 'color': '#999999'});
		$("#companyInfoFields input.text").each(function() { if($(this).attr('value') == 0)$(this).attr('value', $(this).attr('title')); 	});
		$(".container_new_user input.text").each(function() { if($(this).attr('value') == 0)$(this).attr('value', $(this).attr('title')); 	});
		$(".container_registered_user input.text").each(function() { if($(this).attr('value') == 0)$(this).attr('value', $(this).attr('title')); 	});
		
		if($(this).attr('value') == $(this).attr('title')) {	$(this).attr('value', '');	}
	});
	$("#companyInfoFields input.text").change(function(){ 
		//if($(this).attr('value').length > 0 && $(this).attr('value') != $(this).attr('title')) { $(this).css({'font-size': '14px', 'color': '#0059AD'});	}
	});
	
	
	$('.clck').click(function(){
		
		var catee = $(this).attr('rel');
		
		
		$('.grcont').css('display', 'none');
		$('.praz').css('display', 'none');
		$('.catee'+catee).css('display', 'block');
		$('.catee'+catee).css('visibility', 'visible');
		
		
		
		$('.coocatop').attr('rel', catee);

		$('.praz').css('display', 'none');
		$('.rtov').css('display', 'none');
		
		if($('.catee'+catee+' .grobcont .graz').attr('class'))
		{
		}else{
			$('.tovlvl'+catee+'').css('display', 'block');
			//alert('sss');
		}

		//alert('sss');
	});
	
	$('.ajalocat').live( 'click' ,function(){
	
		$('.ajalocat').attr('class', 'ajalocat');
		$(this).attr('class', 'ajalocat gract');
		if($(this).parent('div').parent('.praz').attr('class'))
		{
			var reldu = $(this).parent('div').parent('.praz').attr('class').replace('praz cslvl', '');//
			$('a[rel='+reldu+']').attr('class', 'ajalocat gract');
			//alert($('a[rel='+reldu+']').attr);
		}
		
		var rel= $(this).attr('rel');
		//alert(rel);
		
		if( $('div').is('.cslvl'+rel))
		{
			$('.praz').css('display', 'none');
			$('.rtov').css('display', 'none');
			$('.cslvl'+rel).css('display', 'block');
			
			//if($('.cslvl'+rel))
		}
		
		if( $('div').is('.tovlvl'+rel))
		{
			
			$('.praz').css('display', 'none');
			$('.rtov').css('display', 'none');
			
		if($(this).parent('div').parent('.praz').attr('class'))
		{
			$(this).parent('div').parent('.praz').css('display', 'block');
		}			
			
			$('.tovlvl'+rel).css('display', 'block');
		}
	});
	
	$('.ngrzclose').click(function(){
		$('.grcont').css('display', 'none');
	});
	

	
	$(".container_new_user input.text").each(function() { $(this).attr('value', $(this).attr('title')); });
	$(".container_new_user input.text").focus(function(){
		//$(this).css({'font-size': '11px', 'color': '#999999'});
		$("#companyInfoFields input.text").each(function() { if($(this).attr('value') == 0)$(this).attr('value', $(this).attr('title')); 	});
		$(".container_new_user input.text").each(function() { if($(this).attr('value') == 0)$(this).attr('value', $(this).attr('title')); 	});
		$(".container_registered_user input.text").each(function() { if($(this).attr('value') == 0)$(this).attr('value', $(this).attr('title')); 	});
		if($(this).attr('value') == $(this).attr('title')) {	$(this).attr('value', '');	}
	});
	$(".container_new_user input.text").change(function(){ 
		//$(this).css({'font-size': '14px', 'color': '#0059AD'});
	});	
	
	$(".container_registered_user input.text").each(function() { if(!$(this).attr('value')) { $(this).attr('value', $(this).attr('title')); }});
	$(".container_registered_user input.text").focus(function(){
		//$(this).css({'font-size': '11px', 'color': '#999999'});
		$("#companyInfoFields input.text").each(function() { if($(this).attr('value') == 0)$(this).attr('value', $(this).attr('title')); 	});
		$(".container_new_user input.text").each(function() { if($(this).attr('value') == 0)$(this).attr('value', $(this).attr('title')); 	});
		$(".container_registered_user input.text").each(function() { if($(this).attr('value') == 0)$(this).attr('value', $(this).attr('title')); 	});
		if($(this).attr('value') == $(this).attr('title')) {	$(this).attr('value', '');	}
	});
	
	$(".container_registered_user input.text").change(function(){ 
		//$(this).css({'font-size': '14px', 'color': '#0059AD'});
	});		
	
	$(".container_dostav_user input.text").each(function() { if(!$(this).attr('value')) {	$(this).attr('value', $(this).attr('title')); $(this).css('color','#E13835'); }	});
	$(".container_dostav_user input.text").focus(function(){
		//$(this).css({'font-size': '11px', 'color': '#999999'});
		$("#companyInfoFields input.text").each(function() { if($(this).attr('value') == 0)$(this).attr('value', $(this).attr('title')); 	});
		$(".container_new_user input.text").each(function() { if($(this).attr('value') == 0)$(this).attr('value', $(this).attr('title')); 	});
		$(".container_registered_user input.text").each(function() { if($(this).attr('value') == 0)$(this).attr('value', $(this).attr('title')); 	});
		$(".container_dostav_user input.text").each(function() { if($(this).attr('value') == 0)$(this).attr('value', $(this).attr('title')); 	});
		if($(this).attr('value') == $(this).attr('title')) {	$(this).attr('value', '');	}
	});	
	
	$('.appudi').click(function(){
		var ares = $(this).attr('rel');
		if(ares == 1)
		{
			$('.container_uedi_user').css('display','none');
			$(this).attr('rel', '0');
		}else{
			$('.container_uedi_user').css('display','block');
			$(this).attr('rel', '1');
		}
	});
	// $(".container_dostav_user textarea.text").focus(function(){
		// $(this).text('');
	// });
	
	$(".gmail").colorbox({iframe:true, innerWidth:425, innerHeight:380});
	$(".promo").colorbox({iframe:true, innerWidth:425, innerHeight:425});
	$(".mapsl").colorbox({iframe:true, innerWidth:625, innerHeight:625});
	
	$(".imgmanag").colorbox({innerWidth:800, innerHeight:600}); 
	$(".one_image a").colorbox({innerWidth:800, innerHeight:600}); 	
	
	$(".zmm").colorbox({innerWidth:800, innerHeight:600}); 
	
	$(".bimgshop").colorbox({innerWidth:800, innerHeight:600}); 
	
	$(".phdimg a").colorbox({innerWidth:800, innerHeight:600}); 
		
	// $(document).keyup(function (e){
		// if(e.which == '27')
		// {			
			// if($('#prodmenu').css('display') == 'block')
			// {
				// $('#prodmenu').css('display', 'none');
				// $('#tproduct').attr('rel', '0');
				
			// }
		// }		
	// });
		
	$('#tproduct').hover(
		function(){ /*$('#prodmenu').css('display','block');	*/ }, //	setTimeout(function(){	$('#prodmenu').css('display','block');	}, 300);
		//function(){	setTimeout(function(){	$('#prodmenu').css('display','block');	}, 100);},
		function(){	/*$('#prodmenu').css('display','none');*/ }
	);
	
	$('#tproduct').hover(
		function(){	$('#tproduct span').attr('class','hovspan'); },
		function(){	$('#tproduct span').attr('class',''); }
	);
	
	$('#tproduct').click(function(){
		if($('#tproduct').attr('rel') == 1)
		{
			$('#tproduct').attr('rel', '0');
			$('#prodmenu').css('display','none');
		}else{
			$('#tproduct').attr('rel', '1');
			$('#prodmenu').css('display','block');
		}
	});
	
	$('#prodmenu').hover(
		function(){	
				$('#tproduct span').attr('class','hovspan'); $('#prodmenu').css('display','block'); 
			},
		function(){	
				//$('#tproduct span').attr('class',''); $('#prodmenu').css('display','none'); 
			}
	);	
	
	
	
	$('#comsend').click(function(){
		if(!$('input[name=fname]').attr('value')) { 		$.jGrowl('Заполните поле <b>ФИО заказчика</b>');									return false;	}
		if(!$('input[name=femail]').attr('value')) {	 	$.jGrowl('Заполните поле <b>E-mail</b>');											return false;	}
		if(!$('input[name=fcapcha]').attr('value')) { $.jGrowl('Введите текст с картинки');														return false;	}
		$('#comform').submit();
		return false;		
	});	
	
	$('.btstro').click(function(){
		
		var id = $(this).attr('id').replace('st','');
		if($(this).attr('rel') == '1')
		{
			$(this).attr('rel','0');
			$('#sul'+id).css('display', 'none');
		}else{
			$(this).attr('rel','1');
			$('#sul'+id).css('display', 'block');
		}
		
	});
	
	$('input[name=uregist]').click(function(){
		var v = $(this).attr('value');
		$('.container_remember_user').attr('rel', '');
		//alert(v);
		if(v == 1)
		{
			$('.container_registered_user').css('display','block');
			$('.container_new_user_type').css('display','none');
			$('.container_new_user').css('display','none');
			$('#companyInfoFields').css('display','none');
		}else{
			$('.container_registered_user').css('display','none');
			$('.container_new_user_type').css('display','block');
			$('.container_new_user').css('display','block');
			//alert($('input[name=usertype]:checked').attr('value'));
			if($('input[name=usertype]:checked').attr('value') == 1) $('#companyInfoFields').css('display','block');	
			$('.container_remember_user').css('display', 'none');
		}
		///////////////////////////////////////////////////
	});
	
	
	$('input[name=sendpromoorder]').click(function(){

		if(!$('#promoorder_userfio').attr('value')) {	$.jGrowl('Заполните поле ФИО');		return false;	}
		if(!$('#promoorder_email').attr('value')) {	$.jGrowl('Заполните поле E-mail');		return false;	}
		if(!$('#promoorder_tell').attr('value'))	{	$.jGrowl('Заполните поле Телефон');	return false;	}
		if(!$('#promoorder_city').attr('value')) 	{	$.jGrowl('Заполните поле Город');	return false;	}
		if(!$('#promoorder_adres').val()) 			{	$.jGrowl('Заполните поле Адрес');	return false;	}
		//return false;
	});
	
	$('input[name=usertype]').click(function(){
		var v = $(this).attr('value');
		//alert(v);
		if(v == 1)
		{
			$('#companyInfoFields').css('display','block');
		}else{
			$('#companyInfoFields').css('display','none');
	
		}

	});
	
	$('#rememberpass').click(function(){
		$('.container_remember_user').attr('rel', '1');
		$('.container_remember_user').css('display', 'block');
		$('.container_registered_user').css('display', 'none');
	});
	
	$('#user_adres').click(function(){
		$('#user_adres').text('');
	});
	
	$("select[name=manufacturer]").change( function() {
		var dateto = $("select[name=manufacturer] option:selected").attr('value');
		//var manager = $("select[name=manufacturer]").attr('class');
		location.replace('catalog.php?pid='+dateto);
	});	

	
	
	$('input[class=gprog]').click(function() {
		
		if(!$('input[name=paytype]').attr('value'))
		{
			if(($('#user_name').attr('value') == $('#user_name').attr('title')) || !$('#user_name').attr('value'))	{	$.jGrowl('Заполните поле Имя');	return false;}
			if(($('#user_oname').attr('value') == $('#user_oname').attr('title')) || !$('#user_oname').attr('value'))	{	$.jGrowl('Заполните поле Отчество');	return false;}
			if(($('#user_fname').attr('value') == $('#user_fname').attr('title')) || !$('#user_fname').attr('value'))	{	$.jGrowl('Заполните поле Фамилия');	return false;}
			if(($('#user_tell').attr('value') == $('#user_tell').attr('title')) || !$('#user_tell').attr('value'))	{	$.jGrowl('Заполните поле Телефон');	return false;}
			if(($('#user_city').attr('value') == $('#user_city').attr('title')) || !$('#user_city').attr('value'))	{	$.jGrowl('Заполните поле Город');	return false;}
			//if(($('#user_postcode').attr('value') == $('#user_postcode').attr('title')) || !$('#user_postcode').attr('value'))	{	$.jGrowl('Заполните поле Индекс');	return false;}
			if(($('#user_adres').val() == $('#user_adres').attr('title')) || !$('#user_adres').val())	{	$.jGrowl('Заполните поле Адрес');	return false;}
		}
	});
	
	$('input[class=gpsave]').click(function() {
		
		if(!$('input[name=paytype]').attr('value'))
		{
			if(($('#user_name').attr('value') == $('#user_name').attr('title')) || !$('#user_name').attr('value'))	{	$.jGrowl('Заполните поле Имя');	return false;}
			if(($('#user_oname').attr('value') == $('#user_oname').attr('title')) || !$('#user_oname').attr('value'))	{	$.jGrowl('Заполните поле Отчество');	return false;}
			if(($('#user_fname').attr('value') == $('#user_fname').attr('title')) || !$('#user_fname').attr('value'))	{	$.jGrowl('Заполните поле Фамилия');	return false;}
			if(($('#user_tell').attr('value') == $('#user_tell').attr('title')) || !$('#user_tell').attr('value'))	{	$.jGrowl('Заполните поле Телефон');	return false;}
			if(($('#user_city').attr('value') == $('#user_city').attr('title')) || !$('#user_city').attr('value'))	{	$.jGrowl('Заполните поле Город');	return false;}
			//if(($('#user_postcode').attr('value') == $('#user_postcode').attr('title')) || !$('#user_postcode').attr('value'))	{	$.jGrowl('Заполните поле Индекс');	return false;}
			if(($('#user_adres').val() == $('#user_adres').attr('title')) || !$('#user_adres').val())	{	$.jGrowl('Заполните поле Адрес');	return false;}
		}
	});	
	
	$('#user_email4').change(function(){
		$.get("js/funcajax.php", { 'confemail': $('#user_email4').attr('value') }, function(data){
			if(data == 'err')
			{
				$.jGrowl('E-mail: '+$('#user_email4').attr('value')+' уже зарегистрирован на сайте.');
				$('.quec').css('display','block');
				$('.que3').css('display','block');
				$('.que2').css('display','none');
				$('.que1').css('display','none');
				setTimeout(function(){ $('.quec').css('display','none'); }, 2000);
				return false;
			}else{
				//setTimeout(function(){ $('.que2').css('display','block'); }, 2000);
				$('.quec').css('display','block');
				$('.que2').css('display','block');
				$('.que3').css('display','none');
				$('.que1').css('display','none');
				setTimeout(function(){ $('.quec').css('display','none'); }, 2000);
			}
		});	
	});
	$('div[class=gprog]').click(function() {
		
		var rstatus = '';
		//uregist
		if($('input[name=uregist]:checked').attr('value') == 1)
		{
			
			if($('.container_remember_user').attr('rel') == '1')
			{
				if(($('#auth_remember_mail').attr('value') == $('#auth_remember_mail').attr('title')) || !$('#auth_remember_mail').attr('value'))	{	$.jGrowl('Заполните поле Email');	return false;}
				
				if(isValidEmail($('#auth_remember_mail').attr('value')) == false)	{	$.jGrowl('Заполните поле Email (в формате email@email.ru)');	return false;}
			}else{
				if(($('#auth_user_login4').attr('value') == $('#auth_user_login4').attr('title')) || !$('#auth_user_login4').attr('value'))	{	$.jGrowl('Заполните поле Email/Логин');	return false;}
				
				if(isValidEmail($('#auth_user_login4').attr('value')) == false)	{	$.jGrowl('Заполните поле Email (в формате email@email.ru)');	return false;}
				
				if(($('#auth_user_password4').attr('value') == $('#auth_user_password4').attr('title')) || !$('#auth_user_password4').attr('value'))	{	$.jGrowl('Заполните поле Пароль');	return false;}
			}
			$('.que2').css('display','block');
			//alert('1');
		}else{
			//usertype
			if(($('#user_name4').attr('value') == $('#user_name4').attr('title')) || !$('#user_name4').attr('value'))	{	$.jGrowl('Заполните поле Имя');	return false;}
			
			if(($('#user_surname4').attr('value') == $('#user_surname4').attr('title')) || !$('#user_surname4').attr('value'))	{	$.jGrowl('Заполните поле Фамилия');	return false;}
			
			if(($('#user_phone4').attr('value') == $('#user_phone4').attr('title')) || !$('#user_phone4').attr('value'))	{	$.jGrowl('Заполните поле Телефон');	return false;}
	
			if(($('#user_email4').attr('value') == $('#user_email4').attr('title')) || !$('#user_email4').attr('value'))	{	$.jGrowl('Заполните поле Email');	return false;}
			
			if(isValidEmail($('#user_email4').attr('value')) == false)	{	$.jGrowl('Заполните поле Email (в формате email@email.ru)');	return false;}
			
			
			$.get("js/funcajax.php", { 'confemail': $('#user_email4').attr('value') }, function(data){
				if(data == 'err')
				{
					$.jGrowl('E-mail: '+$('#user_email4').attr('value')+' уже зарегистрирован на сайте.');
					return false;
				}else{
					$('.que2').css('display','block');
					setTimeout(function(){ $('.quec').css('display','none'); }, 2000);
				}
			});
			if($('input[name=usertype]:checked').attr('value') == 1)
			{
				if(($('#legal_form4').attr('value') == $('#legal_form4').attr('title')) || !$('#legal_form4').attr('value'))	{	$.jGrowl('Заполните поле Форма организации');	return false;}
				if(($('#legal_name4').attr('value') == $('#legal_name4').attr('title')) || !$('#legal_name4').attr('value'))	{	$.jGrowl('Название организации');	return false;}
				if(($('#legal_address4').attr('value') == $('#legal_address4').attr('title')) || !$('#legal_address4').attr('value'))	{	$.jGrowl('Юридический адрес');	return false;}
				if(($('#fact_address4').attr('value') == $('#fact_address4').attr('title')) || !$('#fact_address4').attr('value'))	{	$.jGrowl('Фактический адрес');	return false;}
				if(($('#rs4').attr('value') == $('#rs4').attr('title')) || !$('#rs4').attr('value'))	{	$.jGrowl('Расчетный счет');	return false;}
				if(($('#bank_name4').attr('value') == $('#bank_name4').attr('title')) || !$('#bank_name4').attr('value'))	{	$.jGrowl('Название банка');	return false;}
				if(($('#ks4').attr('value') == $('#ks4').attr('title')) || !$('#ks4').attr('value'))	{	$.jGrowl('Корреспондентский счет');	return false;}
				if(($('#bik4').attr('value') == $('#bik4').attr('title')) || !$('#bik4').attr('value'))	{	$.jGrowl('БИК');	return false;}
				if(($('#inn4').attr('value') == $('#inn4').attr('title')) || !$('#inn4').attr('value'))	{	$.jGrowl('ИНН');	return false;}
				if(($('#kpp4').attr('value') == $('#kpp4').attr('title')) || !$('#kpp4').attr('value'))	{	$.jGrowl('КПП');	return false;}
				if(($('#director_name4').attr('value') == $('#director_name4').attr('title')) || !$('#director_name4').attr('value'))	{	$.jGrowl('Имя руководителя');	return false;}
				if(($('#director_patronymic4').attr('value') == $('#director_patronymic4').attr('title')) || !$('#director_patronymic4').attr('value'))	{	$.jGrowl('Отчество руководителя');	return false;}
				if(($('#director_surname4').attr('value') == $('#director_surname4').attr('title')) || !$('#director_surname4').attr('value'))	{	$.jGrowl('Фамилия руководителя');	return false;}
				if(($('#director_duty4').attr('value') == $('#director_duty4').attr('title')) || !$('#director_duty4').attr('value'))	{	$.jGrowl('Должность руководителя');	return false;}
			}
			//alert('0');
		}
		//return false;
		// if($("input[name=f_famili]").val() == '')	{	$.jGrowl('Заполните поле Фамилия');	return false;}
		// if($("input[name=f_phone]").val() == '')	{	$.jGrowl('Заполните поле Телефон');	return false;}
		// if($("textarea[name=f_adres]").val() == ''){	$.jGrowl('Заполните поле Адрес');	return false;}
		//alert(rstatus);
		if($('.que2').css('display') == 'block')
		{
			$("form[name=user_auth_reg]").submit();
		}else{
			$.jGrowl('Подождите, проверяется email');	
		}
	});
	
});

function window1(src,w,h)
{
	prevImg = new Image();
	prevImg.src = src;

	viewer = window.open(src, "PREV", "width="+w+",height="+h+"toolbar=no,status=no,scrollbars=yes,menubar=no,resizable=no");

	viewer.document.body.style.padding = 0;
	viewer.document.body.style.margin = 0;
	viewer.document.body.style.textAlign = "center";

	viewer.resizeTo(w+10,h+30);

	viewer.focus();

	return false;
}

/*Новые табы*/
(function($) {
$(function() {

	$('ul.tabs').delegate('li:not(.current)', 'click', function() {
		$(this).addClass('current').siblings().removeClass('current')
			.parents('div.section').find('div.box').hide().eq($(this).index()).fadeIn(150);
	})

})
})(jQuery)
