function buyProd()
{
    window.open("/shop/goumai.htm","NewWindow","toolbar=0,status=0,resizable=0,Width=400,Height=400,top=100,left=100");
}

function buyMyProd(WID)
{
    window.open("mySiteBuy.aspx?WID="+WID,"NewWindow","toolbar=0,status=0,resizable=0,Width=400,Height=340,top=100,left=100");
}

function buyProdcutInfo(PID)
{
    document.location.href="shoppingCart_" + PID + ".aspx";
}

function buyProdcutInfo(PID,flag)
{
    document.location.href="shoppingCart_" + PID + "_" + flag + ".aspx";
}


function shoppingCartAdd(PID)
{
    document.location.href="/shopping/cart_" + PID + ".aspx?reUrl="+escape(window.location.href); 
    //window.open("/shop/shoppingCart_" + WID + "_" + PID + ".aspx","NewWindow","");
}

function shoppingCartAdd2(PID)
{
    document.location.href="/shopping/cart_" + PID + ".aspx"; 
}

//预定产品
function shoppingPreconcert(PID)
{
    if(confirm("该商品暂时缺货！\n\n如果您需要预订，请按确定按钮！"))
        document.location.href="/product/preconcert_" + PID + ".aspx?reUrl="+escape(window.location.href); 
}
function shoppingPreconcertAddress()
{
    if(document.form1.txtUsername.value == "")
	{
		alert("请填写姓名！");
		document.form1.txtUsername.focus();
		return false;
	}
		
	if(document.form1.txtTelephone.value == "" && document.form1.txtEmail.value == "")
	{
		alert("联系电话和邮件地址不能同时为空！");
		document.form1.txtTelephone.focus();
		return false;
	}
	if(document.form1.txtTelephone.value != "")
	{
	    if (document.form1.txtTelephone.value.length < 11)
	    {
	        alert("联系电话不正确，是否写区号了？");
		    document.form1.txtTelephone.focus();
		    return false;
	    }
	}	
	
	if(document.form1.txtEmail.value != "")
	{
		var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_@.";
	    var checkStr = document.form1.txtEmail.value;
	    var allValid = true;
	    for (i = 0;  i < checkStr.length;  i++)
	    {
		    ch = checkStr.charAt(i);
		    for (j = 0;  j < checkOK.length;  j++)
		    if (ch == checkOK.charAt(j))
			    break;
		    if (j == checkOK.length)
		    {
			    allValid = false;
			    break;
		    }
	    }

	    if (document.form1.txtEmail.value.length < 6)
	    {
			    allValid = false;
	    }

	    if (!allValid)
	    {
		    alert("您输入的 电子邮件地址 无效!");
		    document.form1.txtEmail.focus();
		    return (false);
	    }
	    address=document.form1.txtEmail.value;
        if(address.length>0)
	    {
            i=address.indexOf("@");
            if(i==-1)
		    {
			    window.alert("对不起！您输入的邮件是错误的！")
			    document.form1.txtEmail.focus();
			    return false;
            }
           ii=address.indexOf(".")
            if(ii==-1)
		    {
			    window.alert("对不起！您输入的电子邮件地址是错误的！")
			    document.form1.txtEmail.focus();
			    return (false);
            }
        }
	}
}

function addProdFavorite(UID,PID)
{
    if(UID == "0")
    {
        alert("请登陆后使用收藏功能！");
        document.location.href="/user/regLogin.aspx?url=" + escape(window.location.href);
        return false;
    }
    else
    {
        document.location.href="/product/favorite.aspx?PID=" + PID + "&CURL=" + escape(window.location.href);
    }
}


function shoppingCartNext()
{
    alert("由于物流成本限制，青瓷网商城设置了最低消费额100元，\n\n您当前购买的商品低于100元，请返回商城继续挑选一些，谢谢！");
    return; 
}

function shoppingCartNo()
{
    alert("您还没购买商品，请挑选商品后再结帐！");
    return; 
}

function shoppingAddress()
{
    if(document.form1.txtConsignee.value == "")
	{
		alert("请填写收货人姓名！");
		document.form1.txtConsignee.focus();
		return false;
	}	
	if (document.form1.txtConsignee.value.length < 2)
	{
	    alert("收货人姓名正确吗？");
		document.form1.txtConsignee.focus();
		return false;
	}
		
	if(document.form1.txtConsigneeAddress.value == "")
	{
		alert("请填写收货人地址！");
		document.form1.txtConsigneeAddress.focus();
		return false;
	}
	if (document.form1.txtConsigneeAddress.value.length < 6)
	{
	    alert("收货人地址正确吗？");
		document.form1.txtConsigneeAddress.focus();
		return false;
	}
	
	if(document.form1.txtPostcode.value == "")
	{
		alert("请填写邮政编码！");
		document.form1.txtPostcode.focus();
		return false;
	}
	if (document.form1.txtPostcode.value.length != 6)
	{
	    alert("邮政编码6位，您写的不正确！");
		document.form1.txtPostcode.focus();
		return false;
	}
	
	if(document.form1.txtHandset.value == "" )
	{
		alert("请填写手机号码！");
		document.form1.txtHandset.focus();
		return false;
	}
	if(document.form1.txtHandset.value != "")
	{
	    if (document.form1.txtHandset.value.length != 11)
	    {
	        alert("手机号码不正确！");
		    document.form1.txtHandset.focus();
		    return false;
	    }
	}
	
	if(document.form1.txtTelephone.value != "")
	{
	    if (document.form1.txtTelephone.value.length < 11)
	    {
	        alert("固定电话不正确，是否写区号了？");
		    document.form1.txtTelephone.focus();
		    return false;
	    }
	}
	
	if(document.form1.txtEmail.value != "")
	{
		var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_@.";
	    var checkStr = document.form1.txtEmail.value;
	    var allValid = true;
	    for (i = 0;  i < checkStr.length;  i++)
	    {
		    ch = checkStr.charAt(i);
		    for (j = 0;  j < checkOK.length;  j++)
		    if (ch == checkOK.charAt(j))
			    break;
		    if (j == checkOK.length)
		    {
			    allValid = false;
			    break;
		    }
	    }

	    if (document.form1.txtEmail.value.length < 6)
	    {
			    allValid = false;
	    }

	    if (!allValid)
	    {
		    alert("您输入的 电子邮件地址 无效!");
		    document.form1.txtEmail.focus();
		    return (false);
	    }
	    address=document.form1.txtEmail.value;
        if(address.length>0)
	    {
            i=address.indexOf("@");
            if(i==-1)
		    {
			    window.alert("对不起！您输入的邮件是错误的！")
			    document.form1.txtEmail.focus();
			    return false;
            }
           ii=address.indexOf(".")
            if(ii==-1)
		    {
			    window.alert("对不起！您输入的电子邮件地址是错误的！")
			    document.form1.txtEmail.focus();
			    return (false);
            }
        }
	}
	
	var objProvince=document.form1.ddlProvince;//省市
	var province;
	for(i=0;i<objProvince.length;i++)
	{
		if(objProvince[i].selected)
		{
			province=objProvince[i].value;			
		 }
	}
	if(province == 0)
	{
		alert("请选择省市！");
		document.form1.ddlProvince.focus();
		return false;
	}
	
	var objCity=document.form1.ddlCity;//区县
	var city;
	for(i=0;i<objCity.length;i++)
	{
		if(objCity[i].selected)
		{
			city=objCity[i].value;			
		 }
	}
	if(city == 0)
	{
		alert("请选择区县！");
		document.form1.ddlCity.focus();
		return false;
	}
}

function shoppingLogin()
{
    if(document.form1.txtUserName.value == "")
	{
		alert("请填写用户！");
		document.form1.txtUserName.focus();
		return false;
	}
	
	if(document.form1.txtPassWord.value == "")
	{
		alert("请填写密码！");
		document.form1.txtPassWord.focus();
		return false;
	}
}

//配送方式
function checkDeliverType()
{
    var obj=document.form1.deliverType;
	var flag=0;
	var types;
	var id;
	for(i=0;i<obj.length;i++)
	{
		if(obj[i].checked)
		{
			types=obj[i].value;			
		 }
	}
	
	
	if(types=="送货上门")
	{
	    document.getElementById('divHDFK').style.display="";
	    document.getElementById('divZXZH').style.display="none";
	    document.getElementById('divGRYHHK').style.display="";
	    document.getElementById('divYZHK').style.display="";
	    document.getElementById('divXKXJ').style.display="none";
	    
	    document.form1.payTypeInfo.value="个人银行汇款";
	    document.form1.txtDeliverPrices.value=document.form1.txtDeliverPrices2.value;
	    document.form1.txtShoppingOrderPrices.value=document.form1.txtShoppingOrderPrices2.value;//定单
	    document.form1.txtCash.value=document.form1.txtShoppingOrderPrices2.value;//现金
	}	
	else if(types=="上门自提")
	{
	    document.getElementById('divHDFK').style.display="none";
	    document.getElementById('divZXZH').style.display="none";
	    document.getElementById('divGRYHHK').style.display="none";
	    document.getElementById('divYZHK').style.display="none";
	    document.getElementById('divXKXJ').style.display="";
	    
	    document.form1.payTypeInfo.value="现款现结";
	    document.form1.txtDeliverPrices.value="0.00";//配送费用
	    //document.form1.payType.checked=true;
	    document.form1.txtShoppingOrderPrices.value=document.form1.txtShoppingOrderPrices2.value-document.form1.txtDeliverPrices2.value;//定单
	    document.form1.txtCash.value=document.form1.txtShoppingOrderPrices2.value-document.form1.txtDeliverPrices2.value;//现金
	    
	}
	else//if(types=="邮政包裹")
	{
	    document.getElementById('divHDFK').style.display="none";
	    document.getElementById('divZXZH').style.display="none";
	    document.getElementById('divGRYHHK').style.display="";
	    document.getElementById('divYZHK').style.display="";
	    document.getElementById('divXKXJ').style.display="none";
	    
	    document.form1.payTypeInfo.value="个人银行汇款";
	    document.form1.txtDeliverPrices.value=document.form1.txtDeliverPrices2.value;
	    document.form1.txtShoppingOrderPrices.value=document.form1.txtShoppingOrderPrices2.value;//定单
	    document.form1.txtCash.value=document.form1.txtShoppingOrderPrices2.value;//现金
	}
	
	document.form1.deliverTypeInfo.value=types;
}

function bigPic(url)
        {		
		    window.open('../files/shopPic/'+url,'','');
		}
		
		function checkStar()
		{
		    if(document.form1.txtCode.value=="")
			{
			  alert("请输入验证码！");
			  document.form1.txtCode.focus();
			  return false;
			}
			if(document.form1.txtCode2.value != document.form1.txtCode.value)
			{
			  alert("你输入验证码错误！");
			  document.form1.txtCode.focus();
			  return false;
			}
				
		    if(document.form1.starContent.value=="")
	        {
		        alert("请填写留言内容！");
		        document.form1.starContent.focus();
		        return false;
	        }
	        
	        if(document.form1.starContent.value.length > 200)
            {
                    alert("您的留言不能超过200个字！");
                    document.form1.starContent.focus();
                    return false;
            }
		}
		
		function stared()
		{
		    document.form1.starContent.value="";
		}

//支付方式
function checkPayType()
{
    var obj=document.form1.payType;
	var flag=0;
	var types;
	var id;
	for(i=0;i<obj.length;i++)
	{
		if(obj[i].checked)
		{
			types=obj[i].value;			
		 }
	}
	document.form1.payTypeInfo.value=types;
}

function showOrderInfo(layers)
{
	document.getElementById('dSaveOrder').style.display="none";
	document.getElementById('dDriverTime').style.display="none";
	document.getElementById('dTeayShoww').style.display="none";
	
	if(layers=='dSaveOrder')
	{				
		document.getElementById('dSaveOrder').style.display="";
	}
	if(layers=='dDriverTime')
	{				
		document.getElementById('dDriverTime').style.display="";
	}
	if(layers=='dTeayShoww')
	{				
		document.getElementById('dTeayShoww').style.display="";
	}
}	


function prodFavoriteIDselect()
{
    var num=document.form1.favoriteID.length;
     if (num > 0)
     {
	    for (var i=0; i< num; i++) 
	    {
		    if(document.form1.favoriteID[i].checked == false)
			    document.form1.favoriteID[i].checked=true;					
	    } 
     }
     else
     {
	    if(document.form1.favoriteID.checked == false)
		    document.form1.favoriteID.checked=true; 
     }
}
function prodFavoriteIDdel()
{
    var num=document.form1.favoriteID.length;
     if (num > 0)
     {
	    for (var i=0; i< num; i++) 
	    {
		    if(document.form1.favoriteID[i].checked == true)
			    document.form1.favoriteID[i].checked=false;					
	    } 
     }
     else
     {
	    if(document.form1.favoriteID.checked == true)
		    document.form1.favoriteID.checked=false; 
     }
}	







function userAdd()
{
	window.parent.location.href="/user/regLogin.aspx";
}

function showShopHomeTitle(sid,submenuNum)
{
	var index = parseInt(sid);
	for(var i=1;i<=submenuNum;i++)
	{
		try {
			if(index == i)
			{
				document.getElementById("head_"+i).className="headShopHomeOn";
				document.getElementById("FID_"+i).style.display="";
	    			document.getElementById("FID_"+i).style.visibility="visible";
			}
			else
			{
				document.getElementById("head_"+i).className="headShopHomeOff";
				document.getElementById("FID_"+i).style.display="none";
	    		document.getElementById("FID_"+i).style.visibility="hidden";
			}
		} catch (e) {}
	}
}

function showHomeUserList(sid,submenuNum)
{
	var index = parseInt(sid);
	for(var i=1;i<=submenuNum;i++)
	{
		try {
			if(index == i)
			{
				document.getElementById("homeUser_"+i).className="homeUserListOn";
				document.getElementById("UID_"+i).style.display="";
	    			document.getElementById("UID_"+i).style.visibility="visible";
			}
			else
			{
				document.getElementById("homeUser_"+i).className="homeUserListOff";
				document.getElementById("UID_"+i).style.display="none";
	    		document.getElementById("UID_"+i).style.visibility="hidden";
			}
		} catch (e) {}
	}
}


function showClubTitle(sid,submenuNum)
{
	var index = parseInt(sid);
	for(var i=1;i<=submenuNum;i++)
	{
		try {
			if(index == i)
			{
				document.getElementById("head_"+i).className="headClubOn";
				document.getElementById("FID_"+i).style.display="";
	    			document.getElementById("FID_"+i).style.visibility="visible";
			}
			else
			{
				document.getElementById("head_"+i).className="headClubOff";
				document.getElementById("FID_"+i).style.display="none";
	    		document.getElementById("FID_"+i).style.visibility="hidden";
			}
		} catch (e) {}
	}
}

function showBizTitle(sid,submenuNum)
{
	var index = parseInt(sid);
	for(var i=1;i<=submenuNum;i++)
	{
		try {
			if(index == i)
			{
				document.getElementById("head_"+i).className="headBizOn";
				document.getElementById("FID_"+i).style.display="";
	    			document.getElementById("FID_"+i).style.visibility="visible";
			}
			else
			{
				document.getElementById("head_"+i).className="headBizOff";
				document.getElementById("FID_"+i).style.display="none";
	    		document.getElementById("FID_"+i).style.visibility="hidden";
			}
		} catch (e) {}
	}
}

function showNewsTitle(sid,submenuNum)
{
	var index = parseInt(sid);
	for(var i=1;i<=submenuNum;i++)
	{
		try {
			if(index == i)
			{
				document.getElementById("head_"+i).className="headNewsOn";
				document.getElementById("FID_"+i).style.display="";
	    			document.getElementById("FID_"+i).style.visibility="visible";
			}
			else
			{
				document.getElementById("head_"+i).className="headNewsOff";
				document.getElementById("FID_"+i).style.display="none";
	    		document.getElementById("FID_"+i).style.visibility="hidden";
			}
		} catch (e) {}
	}
}


function showNewsInfo(sid,submenuNum)
{
	var index = parseInt(sid);
	for(var i=1;i<=submenuNum;i++)
	{
		try {
			if(index == i)
			{
				document.getElementById("headNews_"+i).className="newsInfoOn";
				document.getElementById("newsID_"+i).style.display="";
	    			document.getElementById("newsID_"+i).style.visibility="visible";
			}
			else
			{
				document.getElementById("headNews_"+i).className="newsInfoOff";
				document.getElementById("newsID_"+i).style.display="none";
	    		document.getElementById("newsID_"+i).style.visibility="hidden";
			}
		} catch (e) {}
	}
}


function showChake(showID)
{	
    var i=1;
    var tmp;
    
    
	for(i=1;i<=3;i++)
	{
	    tmp="info"+i;
	    if (showID == i)
	    {
	    	document.getElementById(i).className="lblOn";
	    	document.getElementById(tmp).style.display="";
	    	document.getElementById(tmp).style.visibility="visible";
	    }
	    else
	    {
	        document.getElementById(i).className="lblOff";
	        document.getElementById(tmp).style.display="none";
	    	document.getElementById(tmp).style.visibility="hidden";
	    }
	}
}

function showChashe(showID)
{	
    var i=1;
    var tmp;
    
    
	for(i=1;i<=2;i++)
	{
	    tmp="info"+i;
	    if (showID == i)
	    {
	    	document.getElementById(i).className="lblOn";
	    	document.getElementById(tmp).style.display="";
	    	document.getElementById(tmp).style.visibility="visible";
	    }
	    else
	    {
	        document.getElementById(i).className="lblOff";
	        document.getElementById(tmp).style.display="none";
	    	document.getElementById(tmp).style.visibility="hidden";
	    }
	}
}



function searchInfo()
{	
	var searchKey=document.form1.NewsHome_txtSearchKey.value;
	if( searchKey == "")
	{
		alert("请输入关键字");
		document.form1.NewsHome_txtSearchKey.focus();
		return false;				
	}
	
	//本窗口打开
	//document.location.href="search.aspx?searchType=1&search=" + searchKey;
}

function searchInfo2()
{				
	if( document.form1.txtSearchKey2.value == "")
	{
		alert("请输入关键字");
		document.form1.txtSearchKey2.focus();
		return false;					
	}
}



function searchNews()
{	
	var searchTypeName=document.getElementsByName("NewsHead1_ddlSearchType")[0].options[document.getElementsByName("NewsHead1_ddlSearchType")[0].selectedIndex].text; 
	var searchTypeValue=document.getElementsByName("NewsHead1_ddlSearchType")[0].value;
	
	var searchKeyword=document.form1.NewsHead1_txtKeyword.value;
	if( searchKeyword == "")
	{
		alert("请输入" + searchTypeName+ "的关键字!");
		document.form1.NewsHead1_txtKeyword.focus();
		return false;				
	}
	
	//本窗口打开
	document.location.href="/search/"+ searchTypeValue +".aspx?keyType="+ searchTypeValue +"&keyWord=" + escape(searchKeyword);
}	


function searchProduct()
{	
	var searchTypeName=document.getElementsByName("Title1_ddlSearchType")[0].options[document.getElementsByName("Title1_ddlSearchType")[0].selectedIndex].text; 
	var searchTypeValue=document.getElementsByName("Title1_ddlSearchType")[0].value;
	
	var searchKeyword=document.form1.Title1_txtKeyword.value;
	if( searchKeyword == "")
	{
		alert("请输入" + searchTypeName+ "的关键字!");
		document.form1.Title1_txtKeyword.focus();
		return false;				
	}
	
	//本窗口打开
	document.location.href="/search/"+ searchTypeValue +".aspx?keyType="+ searchTypeValue +"&keyWord=" + escape(searchKeyword);
}

function searchProduct2()
{	
	var searchTypeName=document.getElementsByName("Title1_ddlSearchType")[0].options[document.getElementsByName("Title1_ddlSearchType")[0].selectedIndex].text; 
	var searchTypeValue=document.getElementsByName("Title1_ddlSearchType")[0].value;
	
	var searchKeyword=document.Form1.Title1_txtKeyword.value;
	if( searchKeyword == "")
	{
		alert("请输入" + searchTypeName+ "的关键字!");
		document.Form1.Title1_txtKeyword.focus();
		return false;				
	}
	
	//本窗口打开
	document.location.href="/search/"+ searchTypeValue +".aspx?keyType="+ searchTypeValue +"&keyWord=" + escape(searchKeyword);
}

function searchClub()
{	
	var searchTypeName=document.getElementsByName("title1_ddlSearchType")[0].options[document.getElementsByName("title1_ddlSearchType")[0].selectedIndex].text; 
	var searchTypeValue=document.getElementsByName("title1_ddlSearchType")[0].value;
	
	var searchKeyword=document.form1.title1_txtKeyword.value;
	if( searchKeyword == "")
	{
		alert("请输入" + searchTypeName+ "的关键字!");
		document.form1.title1_txtKeyword.focus();
		return false;				
	}
	
	//本窗口打开
	document.location.href="/search/"+ searchTypeValue +".aspx?keyType="+ searchTypeValue +"&keyWord=" + escape(searchKeyword);
}

function searchClub2()
{	
	var searchTypeName=document.getElementsByName("title1_ddlSearchType")[0].options[document.getElementsByName("title1_ddlSearchType")[0].selectedIndex].text; 
	var searchTypeValue=document.getElementsByName("title1_ddlSearchType")[0].value;
	
	var searchKeyword=document.Form1.title1_txtKeyword.value;
	if( searchKeyword == "")
	{
		alert("请输入" + searchTypeName+ "的关键字!");
		document.Form1.title1_txtKeyword.focus();
		return false;				
	}
	
	//本窗口打开
	document.location.href="/search/"+ searchTypeValue +".aspx?keyType="+ searchTypeValue +"&keyWord=" + escape(searchKeyword);
}


//biz
function companyInfo()
{
    if(document.form1.txtComName.value == "")
	{
		alert("请填写您的公司名称！");
		document.form1.txtComName.focus();
		return false;
	}	
	if (document.form1.txtComName.value.length < 2)
	{
	    alert("您的公司名称正确吗？");
		document.form1.txtComName.focus();
		return false;
	}
		
	if(document.form1.txtNickName.value == "")
	{
		alert("请填写您的真实姓名！");
		document.form1.txtNickName.focus();
		return false;
	}	
	if (document.form1.txtNickName.value.length < 2)
	{
	    alert("您的真实姓名正确吗？");
		document.form1.txtNickName.focus();
		return false;
	}
	
	if(document.form1.txtEmail.value != "")
	{
		var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_@.";
	    var checkStr = document.form1.txtEmail.value;
	    var allValid = true;
	    for (i = 0;  i < checkStr.length;  i++)
	    {
		    ch = checkStr.charAt(i);
		    for (j = 0;  j < checkOK.length;  j++)
		    if (ch == checkOK.charAt(j))
			    break;
		    if (j == checkOK.length)
		    {
			    allValid = false;
			    break;
		    }
	    }

	    if (document.form1.txtEmail.value.length < 6)
	    {
			    allValid = false;
	    }

	    if (!allValid)
	    {
		    alert("您输入的 电子邮件地址 无效!");
		    document.form1.txtEmail.focus();
		    return (false);
	    }
	    address=document.form1.txtEmail.value;
        if(address.length>0)
	    {
            i=address.indexOf("@");
            if(i==-1)
		    {
			    window.alert("对不起！您输入的邮件是错误的！")
			    document.form1.txtEmail.focus();
			    return false;
            }
           ii=address.indexOf(".")
            if(ii==-1)
		    {
			    window.alert("对不起！您输入的电子邮件地址是错误的！")
			    document.form1.txtEmail.focus();
			    return (false);
            }
        }
	}
	else
	{
	    alert("Email地址不能为空！");
		document.form1.txtEmail.focus();
		return false;
	}
	
	
	
	if(document.form1.txtPhone.value == "")
	{
		alert("联系电话不能为空！");
		document.form1.txtPhone.focus();
		return false;
	}

	if(document.form1.txtHandset.value != "")
	{
	    if (document.form1.txtHandset.value.length != 11)
	    {
	        alert("手机号码不正确！");
		    document.form1.txtHandset.focus();
		    return false;
	    }
	}
	
	if(document.form1.txtPostcode.value == "")
	{
		alert("请填写邮政编码！");
		document.form1.txtPostcode.focus();
		return false;
	}
	if (document.form1.txtPostcode.value.length != 6)
	{
	    alert("邮政编码6位，您写的不正确！");
		document.form1.txtPostcode.focus();
		return false;
	}
	
	if(document.form1.txtAddress.value == "")
	{
		alert("请填写公司的主要营业地址！");
		document.form1.txtAddress.focus();
		return false;
	}	
	if (document.form1.txtAddress.value.length < 6)
	{
	    alert("您的公司地址正确吗？");
		document.form1.txtAddress.focus();
		return false;
	}
}

function companyIntro()
{
    if(document.form1.ftbMain.value == "")
	{
		alert("请填写企业介绍！");
		return false;
	}
	
	if (document.form1.ftbMain.value.length > 10000)
	{
	    alert("字数应小于1000字！");
		return false;
	}
}

function companyPWD()
{
    if(document.form1.txtPassWordOld.value == "")
	{
		alert("请填写原密码！");
		document.form1.txtPassWordOld.focus();
		return false;
	}
	if(document.form1.txtPassWordOld.value!=document.form1.txtPassWordOldS.value)
    {
            alert("您输入的原密码错误！");
            document.form1.txtPassWordOld.focus();
            return false;
    }
	
	if(document.form1.txtPassWord.value == "")
    {
            alert("请填写新密码！");
            document.form1.txtPassWord.focus();
            return false;
    }
	  
    if(document.form1.txtPassWord.value != "" && document.form1.txtPassWord.value.length < 6)
    {
            alert("更改密码至少需要6个字符！");
            document.form1.txtPassWord.focus();
            return false;
    }
    
    if(document.form1.txtPassWord.value != "" && document.form1.txtPassWord.value.length > 16)
    {
            alert("更改密码至多为16个字符！");
            document.form1.txtPassWord.focus();
            return false;
    }
     if(document.form1.txtPassWord.value != "" && document.form1.txtPassWordS.value=="")
    {
            alert("请再次输入新密码！");
            document.form1.txtPassWordS.focus();
            return false;
    }
    if(document.form1.txtPassWord.value!=document.form1.txtPassWordS.value)
    {
            alert("您再次输入的新密码不正确！");
            document.form1.txtPassWordS.focus();
            return false;
    }
}


function adminProdAdd()
{
    if(document.form1.txtProdName.value == "")
	{
		alert("请填写产品名称！");
		document.form1.txtProdName.focus();
		return false;
	}
}

function adminProdIDselect()
{
    var num=document.form1.prodID.length;
     if (num > 0)
     {
	    for (var i=0; i< num; i++) 
	    {
		    if(document.form1.prodID[i].checked == true)
			    document.form1.prodID[i].checked=false;
		    else
			    document.form1.prodID[i].checked=true;					
	    } 
     }
     else
     {
	    if(document.form1.prodID.checked == true)
		    document.form1.prodID.checked=false;
	    else
		    document.form1.prodID.checked=true; 
     }
}


function adminBizAdd()
{
    if(document.form1.txtBizName.value == "")
	{
		alert("请填写商机名称！");
		document.form1.txtBizName.focus();
		return false;
	}
	
	 if(document.form1.txtKeyword.value == "")
	{
		alert("请填写关键字！");
		document.form1.txtKeyword.focus();
		return false;
	}
}


function adminNewsAdd()
{
    if(document.form1.txtNewsName.value == "")
	{
		alert("请填写动态标题！");
		document.form1.txtNewsName.focus();
		return false;
	}
	
	 if(document.form1.ftbMain.value == "")
	{
		alert("请填写详细内容！");
		return false;
	}
}

function searchBizProd(UCID)
{		
	var searchKeyword=document.form1.txtProdKeyword.value;
	if( searchKeyword == "")
	{
		alert("请输入商品的关键字!");
		document.form1.txtProdKeyword.focus();
		return false;				
	}
	
	//本窗口打开
	document.location.href="/biz/prod.aspx?UCID="+ UCID +"&keyWord=" + escape(searchKeyword);
}

function searchBizProd2(UCID)
{		
	var searchKeyword=document.form1.txtProdKeywords.value;
	var priceStart=document.form1.txtPriceStart.value;
	var priceEnd=document.form1.txtPriceEnd.value;
	if( searchKeyword == "")
	{
		alert("请输入快速查找商品的关键字!");
		document.form1.txtProdKeywords.focus();
		return false;				
	}
	
	if( priceStart == "")
	{
		alert("请输入开始价格!");
		document.form1.txtPriceStart.focus();
		return false;				
	}
	
	if( priceEnd == "")
	{
		alert("请输入另个价格!");
		document.form1.txtPriceEnd.focus();
		return false;				
	}
	//本窗口打开
	document.location.href="/biz/prod.aspx?UCID="+ UCID +"&priceStart="+ priceStart +"&priceEnd="+ priceEnd +"&keyWord=" + escape(searchKeyword);
}

function searchBizProd3()
{		
	var searchKeyword=document.form1.txtProdKeywords.value;
	var priceStart=document.form1.txtPriceStart.value;
	var priceEnd=document.form1.txtPriceEnd.value;
	if( searchKeyword == "")
	{
		alert("请输入快速查找商品的关键字!");
		document.form1.txtProdKeywords.focus();
		return false;				
	}
	
	if( priceStart == "")
	{
		alert("请输入开始价格!");
		document.form1.txtPriceStart.focus();
		return false;				
	}
	
	if( priceEnd == "")
	{
		alert("请输入另个价格!");
		document.form1.txtPriceEnd.focus();
		return false;				
	}
	//本窗口打开
	document.location.href="/biz/indexProd.aspx?priceStart="+ priceStart +"&priceEnd="+ priceEnd +"&keyWord=" + escape(searchKeyword);
}


function searchBizInfo(UCID)
{		
	var searchKeyword=document.form1.txtBizKeyword.value;
	if( searchKeyword == "")
	{
		alert("请输入商机的关键字!");
		document.form1.txtBizKeyword.focus();
		return false;				
	}
	
	var bizType=document.getElementsByName("selBizType")[0].value
	
	//本窗口打开
	document.location.href="/biz/biz.aspx?UCID="+ UCID +"&bizType="+ escape(bizType) +"&keyWord=" + escape(searchKeyword);
}

function searchBizInfo2()
{		
	var searchKeyword=document.form1.txtBizKeyword.value;
	if( searchKeyword == "")
	{
		alert("请输入商机的关键字!");
		document.form1.txtBizKeyword.focus();
		return false;				
	}
	
	var bizType=document.getElementsByName("selBizType")[0].value
	
	//本窗口打开
	document.location.href="/biz/indexBiz.aspx?bizType="+ escape(bizType) +"&keyWord=" + escape(searchKeyword);
}

function copyToClipBoard(url)    
{    
    window.clipboardData.setData('text',url);
    alert("公司网址："+url+"\r\n\r\n已保存到剪贴板");  
} 


function addBizFavoriteProd(comID,PID)
{
    if(comID == "0")
    {
        alert("您不能收藏，请登录再用！");
        document.location.href="/user/regLogin.aspx?url=" + escape(window.location.href);
        return false;
    }
    else
    {
        document.location.href="/biz/collectionProd.aspx?PID=" + PID + "&CURL=" + escape(window.location.href);
    }
}

function addBizFavoriteBiz(comID,BID)
{
    if(comID == "0")
    {
        alert("您不能收藏，请登录再用！");
        document.location.href="/user/regLogin.aspx?url=" + escape(window.location.href);
        return false;
    }
    else
    {
        document.location.href="/biz/collectionBiz.aspx?BID=" + BID + "&CURL=" + escape(window.location.href);
    }
}

function bizBBSadd(userID)
{
    if(userID == "0")
    {
        alert("您还没有登陆，不能发贴！");
        document.location.href="/user/regLogin.aspx?url=" + escape(window.location.href);
        return false;
    }
    else
    {    
        if(document.form1.txtTitle.value == "")
	    {
		    alert("请填写帖子标题！");
		    document.form1.txtTitle.focus();
		    return false;
	    }
    	
	     if(document.form1.txtContent.value == "")
	    {
		    alert("请填写帖子内容！");
		    document.form1.txtContent.focus();
		    return false;
	    }
	    
	    if(document.form1.txtCode.value=="")
		{
		  alert("请输入验证码！");
		  document.form1.txtCode.focus();
		  return false;
		}
		if(document.form1.txtCode2.value != document.form1.txtCode.value)
		{
		  alert("你输入验证码错误！");
		  document.form1.txtCode.focus();
		  return false;
		}
	}
}


function bizBBSinfoAdd(userID)
{
    if(userID == "0")
    {
        alert("您还没有登陆，不能发贴！");
        document.location.href="/user/regLogin.aspx?url=" + escape(window.location.href);
        return false;
    }
    else
    {  
	    if(document.form1.txtContent.value == "")
	    {
		    alert("请填写回复内容！");
		    document.form1.txtContent.focus();
		    return false;
	    }
	    
	    if(document.form1.txtCode.value=="")
		{
		  alert("请输入验证码！");
		  document.form1.txtCode.focus();
		  return false;
		}
		if(document.form1.txtCode2.value != document.form1.txtCode.value)
		{
		  alert("你输入验证码错误！");
		  document.form1.txtCode.focus();
		  return false;
		}
	}
}

function bizUserLogin()
{
    if(document.form1.txtUsername.value == "")
	{
		alert("请填写用户！");
		document.form1.txtUsername.focus();
		return false;
	}
	
	if(document.form1.txtPassword.value == "")
	{
		alert("请填写密码！");
		document.form1.txtPassword.focus();
		return false;
	}
}

function shopUserLogin()
{
    document.location.href="/user/regLogin.aspx?url=" + escape(window.location.href);
}

function shopUserLogout()
{
    document.location.href="/user/logout.aspx?url=" + escape(window.location.href);
}

function searchHeadShopProduct()
{	
	var searchKeyword=document.form1.txtShopSearchKeyword.value;
	if( searchKeyword == "")
	{
		alert("请输入商品的关键字!");
		document.form1.txtShopSearchKeyword.focus();
		return false;				
	}
	
	//本窗口打开
	document.location.href="/search/product.aspx?keyWord=" + escape(searchKeyword);
}


function searchHeadShopProduct2()
{	
	var searchKeyword=document.Form1.txtShopSearchKeyword.value;
	if( searchKeyword == "")
	{
		alert("请输入商品的关键字!");
		document.Form1.txtShopSearchKeyword.focus();
		return false;				
	}
	
	//本窗口打开
	document.location.href="/search/product.aspx?keyWord=" + escape(searchKeyword);
}

//资讯列表页底搜索2009-03-13
function searchNewsList()
{		
	var searchKeyword=document.form1.txtNewsSearchKey.value;
	if( searchKeyword == "")
	{
		alert("请输入资讯的关键字!");
		document.form1.txtNewsSearchKey.focus();
		return false;				
	}
	
	//本窗口打开
	document.location.href="/search/news.aspx?keyWord=" + escape(searchKeyword);
}

//视频列表页底搜索2009-03-13
function searchVideoList()
{		
	var searchKeyword=document.form1.txtVideoSearchKey.value;
	if( searchKeyword == "")
	{
		alert("请输入视频的关键字!");
		document.form1.txtVideoSearchKey.focus();
		return false;				
	}
	
	//本窗口打开
	document.location.href="/search/video.aspx?keyWord=" + escape(searchKeyword);
}

//blog album topic user 搜索2009-03-16
function searchKeywordList(keyword,aspxName)
{		
	var searchKeyword=document.form1.txtNewsSearchKey.value;
	if( searchKeyword == "")
	{
		alert("请输入"+keyword+"的关键字!");
		document.form1.txtNewsSearchKey.focus();
		return false;				
	}
	
	//本窗口打开
	document.location.href="/search/"+aspxName+".aspx?keyWord=" + escape(searchKeyword);
}


//批发订购
function pifaCartAdd(PID)
{
    document.location.href="/pifa/cart_" + PID + ".aspx?reUrl="+escape(window.location.href); 
    //window.open("/shop/shoppingCart_" + WID + "_" + PID + ".aspx","NewWindow","");
}

function pifaCartAddInfo(PID)
{
    document.location.href="/pifa/cart_" + PID + ".aspx"; 
}