/**if(document.getElementById("se_cust_id")==null||document.getElementById("se_cust_id").value=="")
					{
						document.write('您好,欢迎来到孕婴童电子商务平台 [<a href="/member" class="huangse">登录</a>] [<a href="/member/newreg.html" class="huangse">免费注册</a>]');
				
					}else 
					{
						document.write("您好, "+document.getElementById("se_contact_name").value+'! 欢迎来到孕婴童电子商务平台 ');
						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>')
						}
					}
					
*/
	
	if(document.getElementById("se_cust_id")==null||document.getElementById("se_cust_id").value=="")
	{
		document.write('Hello, Welcome to CBME Online Trade [<a href="/member" class="huangse">Login</a>] [<a href="/member/newreg.html" class="huangse">Free Registration</a>]');

	}else 
	{
		document.write(document.getElementById("se_user_name").value);

		if(document.getElementById("se_user_type").value=="1")
		{
		document.write(",Welcome to CBME Online Trade, "+" <a href='/admin/mainMenu/default.jsp'>[My Office]</a>")
		document.write('&nbsp;&nbsp;&nbsp;<a href="/admin/userMgr/cleanUpSession.jsp">[Exit]</a>')
		}
		else
		{
		document.write('<a href="/member/mainMenu/default.jsp">[My Office]')
		document.write('&nbsp;&nbsp;&nbsp;<a href="/member/userMgr/cleanUpSession.jsp">[Exit]</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";
document.selectform_top.top_querystring.value="Search Products";
var url = document.location.href;
if(url.indexOf('enterprise')>-1||url.indexOf('company_list')>-1||url.indexOf('ShangJi')>-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;
		if(n==1){document.selectform_top.top_querystring.value="Search Products";}
		if(n==2){document.selectform_top.top_querystring.value="Search Suppliers";}
		if(n==3){document.selectform_top.top_querystring.value="Search Buyers";}
		if(n==5){document.selectform_top.top_querystring.value="Search Brands";}
		//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||value=='Search Products'||value=='Search Suppliers'||value=='Search Buyers'||value=='Search Brands')
		{
			if(type==1)alert("Please enter a product name");
			else if(type==2)alert("Please enter a Company Name");
			else if(type==3)alert("Please enter the name of the supply, or buy");
			else if(type==4)alert("Please enter the name of information");
			else if(type==5)alert("Please enter a brand name");
			return false;
		}
		document.selectform_top.submit();
		return true;
}
	
/**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);
}

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
