(function ($) {
$(document).ready(function(){
//write...
common();
lishan();
productImages();
ie6();
});
})(jQuery);
function ie6(){
	$('.submit,.reset').mouseover(function(){
		$(this).css('background-position','0 0');
	}).mouseout(function(){
		$(this).css('background-position','0 -32px');
	});
}
function common(){
var errora=$.trim($('#system-message .message.fade').text());
 if(errora!=''){
  alert(errora);
 }
 
 $('a').focus(function(){
 	$(this).blur();
 });
}
 
function lishan(){
	$('.menu_top li').each(function(i){
		$(this).hover(
		function(){
			 $(this).find('>ul').css('display','block');
		},function(){
			$(this).find('>ul').css('display','none');
		});
	 });
}
//²úÆ·Í¼Æ¬Õ¹Ê¾
function productImages(){
	var iteml = 0;var allowl=10;
	jQuery('.image_list').each(function(){
		iteml = jQuery(this).find('.image_item').length;
		pre = jQuery(this).find('.pre a');
		next = jQuery(this).find('.next a');
		all = jQuery(this);
		first = jQuery(this).find('.image_item:first');
		first.addClass('active');
		if(iteml<=allowl){
			pre.css('display','none');
			next.css('display','none');
			return ;
		}
		function backfn(items){
			items.parent().find('.image_item:first').click();
		}
		iteml = ((iteml-allowl)>allowl)?allowl:(iteml-allowl);
		imagesSwitch44(pre,next,jQuery(this).find('.image_item'),1200,iteml,backfn);
	});

	jQuery('.image_item').click(function(){
		jQuery(this).parent().find('.image_item').removeClass('active');
		jQuery(this).addClass('active');
		var bigimg = jQuery(this).parents('.viewsdetail').find('.bimg685');
		var bigsrc = jQuery(this).find('.bimg50').attr('bigsrc');
		var truesrc = jQuery(this).find('.bimg50').attr('truesrc');
		bigimg.animate({'opacity':'0.1'},400,function(){
			bigimg.css('background-image','url('+bigsrc+')');
			bigimg.attr('truesrc',truesrc);
			bigimg.animate({'opacity':'1'},700);
		});
	});
	jQuery('.bimg685').click(function(){
		var img = jQuery('<img src="'+jQuery(this).attr('truesrc')+'"/>');
		img.setLightBox({layoverBg:'#888',layoverOpa:'0.45',alertdivBg:'#fff',closeBut:img});
	});
}
