//--------------------------------
// 功能子程序
//--------------------------------
//---显示内容
function d(s){
 document.write(s);
}
//---显示指定高度的空行
function dSpace(nSpace){
 d('<table border=0 width=100% cellspacing=0 cellpadding=0>'
	+'<tr height='+nSpace+'><td></td></tr>'
	+'</table>');
}
//---居中显示一个无下拉条的对话框
function dialog(mywidth,myheight,func){
 var myleft=Math.max(0,(screen.availWidth-mywidth-10)/2);
 var mytop=Math.max(0,(screen.availHeight-myheight-30)/2);
 var t=window.open(func,'_blank','left='+myleft+',top='+mytop+',height='+myheight+',width='+mywidth+',status=no,toolbar=no,scrollbars=no,menubar=no,location=no,resizable=no');
 t.focus();
}
//---居中显示一个有下拉条的对话框
function dialog2(mywidth,myheight,func){
 var myleft=Math.max(0,(screen.availWidth-mywidth-10)/2);
 var mytop=Math.max(0,(screen.availHeight-myheight-30)/2);
 var t=window.open(func,'_blank','left='+myleft+',top='+mytop+',height='+myheight+',width='+mywidth+',status=no,toolbar=no,scrollbars=yes,menubar=no,location=no,resizable=no');
 t.focus();
}

//--------------------------------
// 表单判断子程序
//--------------------------------
//---判断是否数字
function isnumber(c){
 if ((c>='0') && (c<='9'))
	return true;
 else
	return false;
}
//---判断是否有效ASCII字符
function ischar(c){
 if (((c>='a') && (c<='z')) || ((c>='A') && (c<='Z')))
	return true;
 else
	return false;
}
//---判断是否邮件
function checkemail(s){
 var nAtPos,nAtPos1,flag;
 flag=0;
 nAtPos = 0;
 nAtPos1 = 0;
 for(i=0; i<s.length; i++){
	n = s.substr(i, 1)
	if (!(isnumber(n)||ischar(n)||n=='_'||n=='.'||n=='@'||n=='-')){
		return false;
	}
	if ( n == '@'){
		flag=flag+1;
		nAtPos = i;
	}
	if ( n == '.'){
		nAtPos1 = i;
	}
 }
 if ( (nAtPos == 0) || (flag>1) || (nAtPos == s.length-1) || (nAtPos1 == 0) || (nAtPos1 == s.length-1) ){
	return false;
 }else{
	return true;
 }
}

function frmSubmit()
{
	document.frmProduct.submit();
}
function protype()
{
    var e = document.frmProduct.protype;
    for (var i=0; i<protypeName.length; i++)
       e.options.add(new Option(protypeName[i], protypeName[i]));
}
function protype1Name(n)
{
    var e = document.frmProduct.protype1;
    for (var i=e.options.length; i>0; i--)  e.remove(i);
    if (n == 0) return;
    var a = eval("protype1"+ n); 
    for (var i=0; i<a.length; i++) e.options.add(new Option(a[i], a[i]));
}

function productSearchHTML()
{
	d('<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ceeff6">'
	+'<tr><td height="25" colspan="4" valign="middle"> 　<strong>站内搜索</strong></td></tr>'
	+'<FORM name="frmProduct" action="../product/product.asp" method="GET">'
	+'<tr><TD width="19" height=32>&nbsp;</TD><TD colspan="3" align="left" valign="top"><INPUT style="BORDER-RIGHT: #cccccc 1px inset; BORDER-TOP: #cccccc  1px inset; FONT-SIZE: 9pt; BORDER-LEFT: #cccccc  1px inset; COLOR: #cccccc ; BORDER-BOTTOM: #cccccc  1px inset; TEXT-DECORATION: none" size=12 name="keys">&nbsp;<INPUT name=Button type=button style="BORDER-RIGHT: #cccccc 1px groove; FONT-WEIGHT: normal; FONT-SIZE: 9pt; LINE-HEIGHT: normal; BORDER-BOTTOM: #cccccc 1px groove; FONT-STYLE: normal; HEIGHT: 20px; BACKGROUND-COLOR: #eeeeee; FONT-VARIANT: normal" onclick="javascript:frmSubmit();" value="搜 索"></TD></tr>'
	+'<tr><TD height=30>&nbsp;</TD><TD colspan="3" align="left" valign="middle"><SELECT name="protype" style="width:130px;" onChange="protype1Name(this.selectedIndex);"><OPTION value="">请选择产品类型</OPTION></SELECT></TD></tr>'
	+'<tr><TD height=30>&nbsp;</TD><TD colspan="3" align="left" valign="top"><SELECT name="protype1" style="width:130px;"><OPTION value="">所有产品</OPTION></SELECT></TD></tr>'
	+'</FORM>'
	+'<tr><td height="12" colspan="4" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell-->&nbsp;</td></tr>'
	+'<tr><td height="1"></td><td></td><td width="34"></td><td></td></tr>'
	+'</table>');
}	

function userLoginHTML(ulogin,realName,Target){
	var t;
	if(ulogin=="游客"){
		t='<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ceeff6">'
		+'<tr><td width="160" height="25" valign="middle"><strong>会员信息</strong></td></tr>'
		+'<tr><TD height=2 valign="top" bgcolor="#FFFFFF"></TD></tr>'
		+'<tr><TD><FORM action="../pub/login.asp?Target='+Target+'" name="frmLogin" method="POST"><FONT color=#999999></FONT>'
			+'<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>'
			+'<TR><TD> &nbsp;<img src="../images/icon_01.gif" width="10" height="12">&nbsp;</TD><TD height=32 width="50">会员帐号</TD><TD colspan="2"><FONT color=#999999><INPUT style="BORDER-RIGHT: #ffffff 1px groove; BORDER-TOP: #ffffff 1px groove; FONT: 12px Verdana,Geneva,sans-serif; BORDER-LEFT: #ffffff 1px groove; WIDTH: 70px; COLOR: #000000; BORDER-BOTTOM: #ffffff 1px groove; HEIGHT: 18px; " name="userName"></FONT></TD></TR>'
			+'<TR><td>&nbsp;<img src="../images/icon_01.gif" width="10" height="12">&nbsp; </td><TD>密　　码</TD><TD height=32 colspan="2"><FONT color=#999999><INPUT style="BORDER-RIGHT: #ffffff 1px groove; BORDER-TOP: #ffffff 1px groove; FONT: 12px Verdana,Geneva,sans-serif; BORDER-LEFT: #ffffff 1px groove; WIDTH: 70px; COLOR: #000000; BORDER-BOTTOM: #ffffff 1px groove; HEIGHT: 18px; " type=password name="password"></FONT></TD></TR>'
			+'<TR><TD height=32 colSpan=4 align="center"><INPUT style="BORDER-RIGHT: #cccccc 1px groove; FONT-WEIGHT: normal; FONT-SIZE: 9pt; LINE-HEIGHT: normal; BORDER-BOTTOM: #cccccc 1px groove; FONT-STYLE: normal; HEIGHT: 20px; BACKGROUND-COLOR: #eeeeee; FONT-VARIANT: normal" type=submit value="登录" name="login" onkeypress="javascript:if(event.keyCode==13)userlogin();">&nbsp;&nbsp;&nbsp;&nbsp;<INPUT style="BORDER-RIGHT: #cccccc 1px groove; FONT-WEIGHT: normal; FONT-SIZE: 9pt; LINE-HEIGHT: normal; BORDER-BOTTOM: #cccccc 1px groove; FONT-STYLE: normal; HEIGHT: 20px; BACKGROUND-COLOR: #eeeeee; FONT-VARIANT: normal" onclick="javascript:document.location.href=\'../user/register.asp\'" type=button value=注册></TD></TR>'
			+'<TR><td colspan="4">&nbsp;<img src="../images/icon_01.gif" width="10" height="12"><a href="../user/pwdregister.asp">忘记密码</a>&nbsp;<img src="../images/icon_01.gif" width="10" height="12"><a href="../user/editregister.asp">会员信息修改</a></TD></TR>'
			+'</TABLE></FORM></TD></tr>'
		+'</table>';
	}else{
		t='<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ceeff6">'
		+'<tr height="25"><td width="160" valign="middle"><strong>会员信息</strong></td></tr>'
		+'<tr height=2><TD valign="top" bgcolor="#FFFFFF"></TD></tr>'
		+'<tr height="90"><TD align="center">欢迎您！'+realName+'<TD></tr>'
		+'<tr height="40"><TD valign="top" align="center"><a href="../pub/login.asp?Target='+Target+'&cmd=退出">注销</a><TD></tr>'
		+'</table>';
	}	
	d(t);
}
function userlogin(){
	if(frmLogin.userName.value.length<1){
		alert("请输入用户名");
		return;
	}
	if (frmLogin.password.value.length==0){
		alert("请输入密码");
		return;
	}
	frmLogin.submit();
}

function DispLogin(utypeid){
var t;
	switch(utypeid){
		case 80 :
			t='<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 bgcolor="#ceeff6">'
			+'<TBODY>'
			+'<TR height="5"><TD>&nbsp;</TD></TR>'
			+'<TR align="center" height="25"><TD><a href="users.asp">用户管理</a></TD><TD><a href="member.asp">会员管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="glory.asp">公司荣誉</a></TD><TD><a href="memorabilia.asp">大 事 记</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="report.asp">公司报告</a></TD><TD><a href="fellow.asp">合作伙伴</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="news.asp">新闻管理</a></TD><TD><a href="products.asp">产品管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="salesnet.asp">销售网络</a></TD><TD><a href="order.asp">订单管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="guide.asp">导购管理</a></TD><TD><a href="health.asp">健康家电</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="servicenet.asp">服务网络</a></TD><TD><a href="consult.asp">咨询管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="job.asp">招聘管理</a></TD><TD><a href="ability.asp">人才管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="picture.asp">图片管理</a></TD><TD><a href="contact.asp">联系我们</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="hotline.asp">社区热线</a></TD><TD><a href="login.asp?cmd=退出">退出系统</a></TD></TR>'
			+'</TBODY>'
			+'</TABLE>';
			break;
		case 70 :
			t='<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 bgcolor="#ceeff6">'
			+'<TBODY>'
			+'<TR height="5"><TD>&nbsp;</TD></TR>'
			+'<TR align="center" height="25"><TD><a href="users.asp">用户管理</a></TD><TD><a href="member.asp">会员管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="picture.asp">图片管理</a></TD><TD><a href="login.asp?cmd=退出">退出系统</a></TD></TR>'
			+'</TBODY>'
			+'</TABLE>';
			break;
		case 66 :
			t='<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 bgcolor="#ceeff6">'
			+'<TBODY>'
			+'<TR height="5"><TD>&nbsp;</TD></TR>'
			+'<TR align="center" height="25"><TD><a href="glory.asp">公司荣誉</a></TD><TD><a href="memorabilia.asp">大 事 记</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="report.asp">公司报告</a></TD><TD><a href="fellow.asp">合作伙伴</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="news.asp">新闻管理</a></TD><TD><a href="products.asp">产品管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="salesnet.asp">销售网络</a></TD><TD><a href="order.asp">订单管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="guide.asp">导购管理</a></TD><TD><a href="health.asp">健康家电</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="servicenet.asp">服务网络</a></TD><TD><a href="consult.asp">咨询管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="job.asp">招聘管理</a></TD><TD><a href="ability.asp">人才管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="picture.asp">图片管理</a></TD><TD><a href="contact.asp">联系我们</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="hotline.asp">社区热线</a></TD><TD><a href="login.asp?cmd=退出">退出系统</a></TD></TR>'
			+'</TBODY>'
			+'</TABLE>';
			break;
		case 60 :
			t='<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 bgcolor="#ceeff6">'
			+'<TBODY>'
			+'<TR height="5"><TD>&nbsp;</TD></TR>'
			+'<TR align="center" height="25"><TD><a href="glory.asp">公司荣誉</a></TD><TD><a href="memorabilia.asp">大 事 记</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="report.asp">公司报告</a></TD><TD><a href="fellow.asp">合作伙伴</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="news.asp">新闻管理</a></TD><TD><a href="products.asp">产品管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="salesnet.asp">销售网络</a></TD><TD><a href="order.asp">订单管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="guide.asp">导购管理</a></TD><TD><a href="health.asp">健康家电</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="servicenet.asp">服务网络</a></TD><TD><a href="consult.asp">咨询管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="job.asp">招聘管理</a></TD><TD><a href="ability.asp">人才管理</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="picture.asp">图片管理</a></TD><TD><a href="contact.asp">联系我们</a></TD></TR>'
			+'<TR align="center" height="25"><TD><a href="hotline.asp">社区热线</a></TD><TD><a href="login.asp?cmd=退出">退出系统</a></TD></TR>'
			+'</TBODY>'
			+'</TABLE>';
			break;
		default :
	}
	d(t);		
}            
