
function welcomeflash() 
{	//if(CheckBrowser()){
	 var ntpflash = document.getElementById("timeFlash");
	 ntpflash.innerHTML ="<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab #version=6,0,29,0 height=62 width=175 align=top classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000><PARAM NAME=movie VALUE=/images/digitalclock.swf><PARAM NAME=quality VALUE=high><param name=quality value=high><param name=menu value=false><embed src=/images/digitalclock.swf align=center quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash><param name=wmode value=opaque></embed></OBJECT>";
	//}
}

var NowImg = 1;
var bStart = 0;
var bStop =0;

function fnToggle() 
{
	var next = NowImg + 1;

	if(next == MaxImg+1) 
	{
		NowImg = MaxImg;
		next = 1;
	}
	if(bStop!=1)
	{

		if(bStart == 0)
		{
			bStart = 1;		
			setTimeout('fnToggle()', 10000);
			return;
		}
		else
		{
			oTransContainer.filters[0].Apply();

			document.images['oDIV'+next].style.display = "";
			document.images['oDIV'+NowImg].style.display = "none"; 

			oTransContainer.filters[0].Play(duration=2);

			if(NowImg == MaxImg) 
				NowImg = 1;
			else
				NowImg++;
		}
		setTimeout('fnToggle()', 10000);
	}
}


function toggleTo(img)
{
	bStop=1;
	if(img==1)
	{
			document.images['oDIV1'].style.display = "";
			document.images['oDIV2'].style.display = "none"; 
			document.images['oDIV3'].style.display = "none"; 
	}
	if(img==2)
	{
			document.images['oDIV2'].style.display = "";
			document.images['oDIV1'].style.display = "none"; 
			document.images['oDIV3'].style.display = "none";
	}
	if(img==3)
	{
			document.images['oDIV3'].style.display = "";
			document.images['oDIV1'].style.display = "none"; 
			document.images['oDIV2'].style.display = "none"; 
	}
}

var enabletabpersistence=1 //enable tab persistence via session only cookies, so selected tab is remembered?

////NO NEED TO EDIT BELOW////////////////////////
var tabcontentIDs=new Object()

function expandcontent(linkobj){
var ulid=linkobj.parentNode.parentNode.id //id of UL element
var ullist=document.getElementById(ulid).getElementsByTagName("li") //get list of LIs corresponding to the tab contents
for (var i=0; i<ullist.length; i++){
ullist[i].className=""  //deselect all tabs
if (typeof tabcontentIDs[ulid][i]!="undefined") //if tab content within this array index exists (exception: More tabs than there are tab contents)
document.getElementById(tabcontentIDs[ulid][i]).style.display="none" //hide all tab contents
}
linkobj.parentNode.className="selected"  //highlight currently clicked on tab
document.getElementById(linkobj.getAttribute("rel")).style.display="block" //expand corresponding tab content
saveselectedtabcontentid(ulid, linkobj.getAttribute("rel"))
}

function expandtab(tabcontentid, tabnumber){ //interface for selecting a tab (plus expand corresponding content)
var thetab=document.getElementById(tabcontentid).getElementsByTagName("a")[tabnumber]
if (thetab.getAttribute("rel"))
expandcontent(thetab)
}

function savetabcontentids(ulid, relattribute){// save ids of tab content divs
if (typeof tabcontentIDs[ulid]=="undefined") //if this array doesn't exist yet
tabcontentIDs[ulid]=new Array()
tabcontentIDs[ulid][tabcontentIDs[ulid].length]=relattribute
}

function saveselectedtabcontentid(ulid, selectedtabid){ //set id of clicked on tab as selected tab id & enter into cookie
if (enabletabpersistence==1) //if persistence feature turned on
setCookie(ulid, selectedtabid)
}

function getullistlinkbyId(ulid, tabcontentid){ //returns a tab link based on the ID of the associated tab content
var ullist=document.getElementById(ulid).getElementsByTagName("li")
for (var i=0; i<ullist.length; i++){
if (ullist[i].getElementsByTagName("a")[0].getAttribute("rel")==tabcontentid){
return ullist[i].getElementsByTagName("a")[0]
break
}
}
}

function initializetabcontent(){
for (var i=0; i<arguments.length; i++){ //loop through passed UL ids
if (enabletabpersistence==0 && getCookie(arguments[i])!="") //clean up cookie if persist=off
setCookie(arguments[i], "")
var clickedontab=getCookie(arguments[i]) //retrieve ID of last clicked on tab from cookie, if any
var ulobj=document.getElementById(arguments[i])
var ulist=ulobj.getElementsByTagName("li") //array containing the LI elements within UL
for (var x=0; x<ulist.length; x++){ //loop through each LI element
var ulistlink=ulist[x].getElementsByTagName("a")[0]
if (ulistlink.getAttribute("rel")){
savetabcontentids(arguments[i], ulistlink.getAttribute("rel")) //save id of each tab content as loop runs
ulistlink.onclick=function(){
expandcontent(this)
return false
}
if (ulist[x].className=="selected" && clickedontab=="") //if a tab is set to be selected by default
expandcontent(ulistlink) //auto load currenly selected tab content
}
} //end inner for loop
if (clickedontab!=""){ //if a tab has been previously clicked on per the cookie value
var culistlink=getullistlinkbyId(arguments[i], clickedontab)
if (typeof culistlink!="undefined") //if match found between tabcontent id and rel attribute value
expandcontent(culistlink) //auto load currenly selected tab content
else //else if no match found between tabcontent id and rel attribute value (cookie mis-association)
expandcontent(ulist[0].getElementsByTagName("a")[0]) //just auto load first tab instead
}
} //end outer for loop
}


function getCookie(Name){ 
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return ""
}

function setCookie(name, value){
document.cookie = name+"="+value //cookie value is domain wide (path=/)


}
function submitLogin() {
	//UserLogic.validateUserLogin($("username").value, $("password").value, show);
	document.loginForm.method.value = "userLogin";
	$("loginForm").submit();
}
 function loadimage()
  {
    document.getElementById("randImage").src = "http://copyright.tsa.cn/rand.jsp?"+Math.random();
 
  }

  function loadimageByTSA(stat)
  {
    document.getElementById("randImage").src = stat+".tsa.cn/rand.jsp?"+Math.random();
 
  }
  function loadEntimage(){
  	document.getElementById("random").src = "http://copyright.tsa.cn/rand.jsp?"+Math.random();
  }
  function getVerCode(){
  	var src = document.getElementById("randImage").src;
  	if(src.Trim()==''||src==null){
  		document.getElementById("randImage").src = "http://copyright.tsa.cn/rand.jsp?"+Math.random();
 		document.getElementById("randImage").style.display = 'inline';
  	}
 }
 function getEmpVerCode(){
 	var src = document.getElementById("randImage").src;
  	if(src.Trim()==''||src==null){
  		document.getElementById("randImage").src = "http://copyright.tsa.cn/rand.jsp?"+Math.random();
 		document.getElementById("randImage").style.display = 'inline';
  	}
 }
  function getEntVerCode(){
    var src = document.getElementById("random").src;
    if(src.Trim()==''||src==null){
 		document.getElementById("random").src = "http://copyright.tsa.cn/rand.jsp?"+Math.random();
 		document.getElementById("random").style.display = 'inline';
 	}
 }
//首页判断企业用户登陆身份
function chooseSubmitLogin(stat){
	var loginchoose = document.cklogin.chooseLogin;
	var loginMan = null;
	for(var i=0;i<loginchoose.length;i++){
	    if(loginchoose[i].checked)   
        {    
        	loginMan=loginchoose[i].value;
        }
	}
	if(loginMan==null){
		alert("请选择身份登陆");
		return false;
	}
	
	var userId = document.getElementById("ename").value;  
	var pwd = document.getElementById("epwd").value;
	var vercode = document.getElementById("evercode").value;
	if(userId.Trim() =='') 
	 {
		 alert("请输入用户名")
		 return false;
	 }
	 else if(pwd.Trim() =='')
	 {
	 	alert("请输入密码")
	 	return false;
	 }
	 else if(vercode.Trim() =='')
	 {
	 	alert("请输入验证码")
	 	return false;
	 }
	 else if(userId.length<6)
	 {
	 	alert("您输入的用户名长度不够！")
	 	return false;
	 }
	 else if(userId.length>32)
	 {
	 	alert("您输入的用户名太长！")
	 	return false;
	 }
	  else if(vercode.length<4)
	 {
	 	alert("验证码位数不够!")
	 	return false;
	 }
	 else
	 {
		 if(loginMan==102){
			document.cklogin.action = stat+'.tsa.cn/userlogin.do?method=entManagerLogin';
		}
		if(loginMan==103){
			document.cklogin.action = stat+'.tsa.cn/userlogin.do?method=entEmpLogin';
		}
		document.cklogin.target="_parent";
		document.cklogin.submit();
	 }
}


function checkUserEmpty(stat){
	var userId = document.getElementById("name").value;  
	var pwd = document.getElementById("pwd").value;
	var vercode = document.getElementById("vercode").value;
	if(userId.Trim() =='') 
	 {
		 alert("请输入用户名")
		 return false;
	 }
	 else if(pwd.Trim() =='')
	 {
	 	alert("请输入密码")
	 	return false;
	 }
	 else if(vercode.Trim() =='')
	 {
	 	alert("请输入验证码")
	 	return false;
	 }
	 else if(userId.length<6)
	 {
	 	alert("您输入的用户名长度不够！")
	 	return false;
	 }
	 else if(userId.length>32)
	 {
	 	alert("您输入的用户名太长！")
	 	return false;
	 }
	 else if(vercode.length<4)
	 {
	 	alert("验证码位数不够!")
	 	return false;
	 }
	 else
	 {
		 document.login.action=stat+".tsa.cn/userlogin.do?method=userLogin";
		 document.login.target="_parent";
		 document.login.submit();
	 	return true;
	 }
}
function checkScsUserEmpty(){
	var userId = document.getElementById("name").value;  
	var pwd = document.getElementById("pwd").value;
	var vercode = document.getElementById("vercode").value;
	if(userId.Trim() =='') 
	 {
		 alert("请输入用户名")
		 return false;
	 }
	 else if(pwd.Trim() =='')
	 {
	 	alert("请输入密码")
	 	return false;
	 }
	 else if(vercode.Trim() =='')
	 {
	 	alert("请输入验证码")
	 	return false;
	 }
	 else if(userId.length<6)
	 {
	 	alert("您输入的用户名长度不够！")
	 	return false;
	 }
	 else if(userId.length>32)
	 {
	 	alert("您输入的用户名太长！")
	 	return false;
	 }
	 else if(vercode.length<4)
	 {
	 	alert("验证码位数不够!")
	 	return false;
	 }
	 else
	 {
		 document.login.action="http://copyright.tsa.cn/userlogin.do?method=scsEntManagerLogin";
		 document.login.target="_parent";
		 document.login.submit();
	 	return true;
	 }
}
function checkScsEmpUserEmpty(){
	var userId = document.getElementById("name").value;  
	var pwd = document.getElementById("pwd").value;
	var vercode = document.getElementById("vercode").value;
	if(userId.Trim() =='') 
	 {
		 alert("请输入用户名")
		 return false;
	 }
	 else if(pwd.Trim() =='')
	 {
	 	alert("请输入密码")
	 	return false;
	 }
	 else if(vercode.Trim() =='')
	 {
	 	alert("请输入验证码")
	 	return false;
	 }
	 else if(userId.length<6)
	 {
	 	alert("您输入的用户名长度不够！")
	 	return false;
	 }
	 else if(userId.length>32)
	 {
	 	alert("您输入的用户名太长！")
	 	return false;
	 }
	 else if(vercode.length<4)
	 {
	 	alert("验证码位数不够!")
	 	return false;
	 }
	 else
	 {
		 document.login.action="http://copyright.tsa.cn/userlogin.do?method=scsEntEmpLogin";
		 document.login.target="_parent";
		 document.login.submit();
	 	return true;
	 }
}
function findEmail(stat){
	var chooseLogin = document.cklogin.chooseLogin; 
	
	var chooseLog =null;
	for(var i=0;i<chooseLogin.length;i++){
		    if   (chooseLogin[i].checked)   
		         {    
		         	chooseLog=chooseLogin[i].value;
		         }
		   }
	if(chooseLog==102){
		document.cklogin.action = stat+'.tsa.cn/valueSendMail.do?method=entsendMail';
		document.cklogin.target="_blank";
		document.cklogin.submit();
	}else{
		document.cklogin.action =stat+ '.tsa.cn/valueSendMail.do?method=empsendMail';
		document.cklogin.target="_blank";
		document.cklogin.submit();
	}

}
function disReg(){
	document.getElementById("entreg").style.display='inline';
}
function hideReg(){
	document.getElementById("entreg").style.display='inline';
}

String.prototype.Trim=function() {
	return this.replace(/(^\s*)|(\s*$)/g,"");
} 
//判断火狐浏览器
function CheckBrowser()
{

  var app=navigator.appName;
  var verStr=navigator.appVersion;
  if (app.indexOf('Netscape') != -1) {
    alert("本网站暂不支持火狐浏览器,请选用其他浏览器");
  }
  return true;
} 
//添加到收藏夹
function addBookmark(title,url) {
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,""); 
	} else if( document.all ) {
	window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
	return true;
	}
}
function run(){}

