jQuery.cookie = function(name, value, options) {if (typeof value != 'undefined') { options = options || {};if (value === null) {value = '';options = $.extend({}, options); options.expires = -1;}var expires = '';if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {var date;if (typeof options.expires == 'number') {date = new Date();date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));} else {date = options.expires;}expires = '; expires=' + date.toUTCString();}var path = options.path ? '; path=' + (options.path) : '';var domain = options.domain ? '; domain=' + (options.domain) : '';var secure = options.secure ? '; secure' : '';document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');} else {var cookieValue = null;if (document.cookie && document.cookie != '') {var cookies = document.cookie.split(';');for (var i = 0; i < cookies.length; i++) {var cookie = jQuery.trim(cookies[i]);if (cookie.substring(0, name.length + 1) == (name + '=')) {cookieValue = decodeURIComponent(cookie.substring(name.length + 1));break;}}}return cookieValue;}};

var showinfo2=0;

$(function(){

var cook_userid=$.cookie("cookie_userid");
var cook_username=$.cookie("cookie_username");
var cookie_user_group_show=$.cookie("cookie_user_group_show");
if(cook_userid!=null && cook_username!=null )
{
	var login_t=cook_username;
		login_t+=' ['+cookie_user_group_show+']';
		login_t+="，欢迎来礼奇特！<a href=/Logout>退出</a>";
	$(".topnav_l").html(login_t);
}

$(".navsearch_r_1").mouseover(function(){
var xxout='';
var cook=$.cookie("cookie_view_his");
if(cook===null)
{
xxout="<div class=goods_js_list><ul><li><div class=g_sn>没有浏览记录</div></li></ul><div class=f></div></div>";
}
else
{
xxout='<div class="goods_js_list"><ul>';
tmp=cook.split("###");
$.each(tmp,function(j){
if(tmp[j]!="")
{
var cid=tmp[j].split('@#@');
xxout+="<li><div class=g_img><a href='/product/"+cid[0]+".html'><img src="+cid[1]+" /></a></div><div class=g_name><a href='/product/"+cid[0]+".html'>"+cid[2]+"</a></div></li>";
}
});

xxout+='</ul><div class="p"><span></span><a href="javascript:clear_his()">【清空】</a></div><div class=f></div></div>';
}

var position = $(this).offset();
$("#showinfo").html(xxout);
$("#showinfo").css({"left":position.left,"top":position.top+35});
$("#showinfo").slideDown(800); 
showinfo2=1;
}).mouseout(function(){showinfo2=0;window.setTimeout(showinfo,500); });

$("#showinfo").mouseover(function(){
showinfo2=1;
}).mouseout(function(){showinfo2=0;window.setTimeout(showinfo,500); });

});

function showinfo()
{
if(showinfo2==0) $("#showinfo").slideUp(400); 
}

function clear_his()
{
$.cookie('cookie_view_his','',{expires:7,path:'/',domain:'liqite.com'});
xxout="<div class=goods_js_list><ul><li><div class=g_sn>没有浏览记录</div></li></ul><div class=f></div></div>";
$("#showinfo").html(xxout);
showinfo2=0;window.setTimeout(showinfo,800);
}



