//--- utf-8
$(function(){
	menuSub();
	$("[rel$='}']").each(function(){
		rel_Analytical($(this));
	});
	buy();
});

function menuSub(){
	var menuId = $('.menu');
	$('a', menuId).mouseover(function(){
		var rel = $(this).attr('rel');
		var subId = $('.menu-sub[rel='+rel+']');
		if(subId.size()>0){
			var offset = $(this).offset();
			$('.menu-sub').hide();
			subId.show().css({left:offset.left,top:offset.top+$(this).height()});
		}
	});
	$('body').click(function(){
		$('.menu-sub').hide();
	});
}

function rel_Analytical(id){
	eval("var u="+id.attr('rel'));
	if(u.type==1){
		//{type:1, slidetime:200, target:'.jq--9960', callback:'alert(0)', execute:false}
		var s = {slidetime:0, toggleClass:'close', execute:true};
		for (var i in u){
			s[i]=u[i];
		}
		if(!s.execute) return;
		id.click(function(){
			$(s.target).toggle(s.slidetime, function(){
				if(u.callback) eval(u.callback);
			});
			id.toggleClass(s.toggleClass);
		});
	}
}

function buy(){
	$('.pro__showRight .buy').click(function(){
		$('.pro__showRight > a').fadeOut();
		$('.pro__showRight > div').fadeOut(function(){
			$('.pro__showRight > .jq-click-buy').show();
		});
		window.location.href = '#';
	});
	$('.pro__showRight .buy-cancel').click(function(){
		$('.pro__showRight > a').show();
		$('.pro__showRight > div').slideDown(function(){
				$('.pro__showRight > .jq-click-buy').hide();
		});
	});
}


//  <--------------