function checklist(id){return typeof(id)=="string"?document.getElementById(id):id;}
function showDIVInfos(DIVID,color,msg){
	checklist(DIVID).innerHTML="<font color='"+color+"'>"+msg+"</font>";
      }

function isExpress(v){
	var express = /^.*[\\!\\@\#\\$\\%\\^\\&\\*\\'].*$/;
	if(express.test(v)){
		return false;
	}
		return true;
}

//验证是否为非法字符
function yanzhenss(txtid){
	var str = $("#"+txtid).attr("value");
	if(str=="请输入关键字,如太平福寿C"){
		$("#"+txtid).attr("value","");return true;
	}
	if (isExpress(str)) {
		return true;
	} else {
		alert("不能输入特殊字符@#*...");
		return false;
	}
	if(str.trim().length==0){
		$("#"+txtid).attr("value","");return true;
	}
	return false;
}

//验证友情链接
function ckfriendlink(){
	var webname = $("#webname").attr("value");
	var weburl = $("#weburl").attr("value");
	var companyname = $("#companyname").attr("value");
	var username = $("#username").attr("value");
	var telephone = $("#telephone").attr("value");
	var pattern = /^[0-9a-zA-Z\u4e00-\u9fa5]+$/i;
	var tel = /^((\(\d{2,3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}(\-\d{1,4})?$/;
	var url=/^http:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/;;
	if(webname.length==0 || weburl.length==0 ||   companyname.length==0 || username.length==0|| telephone.length==0){
		alert("不能为空，请注意填写");
		return ;
	}
	if(!pattern.test(webname)){
		alert("不能输入非法字符");
		return ;
	}if(!url.test(weburl)){
		alert("地址格式不正确");
		return ;
	}if(!pattern.test(username)){
		alert("不能输入非法字符");
		return ;
	}if(!tel.test(telephone)){
		alert("电话格式不正确");
		return ;
	}
	document.getElementById("friendlink").submit();
}


//选项卡提交表单
function subxxk(str){
		var path = "/special/more/all-"+str+".html";
		if(str==0)path="/special/more/all-"+str+".html";
		//if(str==1)path="/special/more/hot-"+str+".html";
		if(str==1)path="/special/more/online-"+str+".html";
		if(str==2)path="/special/more/outdata-"+str+".html";
		document.xxkform.action= path;
		document.xxkform.submit(); 
}

//提交产品公司表单
function subcomform(comname,companyid){
	$("#companyname").attr("value",comname);
	$("#companyid").attr("value",companyid);
	document.inscomform.submit(); 
}