  

$(window).load(function() {$('.vml_box_shadow').css({visibility:'visible'});
});
$(document).ready(function() {

	Cufon.replace('.typeface-js');

	$('.news div.w5-5:nth-child(2n)').addClass('last');
	$('.downloads div.w5-5:nth-child(2n)').addClass('last');

	//$('.vml_box_shadow').css({display:'none'});

	ie7 = ((jQuery.browser.msie) && (parseInt(jQuery.browser.version))==7)?true:false;
	ie = (jQuery.browser.msie)?true:false;
	opera = ($.browser.opera)?true:false;
	chrome = /chrome/.test(navigator.userAgent.toLowerCase());

	at=ie?0:300;

	$("#n>div>ul>li,  #n>div>ul>li>ul>li").bind("mouseleave", function(e){drUp($(this));});
	$("#n>div>ul>li>a, #n>div>ul>li>ul>li>a").bind("mouseover", function(e){drDwn($(this));});	

	var drDwn =  $.debounce(function(o) {
		var e = o.parent('li');
		if (!e.data( 'fussy')) {
			o.addClass('hover');
			o.parent('li').children('ul').slideDown(300);
		}
	}, 100,false);

	var drUp = function(o) {
		o.children('ul').slideUp(at,function(){o.children('a').removeClass('hover');});
		if(o.children('ul').length==0)  o.children('a').removeClass('hover');
		o.data('fussy', true);
		setTimeout(function(){o.data('fussy', false);},150);
	};

	$('#side').children('li').children('a')
	.each(function(index) {
		var papa = $(this).parent('li');
		var ul = papa.children('ul');
		if(ul.length){
			if (!papa.hasClass('here')) {ul.hide();ul.before('<b class="arr dwn">+</b>');}else{ul.before('<b class="arr">&ndash;</b>');}
		}
	})
	.click(function() {
		var o = $(this).parent('li').children('ul');
		var arr = o.parent('li').children('.arr');
		o.slideToggle(300);
		if(arr.hasClass('dwn')){arr.html('&ndash;').removeClass('dwn');}else{arr.html('+').addClass('dwn');}
	})
	.css({cursor:'hand',cursor:'pointer'});

//if ($('.w4.descr div').length) $('.w4.descr div').html($('.w4.descr div').html().replace('Size:','<b>Size:</b>').replace('Catalogue no:','<b>Catalogue no:</b>'));


	
$('.productsList').each(function(){
		var o = $(this);
		o.click(function(){location.href=o.children('div').children('a').attr('href');}).css({cursor:'hand',cursor:'pointer'});

var w = 137 - o.children('div').children('a').width();

if (o.children('div').children('a').width()>140){
o.hover(
  function () {
    o.children('div').children('a').animate({
       left: '+='+w
  }, 400); 
  }, 
  function () {
    o.children('div').children('a').animate({
       left: '0'
  }, 400);
  }
);
}



	});


/*$('.productsList:nth-child(4n)').css({marginRight:'0'});*/

	$('.ftr div.w3:nth-child(4n)').addClass('last').css({width:'200px'});
	$('div.w5 .descr a:nth-child(4n)').css({marginRight:'0',marginLeft:'1px'});
	$('a.nyroModal img.entry_img').each(function(){
		var o = $(this);
	o.after('<img src="/i/zoom.png" style="position:absolute;z-index:999;left:'+(o.width()-20)+'px;top:'+(o.height()-20)+'px;">');
	});


});

$(document).ready(function() {

if ($("#feedback").length) {	}

$("#feedback").live("submit", function(){

		 $(this).ajaxSubmit({ 
			beforeSubmit: function(){if(!$("#feedback").valid()) {return false;}else{$('.btn').hide();$('#re_feedback_form').html('<img src="/i/ajaxLoader.gif" width="16" height="16" id="snake">')}},
			success: function(responseText, statusText){
						var reg=/\s*<jGrowl>/gi;
						var result=reg.test(responseText) ? 1 : 0;
						if(result == 0){
							$('#result').html(responseText);
							setTimeout(function(){$("#tnx").fadeOut(500);},5000);
							$('.required').prev('label').append('<sup style="color:red;">*</sup>');
						}else{
							//_gaq.push(['_trackEvent', 'Error', 'feedback '+responseText]);
							$('#re_feedback_form').html('Error try again later');
							setTimeout(function(){$('#re_feedback_form').fadeOut(500);},5000);
							setTimeout(function(){$('#re_feedback_form').html('').show();},5550);
						}
					}
			});
		  return false;
	    });
$('.required').prev('label').append('<sup style="color:red;">*</sup>');
});


