﻿if(document.getElementById("se_cust_id")==null||document.getElementById("se_cust_id").value=="")
					{
						document.write('您好,欢迎来到cbme孕婴童线上贸易 [<a href="/member" class="huangse" target="_blank">登录</a>] [<a href="/member/newreg.html" class="huangse" target="_blank">免费注册</a>]');
				
					}else 
					{
						document.write("您好, "+document.getElementById("se_user_name").value+'! 您好,欢迎来到cbme孕婴童线上贸易');
						if(document.getElementById("se_user_type").value=="1")
						{
						document.write(" <a href='/admin/mainMenu/default.jsp'>[我的商务室]</a>")
						document.write('&nbsp;&nbsp;&nbsp;<a href="/admin/userMgr/cleanUpSession.jsp">[退出]</a>')
						}
						else
						{
						document.write('<a href="/member/mainMenu/default.jsp">[我的商务室]')
						document.write('&nbsp;&nbsp;&nbsp;<a href="/member/userMgr/cleanUpSession.jsp">[退出]</a>')
						}
					}
					

String.prototype.Trim  =  function() 
{  
  return  this.replace(/(^\s*)|(\s*$)/g,  "");  
} 
//删除字符串左端的空格
String.prototype.LTrim  =  function()  
{  
return  this.replace(/(^\s*)/g,  "");  
}  
  //删除字符串右端的空格
String.prototype.RTrim  =  function()  
  {  
  return  this.replace(/(\s*$)/g,  "");  
}

window.onload=function load(){
document.selectform_top.top_querystring.focus();
document.selectform_top.top_xype.value="1";
var url = document.location.href;
if(url.indexOf('enterprise')>-1||url.indexOf('company_list')>-1){
secBoardch(2);
}else if(url.indexOf('brand')>-1){
secBoardch(5);
}else if(url.indexOf('sales')>-1||url.indexOf('buying')>-1){
secBoardch(3);
}else{
secBoardch(1);
}
}

function secBoardch(n)
{
	var url = document.location.href;
	for(i=1;i<6;i++) {
		if (i==n) {
		document.getElementById('a' + i).className="li2";
		/**
		if(n==5&&url.indexOf('/PinPai/')==-1){window.location.href='/PinPai/index.html';}
		if(n==5&&url.indexOf('/brand/')==-1){window.location.href='/brand/index.html';}
		if(n==2&&url.indexOf('/enterprise/')==-1){window.location.href='/enterprise/index.html';}
		*/
		document.getElementById("top_xype").value=n;
		document.selectform_top.top_querystring.focus();
		document.selectform_top.top_querystring.value="";
		} else {
		document.getElementById('a' + i).className="li1";}
		document.selectform_top.top_querystring.focus();
		document.selectform_top.top_querystring.value="";
		}
}
function Search(){
		var type=document.getElementById("top_xype").value;
		var value=document.getElementById("top_querystring").value.Trim();
		if(value==""||value==null)
		{
			if(type==1)alert("请输入产品名称");
			else if(type==2)alert("请输入企业名称");
			else if(type==3)alert("请输入供应或者求购名称");
			else if(type==4)alert("请输入资讯名称");
			else if(type==5)alert("请输入品牌名称");
			return false;
		}
		document.selectform_top.submit();
		return true;
}
function clearKey()
{
	document.getElementById("top_querystring").value="";
}

function setValue(obj)
{
		if(obj.value.Trim()==''){
			if(document.getElementById("top_xype").value=="5")
				obj.value='请输入感兴趣的资讯';
			else if(document.getElementById("top_xype").value=="4")
				obj.value='请输入企业名称';
			else
				obj.value='请输入产品名称';
		}
}
function loadUrl()
{
location.href='/member/leaveWordsMgr/addLeavewords.jsp';
}
function showErrorMessage()
{
alert("您好！请登录后留言！");
}

function clearInput(obj)
{
	obj.value="";
}

//截取字符串
//str字符串　len字符串长度  tof　1追加点　0不追加
function strProc(str,len,tof)
{
	str=str.replace(/<[^<|^>]+>/g,"");
	if(str.length>len)
		if(tof=="1")
			document.write(str.substring(0,len)+"..");
		else
			document.write(str.substring(0,len));
	else
			document.write(str);
}

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
