// JScript File
var selectedTab;
var selectedTabIndex=0;
var webData = {};//重要，全網站中的數據均從些獲得，此數據為json對像具體格式參考〞數據設計.doc〞文檔
var tabData=new Array();
var lang=getLang();
$.ajaxSetup ({cache: false});

$(document).ready(function(){
	selectLang();
	PageClickCss();
	loadheadFlash('null');//flash,image,null
	poupDrag();//彈出窗口拖動
	pageSplit2();
	enterKeyDown();
	toolTabEven();
	languageLink();
	showUserInfo();
})

function loadheadFlash(flag)
{
    var flashCode="";
    if(flag=='flash')
    {
        var width="200";
		var height="72";
        var fileName="sjb.swf";
        flashCode='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" name="promotion" width="'+width+'" height="'+height+'" align="middle" id="promotion">'
        flashCode=flashCode+'<param name="allowScriptAccess" value="sameDomain" />';
	    flashCode=flashCode+'<param name="movie" value="/comm/flash/'+fileName+'" />'
		flashCode=flashCode+'<param name="quality" value="high" />'
		flashCode=flashCode+'<param name="bgcolor" value="#ffffff" />'
		flashCode=flashCode+'<param name="wmode" value="transparent" />'
		flashCode=flashCode+'<embed src="/comm/flash/'+fileName+'" quality="high" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="promotion" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
    }else if(flag=='image')
    {
        //\comm\images\web\51.jpg
        //flashCode="<a href='/chi/Promotion/index.html' target='_self'><img src='/comm/images/web/51.jpg' alt='' width='200' height='75' /></a>";
        flashCode="<img src='/comm/images/web/fathers-day.jpg' alt='' width='200' height='75' />";
    }
    
    $(".year").html(flashCode);
}

function setCurrency(s){//数字三位用逗号分开
       if(/^[^0-9\.\-]*$/.test(s)) 
	   		return '00'; "invalid value";
       s=s.replace(/^(\d*)$/,"$1.");
       s=(s+"00").replace(/(\d*\.\d\d)\d*/,"$1");
       s=s.replace(".",",");
       var re=/(\d)(\d{3},)/;
       while(re.test(s))
              s=s.replace(re,"$1,$2");
       s=s.replace(/,(\d\d)$/,".$1");
       return s.replace(/^\./,"0.")
       }
	   
function textBoxLength(sender,textlength)
{
	var theValue=$(sender).val();
	if(theValue.length>textlength)
		$(sender).val(theValue.substr(0,textlength));
}
function showUserInfo()
{
	$.getJSON("../../AjaxServer.aspx",{cmd:"getUserInfo"},function(jsonUserInfo){
		if(jsonUserInfo[0].userType!="N")
		{
			$("#topUserName").html(currLD[2]+"!"+ jsonUserInfo[0].userName+" ");
			//$("#loginLogout").html(currLD[46]);//登出
		}
	})
}
function checkLogin(isShow)//核對登陸信息
{
	$.getJSON("../../AjaxServer.aspx",{cmd:"checkLogin"},function(jsonCheckLogin){
		if(jsonCheckLogin.userType=="N")
		{
			webData.userType=jsonCheckLogin.userType;
		}
		else
		{
			webData.userindex=jsonCheckLogin.userindex;
			webData.userName=jsonCheckLogin.userName;
			webData.lastLogin=jsonCheckLogin.lastLogin;
			webData.userType=jsonCheckLogin.userType;
		}
		if(isShow==true)
		{
			if(webData.userType=="N")
			{
				$("#content .content1").html(currLD[0]);//您還沒登入！點擊這裡登入登入後將顯示您的個性化頁面。您還沒有註冊嗎？
				$("#tabList").html("");  
				prepareLogin();
			}
			else
			{
				getTabInfo(true);
			}
		}
	})
}
function prepareLogin()//判斷是否登陸,如沒登陸，則顯示登陸框，如已登陸，顯示已登陸信息並由用戶決定是否註銷或重新登陸
{
	$.getJSON("../../AjaxServer.aspx",{cmd:"checkLogin"},function(jsonCheckLogin){
		if(jsonCheckLogin.userType=="N")
		{
			displayPopup('#userLogin',true);
		}
		else
		{
			webData.userindex=jsonCheckLogin.userindex;
			webData.userName=jsonCheckLogin.userName;
			webData.lastLogin=jsonCheckLogin.lastLogin;
			webData.userType=jsonCheckLogin.userType;
			$("#userLogout .toolContent span").eq(0).html(webData.userName);
			$("#userLogout .toolContent span").eq(1).html(webData.lastLogin);
			displayPopup('#userLogout',true);
		}
	})
}
function userLogin(isShow)//用戶登陸
{
	userLogin3(isShow,false);
	return;
}

function userLogin3(isMypage,isHome)//用戶登陸
{
	var userNameobj=$(isHome==true?"#userName1":"#userName");
	var passwordobj=$(isHome==true?"#password1":"#password");
	var userName =$.trim(userNameobj.val()); 
	var password =$.trim(passwordobj.val());
	var isClient=$("#userLogin"+(isHome==true?"1":"")+" input[name='isclient"+(isHome==true?"1":"")+"']:checked").val();
	//alert(userName+"|"+password+"|"+ isClient);
	if(isClient=="1")
	{
		var regClientCode=/^([PMECpmec][Nn]\d{6})|([APap][Cc]\d{6})$/;
		if(!regClientCode.test(userName))
		{
			alert(currLD[50]);//无此用户!
			return;
		}
	}else
	{
		var regEmail=/^[a-zA-Z]([a-zA-Z0-9]*[-_.]?[a-zA-Z0-9]+)+@([\w-]+\.)+[a-zA-Z]{2,}$/;
		if(!regEmail.test(userName))
		{
			alert( currLD[49]);//请输入正确的邮箱地址
			return;
		}
	}
	userNameobj.val("");passwordobj.val("");
	$.getJSON("/AjaxServerVer2.aspx", {cmd: "userLogin",userName: userName,password: password,isClient: isClient}, function(jsonLogin){
		if(jsonLogin.userType=="E")
        {
            alert(jsonLogin.userName+ currLD[48]);//您好,您已经完成了注册步骤,请到你的注册邮件中进行注册确认!
            if(isHome==false)
				displayPopup("#userLogin",false);
        }
        else if (jsonLogin.userType == "N") {
			alert(currLD[1]);
			//popupMsg(currLD[1], 3000);//sorry!登入不成功<br/>請確定輸入無誤！
		}
		else {
			if(isHome==false)
				displayPopup("#userLogin",false);
			webData.userindex=jsonLogin.userindex;
			webData.userName = jsonLogin.userName;
			webData.lastLogin = jsonLogin.lastLogin;
			webData.userType = jsonLogin.userType;
			$("#topUserName").html(currLD[2]+"!"+jsonLogin.userName + " ");
			var msg=currLD[2]+ jsonLogin.userName+currLD[3]+ jsonLogin.lastLogin+currLD[4];//歡迎userName到來！你上次登入時間:
			popupMsg(msg,3000);
			if (isHome == true) {
				$("#topUserName").html(currLD[2]+"!"+jsonLogin.userName+" ");
				$("#homeUserInfo span").eq(0).html(jsonLogin.userName).end().eq(1).html(jsonLogin.lastLogin);
				$("#loginImg").css({"backgroundImage":"url(images/logout.gif)"});
				$("#loginForm,#LoginSetting").css({display:"none"});
				$("#homeUserInfo,#LoginSetting2").css({display:"block"});
			}
			if(isMypage==true)
				getTabInfo(true);
		}
	})
}

function userLogin2()//主页的用户登陆
{
	$.getJSON("../../AjaxServer.aspx",{cmd:"checkLogin"},function(jsonCheckLogin){
		if (jsonCheckLogin.userType != "N") {
			webData.userindex=jsonCheckLogin.userindex;
			webData.userName = jsonCheckLogin.userName;
			webData.lastLogin = jsonCheckLogin.lastLogin;
			webData.userType = jsonCheckLogin.userType;
			$("#userLogout .toolContent span").eq(0).html(webData.userName);
			$("#userLogout .toolContent span").eq(1).html(webData.lastLogin);
			displayPopup('#userLogout', true);
		}
		else {
			userLogin3(false,true);
		}
	})
}
function userLogout()//用戶註銷
{
	displayPopup("#userLogout",false)
	$.getJSON("../../AjaxServer.aspx",{cmd:"userLogout"},function(jsonLogout){
		if(jsonLogout.isLogout=="true")
		{
			webData.userName=null
			webData.lastLogin=null
			webData.userType=null
			//popupMsg("已經註銷！歡迎你再次光臨<br/>3秒後返回",3000)
			window.location.reload(true);
			popupMsg( currLD[5],3000)
		}else
		{
			//popupMsg("系統繁忙！請稍候再試<br/>3秒後返回",3000)
			popupMsg( currLD[6],3000)
		}
	})
}
function reLogin()//重新登陸
{
	displayPopup("#userLogout",false)
	displayPopup("#userLogin",true)
}

function forgetPassword()//忘记密码
{
	var FGEmail=$("#FGEmail").val();
	var vcode=$("#vcode").val();
	var reg=/^[a-zA-Z]([a-zA-Z0-9]*[-_.]?[a-zA-Z0-9]+)+@([\w-]+\.)+[a-zA-Z]{2,}$/;
   	if(FGEmail==""||!reg.test(FGEmail)||vcode=="")
	{
		alert( currLD[45]);
		return false;
	}
	var lang=getLang();
	$.get("../../AjaxServer.aspx",{cmd:"forgetPassword",lang:lang,email: FGEmail,vcode:vcode},function(result){
		if(result=="ok")
		{
			displayPopup('#forgetPW',false);
			alert(currLD[43]);//密码已经发送至你的邮箱,请注意查收!
			$("#FGEmail").val("");
			$("#vcode").val("");
			getPicCode('PicGet',true);
		}else
		{
			if(result=="vcode")
				alert(currLD[61]);//验证码有误
			else
				alert(currLD[44]);//系统繁忙,请稍后再试!
		}	
	})
}

function modifyPSW()//修改密码
{
	var oldPSW=$("#oldPSW").val();
	var newPSW1=$("#newPSW1").val();
	var newPSW2=$("#newPSW2").val();
	if(newPSW1==""|| newPSW2=="" || newPSW1!= newPSW2)
	{
		alert(currLD[13]);
		return;
	}else
	{
		$.getJSON("../../AjaxServer.aspx",{cmd:"modifyPassword",oldPassword:oldPSW,newPassword: newPSW1},function(jsonResult){
			if(jsonResult[0].resultState=='0')
				alert(currLD[26]);
			else
				alert(currLD[25]);
		})
	}
}
function isEmail(sender)//
{
  var reg=/^[a-zA-Z]([a-zA-Z0-9]*[-_.]?[a-zA-Z0-9]+)+@([\w-]+\.)+[a-zA-Z]{2,}$/;
   var userEmail=$(sender).val();
   if(userEmail=="")
   		return false;
   if(!reg.test(userEmail)){  
	$(sender).parent().next().attr("flag","false");//請輸入正確的郵箱
	$("#emailError").css({display:""});
	return false;
   }else
   	$("#emailError").css({display:"none"});
   $.getJSON("../../AjaxServer.aspx",{cmd:"checkReUserEmail",userEmail:userEmail},function(jsonIsExist){
   	if (jsonIsExist.isExist == "false") {
		$(sender).parent().next().attr("flag","true");
		$("#emailError1").css({display:"none"});
   		return true;
   	}
   	else {
		$(sender).parent().next().attr("flag","false");//sorry!該Email已被註冊!
		$("#emailError1").css({display:""});
   		return false;
   	}
   })
}

function isEmail2(sender)
{
  var reg=/^[a-zA-Z]([a-zA-Z0-9]*[-_.]?[a-zA-Z0-9]+)+@([\w-]+\.)+[a-zA-Z]{2,}$/;
   var userEmail=$(sender).val();
   if(userEmail=="")
   		return false;
   if(!reg.test(userEmail)){ 
	$(sender).parent().next().html( currLD[10]).attr("flag","false");//請輸入正確的郵箱!
	return false;
   }
   else{
   	$(sender).parent().next().html("").attr("flag","true");
   		return true;
   }
}
function isEqual(sender)
{
	var var1=$("#rePassword").val();
	var var2=$("#rePassword2").val();
	if ($(sender).attr("id") == "rePassword") 
	{
		if (var1.length > 5 && var1.length < 17) {
			$("#rePassword2").parent().next().attr("flag", "true");
			$("#rePassword").parent().next().html("");
			return true;
		}
		else 
		{
			$("#rePassword").parent().next().html(currLD[14]);//密碼長度不正確!
			$("#rePassword2").parent().next().html("").attr("flag", "false");
			return false;
		}
	}
	else {
		if (var1 != var2) {
			$("#rePassword2").parent().next().html(currLD[13]).attr("flag", "false");//二次輸入的密碼不相等!
			return false;
		}else
		{
			$("#rePassword2").parent().next().html("").attr("flag", "true");
			return true;
		}
	}
}
function isEqual1(eq1id,eq2id,showid)
{
	var var1=$("#"+eq1id).val();
	var var2=$("#"+eq2id).val();
	if (var1.length > 5 && var1.length < 17) {
		if (var1 != var2) {
			$("#"+showid).html(currLD[13]).attr("flag", "false");//二次輸入的密碼不相等
			return false
		}else
		{
			$("#"+showid).html("").attr("flag", "true");
			return true
		}
	}
	else 
	{
		$("#"+showid).html(currLD[14]);//密碼長度不正確
		return false
	}
}

function regClientSelect(flag)
{
	if(flag)
	{
		$('#clientCodeI,#clientEmailM').css({display:''});
	}else
	{
		$('#clientCodeI,#clientEmailM').css({display:'none'});	
	}
}

function userRegister()//用戶註冊
{
	var client=$("#isClientC").attr("checked");
	var lang=getLang();
	if($("#accept").attr("checked")==false)
	{
		alert( currLD[16]);//您必須同意時富金融服務集團的條款才可以註冊!
		return;
	}
	var registerDiv=$("#register");
	var userName=$.trim($("#reUserName").val());
	var userEmail=$.trim($("#reEmail").val());
	var password2=$.trim($("#rePassword2").val());
	var password1=$.trim($("#rePassword").val());
	var ccode=$.trim($("#clientCode").val());
	var sex=$("#register input[name='sex']:checked").val();
	var flag = true;
	if(userName==""|| userEmail==""|| password1=="" || password1!= password2||password1.length<6||password1.length>16)
	{
		alert(currLD[15]);//alert("請正確填寫好信息後再註冊!")
		return false;
	}
	if(!/^[a-zA-Z]([a-zA-Z0-9]*[-_.]?[a-zA-Z0-9]+)+@([\w-]+\.)+[a-zA-Z]{2,}$/.test(userEmail))
	{
		alert(currLD[15]);//alert("請正確填寫好信息後再註冊!")
		return false;
	}
	if(client&&!/^([PMECpmec][Nn]\d{6})|([APap][Cc]\d{6})$/.test(ccode))
	{
		alert(currLD[50]);
		return;
	}
	//註冊
	$.getJSON("../../AjaxServerVer2.aspx", {cmd: "userRegister",userName: userName,userEmail: userEmail,sex: sex,password:password1,client: client,lang: lang,cCode:ccode}, function(jsonIsOK){
		if (jsonIsOK.isOk == false) {
			switch(jsonIsOK.errorCode)
			{
				case -1:popupMsg(currLD[57],2000); break;//注册次数太多
				case -2:popupMsg(currLD[58],2000); break;//邮件已注册
				case -3:popupMsg(currLD[59],2000); break;//系统繁忙
				default:popupMsg(currLD[59]+"!!",2500); break;
			}
		}
		else {
			$("#reUserName,#reEmail,#rePassword2,#rePassword").val("");
			popupMsg(currLD[18], 2000);//popupMsg("恭喜你,已經註冊成功!到邮件确认",2000)
			setTimeout('document.location="../home/"',2000);
		}
	})
}

////註冊end///////////
function displayPopup(targetDiv,flag)//顯示對話框,參數targetDiv為需要彈出的div，flag值為false和true分別為關閉對話框和顯示對話框
{
	if(flag==false)
	{
		$("#popUpBg,"+targetDiv).css({display:"none"});//popUpBg為半透明背景層
	}
	else
	{
		var frontDivDoc=$(targetDiv)
		var msgleft=(document.body.clientWidth-frontDivDoc.width())/2;
		var msgtop=document.documentElement.scrollTop+window.screen.availHeight/7;
		frontDivDoc.css({display:"block",left:msgleft,top:msgtop,zIndex:10001});
		var bgHeight=$(document).height();
		$("#popUpBg").css({height:bgHeight,display:"block",zIndex:10000});
	}
}
function popupMsg(msg,time)//彈出提醒信息,msg信息的內容,time顯示時間(單位秒)
{
	$("#message .toolContent").html(msg);
	displayPopup("#message",true);
	setTimeout("displayPopup('#message',false)",time)
}
function confirmBox(title,msg,okFunction)//彈出確認框，參數分別表示：確認框標題，內容，確認後執行的函數
{
	$("#confirmBox #confirmTitle").html(title)
	$("#confirmBox #confirmMsg").html(msg)
	$("#confirmBox #confirmYes").unbind("click").click(function(){displayPopup("#confirmBox",false);eval(okFunction); return true}).val( currLD[60]);
	displayPopup("#confirmBox",true);
	return false
}
function messageBox_news(title,newsLink,width,height)
{
	$("#messageBox #msgBoxTitle").html(title)
	$("#messageBox").css({width:width})
	$("#messageBox #msgBoxContent").html("<div style=' margin:20px'><img src='/comm/images/web/dataLoading.gif'/>"+ currLD[19]+"</div><div style='clear:both'></div>")
	displayPopup("#messageBox",true)
	$("#messageBox #msgBoxContent").load(newsLink)
}
function toolEven()
{
	$(".dragColumn .toolIcon .iconZoon").live("click",function(){$(this).parent().parent().parent().next().slideToggle()})//縮放
	$(".dragColumn .toolIcon .iconDelete").live("click",function(){$(this).parent().parent().parent().parent().remove()})//刪除
}
function toolDragEven()
{
		$(".dragColumn").sortable(
			{opacity:0.5,//透明度
			 connectWith:".dragColumn",//放置容器
			 handle:".toolHead,.toolFoot",//拖動的位置
			 placeholder:"toolHolder",
			 forcePlaceholderSize:true
			})
}
function poupDrag()//彈出窗口自由拖動
{
	$(".popUpTop").draggable({ handle: '.toolHead' });
}

function pageSplit2()//分頁按鈕
{
	$(".splitPage li").live("mouseover",function(){$(this).addClass("hover")})
	$(".splitPage li").live("mouseout",function(){$(this).removeClass("hover")})
	$(".splitPage li").live("click",function(){
		var thisUl=$(this).parent()
		var pageClickIndex=thisUl.find("li").index(this);
		var pageNum=thisUl.find("li").length-1
		var oldPageClickindex=thisUl.find("li").index(thisUl.find(".current")[0]);
		if(pageClickIndex==0)
		{
			oldPageClickindex--
			if(oldPageClickindex>0)
				thisUl.find("li").eq(oldPageClickindex).click()
			return
		}
		else if(pageClickIndex==pageNum)
		{
			oldPageClickindex++
			if(oldPageClickindex<pageNum)
				thisUl.find("li").eq(oldPageClickindex).click()
			return
		}
		pageClickIndex--;
		thisUl.find(".current").removeClass("current");
		$(this).addClass("current");
		thisUl.parent().find("ul").css({display:"none"})
		thisUl.css({display:"block"})
		thisUl.parent().find("ul").eq(pageClickIndex).css({display:"block"})
		})
}
function pageSplitClick(clickFuntion)//分页按钮 ,如參數中有index和sender的話,他們分別被替換為被點擊的索引和this
{
	$(".splitPage li").live("mouseover",function(){$(this).addClass("hover")})
	$(".splitPage li").live("mouseout",function(){$(this).removeClass("hover")})
	$(".splitPage li").live("click",function(){
		var thisUl=$(this).parent()
		var pageClickIndex=thisUl.find("li").index(this);
		var pageNum=thisUl.find("li").length-1
		var oldPageClickindex=thisUl.find("li").index(thisUl.find(".current")[0]);
		if(pageClickIndex==0)//上一页
		{
			oldPageClickindex--
			if(oldPageClickindex>0)
				thisUl.find("li").eq(oldPageClickindex).click()
			return
		}
		else if(pageClickIndex==pageNum)//上一页
		{
			oldPageClickindex++
			if(oldPageClickindex<pageNum)
				thisUl.find("li").eq(oldPageClickindex).click()
			return
		}
		pageClickIndex=$(this).html();
		pageClickIndex--;
		thisUl.find(".current").removeClass("current");
		$(this).addClass("current");
		//
		var funSp=clickFuntion.split("(")
		var newFun="("+funSp[1].replace(/index/,pageClickIndex)
		newFun=funSp[0]+newFun.replace(/sender/,'this')
		eval(newFun)
		})
}

function getUrlParam(param)//獲得url中的參數
{
	var url=""+document.location;
	//alert(/[?&]\w*?=/.exec(url).length);
	var params=url.split("?")
	if(params.length==2)
	{
		var paramsArr=params[1].split("&")
		var paramNum=paramsArr.length
		var paramItem
		for(paramCount=0;paramCount<paramNum;paramCount++)
		{
			paramItem=paramsArr[paramCount].split("=")
			if(paramItem[0]==param)
			{
				if(paramItem.length==2)
					return paramItem[1]
				else 
					return ""
			}
		}
	}
	return ""
}
function PageClickCss()//導航中的樣式改變
{
	$("#navMiddle .navLiLeft a").click(function(){$(this).addClass("navLiLeftC");})
	$("#navMiddle .navLiMid a").click(function(){$(this).addClass("navLiMidC");})
	$("#navMiddle .navLiRight a").click(function(){	$(this).addClass("navLiRightC");})
}
function reinitIframe(sender)//iframe高度自適應
{
	var iframe = sender
	try{
	var bHeight = iframe.contentWindow.document.body.scrollHeight;
	var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
	var height = Math.max(bHeight, dHeight);
	iframe.height =  height;
	}catch (ex){}
}
function arrToTab(array,tabCss,trCss,contentID)//"研究"的表格生成
	{
		var result=new Array()
		var Num=array.length
		var endLength=10
		var temp=new Array()
		result.push("<table class='"+tabCss+"'>")
		//result.push("<tr><th style='width:100px'>日期</th><th style=' width:250px'>報告</th></tr>")
		result.push(currLD[20])
		for(count=0;count<Num&&count<endLength;count++)
		{
			temp=array[count].split("\n")
			result.push("<tr class='"+(count%2==0?trCss:"")+"'><td>"+temp[0]+"</td><td><a href="+temp[2]+" target='_blank'>"+temp[1]+"</a></td></tr>")
		}
		result.push("</table>")
		$(contentID).html(result.join(""))		
	}

function getSpliePageIndexHtml(listNum,pageListNum)//顯示數據分頁導航條，參數含義：總共數據的條數，和每頁顯示的條數---已经抛弃,但可能某些地方用到,暂时保留
{
	var splitPageCount=Math.ceil(listNum/pageListNum)
	var splitPageHtml=new Array()
	splitPageHtml.push("<ul class='splitPage'>")
	if(splitPageCount>1)
	{
		splitPageHtml.push("<li>"+ currLD[41]+"</li>")
		for(pageCount=0; pageCount<splitPageCount&&pageCount<14; pageCount++)
			splitPageHtml.push("<li>"+(pageCount+1)+"</li>")
		splitPageHtml.push("<li>"+ currLD[42]+"</li>")
	}
	splitPageHtml.push("</ul><div style='clear:both'></div>")
	return splitPageHtml.join("")
}

function getCookie(name)//獲得cookie中name的值
{
	var strCookie=document.cookie
	var arrCookie=strCookie.split(";")
	var arrCookieNum=arrCookie.length
	var cookieValue=""
	for(count=0;count<arrCookieNum;count++)
	{
		var arrCookieItem= arrCookie[count].split("=")
		if(arrCookieItem[0].replace(" ","")==name)
		{
			cookieValue=arrCookieItem[1]
			break;
		}	
	}
	return cookieValue
}
function setCookie(name,value,time)//設置cookie的值,time以小時為單位
{
	var cookieStr=name+"="+value
	if(time!="")
	{
		var date=new Date();
		date.setTime(date.getTime()+time*60*60*1000);
		cookieStr+="; expires="+date.toGMTString();
	}
	document.cookie=cookieStr;
}
function changeUrl()//根據url傳來的參數打開分頁
{
	var urlTabIndex2=getUrlParam("tabIndex2")
	var url= document.location.href
	var lang= url.split("/")[3];
	if(urlTabIndex2!=null&&urlTabIndex2!="")
	{
		selectedTabIndex=urlTabIndex2
		document.cookie="tabIndex="+urlTabIndex2
		url=url.replace(/tabIndex2=\d/,"tabIndex="+urlTabIndex2)
		document.location=url
		return;
	}
	var urlTabIndex=getUrlParam("tabIndex")
	var cookieTabIndex=getCookie("tabIndex")
	var urlnoParamarr=url.split("?")
	var urlnoParam=urlnoParamarr[0]
	if(urlnoParam.lastIndexOf("/")==(urlnoParam.length-1))
		urlnoParam+="index.html"
	var cookieUrl=getCookie("url")
	if(urlTabIndex!=null&&urlTabIndex!="")
		selectedTabIndex=urlTabIndex
	else
		selectedTabIndex=0
	return	
	if(urlnoParam==cookieUrl)
	{
		if(cookieTabIndex!=null&&cookieTabIndex!="")
		{
			if(urlTabIndex==null||urlTabIndex=="")
			{
				
				url=url.split("?").length>1?(url+"&tabIndex="):(urlnoParam+"?tabIndex=")
				document.location=url+cookieTabIndex
				//alert(url+cookieTabIndex)
			}
			else if(cookieTabIndex!=urlTabIndex)
			{
				url=url.replace(/tabIndex=\d/,"tabIndex="+cookieTabIndex)
				document.location=url
				//alert(url)
			}
		}
	}
}
function headerCss()//
{
	$(".aLink").live("mousemove",function(){$(this).css({color:"#ff7800"})})
	$(".aLink").live("mouseout",function(){$(this).css({color:"#000"})})
	
}
function toolTabEven()//工具內的頁簽切換
{
	$(".toolTab li").live("click",function(){
		//樣式設置
		var theClickCon=$(this).parent().parent().parent()
		theClickCon.find(".toolTab li").removeClass("hover")
		$(this).addClass("hover")
		var toolTabIndex=theClickCon.find(".toolTab li").index($(this))
		var toolTabCon=theClickCon.find(".Contentbox>div")
		toolTabCon.css({display:"none"})
		toolTabCon.eq(toolTabIndex).css({display:"block"})
		toolTabCon.eq(toolTabIndex).find(".toolTab li").eq(0).click();
		//數據導入
		var rssLink=$(this).attr("rssLink")
		if(rssLink!=null&&rssLink!="")
		{
			var hasData=toolTabCon.eq(toolTabIndex).attr("hasData")
			if(hasData=="true")
				return
			var encord=$(this).attr("encord");
			var pageSize=10;
			toolTabCon.eq(toolTabIndex).load("/AjaxServerVer2.aspx #RSSDiv",{cmd:"getRssData",rssLink:rssLink,pageSize:pageSize,encord:encord,lang:lang},function(data){
				toolTabCon.eq(toolTabIndex).attr("hasData","true")
				tabData[selectedTabIndex]=$("#content .content1").html()
			});
		}
	})
}
function rssTool(contentId,rssUrl)
{
	var param=rssUrl.split(",");
	var pageSize=10;
	//$(contentId).load("/AjaxServerVer2.aspx?cmd=getRssData&rssLink="+param[0]+"&pageSize="+pageSize+"&encord="+param[1]+" #RSSDiv");
	$(contentId).load("/AjaxServerVer2.aspx #RSSDiv",{cmd:"getRssData",rssLink:param[0],pageSize:pageSize,encord:param[1]});
}

function rssPageClick(sender,pageIndex)//RSS分页显示
{
	var senderP=$(sender).parent().find("a");
	senderP.removeClass("this");
	senderP.eq(pageIndex-1+3).addClass("this");
	var rssPageList=senderP.parent().parent().find(".pageIndexDiv");
	rssPageList.css({display:"none"}).eq(pageIndex).css({display:"block"});
	//alert(senderP.parent().html());
}

function pageClick(sender,direction)//direction(first:首页,next:下一页,pre:上一页,last:最后一页)
{
	var senderList=$(sender).parent().find("a");
	var listLength= senderList.length;
	var currIndex= senderList.index($(sender).parent().find(".this"));
	switch(direction)
	{
		case "first": senderList.eq(2).click(); break;
		case "last": senderList.eq(listLength-3).click();break;
		case "next": if(currIndex>=(listLength-3)){return;}else{ senderList.eq(currIndex+1).click();} break;
		case "pre":if(currIndex<=2){return;}else{ senderList.eq(currIndex-1).click();} break;
		default: break;
	}
}

function obj2str(o)//JSON To String  
{
	var r = [];
	if (typeof o == "string")
		return "\"" + o.replace(/([\'\"\\])/g, "\\$1").replace(/(\n)/g, "\\n").replace(/(\r)/g, "\\r").replace(/(\t)/g, "\\t") + "\"";
	if (typeof o == "object")
	{
		if (!o.sort)
		{
			for (var i in o)
			r.push("\"" + i + "\":" + obj2str(o[i]));
			if (!!document.all && !/^\n?function\s*toString\(\)\s*\{\n?\s*\[native code\]\n?\s*\}\n?\s*$/.test(o.toString))
			{
				 r.push("toString:" + o.toString.toString());
			}
			r = "{" + r.join() + "}"
		}
		else
		{
			for (var i = 0; i < o.length; i++)
				r.push(obj2str(o[i]))
			r = "[" + r.join() + "]"
		}
		return r;
	}
	return o.toString();
}
function enterKeyDown()//按鍵事件
{
	$("input").unbind("keyup")
	$("input").keyup(function(event){
		var thisIndex=$("input").index($(this))
		if(event.keyCode==13)
		{
			//alert("key");
			thisIndex++
			if(thisIndex>=$("input").length)
				return
			var nextInput=$("input").eq(thisIndex);
			switch(nextInput.attr("type"))
			{
				case "password":
				case "text":nextInput.focus();break;
				case "button":nextInput.focus();nextInput.click();break;
				default:nextInput.focus();break;
			}
		}
	})
}
function initialC()//除個人化主頁外其它頁面的初始化
{
	$("#tabList li").eq(selectedTabIndex).click()
	var pageIndex=$("#content .content1").attr("pageIndex")
	if(pageIndex!=null&&pageIndex!="")
	{
		if(pageIndex<=6)//flash菜單
			$("#navMiddle li a").eq(pageIndex).click()
	}
	var bannerBgImg=$("#content .content1").attr("bannerBgImg")
	if(bannerBgImg!=null&&bannerBgImg!="")
		$("#banner").css({backgroundImage:"url("+bannerBgImg+")"})
}

function menuCss(lang, bheight, bwith)//语言,图片中菜单高度距离,菜单宽度距离
{
	var langHeight = 0
	switch (lang) {
		case "gb":langHeight = 0;break;
		case "chi":langHeight = bheight * 2;break;
		case "eng":langHeight = bheight * 4;break;
		default:langHeight = 0;break;
	}
	var currIndex = $("#content .content1").attr("pageIndex");
	$("#navMiddle a").css({background:"url(/comm/images/web/menu.gif) no-repeat"});
	$("#navMiddle a").each(function(i){
		if (i == currIndex) 
			$(this).css({backgroundPosition: "-" + bwith * i + "px -" + (langHeight + bheight) + "px"})
		else {
			$(this).css({backgroundPosition: "-" + bwith * i + "px -" + langHeight + "px"})
			$(this).mouseover(function(){$(this).css({backgroundPosition: "-" + bwith * i + "px -" + (langHeight + bheight) + "px"})}).mouseout(function(){
				$(this).css({backgroundPosition: "-" + bwith * i + "px -" + langHeight + "px"})})
		}
	})
}

function tabClickEvenC()//頁面分頁標籤切換(個人化主頁除外)
{
	$("#tabList li").live("click",function(){//樣式改變
		var tabDataLink=$(this).attr("dataLink")
		var reload=$(this).attr("reload")
		if(tabDataLink==null)
			return
		$(selectedTab).find(".tabOuterC").removeClass().addClass("tabOuter").end()
		.find(".tabInnerC").removeClass().addClass("tabInner");
		$(this).find(".tabOuter").removeClass().addClass("tabOuterC").end()
		.find(".tabInner").removeClass().addClass("tabInnerC");
		selectedTab=this;
		selectedTabIndex=$("#tabList li").index(this)
		//保存cookie
		document.cookie="tabIndex="+selectedTabIndex
		var urlstr=document.location.href.split("?")[0]
		if(urlstr.lastIndexOf("/")==(urlstr.length-1))
			urlstr+="index.html"
		document.cookie="url="+ urlstr
		languageLink()
		//導入數據
		var tabDataLink=$(this).attr("dataLink")
		if(tabDataLink==null)
			return
		else if(tabDataLink=="")
		{
			//alert("無數據鏈接!")
			alert(currLD[21])
			return;
		}
		$("#content .content1").html("<div style=' margin:20px'><img src='/comm/images/web/dataLoading.gif'/>"+ currLD[19]+"</div><div style='clear:both'></div>")
		if(tabData[selectedTabIndex]==null||(reload!=null&&reload=="true"))
			$("#content .content1").load(tabDataLink,function(){
				tabData[selectedTabIndex]=$("#content .content1").html();
				$(".toolTab li:first-child").click();
			})
		else
		{
			$("#content .content1").html(tabData[selectedTabIndex]);
				$(".toolTab li:first-child").click();
		}			
		})
}
function languageLink()//语言链接切换
{
	var langlink=document.location.href
	var lang1=""
	var lang2=""
	langlink= langlink.replace(/tabIndex=\d/,"tabIndex="+selectedTabIndex)
	if (/tabIndex=\d/.test(langlink) == false) {
		if (/\?/.test(langlink)) 
			langlink += "&tabIndex=" + selectedTabIndex;
		else 
			langlink += "?tabIndex=" + selectedTabIndex;
	}
	var regLang=/\/chi\//;
	if(langlink.indexOf("/eng/")!=-1)
		regLang=/\/eng\//;
	else if(langlink.indexOf("/gb/")!=-1)
		regLang=/\/gb\//;
	else
		regLang=/\/chi\//;
	$("#engLan").attr("href",langlink.replace(regLang,"/eng/"))
	$("#gbLan").attr("href",langlink.replace(regLang,"/gb/"))
	$("#chiLan").attr("href",langlink.replace(regLang,"/chi/"))
}
function getLang()
{
	var lang="chi"
	var langlink=document.location.href;
	if(langlink.indexOf("/eng/")!=-1)
		lang="eng";
	else if(langlink.indexOf("/gb/")!=-1)
		lang="gb";
	else
		lang="chi";
	return lang;
}

function loadDataEven()
{
	$(".aLink").live("click",function(){
		var aDataLink=$(this).attr("aDataLink")
		if(aDataLink==null||aDataLink=="")
		{
			//alert("無數據鏈接!")
			alert(currLD[21])
			return;
		}
		$("#content .content1").append("<div style=' margin:20px; float:left'><img src='/comm/images/web/dataLoading.gif'/>"+ currLD[19]+"</div></div><div style='clear:both'></div>")
		$("#content .content1").load(aDataLink,function(){toolDragEven();})
	})
}
function getHtmlTool(contentID, targetUrl, targetId){
	$("#" + contentID).load(targetUrl + " #" + targetId, function(){
		tabData[selectedTabIndex] = $("#content .content1").html();
	})
}
function clientRegSelect(sender)
{
	var isClient=$(sender).val();
	var jq_isclient=$("#isClientReg");
	var jq_noclient=$("#noClientReg");
	if(isClient=="0")
	{
		jq_isclient.css({display:"none"});
		jq_noclient.css({display:"block"});
	}else
	{
		jq_isclient.css({display:"block"});
		jq_noclient.css({display:"none"});
	}
}

function useOldPsw(sender)
{
	if($(sender).val()=="0")
	{
		$(sender).parents("tr").next().css({display:"block"}).next().css({display:"block"});
	}else
	{
		$(sender).parents("tr").next().css({display:"none"}).next().css({display:"none"});
	}
}
var newWindow = null;
var loginData=[{goods:"证券(现金/ 孖展)chi",purl:"https://www.cashonline.com.hk/TradingPlatform_Merged/SECURITIES/chi/logon.aspx",pname:"SecuritiesLogin",pwidth:795,pheight:545},
{goods:"期货及期权chi",purl:"https://www.cashonline.com.hk/TradingPlatform_Merged/COMMODITIES/chi/logon.aspx",pname:"CommoditiesLogin",pwidth:795,pheight:545},
{goods:"外汇chi",purl:"https://www.cashonline.com.hk/Forex/Logon.asp?lng=C",pname:"ForexLogin",pwidth:795,pheight:545},
{goods:"资产管理chi",purl:"https://www.cashonline.com.hk/AMPortfolio/main/chi/logon.aspx",pname:"asset_management_login",pwidth:600,pheight:550},
{goods:"財富管理chi",purl:"https://www.cashonline.com.hk/eClient/LoginForm.aspx?lang=C",pname:"",pwidth:1024,pheight:600},
//{goods:"尊尚客户chi",purl:"https://www.cashonline.com.hk/Premier/PremierLogin.asp?lng=C",pname:"PremierLogin",pwidth:795,pheight:545},
{goods:"我的投資組合chi",purl:"https://www.cashonline.com.hk/MyPortfolio/PortfolioSummary_login.asp?lng=C",pname:"PortfolioSummary",pwidth:795,pheight:545},
{goods:"证券(现金/ 孖展)gb",purl:"https://www.cashonline.com.hk/TradingPlatform_Merged/SECURITIES/gb/logon.aspx",pname:"SecuritiesLogin",pwidth:795,pheight:545},
{goods:"期货及期权gb",purl:"https://www.cashonline.com.hk/TradingPlatform_Merged/COMMODITIES/gb/logon.aspx",pname:"CommoditiesLogin",pwidth:795,pheight:545},
{goods:"外汇gb",purl:"https://www.cashonline.com.hk/Forex/Logon.asp?lng=GB",pname:"ForexLogin",pwidth:795,pheight:545},
{goods:"资产管理gb",purl:"https://www.cashonline.com.hk/AMPortfolio/main/gb/logon.aspx",pname:"asset_management_login",pwidth:600,pheight:550},
{goods:"財富管理gb",purl:"https://www.cashonline.com.hk/eClient/LoginForm.aspx?lang=E",pname:"",pwidth:1024,pheight:600},
//{goods:"尊尚客户gb",purl:"https://www.cashonline.com.hk/Premier/PremierLogin.asp?lng=GB",pname:"PremierLogin",pwidth:795,pheight:545},
{goods:"我的投資組合gb",purl:"https://www.cashonline.com.hk/MyPortfolio/PortfolioSummary_login.asp?lng=GB",pname:"PortfolioSummary",pwidth:795,pheight:545},
{goods:"证券(现金/ 孖展)eng",purl:"https://www.cashonline.com.hk/TradingPlatform_Merged/SECURITIES/eng/logon.aspx",pname:"SecuritiesLogin",pwidth:795,pheight:545},
{goods:"期货及期权eng",purl:"https://www.cashonline.com.hk/TradingPlatform_Merged/COMMODITIES/eng/logon.aspx",pname:"CommoditiesLogin",pwidth:795,pheight:545},
{goods:"外汇eng",purl:"https://www.cashonline.com.hk/Forex/Logon.asp?lng=E",pname:"ForexLogin",pwidth:795,pheight:545},
{goods:"资产管理eng",purl:"https://www.cashonline.com.hk/AMPortfolio/main/eng/logon.aspx",pname:"asset_management_login",pwidth:600,pheight:550},
{goods:"財富管理eng",purl:"https://www.cashonline.com.hk/eClient/LoginForm.aspx?lang=E",pname:"",pwidth:1024,pheight:600},
//{goods:"尊尚客户eng",purl:"https://www.cashonline.com.hk/Premier/PremierLogin.asp?lng=E",pname:"PremierLogin",pwidth:795,pheight:545},
{goods:"我的投資組合eng",purl:"https://www.cashonline.com.hk/MyPortfolio/PortfolioSummary_login.asp?lng=E",pname:"PortfolioSummary",pwidth:795,pheight:545},];
function popUp(purl,pname,pwidth,pheight) {
  
  if (purl != ""){
    if (newWindow && !newWindow.closed)
   newWindow.close();
   var win = window.open(purl, pname, 'toolbar=no,location=no,resizable=yes,left=0,top=0,width=' + pwidth + ',height=' + pheight + ',directories=no,status=no,menubar=no,scrollbars=yes', true);
  }
}
function selectLogin(index)
{
	var lang=getLang();
	var loginIndex=0;
	switch(lang)
	{
		case "chi": loginIndex=0; break;
		case "gb": loginIndex=6; break;
		case "eng": loginIndex=12; break;
		default:loginIndex=0; break;
	}
	popUp(loginData[loginIndex+index].purl,loginData[loginIndex+index].pname,loginData[loginIndex+index].pwidth,loginData[loginIndex+index].pheight)
}
////////////////lee li js start//////////////////


<!--
/*第一種形式 第二種形式 更換顯示樣式*/
function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }
}
//-->


////////////////lee li js end  //////////////////

/*--------------------langData--------------------*/
var gbLD=new Array()
var chiLD=new Array()
var engLD=new Array()
var currLD=new Array()
//
chiLD[0]="<div style='padding:20px'><a href=\"javascript:displayPopup('#userLogin',true)\">點這裡登入</a>查看您的個性主頁。<br/>您可以根據自己關注的市場和產品，從數以百計的免費資源中選擇合適的內容，隨心所欲地組合自己的個性主頁。<br/><br/>您還沒有註冊？<a href=\"/chi/register/index.html\">點這裡立即建立您的訪客帳戶。</a></div>";
chiLD[1]="登入不成功,請確定輸入無誤!";
chiLD[2]="歡迎";
chiLD[3]="到來！<br/>你上次登入時間:<br/>";
chiLD[4]="<br/>3秒後返回";
chiLD[5]="已經註銷！歡迎你再次光臨<br/>3秒後返回";
chiLD[6]="系統繁忙！請稍候再試<br/>3秒後返回";
chiLD[7]="<b style=\"color:red\">請填寫您的用戶名。</b>";
chiLD[8]="OK";//"恭喜你,此用戶名還未被註冊";
chiLD[9]="<b style=\"color:red\">該用戶名已被註冊!</b>";
chiLD[10]="<b style=\"color:red\">請輸入正確的郵箱地址。</b>";
chiLD[11]="OK";//"恭喜你,此Email還未被註冊";
chiLD[12]="<b style=\"color:red\">sorry!該Email已被註冊!</b>";
chiLD[13]="<b style=\"color:red\">二次輸入的密碼不相等!</b>";
chiLD[14]="<b style=\"color:red\">您輸入的密碼長度錯誤。</b>"
chiLD[15]="請正確填寫好信息後再註冊!"
chiLD[16]="您必須同意時富金融服務集團的條款才可以註冊!"
chiLD[17]="註冊失敗,請稍候再試!"
chiLD[18]="恭喜你,已經註冊!請你到你的註冊郵件中確認註冊."
chiLD[19]="數據加載中..."
chiLD[20]="<tr><th style='width:100px'>日期</th><th style=' width:250px'>報告</th></tr>"
chiLD[21]="無數據鏈接!"
chiLD[22]="<div style='padding:20px'>您還沒分頁,點擊<a href=\"javascript:preAddTab()\">這裡添加分頁</a>或在右邊的\"添加分頁\"按鈕添加</div>"
chiLD[23]="無數據"
chiLD[24]="標題不能為空!"
chiLD[25]="修改成功!"
chiLD[26]="修改不成功!"
chiLD[28]="已經添加成功!<br/>2秒後返回"
chiLD[29]='刪除分頁'
chiLD[30]="你確定刪除〞"
chiLD[31]="〞分頁嗎？"
chiLD[32]="已經刪除成功!<br/>2秒後返回"
chiLD[33]=" 數量："
chiLD[34]="sorry!暫無此類型的工具！"
chiLD[35]='立即添加'
chiLD[36]="作者："
chiLD[37]="創建日期："
chiLD[38]="添加成功！"
chiLD[39]="當前頁面無可更改的分頁！"
chiLD[40]="列:<br/>"

///eng
engLD[0] = "<div style='padding:20px'><a href=\"javascript:displayPopup('#userLogin',true)\">Sign in here</a> to view your own page.<br/>You can focus your interested markets and products in one page by choosing gadgets from hundreds of free internet resources.<br/><br/>Haven’t registered yet? <a href=\"/eng/register/index.html\">Create a visitor account here.</ a> </ div> " ; 
engLD[1] = "Unsuccessful login,make sure the input correct!"; 
engLD[2] = "Welcome!"; 
engLD[3] = "<br/> Your last login time is <br/>"; 
engLD[4] = "<br/> Return in 3 seconds"; 
engLD[5] = "You have been registered! Welcome you return again <br/> Return after 3 seconds"; 
engLD[6] = "System busy! Please try again later <br/> Return after 3 seconds"; 
engLD[7] = "<b style='color:red'>Please fill in your user name． </b>"; 
engLD[8] = "OK";//"Congratulations, this username has not been registered"; 
engLD[9] = "<b style='color:red'>This username has been registered．</b>"; 
engLD[10] = "<b style='color:red'>Please enter correct e-mail.</b>"; 
engLD[11] = "OK";//"Congratulations, this email address has not been registered"; 
engLD[12] = "<b style='color:red'> Sorry! This email address has been registered．</b>"; 
engLD[13] = "<b style='color:red'> Password is not the same in second input! </b>"; 
engLD[14] = "<b style='color:red'>Your password length is incorrect.</b>" 
engLD[15] = "Please fill in correct information and register!" 
engLD[16] = "You must agree to the terms and conditions of CASH Financial Services Group to register!" 
engLD[17] = "Registration fails, please try again later!" 
engLD[18] = "Congratulations, you have registered successfully!please go to your e-mail confirmation!" 
engLD[19] = "Loading data ..." 
engLD[20] = "<tr> <th style='width:100px'> Date </th> <th style=' width:250px'> Report </th> </tr>" 
engLD[21] = "No data link!" 
engLD[22] = "<div style='padding:20px'> You do not add page, click here <a href=\"javascript:preAddTab()\"> Add page here </a> Or in the right side of \"Add Page \" Click button to add page</ div> " 
engLD[23] = "No data" 
engLD[24] = "Headline cannot be blank!" 
engLD[25] = "Modified successfully!" 
engLD[26] = "Modified unsuccessfully!" 
engLD[28] = "Added successfully! <br/> Return after 2 seconds" 
engLD[29] = 'Delete Page' 
engLD[30] = "Are you sure to delete " 
engLD[31] = " This page ? " 
engLD[32] = "Deleted successfully! <br/> Return after 2 seconds" 
engLD[33] = "Quantity:" 
engLD[34] = "Sorry! No this type of tools!" 
engLD[35] = 'Add now' 
engLD[36] = "Author:" 
engLD[37] = "Date created:" 
engLD[38] = "Added successfully!" 
engLD[39] = "Current page cannot be changed!" 
engLD[40] = "List: <br/>"

///end
///gb
gbLD[0]="<div style='padding:20px'><a href=\"javascript:displayPopup('#userLogin',true)\">点这里登入</a>查看您的个性主页。<br/>您可以根据自己关注的市场和产品，从数以百计的免费资源中选择合适的内容，随心所欲地组合自己的个性主页。<br/><br/>您还没有注册？<a href=\"/gb/register/index.html\">点这里立即建立您的访客帐户。</a></div>";
gbLD[1]="登入不成功,请确定输入无误！";
gbLD[2]="欢迎";
gbLD[3]="到来！<br/>你上次登入时间:<br/>";
gbLD[4]="<br/>3秒后返回";
gbLD[5]="已经注销！欢迎你再次光临<br/>3秒后返回";
gbLD[6]="系统繁忙！请稍候再试<br/>3秒后返回";
gbLD[7]="<b style=\"color:red\">请填写您的用户名。</b>";
gbLD[8]="OK";//"恭喜你,此用户名还未被注册";
gbLD[9]="<b style=\"color:red\">该用户名已被注册!</b>";
gbLD[10]="<b style=\"color:red\">请输入正确的邮箱地址。</b>";
gbLD[11]="OK";//"恭喜你,此Email还未被注册";
gbLD[12]="<b style=\"color:red\">sorry!该Email已被注册!</b>";
gbLD[13]="<b style=\"color:red\">二次输入的密码不相等!</b>";
gbLD[14]="<b style=\"color:red\">您输入的密码长度错误。</b>"
gbLD[15]="请正确填写好信息后再注册!"
gbLD[16]="您必须同意时富金融服务集团的条款才可以注册!"
gbLD[17]="注册失败,请稍候再试!"
gbLD[18]="恭喜你,已经注册!请你到你的注册邮件中确认注册."
gbLD[19]="数据加载中..."
gbLD[20]="<tr><th style='width:100px'>日期</th><th style=' width:250px'>报告</th></tr>"
gbLD[21]="无数据链接!"
gbLD[22]="<div style='padding:20px'>您还没分页,点击<a href=\"javascript:preAddTab()\">这里添加分页</a>或在右边的\"添加分页\"按钮添加</div>"
gbLD[23]="无数据"
gbLD[24]="标题不能为空!"
gbLD[25]="修改成功!"
gbLD[26]="修改不成功!"
gbLD[28]="已经添加成功!<br/>2秒后返回"
gbLD[29]='删除分页'
gbLD[30]="你确定删除 ";
gbLD[31]=" 分页吗？";
gbLD[32]="已经删除成功!<br/>2秒后返回"
gbLD[33]=" 数量："
gbLD[34]="sorry!暂无此类型的工具！"
gbLD[35]='立即添加'
gbLD[36]="作者："
gbLD[37]="创建日期："
gbLD[38]="添加成功！"
gbLD[39]="当前页面无可更改的分页！"
gbLD[40]="列:<br/>"

///end
//addLang
gbLD[41]="上一页"
gbLD[42]="下一页"
chiLD[41]="上一頁"
chiLD[42]="下一頁"
engLD[41]="previous"
engLD[42]="next"
gbLD[43]="密码已经发送至你的邮箱,请注意查收!"
gbLD[44]=" 系统繁忙,请稍后再试!"
gbLD[45]="输入有误,请重新输入!";
engLD[43]="Password has been sent to your mailbox, please note that check!"
engLD[44]=" System busy, please try again later!";
engLD[45]="Input error, please re-enter";
chiLD[43]="密碼已經發送至你的郵箱,請注意查收!"
chiLD[44]=" 系統繁忙,請稍後再試!"
chiLD[45]="輸入有誤,請重新輸入!";
gbLD[46]="登出";
chiLD[46]="登出";
engLD[46]="Logout";
gbLD[47]=" 工具吗?";
chiLD[47]=" 工具嗎?";
engLD[47]=" tool?";
gbLD[48]=" 您好,请到你的注册邮件中进行注册确认完成注册步骤！";
chiLD[48]="您好,請到你的註冊郵件中進行註冊確認完成註冊步驟！";
engLD[48]="Hello, please go to your mailbox to confirm complete the registration steps to register!";
engLD [49] = "Please enter correct e-mail.";
gbLD[49]="请输入正确的邮箱地址."; 
chiLD[49]="請輸入正確的郵箱地址";
gbLD[50]="客户代码错误!";
chiLD[50]="客戶代碼錯誤!";
engLD[50]="Client code error!";
gbLD[51]="输入不能为空!";
chiLD[51]="輸入不能為空!";
engLD[51]="Input can not be empty!";
gbLD[52]="二次输入的密码不相同!";
chiLD[52]="二次輸入的密碼不相同!";
engLD[52]="Password is not the same in second input!";
gbLD[53]="已经为注册用户!";
chiLD[53]="已經為註冊用戶!";
engLD[53]="Already registered users!";
gbLD[54]="该Email已被注册!";
chiLD[54]="該Email已被註冊!";
engLD[54]="This email address has been registered!";
gbLD[55]="当前页已有该工具!";
chiLD[55]="當前頁已有該工具!";
engLD[55]="This page has been the tool!";
engLD[56]="E-mail can not be empty!";
gbLD[56]="邮箱不能为空!";
chiLD[56]="郵箱不能為空!";
chiLD[57]="註冊失敗,註冊次數過多";
gbLD[57]="注册失败,注册次数过多";
engLD[57]="Registration fails,Excessive Registration";
gbLD[58]="注册失败,该Email已被注册!";
chiLD[58]="註冊失敗,該Email已被註冊!";
engLD[58]="Registration fails,This email address has been registered!";
chiLD[59]="註冊失敗,系统繁忙";
gbLD[59]="注册失败,系統繁忙";
engLD[59]="Registration fails,System busy";
chiLD[60]="確定";
gbLD[60]="确定";
engLD[60]="OK";
chiLD[61]="驗證碼有誤！";
gbLD[61]="验证码有误！";
engLD[61]="Verification code is wrong!";
function selectLang()
{
	var langlink=document.location.href
	if(langlink.indexOf("/eng/")!=-1)
		currLD=engLD
	else if(langlink.indexOf("/chi/")!=-1)
		currLD=chiLD
	else if(langlink.indexOf("/gb/")!=-1)
		currLD=gbLD
	else
		currLD=chiLD
}