var _curr_href = document.location.href;
// FOR CSS TOGGLE
function textEnlarge() {
		setcookie("style","styles-large",31);
		history.go(0);
}
function textReduce() {
		setcookie("style","styles",31);
		history.go(0);
}	
function getSection() {
	if (isAboutSFC()){
		return pAboutsfc;
	}
	else if (isLegislation()){
		return pLegislation;
	}
	else if (isIntermediaries()){
		return pIntermediaries;
	}
	else if (isCfd()){
		return pCfd;
	}
	else if (isForms()){
		return pForms;
	}
	else if (isGeneral()){
		return pGeneral;
	}
	else if (isSpeeches()){
		return pSpeeches;
	}
	else if (isResearch()){
		return pResearch;
	}
	else if (isFaqs()){
		return pFaqs;
	}
	else if(isInutilbar()){
		return pInutilbar;
	}
	else if(isBtmmenu()){
		return pBtmmenu;
	}
	else if(isWhatsNew()){
		return pWhatsnew;
	}
	else if(isHomepage()){
		return pHompage;
	}else if(isIOSCO()){
		return pIOSCO;
	}else if(isRegister()){
		return pRegister;
	}else if(isContingencyInfo()){
		return pContingencyInfo;
	}else if(isEvents()){
		return pEvents;
	}else if(isAcrobat()){
		return pAcrobat;
	}
}

function isAboutSFC() {
	for (i=0; i<aboutsfc.length; i++) {
		if (MenuId==aboutsfc[i])
			return true;
	}
	return false;
}

function isLegislation() {
	for (i=0; i<legislation.length; i++) {
		if (MenuId==legislation[i])
			return true;
	}
	return false;	
}

function isIntermediaries() {
	for (i=0; i<intermediaries.length; i++) {
		if (MenuId==intermediaries[i])
			return true;
	}
	return false;	
}

function isCfd() {
	for (i=0; i<cfd.length; i++) {
		if (MenuId==cfd[i])
			return true;
	}
	return false;	
}

function isForms() {
	for (i=0; i<forms.length; i++) {
		if (MenuId==forms[i])
			return true;
	}
	return false;	
}

function isGeneral() {
	for (i=0; i<general.length; i++) {
		if (MenuId==general[i])
			return true;
	}
	return false;	
}

function isSpeeches() {
	for (i=0; i<speeches.length; i++) {
		if (MenuId==speeches[i])
			return true;
	}
	return false;	
}

function isResearch() {
	for (i=0; i<research.length; i++) {
		if (MenuId==research[i])
			return true;
	}
	return false;	
}
function isFaqs() {
	for (i=0; i<faqs.length; i++) {
		if (MenuId==faqs[i])
			return true;
	}
	return false;	
}
function isInutilbar() {
	for (i=0; i<inutilbar.length; i++) {
		if (MenuId==inutilbar[i])
			return true;
	}
	return false;
}
function isBtmmenu(){
	for (i=0; i<btmmenu.length; i++) {
		if (MenuId==btmmenu[i])
			return true;
	}
	return false;
}
function isWhatsNew(){
	for (i=0; i<whatsnew.length; i++) {
		if (MenuId==whatsnew[i])
			return true;
	}
	return false;
}
function isHomepage(){
	for (i=0; i<homepage.length; i++) {
		if (MenuId==homepage[i])
			return true;
	}
	return false;
}

function isIOSCO(){
	for (i=0; i<iosco.length; i++) {
		if (MenuId==iosco[i])
			return true;
	}
	return false;
}

function isRegister(){
	for (i=0; i<register.length; i++) {
		if (MenuId==register[i])
			return true;
	}
	return false;
}

function isContingencyInfo(){
	for (i=0; i<contingencyinfo.length; i++) {
		if (MenuId==contingencyinfo[i])
			return true;
	}
	return false;
}

function isEvents(){
	for (i=0; i<events.length; i++) {
		if (MenuId==events[i])
			return true;
	}
	return false;
}

function isAcrobat(){
		for (i=0; i<acrobat.length; i++) {
		if (MenuId==acrobat[i])
			return true;
	}
	return false;
}


function getEnLink() {
	var _href = _curr_href;
	if(isSC()){
		if(isTC()){
			_href = _href.substr(0, _href.indexOf(kanhanDomain)) + _href.substr(_href.indexOf(kanhanDomain) + kanhanDomain.length);
			_href = _href.substr(0, _href.indexOf(pSfcTc)) + pSfcEn + _href.substr(_href.indexOf(pSfcTc)+4);	
		}else if(isChi()){
			_href = _href.substr(0, _href.indexOf(kanhanDomain)) + _href.substr(_href.indexOf(kanhanDomain) + kanhanDomain.length);
			_href = _href.substr(0, _href.indexOf(pNotesChi)) + pNotesEng + _href.substr(_href.indexOf(pNotesChi)+5);	
		}		
	}else if(isTC()){
		_href = _href.substr(0, _href.indexOf(pSfcTc)) + pSfcEn + _href.substr(_href.indexOf(pSfcTc)+4);	
	}else if(isChi()){
		_href = _href.substr(0, _href.indexOf(pNotesChi)) + pNotesEng + _href.substr(_href.indexOf(pNotesChi)+5);
	}else{//en case
		_href = "#";
	}
	
	// restart search whenever switch lang
	if (_href.indexOf(pAdvsearch) > 0) {
		if (pSfcTxt == 0)
				if (isSC())
					_href = domainName.replace(kanhanDomain,"")+appName+"/jsp/EN/inutilbar/advsearch/advsearch.jsp";
				else
					_href = domainName.replace(kanhanDomain,"")+appName+"/jsp/EN/inutilbar/advsearch/advsearch.jsp";
		else
				if (isSC())
					_href = domainName.replace(kanhanDomain,"")+appName+"/jsp/EN/inutilbar/advsearch/advsearch_text.jsp";
				else
					_href = domainName.replace(kanhanDomain,"")+appName+"/jsp/EN/inutilbar/advsearch/advsearch_text.jsp";
	}
	
	return _href;	
}

function getTcLink() {
	
	var _href = _curr_href;
	if(isSC()){
		if(isTC()){
			_href = _href.substr(0, _href.indexOf(kanhanDomain)) + _href.substr(_href.indexOf(kanhanDomain) + kanhanDomain.length);
		}else if(isChi()){
			_href = _href.substr(0, _href.indexOf(kanhanDomain)) + _href.substr(_href.indexOf(kanhanDomain) + kanhanDomain.length);
		}		
	}else if(isEN()){
		_href = _href.substr(0, _href.indexOf(pSfcEn)) + pSfcTc + _href.substr(_href.indexOf(pSfcEn)+4);	
	}else if(isEng()){
		_href = _href.substr(0, _href.indexOf(pNotesEng)) + pNotesChi + _href.substr(_href.indexOf(pNotesEng)+5);
	}else{
		_href = "#";
	}	
	
	// restart search whenever switch lang
	if (_href.indexOf(pAdvsearch) > 0) {
		if (pSfcTxt == 0)
				if (isSC())
					_href = domainName.replace(kanhanDomain,"")+appName+"/jsp/TC/inutilbar/advsearch/advsearch.jsp";
				else
					_href = domainName.replace(kanhanDomain,"")+appName+"/jsp/TC/inutilbar/advsearch/advsearch.jsp";
		else
				if (isSC())
					_href = domainName.replace(kanhanDomain,"")+appName+"/jsp/TC/inutilbar/advsearch/advsearch_text.jsp";
				else
					_href = domainName.replace(kanhanDomain,"")+appName+"/jsp/TC/inutilbar/advsearch/advsearch_text.jsp";
	}
	
	// search tc via sc
	if (_href.indexOf(kanhanDomain) > 0 && (isEN() || isEng())) {
		_href = (_href.replace(kanhanDomain,"")).replace("EN","TC");
	}
	if(_href.indexOf(kanhanDomain) > 0 && isTC()) {
		_href = (_href.replace(kanhanDomain,"")).replace("TC","EN");
	}
	
	return _href;
}

function getScLink() {
	var _href = _curr_href;
	var _no = 0;
	if (location.protocol == "http:"){
		_no = 7;
	}else if (location.protocol == "https:"){
		_no = 8;
  };
	if(isSC()){
		_href = "#";
	}else if(isTC()){
		_href = _href.substr(0,_no) + kanhanDomain + _href.substr(_no); 
	}else if(isChi()){
		_href = _href.substr(0,_no) + kanhanDomain + _href.substr(_no); 
	}else if(isEN()){
		_href = _href.substr(0,_no) + kanhanDomain + _href.substr(_no); 
		_href = _href.substr(0, _href.indexOf(pSfcEn)) + pSfcTc + _href.substr(_href.indexOf(pSfcEn)+4);
	}else if(isEng()){
		_href = _href.substr(0,_no) + kanhanDomain + _href.substr(_no); 
		_href = _href.substr(0, _href.indexOf(pNotesEng)) + pNotesChi + _href.substr(_href.indexOf(pNotesEng)+5);
	}

	if(_href != "#"){
		if (_href.indexOf(pAdvsearch) > 0){
			if (pSfcTxt == 0){
				_href = "http://"+kanhanDomain+realDomainName.replace(kanhanDomain,"")+appName+"/html/TC/inutilbar/advsearch/disclaimer.html"; 
			}else{
				_href = "http://"+kanhanDomain+realDomainName.replace(kanhanDomain,"")+appName+"/text/TC/inutilbar/advsearch/disclaimer.html"; 
			};
			_href = domainName+appName+"/jsp" +pSfcSc+"disclaimer.jsp?page=" + escape(_href); 
		}else{
			_href = domainName+appName+"/jsp" +pSfcSc+"disclaimer.jsp?page=" + escape(_href); 
		}
	}
	return _href;
}
function toEN(){
	var _link = getEnLink();
	document.location.href = _link;
}
function toTC(){
	var _link = getTcLink();
	document.location.href = _link;
}
function toAnotherLang(){ //for speeches & publications  -- speeches section
	var link = "";
	if(isEN()){
		link = getTcLink();
	}else{
		link = getEnLink();
	}	
	document.write("<br><span class=\"content\">" + misc_msg[15][lang] + "<a href=\""+link+"\" class=\"highlightcontent\">" + misc_msg[16][lang] +"</a>" + misc_msg[17][lang] + "</span><br>");	
}
function toAnotherLangPub(){//for speeches & publications -- publication section
	var link = "";
	if(isEN()){
		link = getTcLink();
	}else{
		link = getEnLink();
	}	
	document.write("<br><span class=\"content\">" + misc_msg[18][lang] + "<a href=\""+link+"\" class=\"highlightcontent\">" + misc_msg[16][lang] +"</a>" + misc_msg[17][lang] + "</span><br>");	

}
function isSC(){
	var _href = _curr_href;
	if( _href.indexOf(kanhanDomain) > 0){
		return true;
	}else{
		return false;
	}
}
function isEN(){
	var _href = _curr_href;
	if( _href.indexOf(pSfcEn) > 0){
		return true;
	}else{
		return false;
	}
}
function isEng(){
	var _href = _curr_href;
	if( _href.indexOf(pNotesEng) > 0){
		return true;
	}else{
		return false;
	}
}

function isTC(){
	var _href = _curr_href;
	if( _href.indexOf(pSfcTc) > 0){
		return true;
	}else{
		return false;
	}
}
function isChi(){
	var _href = _curr_href;
	if( _href.indexOf(pNotesChi) > 0){
		return true; 
	}else{
		return false;
	}
} 

// COOKIE

// utility bar - search button 
function goSearch() {
	if (isSC()) {		
		document.location.href = "http://"+kanhanDomain+realDomainName.replace(kanhanDomain,"")+appName+"/html/TC/inutilbar/advsearch/disclaimer.html"; 
	} else {
		document.location.href = domainName+appName+"/jsp"+langPath+"inutilbar/advsearch/advsearch.jsp";
	}
}


function changeInnerMenuPos() {
	
	var menuWidth = 172;
	var ericLogoWidth = 126;
	
	var args=changeInnerMenuPos.arguments;
	var nameinput = args[0];
	var corrX = args[1];
	var corrY = args[2];
	var calculateFrom = args[3];
	var menuName = new Array();
	var counter=0;
	var index=0;
	var winW = 0;
	var winH = 0;

	if(navigator.appName.indexOf("Microsoft")!=-1) {
		winW = document.body.offsetWidth;
		winH = document.body.offsetHeight;
	}else if(parseInt(navigator.appVersion)>3) {
		winW = window.innerWidth;
		winH = window.innerHeight;
	}
	
	
	
	//counter starts from 0, the first column	
	menuName[counter++] = "about";
	menuName[counter++] = "legislation";
	menuName[counter++] = "intermediaries";
	menuName[counter++] = "prospectuses";
	menuName[counter++] = "formslist";
	//6 or above, the second column
	menuName[counter++] = "general";
	menuName[counter++] = "speeches";
	menuName[counter++] = "papers";
	menuName[counter++] = "faq";
	menuName[counter++] = "events";
	
	index = getIndexArray(menuName, nameinput);
	
	//calculate X
	if(calculateFrom=="left") {
		var logoWidth = getProperty("logo", "offsetWidth");
		var firstNavWidth = getProperty("firstNav", "offsetWidth");
		var secNavWidth = getProperty("secNav", "offsetWidth");
		var languageWidth = getProperty("languages", "offsetWidth");
	
		if(index<5) {
			setProperty(nameinput, "style", "left", logoWidth-menuWidth+corrX);
		}else{
			setProperty(nameinput, "style", "left", logoWidth+1+firstNavWidth+1+secNavWidth+1+corrX);
		}
	}else{
		setProperty(nameinput, "style", "left", winW-menuWidth-ericLogoWidth+corrX);
	}
	
	//calculate Y
	if(calculateFrom=="left") {
		var maxMenuID = getIndexArray(menuName, nameinput)+1;
		var i=0;
		var totalHeight=0;
		if(maxMenuID<=5) {
			i=1;
		}else{
			i=6;
		}
		
		for (i;i<maxMenuID;i++) {		
			totalHeight += getProperty("menu_"+i, "offsetHeight")+6;
		}
		setProperty(nameinput, "style", "top", totalHeight+corrY);
	}else{
		setProperty(nameinput, "style", "top", corrY);
	}
	
}

 
 
//TOP MENU END

	//get Property by ID
	function getProperty(id, property) {
		return eval("document.getElementById(\""+id+"\""+")."+property);
	}
	
	//set Property by ID
	function setProperty(id, method, property, value) {
	
		//prevent error when method == null
		if(method==null||method=="") {
			method = "";
		}else{
			method += ".";
		}
	
		return eval("document.getElementById(\""+id+"\")."+method+property+"="+value);
		
	}
	//get index/key of array from content
	//integer key only!!!
	function getIndexArray(arrayname, content) {
		for(var i=0, max=arrayname.length-1;i<=max;i++) {
			if(arrayname[i]==content) {
				return i;
			}
		}
	}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) {
  	if ((obj=MM_findObj(args[i]))!=null) {
  		 v=args[i+2];
    	if (obj.style) {
    		 obj=obj.style;
    		  v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
    	}
    	obj.visibility=v; 
    }
  }    
}


function tdmouseover(el,tdcolor)
{
	if(_bro==1||_bro==2)
	{
		document.getElementById(el).style.color = "#535353";
		document.getElementById(el).style.backgroundColor = tdcolor;
		document.getElementById(el).style.cursor = "hand";
	}
	else
	{
		document.all[el].style.color = "#535353";
		document.all[el].style.backgroundColor = tdcolor;
		document.all[el].style.cursor = "hand";
	}
}

function tdmouseout(el)
{
	if(_bro==1||_bro==2)
	{
		document.getElementById(el).style.color = "#535353";
		document.getElementById(el).style.backgroundColor = "";
	}
	else
	{
		document.all[el].style.color = "#535353";
		document.all[el].style.backgroundColor = "";
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr;
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
  	 x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; 
  if(d.images){
  	 if(!d.MM_p)
  		d.MM_p=new Array();
    	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
    	for(i=0; i<a.length; i++){
    	   	if (a[i].indexOf("#")!=0){
    	   		 d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
    	   	}
    	}   	
    }
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  
  if(!d)
  	 d=document;
   if((p=n.indexOf("?"))>0&&parent.frames.length) {
    	d=parent.frames[n.substring(p+1)].document;
    	 n=n.substring(0,p);
    }
  if(!(x=d[n])&&d.all)
  	 x=d.all[n];
  for (i=0;!x&&i<d.forms.length;i++)
  	 x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
  	x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById)
  	 x=d.getElementById(n);
  return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; 
  document.MM_sr=new Array;
  for(i=0;i<(a.length-2);i+=3){
  	if ((x=MM_findObj(a[i]))!=null){
   		document.MM_sr[j++]=x;
   	 	if(!x.oSrc) x.oSrc=x.src;
   	 	 	x.src=a[i+2];
   	}
  } 	
}

// FOR SIDEMENU

 
function getTDBGColor(myMenuId) {
	if (myMenuId==MenuId){
		if (getSection() == pAboutsfc) {
			return (" bgcolor='#3DB4D1' ");
		}else if (getSection() == pLegislation) {
			return (" bgcolor='#F2C100' ");
		}else if (getSection() == pIntermediaries) {
			return (" bgcolor='#00ABAB' ");
		}else if (getSection() == pCfd) {
			return (" bgcolor='#FF9900' ");
		}else if (getSection() == pForms) {
			return (" bgcolor='#999999' ");
		}else if (getSection() == pGeneral) {
			return (" bgcolor='#E05A5A' ");
		}else if (getSection() == pSpeeches ) {
			return (" bgcolor='#CC9155' ");
		}else if (getSection() == pResearch) {
			return (" bgcolor='#A186BE' ");
		}else if (getSection() == pFaqs) {
			return (" bgcolor='#9FA400' ");
		}else if (getSection() == pContingencyInfo) {
			return (" bgcolor='#008F8F' ");
		}else if (getSection() == pEvents) {
			return (" bgcolor='#50C050' ");
		}
	}	
	else{
		return(" ");
	}	
}

function getLvIcon(myMenuId) {
	if (myMenuId==MenuId)
		return "_over";
	else
		return "";
}

function getLinkClass(myMenuId) { 
	if (myMenuId==MenuId){
//		return " class='highlightnav' ";
		return " class='highlightnavsidebar' ";
	}	
	else{
//		return " class='nav' ";
		return " class='navsidebar' ";
	}	
}

function show_hide(the_id) {
	var obj = (dom)? document.getElementById(the_id): document.all[the_id];

	if(obj.style.visibility == "hidden") {
		obj.style.visibility = "visible";
		obj.style.display = "block"; // If this looks wrong, try 'inline'
	} else { // hide
		obj.style.visibility = "hidden";
		obj.style.display = "none";
	}
}

// EMAIL TO FRIEND
function emailAFriend() {
	var winEF = window.open("mailto:?body="+ emailFriendBody[0][lang] + "%0A%0A" + escape (window.location.href)+ "%0A%0A" + "&subject="+ emailFriendSubject[0][lang] + "%0A%0A");  
	//window.location = "mailto:?subject="+ emailFriendSubject[0][lang] +"&body="+ emailFriendBody[0][lang] + escape("\n\n") + escape(window.location.href);
}

// PRINTER FRIENDLY 
function PrinterFriendlyPage(printPath, printLastUpdateDate) {
	var winFP;
	var _http= (printPath.indexOf("https")==0) ? "https" : "http";
	if (printPath.indexOf("#")!=-1){
			printPath = printPath.substring(0,printPath.indexOf("#"));
	}
	if (isSC()) {
		printPath = escape(_http) + "://" + printPath.substring(printPath.indexOf(kanhanDomain)+kanhanDomain.length);
		winFP = window.open (_http + "://" + kanhanDomain + realDomainName+appName+"/jsp/print.jsp?path="+printPath+"&lastUpdateDate="+printLastUpdateDate, "", "width=700, height=640, scrollbars=yes");
	} else {
		winFP = window.open (_http + "://" + realDomainName+appName+"/jsp/print.jsp?path="+printPath+"&lastUpdateDate="+printLastUpdateDate, "", "width=700, height=640, scrollbars=yes");
	}
	
}


// TO EIRC website
function toeIRC(htmlPath) {
	var eIRCWin = window.open(eircDomain+investedLangPath+"html/"+htmlPath);
}

function toeIRCDoc(path){
	var eIRCWindoc = window.open(eircDomain+"/doc"+path);
}

function toNotes(htmlPath){
	var _href;
	_href = notesDomainName + htmlPath;
	document.location.href = _href;
}
function toNotesPop(htmlPath){
	var _href;
	_href = notesDomainName + htmlPath;
	window.open(_href);
}
	
// TO SFC UPDATE ALERT
function sfcUpdateAlert() {
	var _href;
  _href = domainName + sfcUpdateAlertLink + langPath + "update_alert.jsp" ;
	document.location.href = _href;
}
// TO Regulatory Handbook
function toRegulatoryHandbook(htmlPath){
	var _href;
	_href = domainName+sfcRegulatoryHandbookappName + htmlPath;
	document.location.href = _href;
}
// TO CO Prospectus
function toCOPro(htmlPath){
	var _href;
	_href = domainName+sfcCOProappName + htmlPath;
	document.location.href = _href;
}
// TO CO Prospectus Popup
function toCOProPop(htmlPath){
	var _href;
	_href = domainName+sfcCOProappName + htmlPath;
	window.open(_href);
}

// ADVANCE SEARCH
function isDate(year, month, day) {
    if ((month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) && (day > 31))
    	return false;
    else if ((month == 4 || month == 6 || month == 9 || month == 11) && day > 30)
    	return false;
    else if (month == 2) {
    	if ((isLeapYear(year) && day > 29) || (!isLeapYear(year) && day > 28))
    	    return false;
    }
    return true;
}

function compareDate(year1, month1, day1, year2, month2, day2) {
    var date1 = new Date(year1, month1, day1);
    var date2 = new Date(year2, month2, day2);
    if (date1 > date2)
	return -1;
    else if (date1 == date2)
	return 0;
    else
	return 1;
}

function resetSearch() {
	document.advSearchForm.reset();
}
// BRIEFCASE
function errorHandler(e,f,l){
	return true; 
}

function setTreeLink(node, parentFolder, link, fGenLink){
	var genTag, myNode, pLink, rtval;		
	if (node[0]==''+MenuId+''){
			genTag = link + genTreeLinkTag(parentFolder, node[2], node[1], fGenLink, "false", node[3]);
			return genTag;
	}
	
	for (var i = 0 ; i < node.length; i++){	
		if  ( node.length == 4){
			return "false";	
		}
		if (i > 3){
				var tmpParentFolder;
				if ( node[0]==''+ "1" +''){
					tmpParentFolder = parentFolder; // sfc\EN
					pLink = genTreeLinkTag (tmpParentFolder , "" , node[1].toString(), fGenLink , "true", node[3].toString());
				}else{
					tmpParentFolder = parentFolder + node[2].toString(); // sfc\ EN + ex: \aboutsfc	
					pLink =  link + genTreeLinkTag(parentFolder, node[2].toString(), node[1].toString(), fGenLink ,"false" ,node[3].toString());
				}	
		
				rtVal = setTreeLink(node[i], tmpParentFolder, pLink, fGenLink);
				if (rtVal !="false"){
					return  rtVal;
				}
				
		}		
	}	
	return "false";
}

function genTreeLinkTag( parentFolder, folderName , enName, fGenLink, fHome, extURL){

	var link; 
	
	if (fGenLink == "true"){
		if (fHome=="true"){
			link= " <a href=\"" + parentFolder + "\" class=\"treelink\">" + enName + "</a> ";
		}else{
			link= " > <a href=\"" + parentFolder + folderName + folderName + ".html" + "\" class=\"treelink\">" + enName + "</a> ";
		}	
		if (extURL.length > 0 ){
			if (fHome=="true"){		
				link= "<a href=\"" + extURL + "\" class=\"treelink\">" + enName + "</a> ";
			}else{
				link= " > <a href=\"" + extURL + "\" class=\"treelink\">" + enName + "</a> ";
			}	
			return link;
		}		
	}else{
		if (fHome=="true"){
			link = enName ;
		}else	{
			link = " > "+ enName ;
		}
	}	
	return link;
}



function getBold(level, text){
	if (level == 0){
		return "<b>" + text + "</b>";
	}else{
		return text;
	}
}


function setSideMenu(){    
	for (var ir=0; ir<tocTab.length; ir++) {
		toDisplay[ir] = tocTab[ir][0].split(".").length==1;
	}
}
function reDisplay(tocChange) {	
// Input parameters:
	
// tocChange:  the ToC. 0 = Not expand its child level element , 1 =  Expand its child level element
	
	var isOnPath;
	var thisNumber;
	var thisNumArray;
	var thisLevel;
	var html;
	var currentNumber;
	
	for (i=1; i<tocTab.length; i++) {
		if( tocTab[i][3] == ''+MenuId+''){
			currentNumber = tocTab[i][0];
		}		
	}	

	var currentNumArray = currentNumber.split(".");
	var currentLevel = currentNumArray.length-1;

	var currentIndex = null;
	for (i=0; i<tocTab.length; i++) {
		if (tocTab[i][0] == currentNumber) {
			currentIndex = i;
			break;
		}
	}

	if (currentIndex == null) return false;

	for (i=1; i<tocTab.length; i++) {
		
		if (tocChange) {
			thisNumber = tocTab[i][0];
			thisNumArray = thisNumber.split(".");
			
			thisLevel = thisNumArray.length-1;
			isOnPath = true;
			if (thisLevel > 0) {
				for (j=0; j<thisLevel; j++) {
					isOnPath = (j>currentLevel) ? false : isOnPath && (thisNumArray[j] == currentNumArray[j]);
				}
			} 
			
			if (isOnPath == false ){
				
			}else{	
				toDisplay[i] = (tocChange == 1) ? isOnPath : (isOnPath || toDisplay[i]);
			}	

			if (thisNumber.indexOf(currentNumber+".")==0 && thisLevel > currentLevel) { 		
					toDisplay[i] = (thisLevel == currentLevel + 1); 
			}
		}
	} 

	html ="";

	var i=0;
	for (i=1; i<tocTab.length; i++) {
		if (toDisplay[i]) {
			thisNumber = tocTab[i][0];
			thisNumArray = thisNumber.split(".");
			thisLevel = thisNumArray.length-1;
			var level = thisNumArray.length ;
			var levelWidth = "";
			var imageHeight = "" ; 
			var imageWidth = "" ; 
			
			if (thisNumArray.length==1 ){
				levelWidth = "6";
				imageWidth = "11" ; 
				imageHeight = "6";
			}else if (thisNumArray.length==2 ){
				levelWidth = "22";
				imageWidth = "5" ; 
				imageHeight = "5";
			}else if (thisNumArray.length==3 ){
				levelWidth = "32";
				imageWidth = "4" ; 
				imageHeight = "7";
			}else if (thisNumArray.length==4 ){
				levelWidth = "40";
				imageWidth = "6" ; 
				imageHeight = "1";
			}

			var target = "";

			if (tocTab[i][4] == true)
				target = "target=\"_blank\"";
			if(i == 1){
					html +="<table id=\"insidemenu\" class=\"sidemenutable\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"100%\">\n"
				+"<tr>\n"
					+"<td style=\"background:url('"+"//"+realDomainName+appName+"/image/EN"+getSection()+"/bg.gif') repeat-y right;\" valign=\"top\">\n"
					+"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"background:url('"+"//"+realDomainName+appName+"/image/EN"+ getSection ()+"/top_bg.gif') no-repeat top right;\">\n"
				+"	<tr>\n"
				+"		<td><img src=\""+"//"+realDomainName+appName+"/image/EN/spacer.gif\" width=\"1\" height=\"5\" alt=\"\" border=\"0\"></td>\n"
				+"	</tr>\n"
				+"	<tr>\n"
				+"		<td>\n"
				+"			<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n"
				+"				<tr>\n"
				+"					<td width=\"" + levelWidth + "\"" + getTDBGColor(tocTab[i][3])+ " ><img src=\""+"//"+realDomainName+appName+"/image/EN/spacer.gif\" width=\"6\" height=\"1\" alt=\"\" border=\"0\"></td>\n"
				+"					<td width=\"11\" "+ getTDBGColor(tocTab[i][3])  +" valign=\"top\">"
				+"<img src=\""+"//"+realDomainName+appName+"/image/EN/icon_level" +level + getLvIcon(tocTab[i][3]) +".gif\" width=\""+imageWidth+"\" height=\""+imageHeight+"\" alt=\"\" border=\"0\" vspace=\"6\">"
				+"</td>\n" 
				+"					<td " + getTDBGColor(tocTab[i][3])+ "width=\"6\"><img src=\""+"//"+realDomainName+appName+"/image/EN/spacer.gif\" width=\"6\" height=\"1\" alt=\"\" border=\"0\"></td>\n"
				+"					<td " + getTDBGColor(tocTab[i][3]) + ">"
				+"<a href=\"" + tocTab[i][2] + "\"" + getLinkClass(tocTab[i][3]) +  "  " +  target + "  > " + ((showNumbers)?(thisNumber+" "):"") + getBold(thisLevel, tocTab[i][1]) +"</a></td>\n"
				+"</td>\n"
				+"					<td width=\"1\"><img src=\""+"//"+realDomainName+appName+"/image/EN/spacer.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\"></td>\n"
				+"				</tr>\n"
				+"			</table>\n"
				+"		</td>\n"
				+"	</tr>\n"
				+"	<tr>\n"
				+"		<td><img src=\""+"//"+realDomainName+appName+"/image/EN/spacer.gif\" width=\"1\" height=\"5\" alt=\"\" border=\"0\"></td>\n"
				+"	</tr>\n"
				+"	<tr>\n" 
				+"	<td style=\"background:url('"+"//"+realDomainName+appName+"/image/EN"+getSection()+"/dash.gif') repeat-x;\" height=\"1\"><img src=\""+"//"+realDomainName+appName+"/image/EN/spacer.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\"></td>\n"
				+"	</tr>\n"
				+"</table>\n"
				+ "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"\n"  +"style=\"background:url('"+"//"+realDomainName+appName+"/image/EN"+getSection()+"/bg.gif') repeat-y right;\">\n";
			}else{
				html +=	"<tr>\n"
				+"	<td><img src=\""+"//"+realDomainName+appName+"/image/EN/spacer.gif\" width=\"1\" height=\"5\" alt=\"\" border=\"0\"></td>\n"  
				+"</tr>\n"
				+"<tr>\n"
				+"	<td>\n"
				+"		<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n"
				+"			<tr>\n"
				+"				<td "+getTDBGColor(tocTab[i][3])+" width=\""+ levelWidth +"\"><img src=\""+"//"+realDomainName+appName+"/image/EN/spacer.gif\" width=\"6\" height=\"1\" alt=\"\" border=\"0\"></td>\n"
				+"				<td "+getTDBGColor(tocTab[i][3])+" width=\"11\" valign=\"top\">"
				+"<img src=\""+"//"+realDomainName+appName+"/image/EN/icon_level" + level + getLvIcon(tocTab[i][3])+".gif\" width=\""+imageWidth+"\" height=\""+imageHeight+"\" alt=\"\" border=\"0\" vspace=\"6\">"
				+"</td>\n"
				+"				<td "+getTDBGColor(tocTab[i][3])+" width=\"6\"><img src=\""+"//"+realDomainName+appName+"/image/EN/spacer.gif\" width=\"6\" height=\"1\" alt=\"\" border=\"0\"></td>\n"
					+"				<td "+getTDBGColor(tocTab[i][3])+">"
				+"<a href=\"" + tocTab[i][2] + "\"" + getLinkClass(tocTab[i][3])+ "  " +  target + "  >" + ((showNumbers)?(thisNumber+" "):"") + getBold(thisLevel, tocTab[i][1]) +"</a></td>\n"
				+"				<td width=\"1\"><img src=\""+"//"+realDomainName+appName+"/image/EN/spacer.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\"></td>\n"
				+"			</tr>\n"
				+"		</table>\n"
				+"	</td>\n"
				+"</tr>\n"
				+"<tr>\n"
				+"	<td><img src=\""+"//"+realDomainName+appName+"/image/EN/spacer.gif\" width=\"1\" height=\"5\" alt=\"\" border=\"0\"></td>\n"
				+"</tr>\n"
				+"<tr>\n"  
					+"	<td  style=\"background:url('"+"//"+realDomainName+appName+"/image/EN"+getSection()+"/dash.gif') repeat-x;\"><img src=\""+"//"+realDomainName+appName+"/image/EN/spacer.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\"></td>\n"
				+"</tr>";
			}	
		}
	} 
	
	html += "</table>" +"</tr>" +"</td>" +	"</table>";
			 
	
	document.write(html);
}
//last update date
function getLastModifiedDate(){
		
	var lastmod = document.lastModified     // get string of last modified date
	var lastmoddate = Date.parse(lastmod)   // convert modified string to date
	var date  = new Date(lastmoddate);
	var sDate = "";
	var year,month,day;
	
	if(isEng() || isChi()){ //notes case
		sDate = "";
	}else if (lastmoddate == 0) {        
		sDate = "";
	} else {	
		year =  date.getFullYear();
		month = date.getMonth();
		day = date.getDate();
		if(isEN()){					
			sDate = day + " " + pMonth[month] + " " + year;	
		}else{
			month =month+1;	
			sDate = year+pChiYear +month+ pChiMonth + day + pChiDay;	
		}
	  }
	 return sDate;
}
//infobar 
function infobarGetText(pText){
	var _href = _curr_href;
	
	//bold text 
	if(_href.indexOf(pIntermediariesHtml) > 0  ){
		if(pText == infobar_msg[1][0] || pText == infobar_msg[1][1] ){
				return setBold(pText);
		}		
	}
	if(_href.indexOf(pInvestorsHtml) > 0  ){
		if(pText == infobar_msg[2][0]   || pText == infobar_msg[2][1]  ){
				return setBold(pText);
		}		
	}
	if(_href.indexOf(pComplianceHtml) > 0  ){
		if(pText == infobar_msg[3][0]   || pText == infobar_msg[3][1] ){
				return setBold(pText);
		}		
	}
	if(_href.indexOf(pIssuersHtml) > 0  ){
		if(pText  ==  infobar_msg[4][0] || pText  == infobar_msg[4][1] ){
				return setBold(pText);
		}		
	}
	if(_href.indexOf(pRegulatorsHtml) > 0  ){
		if(pText  == infobar_msg[5][0]  || pText  == infobar_msg[5][1] ){
				return setBold(pText);
		}		
	}
	if(_href.indexOf(pAcademicsHtml) > 0  ){
		if(pText  ==  infobar_msg[6][0]  || pText  == infobar_msg[6][1] ){
				return setBold(pText);
		}		
	}
	if(_href.indexOf(pMediaHtml) > 0  ){
		if(pText  == infobar_msg[7][0] || pText  == infobar_msg[7][1] ){
				return setBold(pText);
		}		
	}
	return pText;
}
function setBold(pText){
	return "<b class='info_for_highlight'>" + pText + "</b>";
}
//briefcase function
function getexpirydate(nodays){
	var Today = new Date();
	var nomilli=Date.parse(Today);
	Today.setTime(nomilli+nodays*24*60*60*1000);
	var	UTCstring = Today.toUTCString();
	return UTCstring;
}
function setcookie(name,value,duration){
	var cookiestring=name+"="+escape(value)+";EXPIRES="+getexpirydate(duration)+";path=/" + ";domain=" +cookieDomain+";"; 
	document.cookie=cookiestring;
}
function getCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0){
	  		return null;
	 	}
	} else { 
		begin += 2;
	}
	var end = document.cookie.indexOf(";", begin);
	if (end == -1){
		end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}
function getBriefCaseCookie(){
	var cname="briefcase";
	var	value = getCookie(cname);
	if(value == null){
		value = "";
	}
	var briefcaseValue = value.split("|");
	return briefcaseValue;		
}
function removeBriefCaseCookie(id){
	if(confirm(misc_msg[14][lang])){
		var value = getBriefCaseCookie();
		var result = "";
		var len = value.length;
		for(i = 1 ; i < len ; i = i + 2){			
			if(i != id){
 				result += "|" + value[i] + "|" + value[i+1];
			}
		}
		var name = "briefcase";
	 	setcookie(name,result,cookieDuration);
	 	history.go(0); 
 	} 
 }
 function isBriefcaseCookieFull(pNewVariable){
	var name = "briefcase";
	var temp = getCookie(name);
	if(temp == null)
		temp="";
	temp=escape(temp);
	var _pNewVariable = escape(pNewVariable);
	if( (temp.length + _pNewVariable.length)> briefcaseLimit){
		return true;
	}else{
		return false; 
	}
}
function updateBriefCaseCookie(id,pageName){
	if ( isBriefcaseCookieFull(pageName) ){
		alert(misc_msg[3][lang]);
	}else{
		var	value = getBriefCaseCookie();
		var	result = "";
		var	len = value.length;
	 	var	text = "";
			for(i = 1 ; i < len ; i = i + 2){			
				text += value[i] + "|" + value[i+1]; 
				if(i != id){
					result += "|" + value[i] + "|" + value[i+1];
				}else{
					result += "|" + pageName + "|" + value[i+1];
				}
			}
		var name = "briefcase";
		setcookie(name,result,cookieDuration);
	}
}
function setEditBriefcaseFormTitle(){ 
	document.myForm.pageName.value = window.opener.document.myForm.pageName.value;		  
} 
function updateBriefcase(){   
	var	pageId = window.opener.document.myForm.pageId.value;	  
	var pageName = document.myForm.pageName.value;
	updateBriefCaseCookie(pageId,pageName);   
	window.opener.history.go(0);
	window.close();	
} 
//
function addBriefcase(){
	
	var location_detect = "";
	if(isSC()){	
	   location_detect = pSfcSc;	
	}else if(isEN() || isEng()){ 
	    location_detect = pSfcEn;
	}else if (isTC() || isChi()){	
	    location_detect = pSfcTc;
	}
	
	addBreifCaseCookie(document.myForm.pageName.value,document.myForm.parentLocation.value); 
	var path  = domainName + appName + "/html/inutilbar/briefcase/myBriefcase.html?lang=" +location_detect;	
	winBCase  = window.open(path, "MyBriefcase", "height=400,width=500,resizable=no,scrollbars=yes,staus=no");		
	winBCase.opener = window.opener;//allow my briefcase to change the location of SFC website
	winBCase.focus();
	window.close();
}
function addBreifCaseCookie(pageName,pagePath){
	if(isBriefcaseCookieFull(pageName+pagePath)){
	 	alert(misc_msg[3][lang]);
	}else{
		var name="briefcase";
		var briefcase = getBriefCaseCookie();		
		var result = "";
		var cookiestring = "";
		var isExisting = false;
		var len = briefcase.length;
		 for(i = 1 ; i < len ; i = i + 2){		
			if(briefcase[i+1] == pagePath ){
				isExisting = true; 
				result += "|" + pageName + "|" + pagePath;
			}else{
				result += "|" + briefcase[i] + "|" + briefcase[i+1];
			}
		}
		//if not existed in cookie
		if(!isExisting){
			result += "|" + pageName+ "|" + pagePath;
		}
		
		cookiestring=name+"="+escape(result)+";EXPIRES="+getexpirydate(cookieDuration)+";path=/"+ ";domain=" +cookieDomain+";"; 
		document.cookie=cookiestring;
	}
}
function getParameter(para){
	var _href = window.location.search;
	var end = "&";	
	var temp = _href.substr((_href.indexOf(para)+para.length+1),_href.length);
	if(temp.indexOf(end) != -1)
		temp = temp.substr(0,temp.indexOf(end));	
	return temp;
}
function isBriefcase(){
	if(MenuId == briefcaseMenuId){
		return true;
	}else{
		return false;	
	}
} 
function reloadParent(path){   
		if (window.opener && !window.opener.closed){ 			   
			window.opener.location=path;   
		}
	}  

function AddToBriefcase() {
	var pop = false;
	var path = "";
	var location_detect="";
	if(isSC()){	
	   location_detect = pSfcSc;	
	} else if(isEN() || isEng()){ 
	    location_detect = pSfcEn;
	}else if (isTC() || isChi()){	
	    location_detect = pSfcTc;
	}
	
	if (location_detect.length > 0) {
		if(!winBCaseAdd){
			pop = true;
		}else{	
			if(winBCaseAdd.closed){				 
				pop = true;
			}else{
				//if briefcase window is not the current language
				if ((winBCaseAdd.location.href).indexOf(location_detect) < 0)
				{
					winBCaseAdd.close();
					pop = true;		
				}
			}
		} 
		if(pop){			
		
			path  = domainName + appName + "/html/inutilbar/briefcase/addBriefcase.html?title="+escape(document.title)+"&path=" + escape(_curr_href)+"&lang=" +location_detect;
			winBCaseAdd  = window.open(path, "AddBriefcase", "height=170,width=400,resizable=no,scrollbars=no,staus=no");				
		}
	}
  winBCaseAdd.focus(); 
} 
function MyBriefcase() {	
	var location_detect = "";
	if(isSC()){	
	   location_detect = pSfcSc;	
	}else if(isEN() || isEng()){ 
	    location_detect = pSfcEn;
	}else if (isTC() || isChi()){	
	    location_detect = pSfcTc;
	}
	var pop = false;
		if(!winBCase){
			pop = true;
		}else{	
			if(winBCase.closed){
				pop = true;	
			}else{ 
				//if briefcase window is not the current language
				if ((winBCase.location.href).indexOf(location_detect) < 0)
				{
					winBCase.close();
					pop = true;		
				}
			}
		}
		if(pop){							
			path  = domainName + appName + "/html/inutilbar/briefcase/myBriefcase.html?lang=" +location_detect;
			winBCase  = window.open(path, "MyBriefcase", "height=400,width=500,resizable=no,scrollbars=yes,staus=no");		
		} 
	winBCase.focus();	 
} 

// BROWSER DETECT
// _bro: 1=NN6+, 2=NN4, 3=IE, 4=Opera, 0=others 
_bro=(window.opera?4:(document.all?3:(document.getElementById?1:(document.layers?2:0))));

// Do we use DOM or not? 
dom = (document.getElementById && !document.all)? 1: 0;

style = getCookie("style");

if(style == null){
	style="styles";
} 
// GETTING THE CORRESPONDING LANG FILES
var Section = getSection();
	if (isSC()){
		lang = pSfcTcId;
		langImgPath = pSfcSc; 			
		langPath = pSfcTc; // should be in traditional chinese, for kanhan translation
		investedLangPath = "/sc/";
	} else if ((isTC()) || (isChi())) { 
		lang = pSfcTcId;	
		langImgPath = pSfcTc; 	
		langPath = pSfcTc;
		investedLangPath = "/tc/";
	} else if ((isEN()) || (isEng())) {	
		lang = pSfcEnId; 
		langImgPath = pSfcEn; 	
		langPath = pSfcEn;
		investedLangPath = "/en/";
	} 

//setting eIRC domain
	if(isSC()){
		eircDomain	 = escape("http") + "://" + eIRCkanhanDomain + eircDomain;		
	}else {
		eircDomain	 = escape("http") + "://" + eircDomain;
	}
	document.write("<script src=\""+"//"+realDomainName+appName+"/javascript/treeLinkPara.js\"></script>"); 
	if (isSC()) {
		if (pSfcTxt==0) {	
		document.write("<link href=\""+"//"+realDomainName+appName+"/css/SC/main_nav.css\" rel=\"stylesheet\" type=\"text/css\">");
		if(Section == pHompage){
			document.write("<link href=\""+"//"+realDomainName+appName+"/css/SC/home.css\" rel=\"stylesheet\" type=\"text/css\">");
		}else{
			document.write("<link href=\""+"//"+realDomainName+appName+"/css/SC"+Section+"/" + style + ".css\" rel=\"stylesheet\" type=\"text/css\">");
		}
		} else {
			document.write("<link href=\""+"//"+realDomainName+appName+"/css/SC/text_styles.css\" rel=\"stylesheet\" type=\"text/css\">");		
		}
	} else if ((isEN()) || (isEng())) { 			
		if (pSfcTxt==0) {	
		document.write("<link href=\""+"//"+realDomainName+appName+"/css/EN/main_nav.css\" rel=\"stylesheet\" type=\"text/css\">");
		if(Section == pHompage){
			document.write("<link href=\""+"//"+realDomainName+appName+"/css/EN/home.css\" rel=\"stylesheet\" type=\"text/css\">");
		}else{
			document.write("<link href=\""+"//"+realDomainName+appName+"/css/EN"+Section+"/" + style + ".css\" rel=\"stylesheet\" type=\"text/css\">");
		}
		} else {
			document.write("<link href=\""+"//"+realDomainName+appName+"/css/EN/text_styles.css\" rel=\"stylesheet\" type=\"text/css\">");
		}
	} else if ((isTC()) || (isChi())) {
		if (pSfcTxt==0) { 
		document.write("<link href=\""+"//"+realDomainName+appName+"/css/TC/main_nav.css\" rel=\"stylesheet\" type=\"text/css\">");
		if(Section == pHompage){
			document.write("<link href=\""+"//"+realDomainName+appName+"/css/TC/home.css\" rel=\"stylesheet\" type=\"text/css\">");
		}else{
			document.write("<link href=\""+"//"+realDomainName+appName+"/css/TC"+Section+"/" + style + ".css\" rel=\"stylesheet\" type=\"text/css\">");
			}
		} else {
			document.write("<link href=\""+"//"+realDomainName+appName+"/css/TC/text_styles.css\" rel=\"stylesheet\" type=\"text/css\">");
		}
	}
	
function openSFCmap(){
	var mapWin = window.open(domainName+appName+"/image/sfc_location_map.jpg", "", "scrollbars=no,menubar=no,width=515,height=520,left=0,top=0");
	mapWin.focus;
}

// For the disclaimer to enter text version
function toEnTxt() {
	var w = 620;
	var h = 200;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	var winDisclaimer = window.open(domainName.replace(kanhanDomain,"")+appName+"/text/EN/disclaimer/disclaimer_text.html", "Disclaimer", "height=" + h + " ,width=" + w + ",top=" + wint + ",left=" + winl + ",resizable=no,scrollbars=no,staus=no");	
	winDisclaimer.focus();
}

function getEnTxtLink() {
	window.opener.location = domainName.replace(kanhanDomain,"")+appName+"/text/EN/aboutsfc/intro/intro.html";
	opener.focus();
	window.close();
}

function toTcTxt() {
	var w = 620;
	var h = 200;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	var winDisclaimer = window.open(domainName.replace(kanhanDomain,"")+appName+"/text/TC/disclaimer/disclaimer_text.html", "Disclaimer", "height=" + h + " ,width=" + w + ",top=" + wint + ",left=" + winl + ",resizable=no,scrollbars=no,staus=no");
	winDisclaimer.focus();
}

function getTcTxtLink() {
	window.opener.location = domainName.replace(kanhanDomain,"")+appName+"/text/TC/aboutsfc/intro/intro.html";
	opener.focus();
	window.close();
}

function toScTxt() {
	var w = 620;
	var h = 200;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	var winDisclaimer;
	if(isSC())
		winDisclaimer = window.open(domainName+appName+"/text/SC/disclaimer/disclaimer_text.html", "Disclaimer", "height=" + h + " ,width=" + w + ",top=" + wint + ",left=" + winl + ",resizable=no,scrollbars=no,staus=no");
	else
		winDisclaimer = window.open("http://"+kanhanDomain+realDomainName.replace(kanhanDomain,"")+appName+"/text/SC/disclaimer/disclaimer_text.html", "Disclaimer", "height=" + h + " ,width=" + w + ",top=" + wint + ",left=" + winl + ",resizable=no,scrollbars=no,staus=no");
	winDisclaimer.focus();
}

function getScTxtLink() {
	window.opener.location = domainName.replace(kanhanDomain,"")+appName+"/jsp"+pSfcSc+"disclaimer.jsp?page=http://"+domainName.replace(kanhanDomain,"").substr(7)+appName+"/text/TC/aboutsfc/intro/intro.html";
	opener.focus();
	window.close();
}

function setTableAltRowColor(id){ 
 if(document.getElementsByTagName){  
   var table = document.getElementById(id);   
   if (table == null) return;
   var rows = table.getElementsByTagName("tr");   
   if (rows == null) return;
   for(i = 1; i < rows.length; i++){           
     if(i % 2 == 0){ 
       rows[i].className = "tddark"; 
     }else{ 
       rows[i].className = "tdlight"; 
     }       
   } 
 } 
}	 


function sfcFindPos(obj) {
    var curleft = curtop = 0;
    if (obj.offsetParent) {
        curleft = obj.offsetLeft
        curtop = obj.offsetTop
        while (obj = obj.offsetParent) {
            curleft += obj.offsetLeft
            curtop += obj.offsetTop
        }
    }
    return([curleft,curtop]);
}

function sfcMoveEle(srcID, targetId, offsetArr) {
	var element = document.getElementById(srcID);
	var xy = sfcFindPos(element);
	var targetElement = document.getElementById(targetId)
	targetElement.style.left= xy[0] + offsetArr[0];
	targetElement.style.top= xy[1] + offsetArr[1];
	
}