﻿//头
document.writeln("<div id=topa>");
document.writeln("    <ul id=toprig_img></ul>");
document.writeln("    <ul id=logo>");
document.writeln("		<li><object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=7,0,19,0 width=133 height=67><param name=movie value=\/Template\/web_skin2\/images20090907\/logo.swf><param name=quality value=high><embed src=\/Template\/web_skin2\/images20090907\/logo.swf quality=high pluginspage=http:\/\/www.macromedia.com\/go\/getflashplayer type=application\/x-shockwave-flash width=133 height=67><\/embed><\/object><\/li>")
document.writeln("		<li id=toprig_img><a href=\/minisite\/shengdan\/index.html target=_blank><img src=\/Template\/web_skin2\/images20090907\/top_right.gif border=0 \/><\/a><\/li>");
document.writeln("	</ul>");
document.writeln("	<ul id=toph_line>");
document.writeln("		<div id=line>");
document.writeln("			<ul id=tline_left></ul>");
document.writeln("			<ul id=tline_cen>");
document.writeln("				<li id=UserName></li>");
document.writeln("				<li id=OutIn class=ltext></li>");
//document.writeln("				<li id=UserName>您好，欢迎来下订单！</li>");
//document.writeln("				<li id=OutIn class=ltext><a href=/register.asp target=_top class=a11>[免费注册]</a>　<a href=/login.asp target=_blank class=a11>[登录]</a></li>");
document.writeln("				<li class=ltext><a href=/html/help/0802260134744106.html class=a8 target=_blank>帮助中心</a></li>");
document.writeln("				<li class=ltext><a href=/gift.html class=a8 target=_blank>礼品代送</a></li>");
document.writeln("				<li id=shou><a href=# class=a8 onClick=\"window.external.AddFavorite(parent.location.href, document.title);\">收藏本站</a></li>");
document.writeln("				<li id=sindex><a href=# class=a8 onClick=\"this.style.behavior='url(#default#homepage)'; this.setHomePage('http://www.xiadingdan.com');\">设为首页</a></li>");
document.writeln("			</ul>");
document.writeln("			<ul id=tline_right></ul>");
document.writeln("		</div>");
document.writeln("	</ul>");
document.writeln("</div>");

//导航
document.writeln("<div id=menu>");
document.writeln("	<ul id=menu_left></ul>");
document.writeln("	<ul id=menu_cent>");
document.writeln("		<li>");
document.writeln("			<em id=class_home_1i><a href=/index.html>首页</a></em>");
document.writeln("			<em id=class_geren_1i><a href=/html/category/class_285.html>趣味休闲</a></em>");
document.writeln("			<em id=class_shangwu_1i><a href=/html/category/class_242.html>办公小物</a></em>");
document.writeln("			<em id=class_duixiang_1i><a href=/html/category/class_240.html>快乐居家</a></em>");
document.writeln("			<em id=class_yongtu_1i><a href=/html/category/class_410.html>个人流行</a></em>");
document.writeln("			<span><a href=/index2.html>旧版入口</a></span>");
document.writeln("			<span><a href=/group.html>集团采购</a></span>");
document.writeln("			<span><a href=/html/sys/newproduct/index.html>新品抢鲜看</a></span>");
document.writeln("			<span><a href=/html/AS/index.html>送礼指南</a></span>");
document.writeln("			<span><a href=\/minisite\/fengbao\/index.html><div id=c><b>低价风暴<\/b><\/div><\/a><\/span><\/li>");
document.writeln("		<li id=menu_bot>");
document.writeln("			<div id=ad_left><a href=\/gift.html target=_blank><img src=\/Template\/web_skin2\/images20090907\/ad001.gif border=0 \/><\/a><\/div>");
document.writeln("			<div id=searchx>");
document.writeln("				<form action=\/search.html method=get target=_blank>");
document.writeln("				<dl>");
document.writeln("					<dt id=sea_input><input type=text class=inputa id=seainput id=keyword name=keyword \/><\/dt>");
document.writeln("					<input type=hidden id=SFlag name=SFlag value=MS \/>");
document.writeln("					<dt id=sea_enter><input type=image src=\/Template\/web_skin2\/images20090907\/search_01.jpg \/><\/dt>");
document.writeln("				<\/dl>");
document.writeln("				<\/form>");
document.writeln("			<\/div>")
document.writeln("			<div id=cart>");
document.writeln("				<dl>");
document.writeln("					<dt><iframe id=editor src=/cart/topcarts0907.asp frameborder=0 width=149 scrolling=no height=27 allowTransparency=true></iframe></dt>");
document.writeln("					<dd><a href=\/member\/index.asp target=_top>我的帐户<\/a><\/dd>");
document.writeln("				</dl>");
document.writeln("			</div>");
document.writeln("		</li>");
document.writeln("	</ul>");
document.writeln("	<ul id=menu_right></ul>");
document.writeln("</div>");

var objpath
objpath=window.location.pathname;

if (IndexDemo(objpath,"/index.html")>-1 || IndexDemo(objpath,"/index01.html")>-1 || IndexDemo(objpath,"/")>-1) 
	{menu_cent_em_id = "class_home_1i";}
if (IndexDemo(objpath,"category/class_285")>-1 || IndexDemo(objpath,"category/class_243")>-1 || IndexDemo(objpath,"category/class_244")>-1 || IndexDemo(objpath,"category/class_245")>-1 || IndexDemo(objpath,"category/class_246")>-1 || IndexDemo(objpath,"category/class_247")>-1 || IndexDemo(objpath,"category/class_248")>-1 || IndexDemo(objpath,"category/class_249")>-1 || IndexDemo(objpath,"category/class_250")>-1 || IndexDemo(objpath,"category/class_251")>-1 || IndexDemo(objpath,"category/class_252")>-1 || IndexDemo(objpath,"category/class_253")>-1 || IndexDemo(objpath,"category/class_285")>-1 || IndexDemo(objpath,"category/class_255")>-1 || IndexDemo(objpath,"category/class_256")>-1) 
	{menu_cent_em_id = "class_geren_1i";}
if (IndexDemo(objpath,"category/class_242")>-1 || IndexDemo(objpath,"category/class_257")>-1 || IndexDemo(objpath,"category/class_258")>-1 || IndexDemo(objpath,"category/class_259")>-1 || IndexDemo(objpath,"category/class_260")>-1 || IndexDemo(objpath,"category/class_261")>-1 || IndexDemo(objpath,"category/class_262")>-1 || IndexDemo(objpath,"category/class_263")>-1 || IndexDemo(objpath,"category/class_264")>-1 || IndexDemo(objpath,"category/class_265")>-1 ) 
	{menu_cent_em_id = "class_shangwu_1i";}
if (IndexDemo(objpath,"category/class_410")>-1 || IndexDemo(objpath,"category/class_266")>-1 || IndexDemo(objpath,"category/class_267")>-1 || IndexDemo(objpath,"category/class_268")>-1 || IndexDemo(objpath,"category/class_269")>-1 || IndexDemo(objpath,"category/class_270")>-1 || IndexDemo(objpath,"category/class_271")>-1 || IndexDemo(objpath,"category/class_295")>-1) 
	{menu_cent_em_id = "class_yongtu_1i";}
if (IndexDemo(objpath,"category/class_240")>-1 || IndexDemo(objpath,"category/class_275")>-1 || IndexDemo(objpath,"category/class_276")>-1 || IndexDemo(objpath,"category/class_277")>-1 || IndexDemo(objpath,"category/class_278")>-1 || IndexDemo(objpath,"category/class_279")>-1 || IndexDemo(objpath,"category/class_281")>-1 || IndexDemo(objpath,"category/class_282")>-1 || IndexDemo(objpath,"category/class_291")>-1 || IndexDemo(objpath,"category/class_292")>-1 || IndexDemo(objpath,"category/class_293")>-1 || IndexDemo(objpath,"category/class_294")>-1) 
	{menu_cent_em_id = "class_duixiang_1i";}
//请根据热卖页面调整相应代码，谢谢
//if (IndexDemo(objpath,"minisite/luckday/index.html")>-1) 
//	{menu_cent_em_id = "class_remai_1i"}
//if (IndexDemo(objpath,"html/sys/newproduct/index.html")>-1) 
//	{menu_cent_em_id = "class_xiangou_1i"}
//if (IndexDemo(objpath,"/group.html")>-1) 
//	{menu_cent_em_id = "class_daisong_1i"}
//if (IndexDemo(objpath,"html/AS/index.html")>-1) 
//	{menu_cent_em_id = "class_songli_1i"}
//if (IndexDemo(objpath,"html/sys/jifen0709/index.htmll")>-1) 
//	{menu_cent_em_id = "class_caigou_1i"}
if (menu_cent_em_id != "" && menu_cent_em_id != "undefined") {
	document.getElementById(menu_cent_em_id).className="bian";
} 

function IndexDemo(str1,str2){
	var s = str1.indexOf(str2);
	return(s);
}

SearchUser()


//查询登录
function SearchUser(){
	var xmlHttp = false;
	try {
	   xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e2) {
			xmlHttp = false;
		}
	}
	if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
		xmlHttp = new XMLHttpRequest();
	}
	var url = "/Template/web_skin2/js/top_0825.js.asp";
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = updatePage;
	xmlHttp.send(null);  

	function updatePage() {
		if (xmlHttp.readyState < 4) {
		//aaa.innerHTML="loading...";
		}
		if (xmlHttp.readyState == 4) {
			var user = xmlHttp.responseText;
			v=user.split("|||");
			var UserName = (v[0]);
			var OutIn = (v[1]);
			if (document.getElementById("UserName").innerHTML!="undefinde") {
				document.getElementById("UserName").innerHTML=UserName;
			}
			if (document.getElementById("OutIn").innerHTML!="undefinde") {
				document.getElementById("OutIn").innerHTML=OutIn;
			}
		}
	 }//updatePage结束
}//SearchUser结束




//最近浏览商品cookies写入
function addCookie(objName,objValue,objHours){//添加cookie
	if ( getCookie(objName) != undefined) {
		var str = objName + "=" + escape(objValue+'|||'+getCookie(objName));
	}else{
		var str = objName + "=" + escape(objValue);
	}
	if(objHours > 0){//为0时不设定过期时间，浏览器关闭时cookie自动消失
		var date = new Date();
		var ms = objHours*3600*1000;
		date.setTime(date.getTime() + ms);
		str += "; expires=" + date.toGMTString();
	}
	document.cookie =  str;
	//alert("添加cookie成功");
}

function getCookie(objName){//获取指定名称的cookie的值
	var arrStr = document.cookie.split("; ");
	for(var i = 0;i < arrStr.length;i ++){
	var temp = arrStr[i].split("=");
	if(temp[0] == objName) return unescape(temp[1]);
	} 
}

function delCookie(name){//为了删除指定名称的cookie，可以将其过期时间设定为一个过去的时间
	var date = new Date();
	date.setTime(date.getTime() - 10000);
	document.cookie = name + "=a; expires=" + date.toGMTString();
}

//查看商品是否存在
function CheckPro(ObjName,Pro){
	if (ObjName != undefined) {
		var Str = ObjName.split('|||');
		var x = false
		for (i=0;i<Str.length;i++)
		{
			//alert(Str[i]+'='+Pro)
			if (Str[i] == Pro) {x = true;}
		}
	}else{
		x = false;
	}
	//alert(x)
	return x;
}

//写入COOKIES
function addPro(proName,proUrl,proPic,DateTime)
{
	var Cookies_proName = getCookie('proName');
	var Cookies_proUrl = getCookie('proUrl');
	var Cookies_proPic = getCookie('proPic');
	//alert(Cookies_proName)
	if (CheckPro(Cookies_proName,proName)==false)
	{
		addCookie('proName',proName,DateTime);
		addCookie('proUrl' ,proUrl,DateTime);
		addCookie('proPic' ,proPic,DateTime);
	}
	
	Cookies_proName = Cookies_proName.split("|||")
	Cookies_proUrl = Cookies_proUrl.split("|||")
	Cookies_proPic = Cookies_proPic.split("|||")
	
	str = "";
	var Count;  //显示最近多少件商品
	if (Cookies_proName.length < 10) {Count = Cookies_proName.length;}else{Count = 10;}
	for (i=0;i<Count;i++)
	{
		str +=  "<ul>";
		str += "<li><a href=\""+Cookies_proUrl[i]+"\"><img src='"+Cookies_proPic[i]+"' border='0'></a></li>";
		str += "<li><a href=\""+Cookies_proUrl[i]+"\">"+Cookies_proName[i]+"</a></li>";
		str += "</ul>";
	}
	document.getElementById('Show_Product').innerHTML = str;
}



