﻿<!--
function change(el) {
whichEl = document.getElementById(el)   //获得指定ID值的对象
if (whichEl.style.display == 'none') {   //block是默认值为显示,none为隐藏
   whichEl.style.display   = 'block'; 
} else {
     whichEl.style.display   = 'none';
   }
}

function chkLogin()
{
	return cjx.chkCookiesValue('email',4,60);
}

//检查是否显示浮动登陆窗口
function chkShowLogin(obj)
{		
	if(chkLogin())
	{
		return true;
	}else{	
	jBox.open('iframe-jBoxID','iframe','/common/iframe/login.asp?fpage='+obj.href,'请先登陆','width=380,height=220,center=true,minimizable=true,resize=false,draggable=true,model=true,scrolling=false');
		//jBox.open('iframe-jBoxID','iframe','/iframe/login.asp?fpage=ghgh','请先登陆','width=380,height=220,center=true,minimizable=false,resize=false,draggable=true,frameborder=0,model=true,scrolling=false');
		
		return false;
	}
}
function showSendfriend(pid)
{
	
	jBox.open('iframe-jBoxID','iframe','/common/iframe/sendfriend.asp?id='+pid,'发送给好友','width=380,height=220,center=true,minimizable=true,resize=false,draggable=true,model=true,scrolling=false');
}
function chkPara(pid)
{
	var txt=/^\d+(,?\d+)*$/;
	return txt.test(pid);
}
function addShopcart()
{		
	//参数 产品ID(必须) 产品数量 产品颜色
	var pid=arguments[0];
	var pnum=0;
	var pcolor='';	
	var pmax=0;
	var pmin=0;
	var l=arguments.length;		
	if(l==4)
	{
		//alert(pnum.toString()+'-'+pmin.toString()+"-"+pmax.toString());			
		if(isNaN(arguments[1])||isNaN(arguments[2])||isNaN(arguments[3])||arguments[1]==''||arguments[2]==''||arguments[3]==''){
			alert('产品数量必须为数字');
			return false;
		}
		pnum=arguments[1];		
		pmin=arguments[2];
		pmax=arguments[3];		
		if(pmax!=-1&&pmax<pmin){
			alert('产品库存已经不足');
			return false;
		}
		if(pmax!=-1&&pmax<pnum){
			alert('产品数量不能少于'+pmax.toString());
			return false;
		}
		if(pnum<pmin){
			alert('产品数量必须大于'+pmin.toString());
			return false;
		}
	}
	if(l==3)
	{
		pnum=arguments[1];
		pcolor=arguments[2];
	}
	if(l==2)
		pnum=arguments[1];
	jBox.open('iframe-jBoxID2','iframe','/common/iframe/buy.asp?id='+pid+'&num='+pnum+'&color='+pcolor,'购买产品','width=350,height=150,center=true,minimizable=true,resize=false,draggable=true,model=true,scrolling=false');
}
function addSearchFl()
{
	   $.get('/xml/class.xml', function(d){  
	   var html=''; 
	   var html2='';
	   var findid="3864";	
	   var cb=document.getElementById('searchBid');
       $(d).find('list32').children().each(function(){  
           var $book = $(this);   
		   var pid=$book.attr("ID").toString();		   
		   if(pid==findid){				   		
		   	   $($book).children().each(function(){
				   var $list=$(this);
				   var id=$list.attr("ID");
				   var text = $list.attr("Text"); 
				   var op=new Option(text,id);
				   cb.options.add(op);
				   //$("#searchBid").options.add(new Option(text, id));
				   html+='<option value="'+id+'">'+text+'</option>'; 
				   html2+='<p>·<a href="/products/?id='+findid+','+id+'">'+text+'</a></p>';
			   });
		   	  //$(html).appendTo("#searchBid"); 
			  $("#listfl").html(html2);			 
		   }
       });     
	    
   });    
	  var num=cjx.GetCookies("buyproductnum");
	  var money=cjx.GetCookies("buyproductmoney");
	  if(num=="?"){num="0";}
	  if(money=="?"){money="0";}
	  $("#buytotal").html("<strong>"+num+"</strong>");
	  $("#buymoney").html("<strong>￥"+money+"</strong>");	  
}

function showBigPicDiv(obj,y,x)
{		
	
	var div=document.getElementById("previewPic");	
	if(div==null)
	{
		var bo = document.getElementsByTagName('body')[0];	
		div=document.createElement("div");
		var txt="<div id='previewPic' style='position:absolute; z-index:100;width:310px;height:310px;line-height:310px; background:url(/common/jquery/images/loading.gif) no-repeat center; display:none; border:1px solid #cccccc'><img src='/skin/default/images/noimg.gif' width='310' height='310' id='viewpic'/></div>";
		div.innerHTML=txt;	
		bo.appendChild(div);
	}
	var pic=document.getElementById("viewpic");		
	div.style.top=(y-pic.height-10).toString()+"px";  
	var bw=document.body.clientWidth;
	var picw=pic.width;
	var bpw=bw-picw;
	if(x>bpw) x=x-(x-bw)-80;
    div.style.left=(x-picw-20).toString()+"px";  

	pic.src=$(obj).attr("src");	
	cjx.pic_reset(pic,"310,310");
	div.style.display="";	
	
}

function hideBigPicDiv()
{
	var div=document.getElementById("previewPic");	
	var pic=document.getElementById("viewpic");	
	if(div!=null)
	{
		div.style.display="none";	
	//$("#previewPic").fadeOut("slow");
	}

	
}

//获取同城巴士分站的城市名称
function getCityName()
{
	var d=document.domain;
	var arr=d.split(".");
	var city=arr[0];
	switch(city)
	{
		case "nb":
		case "ningbo":return "宁波";
		case "tz":
		case "taizhou":
		case "tzh":return "台州";
		case "hzh":
		case "hz":
		case "hangzhou":return "杭州";
		case "nj":
		case "nanjing":return "南京";
		case "szh":
		case "sz":
		case "suzhou":return "苏州";
		case "hf":
		case "hefei":return "合肥";
		case "fy":
		case "fuyang":return "阜阳";
		case "jn":
		case "jinan":return "济南";
		case "qd":
		case "qingdao":return "青岛";
		case "nch":
		case "nc":
		case "nanchang":return "南昌";
		case "fzh":
		case "fz":
		case "fuzhou":return "福州";
		case "shh":
		case "sh":
		case "shanghai":return "上海";
		case "nn":
		case "nanling":return "南宁";
		case "gl":
		case "guilin":return "桂林";
		case "chd":
		case "cd":
		case "chengdou":return "成都";
		case "chq":
		case "cq":
		case "chongqing":return "重庆";
		case "bj":
		case "beijing":return "北京";
		case "shy":
		case "sy":
		case "shengyang":return "沈阳";
		case "dl":
		case "dalian":return "大连";
		case "herb":
		case "haerbin":return "哈尔滨";
		case "ty":
		case "taiyuan":return "聊城";
		case "zhzh":
		case "zz":
		case "zhengzhou":return "郑州";
		case "wh":
		case "wuhan":return "武汉";
		case "km":
		case "kunmeng":return "昆明";
		case "xan":
		case "xian":return "西安";
		case "lzh":
		case "lanzhou":return "兰州";
		case "dt":
		case "datong":return "大同";
		case "xm":
		case "xiameng":return "厦门";
		case "kf":
		case "kaifeng":return "开封";
		case "chsh":
		case "cs":
		case "changsha":return "长沙";	
		case "szs":
		case "shenzhen":return "深圳";	
		case "yc":
		case "yichun":return "宜春";	
		default:return "义乌";
	}
}

/*首页公告和新闻切换 added by seleceresky 2011.7.31*/
function gonggao_set(curSelect, listCount){
	for(var i=0;i<listCount;i++){
		if(i == curSelect){
			document.getElementById('gonggao_t'+i).className = 'gonggai_active';			
			document.getElementById('gonggao_l'+i).style.display = '';
		}else{
			document.getElementById('gonggao_t'+i).className = 'gonggai_normal';
			document.getElementById('gonggao_l'+i).style.display = 'none';
		}
	}	
}
-->
