﻿// JavaScript Document
	function CheckLogin()
 	{
 		if(document.getElementById("UserID").value== '')
 		{
 			alert('pls enter your user name!');
 			document.getElementById("UserID").focus();
 			return false;
 		}
 		if(document.getElementById("Pwd").value == '')
 		{
 			alert('pls enter your password!');
 			document.getElementById("Pwd").focus();
 			return false;
 		}
 		return true;
 	}
function getCookie(Name)//cookies读取
{
   var search = Name + "="
   if(document.cookie.length > 0) 
   {
    offset = document.cookie.indexOf(search)
    if(offset != -1) 
    {
     offset += search.length
     end = document.cookie.indexOf("&", offset)
     if(end == -1) end = document.cookie.length
      return unescape(document.cookie.substring(offset, end))
    }
    else return ""
   }
   return ""
}

//show time function
dayName = new Array("", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")
monName = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
now = new Date

var strDay;
if ((now.getDate() == 1) || (now.getDate() != 11)  &&  (now.getDate() % 10 == 1)) 		// Correction for 11th and 1st/21st/31st
	strDay = "st ";
else if ((now.getDate() == 2) || (now.getDate() != 12)  &&  (now.getDate() % 10 == 2)) 	// Correction for 12th and 2nd/22nd/32nd
	strDay = "nd ";
else if ((now.getDate() == 3) || (now.getDate() != 13)  &&  (now.getDate() % 10 == 3)) 	// Correction for 13th and 3rd/23rd/33rd
	strDay = "rd ";
else
	strDay = "th ";

document.write('<div class="login">');
document.write('<form action="/MemberCenter/login.aspx?Act=frm"  method="post" id="form_login"');
document.write('name="login" onsubmit="return CheckLogin()">');
document.write('<a href="http://www.cnci.gov.cn" class="zt_bs">简体中文</a> | ');
document.write('<a href="http://220.231.180.86:1980/gate/big5/www.cnci.gov.cn/" class="zt_bs">繁体中文</a>');
if(getCookie("UserID")=="")
{
document.write('<input name="UserID" id="UserID" type="text" class="input1" maxlength="19" />');
document.write('<input name="Pwd" id="Pwd" type="password" class="input2" maxlength="17" />');
document.write('   <input name="Submit11" type="submit" class="btn_1" value="Sign in"/>');
document.write('   <input name="Submit12" type="button" class="btn_2" value="Register"');
document.write('onClick="location.href=\'/MemberCenter/register.aspx\'" />   ');
}
else
{
document.write(' &nbsp;&nbsp;&nbsp;&nbsp;Welcome <font color=yellow>'+getCookie("UserID")+'</font>');
document.write(' &nbsp;&nbsp;&nbsp;&nbsp;<a href="/MemberCenter/"><span style="padding:1px 6px;border:1px solid #CCCCCC; text-decoration:none;"><font color=#ffffcc>Enter Member Center</font></span></a>');
}
document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+dayName[now.getDay()]+", "+monName[now.getMonth()]+" "+now.getDate()+", "+now.getFullYear());
document.write('</div>');
document.write('<div class="logo">');
document.write('  <div class="search">');
document.write('    <input name="Kw" id="Kw" type="text" maxlength="54" />');
document.write('<a href="#"');
document.write('onclick="location.href=\'../trade/tradelist.aspx?Kw=\'+document.getElementById(\'Kw\').value">');
document.write('<img src="/Files/Templates/4/images/search_icon.gif" border="0" ');
document.write('class="search_btn"/></a></div></form>');
document.write('<div class="search_ad"><a href="#"></a></div>');
document.write('</div>');
document.write('<div class="main_bar">');
document.write('<a href="/"><img src="/Images/TopImages/btn_01.gif" alt="home"');
document.write('width="67" height="31" border="0" /></a>');
document.write('<a href="/News/"><img src="/Images/TopImages/btn_03.gif" ');
document.write('width="69" height="31" border="0" /></a>');
document.write('<a href="/Law/"><img src="/Images/TopImages/btn_04.gif"'); 
document.write('width="144" height="31" border="0" /></a>');
document.write('<a href="/trade/"><img src="/Images/TopImages/btn_05.gif" ');
document.write('width="102" height="31" border="0" /></a>');
document.write('<a href="/Project/"><img src="/Images/TopImages/btn_06.gif"'); 
document.write('width="85" height="31" border="0" /></a>');
document.write('<a href="http://plug.cnci.gov.cn/pro/prolist_en.aspx"><img src="/Images/TopImages/btn_07.gif" ');
document.write('width="60" height="31" border="0" /></a>');
document.write('<a href="/Culture/"><img src="/Images/TopImages/btn_08.gif" ');
document.write('width="142" height="31" border="0" /></a>');
document.write('<a href="/CNCI/Ad.html"><img src="/Images/TopImages/btn_09.gif" ');
document.write('width="105" height="31" border="0" /></a>');
document.write('<a href="/CNCI/Aboutus.html"><img src="/Images/TopImages/btn_02.gif"'); 
document.write(' width="77" height="31" border="0" /></a>');
document.write('<a href="/CNCI/Contactus.html"><img src="/Images/TopImages/btn_10.gif" ');
document.write('width="110" height="31" border="0" /></a></div>');