	var wareEffectID,blnAccept,oAWareParentLink;
	function htWareEffectVote(a,wareEffectIDa,blnAccepta,skinID)
		{
			wareEffectID=wareEffectIDa;
			blnAccept=blnAccepta;
			if(a!=null){oAWareParentLink=a;}
			if(skinID==0){
				var re=/skinID=([0-9]+)/i;
				var	arr=document.cookie.match(re);
				if(arr==null){
					mask('maskEffectSelectSkinID');
					var oDl=$('dlSkinID');
					oDl.setStyle('display','block');
					oDl.setStyle('left',$(a).aLeft()+'px');
					oDl.setStyle('top',$(a).aBottom()+'px');
					oDl.setStyle('zIndex',$(document.body).childMaxZIndex()+1);
					//$('irSkinID1').focus();
					return false;
				}else{
					skinID=arr[1];
				}
			}
			var oHttp=htp();
			oHttp.open('get','/action/wareeffectvote.asp?wareEffectID='+wareEffectID+'&blnAccept='+blnAccept+'&skinID='+skinID,false);
			oHttp.send(null);
			var c=oHttp.responseText;
			if(c!=='1'){alert('您已经投过票了，谢谢。');return false;}
			var oDiv=$(oAWareParentLink).parentClassName('divWareEffect');
			var oElements=oDiv.getElementsByTagName('img');
			var oImg=null;
			//debugger;
			if(oElements){
				for (var i=0; i<oElements.length; i++) {
					var re=/[0-9]+_([0-9])\.gif/i;
					var arr=oElements[i].getAttribute('src',0).match(re);
					if(arr){if(parseInt(arr[1])==skinID){oImg=oElements[i];break;}}
				}
			}
			if(oImg){
				oImg.setAttribute('src',oImg.getAttribute('src',0)+'?date='+new Date(),0);
			}
			else{
				oImg=document.createElement('img');
				oImg.setAttribute('src','/common/images/wareeffectvote/'+wareEffectID+'_'+skinID+'.gif',0);
				oImg.setAttribute('width','155',0);
				oImg.setAttribute('height','90',0);
				$(oDiv).childClassNameFirst('div','divWareEffectStatImg').appendChild(oImg);
			}
			return void(0);
		}
	function htSetSkinID()
		{
			var oDl=$('dlSkinID'),skinID=0;
			var oElements=oDl.getElementsByTagName('input');
			var bln=false;
			for (var i=0; i<oElements.length; i++) {
				if(oElements[i].type.toLowerCase()=='radio'){if(oElements[i].checked){bln=true;skinID=oElements[i].value;break;}}
			}
			if(bln==false){alert('请选择您的肤质，谢谢。');return false;}
			mask('maskEffectSelectSkinID');
			oDl.setStyle('display','none');
			htWareEffectVote(null,wareEffectID,blnAccept,skinID);
			return void(0);
		}

		function htMailWareToFriend(evt)
			{
				try {
					//添加校验码图片
					var d=$('itMailWareCheck');
					var oSpanElement=$(d.parentNode);
					var oImg=oSpanElement.childBy('img');
					if(oImg!=null){oImg.parentNode.removeChild(oImg);}
					oImg=document.createElement('img');
					var oDate=new Date();
					oImg.setAttribute('src','/action/checkimg_ware_sendmail.asp?curDate='+encodeURIComponent(oDate),0);
					oImg.setAttribute('width','63',0);
					oImg.setAttribute('height','18',0);
					oImg.setAttribute('alt','',0);
					oImg.onload=function ()
						{
							var oSpan=oSpanElement.childBy('span');
							if(oSpan){$(oSpan).setStyle('display','none');}
							oSpanElement.appendChild(oImg);
						}
					//a.appendChild(oImg);

					mask('maskMailWareToFriend');
					var oEvt=window.event || evt;
					var oElement=oEvt.srcElement || oEvt.target;
					var a=$('divMailWareToFriend');
					a.setStyle('display','block');
					a.setStyle('left',$(Array(oElement,'left'),2)+(oElement.offsetWidth-a.offsetWidth)/2+'px');
					a.setStyle('top',$(Array(oElement,'top'),2)+oElement.offsetHeight+'px');
					a.setStyle('zIndex',$(document.body).childMaxZIndex()+1);

					//修正IE6的Bug，隐藏selectQty
					try {
						$('selectQty').setStyle('display','none');
					}
					catch (e) {
					}

					$('itMailWareToEmail').focus();
				}
				catch (e) {
				}
			}
		function htCheckMailWareToFriendForm(f)
			{
				var re=/^[^\s@]+@[^\s@]+$/i;
				var email=$('itMailWareToEmail');
				var sendName=$('itMailWareToSendName');
				sendName.value=sendName.value.trim();
				if(email.value.match(re)==null){alert('请正确填写收件电子邮件地址，谢谢。');email.focus();return false;}
				if(sendName.value.length==0){alert('请填写发送人姓名或昵称，谢谢。');sendName.focus();return false;}
				var c=submitFormGet(f,'','mailwaretofriend_checkcode.asp');
				if(c!='1'){alert(c);$('itMailWareCheck').focus();return false;}
				var a=$('divMailWareToFriendState'),b=$('divMailWareToFriend');
				a.setStyle('left','3px');
				a.setStyle('top','3px');
				a.setStyle('width',b.clientWidth-6+'px');
				a.setStyle('height',b.clientHeight-6+'px');
				a.setStyle('display','block');
				a.setStyle('lineHeight',a.clientHeight+'px');
				//submitForm(f,'','mailwaretofriend.asp');
				var c=submitForm(f,'','mailwaretofriend.asp');
				a.setStyle('display','none');
				if(c!='1'){alert(c);return false;}
				a=$('divMailWareToFriendSuccess');
				a.setStyle('left','3px');
				a.setStyle('top','3px');
				a.setStyle('width',b.clientWidth-6+'px');
				a.setStyle('height',b.clientHeight-6+'px');
				a.setStyle('display','block');
				a.setStyle('lineHeight',a.clientHeight+'px');
				return false;

			}
		function htHideMailWareToFriend()
			{
				mask('maskMailWareToFriend');
				$('itMailWareToName').value='';
				$('itMailWareToEmail').value='';
				//$('taMailWareToContent').value='';
				//$('itMailWareToSendName').value='';

				//修正IE6的Bug，显示selectQty
				try {
					$('selectQty').setStyle('display','inline');
				}
				catch (e) {
				}

				//删除校验码图片，并显示提示
				var d=$('itMailWareCheck');
				d.setAttribute('value','',0);
				var oSpanElement=$(d.parentNode);
				var oImg=oSpanElement.childBy('img');
				if(oImg!=null){oImg.parentNode.removeChild(oImg);}
				var oSpan=oSpanElement.childBy('span');
				if(oSpan){$(oSpan).setStyle('display','inline');}

				$('divMailWareToFriendState').setStyle('display','none');
				$('divMailWareToFriendSuccess').setStyle('display','none');
				$('divMailWareToFriend').setStyle('display','none');
			}
	//检查发送客户问题
	function htCheckFormClientQuestion(f)
		{
			f.question.value=f.question.value.trim();
			if(f.question.value.length==0){alert('请填写您的问题，谢谢。');f.question.select();return false;}
			f.email.value=f.email.value.trim();
			f.emailReply.value=f.emailReply.value.trim();
			if(f.email.value.length>0){
				if(f.email.value!=f.emailReply.value){alert('您前后填写的电子信箱不一致，请重写填写，谢谢。');f.email.select();return false;}
			}
			var c=submitForm(f,'','/ware/clientquestion.asp');
			switch (c) {
				case '1':
					alert('您的问题已经成功发送给淡淡香，工作人员会在1个工作日内回复并显示在这里'+(f.email.value.length>0 ? '，同时会向您的电子邮箱发送一封回复电子邮件，请注意查收' : '')+'，谢谢。');
					f.question.value='';
					f.email.value='';
					f.emailReply.value='';
				break;
				case '2':
					alert('您已经发送过该问题，谢谢。');
					f.question.value='';
					f.email.value='';
					f.emailReply.value='';
				break;
				default:
					alert('出现意外错误，请稍后重试，谢谢。');
			}
			return false;
		}

	//翻页客户问题
	function htWCPage(evt,a)
		{
			var c=a.getAttribute('href',0);
			var re=/wareID=([0-9]+)/i;
			var arr=c.match(re);
			if(arr==null){return false;}
			var wareID=arr[1];
			re=/page=([0-9]+)/i;
			arr=c.match(re);
			var page=1;
			if(arr!=null){page=arr[1];}
			var oHttp=htp();
			oHttp.open('get','/ware/ware_clientquestion.asp?wareID='+wareID+'&page='+page,false);
			oHttp.send(null);
			var str=oHttp.responseText;
			$('divWareClientQuestion').innerHTML=str;
			return false;
		}

	//客户推荐时显示功效表
	function htAddEffect(wareID)
		{
			mask('maskAddEffect');
			var arrDiv=createDialog();
			var oDiv=arrDiv[0];
			var oDivContent=arrDiv[1];
			var oClose=arrDiv[2];
			oClose.onclick=function ()
				{
					mask('maskAddEffect');
					oClose.parentNode.parentNode.removeChild(oClose.parentNode);
					return false;
				}
			oDiv.style.top=document.documentElement.scrollTop+(document.documentElement.clientHeight-441)/2+'px';
			oDiv.style.width='600px';
			oDiv.style.left=document.documentElement.scrollLeft+(document.documentElement.clientWidth-600)/2+'px';
			document.body.appendChild(oDiv);
			var oHtp=htp();
			oHtp.onreadystatechange=function ()
				{
					addContentToDialog(oHtp,oDivContent);
				}
			oHtp.open('get','/ware/ware_effect_add.asp?wareID='+wareID,true);
			oHtp.send(null);
		}


	//客户推荐时，提交功效表
	function htCheckFormAddEffect(f)
		{
			var a,c='';
			for (var i=0; i<f.effectID.length; i++) {
				a=f.effectID[i];
				if(a.checked && a.disabled==false){c=c+a.nextSibling.firstChild.nodeValue+'、';}
			}
			if(c.length>0){c=c.substring(0,c.length-1);}else{alert('您还没有选择新的功效，谢谢。');return false;}
			c=submitForm(f,'您确定该商品具有新的功效：'+c+'吗？','ware_effect_add.asp');
			if(c.length>0){
				a=$('divDialogContent');
				a.setStyle('lineHeight',a.clientHeight+'px');
				a.setStyle('textAlign','center');
				a.innerHTML='感谢您的推荐，如果您<a href="#" onclick="self.location.reload();return false;">刷新</a>本页面，即可看到您推荐的功效已经显示出来，谢谢^_^';
			}
			return false;
		}

	//显示或隐藏包裹重量说明图层
	function htShowPackWeightInfo(oSpan,bln)
		{
			if(bln){
				if($('divPackInfo')){return;}
				var oBody=$(document.documentElement).childrenByTagName('body')[0];
				var a=$(oSpan);
				var oDiv=document.createElement('div');
				oDiv=$(oDiv);
				oDiv.setAttribute('id','divPackInfo',0);
				document.body.appendChild(oDiv);
				oDiv.setStyle('position','absolute');
				oDiv.setStyle('width','244px');
				oDiv.setStyle('height','151px');
				oDiv.setStyle('left',a.aLeft()-oBody.offsetLeft+'px');

				oDiv.setStyle('top',a.aTop()+a.clientHeight+'px');
				oDiv.setStyle('backgroundImage','url(/common/images/site/icon-20090427.png)');
				oDiv.setStyle('backgroundPosition','-7px -56px');
				oDiv.setStyle('cursor','pointer');

				var oIcon=$(document.createElement('div'));
				oIcon.setStyle('width','33px');
				oIcon.setStyle('height','30px');
				oIcon.setStyle('backgroundImage','url(/common/images/site/icon-20090427.png)');
				oIcon.setStyle('backgroundPosition','100% -190px');
				oIcon.setStyle('float','left');
				oIcon.setStyle('margin','10px');
				oDiv.appendChild(oIcon);

				oDiv.onclick=function ()
					{
						oDiv.parentNode.removeChild(oDiv);
					}
			}
			else{
				var oDiv=$('divPackInfo');
				if(oDiv){oDiv.parentNode.removeChild(oDiv);}
			}
		}

	//列出评论
	function htReviewPage(wareID)
		{
			var rank=0;
			var arrReview=new Array(null,null,null,null);

			var d=$('divWareReviewState');
			var oDiv=d.parentNode;

			//获得class
			function getClass(a)
				{
					//return a.getAttribute('className',0) || a.getAttribute('class',0);
					return a.attributes.getNamedItem('class').nodeValue;
				}
			//设置class
			function setClass(a,c)
				{
					a.attributes.getNamedItem('class').nodeValue=c;
				}

			//设置arrReview;
			function setArrReview(n)
				{
					var arr=new Array();
					var a=d.nextSibling;
					while (a) {
						if(a.nodeType==1){
							arr.push(a);
						}
						a=a.nextSibling;
					}
					arrReview[n]=arr;
				}
			setArrReview(0);

			//清除d后的对象
			function clearReview()
				{
					var a=d.nextSibling;
					while (a) {
						a.parentNode.removeChild(a);
						a=d.nextSibling;
					}
				}

			//将从arrReview提取的对象加到dom中
			function getArrReview(n)
				{
					//清除d后的对象
					clearReview();

					//添加到d后
					var arr=arrReview[n];
					if(arr){
						for (var i=0, len=arr.length; i<len; i++) {
							oDiv.appendChild(arr[i]);
						}
					}
				}

			//重设d后的对象
			function setReview(c)
				{
					//清除d后的对象
					clearReview();

					var dd=document.createElement('div');
					dd.innerHTML=c;
					if(dd.hasChildNodes()){
						for (var i=0, len=dd.childNodes.length; i<len; i++) {
							var f=dd.childNodes[i].cloneNode(true);
							if(f){oDiv.appendChild(f);}
						}
					}
					dd=null;
					setArrReview(rank);
				}

			oDiv.onclick=function (event)
				{
					var evt=window.event ? window.event : event;
					var a=evt.srcElement || evt.target;

					var tagName=a.tagName.toLowerCase();
					if(tagName=='span'){
						//var cName=a.getAttribute(document.all ? 'className': 'class',0);
						var cName=getClass(a);
						if(cName!='spanWareReviewTitle'){return;}

						var oLi=a.parentNode;
						var oUl=oLi.parentNode;
						var arr=oUl.getElementsByTagName('li');
						for (var i=0, len=arr.length; i<len; i++) {
							if(arr[i]==oLi){
								//arr[i].setAttribute(document.all ? 'className' : 'class','liTitleCur',0);
								setClass(arr[i],'liTitleCur');
								rank=i;
							}
							else{
								//arr[i].setAttribute(document.all ? 'className' : 'class','liTitle',0);
								setClass(arr[i],'liTitle');
							}
						}
						if(arrReview[rank]){getArrReview(rank);}
						else{
							var o=new objRemoteAccess();
							o.getHtp('/ware/ware_review_list.asp?wareID='+wareID+'&rank='+rank,setReview,null,'text',false);
						}
					}
					if(tagName=='a'){
						//var cName=a.getAttribute(document.all ? 'className': 'class',0);
						var cName=getClass(a);

						if(cName!='aPageNum' && cName!='aPagePrevious' && cName!='aPageNext'){return;}
						a=$(a);
						var n=a.getAttribute('rel',0);
						var o=new objRemoteAccess();
						o.getHtp('/ware/ware_review_list.asp?wareID='+wareID+'&page='+n+'&rank='+rank,setReview,null,'text',false);
					}
				}
		}

		function htIntroLink(title,url)
			{
				mask('maskCopyLink');

				var b=$(g.body());

				var d=$(document.createElement('div'));
				d.setStyle('position','absolute');
				d.setStyle('width','390px');
				//d.setStyle('height','180px');
				d.setStyle('left','50%');
				d.setStyle('top',(g.sTop()+g.ch()/2-50)+'px');
				d.setStyle('marginLeft','-195px');
				d.setStyle('border','1px solid #999');
				d.setStyle('backgroundColor','#fff');
				d.setStyle('zIndex',b.childMaxZIndex()+1);

				b.appendChild(d);

				var p=$(document.createElement('p'));
				p.setStyle('padding','0 0 0 6px');
				p.setStyle('height','30px');
				p.setStyle('borderBottom','1px solid #999');
				p.setStyle('backgroundColor','#eee');
				p.setStyle('lineHeight','30px');

				d.appendChild(p);

				var span=$(document.createElement('span'));
				span.setText('通过'+title+'发送链接给好友');
				span.setStyle('fontSize','14px');
				span.setStyle('fontWeight','bolder');
				span.style.styleFloat='left';
				span.style.cssFloat='left';

				p.appendChild(span);

				var a=$(document.createElement('a'));
				a.setAttribute('href',void(0),0);
				a.setText('×');
				a.onclick=function ()
					{
						mask('maskCopyLink');
						d.parentNode.removeChild(d);
						return false;
					}
				a.style.styleFloat='right';
				a.style.cssFloat='right';
				a.setStyle('margin','5px 5px 0 0');
				a.setStyle('width','18px');
				a.setStyle('height','18px');
				a.setStyle('textAlign','center');
				a.setStyle('lineHeight','18px');
				a.setStyle('textDecoration','none');
				a.setStyle('border','1px solid #999');

				p.appendChild(a);

				var pp=$(document.createElement('p'));
				pp.setStyle('clear','both');
				pp.setStyle('margin','18px 0');
				pp.setStyle('textAlign','center');

				d.appendChild(pp);

				var span1=$(document.createElement('span'));
				span1.setText('商品链接：');

				pp.appendChild(span1);

				var input=$(document.createElement('input'));
				input.setAttribute('type','text',0);
				input.setAttribute('value',url,0);
				input.setAttribute('readOnly',true,0);
				input.setStyle('width','195px');
				input.setStyle('backgroundColor','#ddd');

				pp.appendChild(input);

				var ppp=$(document.createElement('p'));
				ppp.setStyle('margin','18px 0');
				ppp.setStyle('textAlign','center');

				d.appendChild(ppp);

				if(window.clipboardData){
					var bn=$(document.createElement('button'));
					bn.setText('复制并发给我的好友');
					bn.onclick=function ()
						{
							window.clipboardData.setData('Text',url);
							var p1=$(document.createElement('p'));
							p1.setText('商品链接地址已经复制，您可以粘贴到QQ、旺旺、MSN或邮件中发送给好友了~');
							p1.setStyle('margin','18px');
							d.removeChild(pp);
							d.removeChild(ppp);
							d.appendChild(p1);
						}

					ppp.appendChild(bn);
				}
				else{
					ppp.setStyle('margin','18px 18px');
					ppp.setStyle('padding','10px');
					ppp.setStyle('border','1px solid #f96');
					ppp.setStyle('textAlign','left');
					ppp.setStyle('color','#666');
					ppp.setText('您的浏览器不支持自动复制功能。您可以按住Ctrl+C，将商品链接地址复制下来，并粘贴到QQ、旺旺、MSN或邮件中发送给好友~');

					input.select();
					input.focus();
				}
			}

	function htRecommend(url,web)
		{
			var wareName=$('h2WareName').childBy('span',null,null).inText();
			var p=$('pWareIDPrice');
			var arr=p.childrenBy(false,new Array(null,'span',null,null,null));
			var wareID=arr[0][0].inText();
			var price=arr[0][1].inText();
			var cit=readCookie('hitau','cit') || '';
			var content='我在淡淡香化妆品商城发现了一个非常不错的商品：'+wareName+'，'+(price>=0 ? '价：￥'+price+'，' : '')+'感觉不错，分享一下';
			var o=$('imgWareMiddleImg');
			if(o==null){o=$('aWareMiddleImg');o=o.childBy('img',null,null)}
			var img=o.getAttribute('src',0);
			if(img.indexOf('http:/')!=0){img='http:/'+'/www.dandanxiang.com'+img}
			var productUrl ="http:/"+"/www.dandanxiang.com/ware/"+wareID+'?cit=';

			if (web == "qzone"){
				url = url + "&title=" + content + "&pic=" + img + "&url=" + productUrl + cit;
			}
			if (web == "sina"){
				url = url + "&title=" + encodeURIComponent(content) + "&pic=" + encodeURIComponent(img) + "&url=" + encodeURIComponent(productUrl) + cit;
			}
			if (web == "renren"){
				url = url + "title=" + wareName +"&content="+ content + "&pic=" + img + "&url=" + productUrl + cit;
			}
			if (web == "kaixing"){
				url = url + "rtitle=" + wareName + "&rcontent=" + content + "&rurl=" + productUrl + cit;
			}
			if (web == "douban"){
				url = url + "title=" + wareName + "&comment=" + content + "&url=" + productUrl + cit;
			}
			if (web == "MSN"){
				url = url + "url=" + productUrl + cit + "&title=" + wareName + "&description=" + content + "&screenshot=" + img;
			}
			if (web == "qq" || web=='ww'){
				url = productUrl + cit;
				htIntroLink(web=='qq' ? 'qq' : '旺旺',url);
			}
			if(web!='qq' && web!='ww'){
				window.open(encodeURI(url), "", "height=500, width=600");
			}
		}

	//当前页面的启动函数
	function htOnLoad()
		{
			$f(11,$('divWareMiddleImg'));

			setTimeout('htShowDan()',1000);
		}

