function check(){ 
if (form1.key.value ==""){ 
alert("关键词不能为空!"); 
return false; 
} 

return true; 
} 
function checks(){
if (form2.ntts.value == '') {
                alert('内容不能为空!');
                return false;
        }
if (form2.ntts.value.length>180){
    alert('评论内容不能大于180个字符！')
    form2.ntts.focus();
    return false;
  }
return true;
} 

function checkb(){
if (form2.nttss.value == '') {
                alert('内容不能为空!');
                return false;
        }
if (form2.nttss.value.length>250){
    alert('评论内容不能大于250个字符！')
    form2.nttss.focus();
    return false;
  }
return true;
} 


function checky(){
  if (Form1.name.value =='') {
                alert('收货人不能为空!');
                return false;
        }
if (Form1.name.value.length>7){
    alert('收货人长度不能大于7字符！')
    Form1.name.focus();
    return false;
  }

 if (Form1.province.value=='') {
                alert('配送区域省份没有选择!');
                return false;
        }
 if (Form1.city.value=='') {
                alert('配送区域城市没有选择!');
                return false;
        }

		 if (Form1.adderss.value=='') {
                alert('详细地址没有填写!');
                return false;
        }
		 if (Form1.tel.value=='' && Form1.telsj.value=='') {
                alert('联系电话和手机必填写一个!');
                return false;
        }
		
		
		
		
		


		
		if(isNaN(Form1.telsj.value))
		{
			alert('请输入有效的手机号码!');
			Form1.name.focus();
			return false;
	    }   
	  

     /*
	 if(Form1.tel.value!="")
	  {
		var cellphone=/^([\d-+]*)$/;
		if(!cellphone.test(Form1.tel.value))
		{
		alert('请输入有效电话号码！');
		Form1.tel.focus();
		return false;
		}
		
		if(Form1.tel.value.length<12 || Form1.tel.value.length>12)
		{
		alert('电话号码不能大于或小于12位数！')
        Form1.tel.focus();
         return false;
	     }
	  }
	  */
	  if (Form1.telsj.value!="")
	  {
		  if(Form1.telsj.value.length<11 || Form1.telsj.value.length>11)
            { alert('手机号不能大于或小于11位数！')
             Form1.telsj.focus();
             return false;
			}
      }

   

if (Form1.telsj.value !="")
{ 
 document.getElementById("statusTxt").innerHTML="操作正在进行中...请稍候!";
} 
return true;


}




function checkpub(){

if (Form1.title.value.length<4){
    alert('标题长度不能小于4字符！')
    Form1.title.focus();
    return false;
  }
		if (Form1.title.value.length>50){
    alert('标题长度不能大于50字符！')
    Form1.title.focus();
    return false;
  }

  if (Form1.ta.value =="") {
                alert('内容不能为空!');
                return false;
        }
		if (Form1.ta.value.length<6){
    alert('内容长度不能小于6字符！')
    Form1.title.focus();
    return false;
  }
		
	if (Form1.ta.value.length>300){
    alert('内容长度不能大于300字符！')
    Form1.title.focus();
    return false;
  }
return true;
}

/*function opengwc1()
{
	var gwcdiv=document.createElement("div");
	gwcdiv.setAttribute("id","ShoppingCart");
	gwcdiv.style.border="2px solid rgb(255, 122, 51)";
	gwcdiv.style.padding="1px";
	gwcdiv.style.position="absolute";
	gwcdiv.style.backgroundColor="rgb(255, 255, 255)";
	gwcdiv.style.width="402px";
	gwcdiv.style.height="200px";
	gwcdiv.style.top="72px";
	gwcdiv.style.left="787.5px";
	gwcdiv.style.right="auto";
	gwcdiv.style.bottom="auto";
	gwcdiv.style.opacity=1;
	gwcdiv.style.zIndex = 99;
	var myheader = document.getElementById("header");
	insertAfter(gwcdiv,myheader);
	var uidgwc=document.createElement("div");
	uidgwc.setAttribute("id","uid_ShoppingCart");
	uidgwc.style.textIndent="20px";
	uidgwc.style.fontSize="14px";
	uidgwc.style.backgroundColor="#E8F4FD";
	uidgwc.style.color="rgb(51, 51, 51)";
	uidgwc.style.lineHeight="22px";
	uidgwc.style.position="relative";
	uidgwc.style.height="22px";
	uidgwc.style.fontWeight=700;
	uidgwc.innerHTML="我的购物车";
	var uidgwcp=document.getElementById("ShoppingCart");
	uidgwcp.appendChild(uidgwc);
	var closeimg=document.createElement("div");
	closeimg.setAttribute("id","closeicon");
	closeimg.style.width="12px";
	closeimg.style.height="12px";
	closeimg.style.position="absolute";
	closeimg.style.right="5px";
	closeimg.style.top="5px";
	closeimg.style.cursor="pointer";
	closeimg.style.background="url(/images/closebtn.gif) no-repeat scroll 0pt 0pt transparent";
	var closep=document.getElementById("uid_ShoppingCart");
	insertAfter(closeimg,closep);
}

function opengwc()
{
	var gwcdiv=document.createElement("div");
	gwcdiv.setAttribute("id","ShoppingCart1");
	gwcdiv.style.border="2px solid rgb(255, 122, 51)";
	gwcdiv.style.padding="1px";
	gwcdiv.style.position="absolute";
	gwcdiv.style.backgroundColor="rgb(255, 255, 255)";
	gwcdiv.style.width="402px";
	gwcdiv.style.top="72px";
	gwcdiv.style.left="787.5px";
	gwcdiv.style.right="auto";
	gwcdiv.style.bottom="auto";
	gwcdiv.style.opacity=1;
	gwcdiv.style.zIndex = 99;
	gwcdiv.innerHTML=document.getElementById("ShoppingCart").innerHTML;
	var myheader = document.getElementById("header");
	insertAfter(gwcdiv,myheader);
}

function insertAfter(newElement,targetElement){//插入
	var parent = targetElement.parentNode;
	if(parent.lastChild == targetElement){
		parent.appendChild(newElement);
	}else{
		parent.insertBefore(newElement,targetElement.nextSibling);
	}
}

function closeLayer(){
document.getElementById("ShoppingCart1").style.display = "none";
return false;
}*/

$(document).ready(function(){
	$(".adv1").mouseover(function(){
		$(".pro_data").hide();
		var objStr1=$(this).parent().attr("href");
		var objStr2=$(this).attr("pic2");
		if(objStr2){
			$(this).attr("src",objStr2);
			$(this).attr("pic2",objStr1);
		}
		if($(this).parent().next().length > 0 && $(this).parent().next().attr("class")=='pro_data'){
			$(this).parent().next().width($(this).width());
			$(this).parent().next().height($(this).height());
			$(this).parent().next().css("z-index","99");
			$(this).parent().next().show();
		}
	});/*.mouseout(function(){
var objStr1=$(this).attr("src");
var objStr2=$(this).attr("pic2");
if(objStr2){
$(this).attr("src",objStr2);
$(this).attr("pic2",objStr1);
}
$(".pro_data").hide();
});*/
});
/*$(document).ready(function(){
	$(".pro_data").mouseout(function(){
		$(this).hide();
	});
});*/
/*.mouseout(function(){
var objStr1=$(this).attr("src");
var objStr2=$(this).attr("pic2");
if(objStr2){
$(this).attr("src",objStr2);
$(this).attr("pic2",objStr1);
}
})*/
