﻿function killErrors() {return true;}
window.onerror = killErrors;

//百度头部统计代码
var _bdhm_top = 0;
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
var _bdhm_tim = new Image(1,1);
_bdhm_tim.id = "bdhmPerimg";
_bdhm_tim.src = _bdhmProtocol + "hm.baidu.com/_tt.gif?si=2ccc2826b445aebac6f6b3f8013e7931&rnd=" + Math.round(Math.random()*2147483647);
_bdhm_tim.onload=function(){_bdhm_top = 1;}

//底部  统计代码
function showfooter(){
document.writeln("<div style='margin-top:-18px;color:red'>")

//var locationUrl = escape(document.location.href);     document.write(unescape("%3Cscript")+" charset='utf-8' src='http://union.rising.com.cn//InfoManage/TrojanInspect.aspx?p1=W3MxAhp6gJ6SJIKHiUWJ9boDVTWHxk4L-K7c2I/4SV0=&p2=dKpHzuSTpgA=&p3=W3MxAhp6gJ6SJIKHiUWJ9RabADXsyfV8&url="+ locationUrl  + "' type='text/javascript'"+unescape("%3E%3C/script%3E"));
//百度
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F2ccc2826b445aebac6f6b3f8013e7931' type='text/javascript'%3E%3C/script%3E"));
//谷歌
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {var pageTracker = _gat._getTracker("UA-8419362-1");pageTracker._trackPageview();} catch(err) {};
document.writeln("特别申明：本站资讯源自香港注册署，香港税务局或深圳工商局，仅供参考查阅，并不用于牟利，如有需要请登陆相关政府官方网站.")
document.writeln("<br/><script language=\"javascript\" type=\"text\/javascript\" src=\"http:\/\/s33.cnzz.com\/stat.php?id=1091429&amp;web_id=1091429&amp;show=pic1\"><\/script>");
document.writeln("</div>")
} 


function ValidateTextboxAdd(box, button){var buttonCtrl = document.getElementById( button );if ( buttonCtrl != null ){if (box.value == "" || box.value == box.Helptext){buttonCtrl.disabled = true;}else{buttonCtrl.disabled = false;}}}

//++++++++++++++++++++++++++++++++++经理直通车 短信
function showztcback(){
var form = ""
+ "<input  class='HJSearchinput' name='phone' id='phone'  type='text' />";
new xWin('msgboxsms','icoIfo','请输入您的联系电话：',form,'确 定','Ajaxztcback()','取 消');}
function Ajaxztcback(){ 
var telNo=document.getElementById('phone').value;
var tre_Note_Content='请回电至'+telNo+',信息来自经理直通车.'
if (telNo==""){alert("请填写您的联系电话!");return false;}
//var loading="<div id='loading'><div class='loading-indicator'><img src='http://www.highkin.com.cn/ext/icons/extanim32.gif' alt='' style='margin-right:8px;float:left;vertical-align:top;'/>宏勤经理直通车 - <a href='http://www.highkin.com'>www.highkin.com</a><br /><span id='loading-msg'>正在处理您的请求请您稍候...</span></div></div>"
//document.getElementById('SendOK').innerHTML =loading;
Ajax_CallBack(false,'SendOK','Send.asp?cmd=sendsms&telNo=13662287945&tre_Note_Content='+escape(tre_Note_Content));
document.getElementById("msgboxsms").style.display="none";	
alert ('指令已发送,我们尽快与您取得联系!');
document.getElementById("navmask").style.display="none";	
}


function externallinks() { 
if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName("a"); 
for (var i=0; i<anchors.length; i++) {var anchor = anchors[i]; 
if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";} } 
window.onload = externallinks;


function getObject(objectId) {
if(document.getElementById && document.getElementById(objectId)){
return document.getElementById(objectId);
} else if (document.all && document.all(objectId)) {
return document.all(objectId);
} else if (document.layers && document.layers[objectId]) {
return document.layers[objectId];
} else {return false;}}


function showtab2(m,n,count){
for(var i=1;i<=count;i++){
if (i==n){getObject('tab_'+m+'_'+i).className='';}
else {getObject('tab_'+m+'_'+i).className='none';}}
var positiony=-(n-1)*28+"px";
getObject('tt'+m).style.backgroundPosition="0px "+positiony;
}

				
				
function CheckAll(form){for (var i=0;i<form.elements.length;i++){var e = form.elements[i];if (e.name != 'chkall' && e.type=="checkbox")e.checked = form.chkall.checked;}}
			
				
				
				
function Showlist(index,Max){
	for(var i=1;i<=Max;i++){
		document.getElementById("Listcentent"+i).style.display="none";
		document.getElementById("ListHeader"+i).className="icos IcoOpen";}
	document.getElementById("ListHeader"+index).className="icos IcoOpen";
	document.getElementById("Listcentent"+index).style.display="";}
			
			
				

	function fEvent(sType,oInput){
		switch (sType){
			case "focus" :
				oInput.isfocus = true;
				oInput.style.border= '1px solid #FB9605';
			case "blur" :
				oInput.isfocus = false;
				oInput.style.border= '1px solid #D7ECFD';
				break;}}

	function fEventbg(sType,oInput){
		switch (sType){
			case "focus" :
				oInput.isfocus = true;
		oInput.style.backgroundColor='#FEF8C7';
			case "mouseover" :
				break;
			case "blur" :
				oInput.isfocus = false;
				oInput.style.backgroundColor="#fff";
			case "mouseout" :
				if(!oInput.isfocus){
					//oInput.style.borderColor='#A1BCA3';
				}
				break;
		}
	}

function copyText(obj)   
{ 
var rng = document.body.createTextRange(); 
rng.moveToElementText(obj); 
rng.scrollIntoView(); 
rng.select(); 
rng.execCommand("Copy"); 
rng.collapse(false);
alert("复制成功!"); 
} 

		
				
				
function ShowPannel(btn){
	var idname = new String(btn.id);
	var s = idname.indexOf("_");
	var e = idname.lastIndexOf("_")+1;
	var tabName = idname.substr(0, s);
	var id = parseInt(idname.substr(e, 1));
	var tabNumber = btn.parentNode.childNodes.length;
	for(i=0;i<tabNumber;i++){
		document.getElementById(tabName+"_tab_"+i).style.display = "none";
		document.getElementById(tabName+"_btn_"+i).className = "";
	};
	document.getElementById(tabName+"_tab_"+id).style.display = "block";
	btn.className = "here";
}

function ContentSize(size){var obj=document.getElementById("size");obj.style.fontSize=size+"px";}
function copyText(obj) {var rng = document.body.createTextRange();rng.moveToElementText(obj);rng.scrollIntoView();rng.select();rng.execCommand("Copy");rng.collapse(false);}

var old='';var old_subject='';var old_box='';var old_icon='';
function ripp(name)
{ripple=eval("ripple_"+name+".style");subject=eval("subject_"+name+".style");box=eval("box_"+name+".style");icon=eval("faqico_"+name);
if(old!=ripple)
{if(old!=''){box.border='';old.display='none';old_subject.color='#666666';old_subject.fontWeight='normal';old_icon.src='/img/go_on.gif';}
ripple.display='block';subject.color='#000000';box.border='2px solid #FB9605';subject.fontWeight='bold';icon.src='/img/go_off.gif';
old=ripple;old_subject=subject;old_box=box;old_icon=icon;Ajax_CallBack(false,'q'+name,'/Loading.asp?cmd=UpdateFaqQuerycount&tablename=miscell&id='+name);}
else{ripple.display='none';subject.color='#666666';box.border='';subject.fontWeight='normal';icon.src='/img/go_on.gif';old='';}}

function getURL(url){if(url.indexOf("http://") == 0){window.open(url);}else{window.location = url;}}

function showheadertext(){
document.writeln('<a href="/business/business-1.html"><span class="red">调价通知:</span> 注册香港公司费用<span class="red">4200元</span>年审<span class="red">1800元</span></a>');
}

//滚动
function startmarquee(lh,speed,delay,index){ 
var t; 
var p=false; 
var o=document.getElementById("indextext"+index); 
o.innerHTML+=o.innerHTML; 
o.onmouseover=function(){p=true} 
o.onmouseout=function(){p=false} 
o.scrollTop = 0; 
function start(){ 
t=setInterval(scrolling,speed); 
if(!p) o.scrollTop += 2; 
} 
function scrolling(){ 
if(o.scrollTop%lh!=0){ 
o.scrollTop += 2; 
if(o.scrollTop>=o.scrollHeight/2) o.scrollTop = 0; 
}else{ 
clearInterval(t); 
setTimeout(start,delay); 
} 
} 
setTimeout(start,delay); 
} 




//navmenu
function getOffsetTop (el, p) {
    var _t = el.offsetTop;
    while (el = el.offsetParent) {
        if (el == p) break;
        _t += el.offsetTop;
    }

    return _t;
};
function getOffsetLeft (el, p) {
    var _l = el.offsetLeft;
    while (el = el.offsetParent) {
        if (el == p) break;
        _l += el.offsetLeft;
    }

    return _l;
};
var tt;
var curMenu;
function mouseover (th, menu) {
    if (tt) clearTimeout(tt);
    displayMenu(false);
    menu = document.getElementById('menu' + menu);

    menu.style.left = getOffsetLeft(th) + 'px';
    menu.style.top = getOffsetTop(th) + th.offsetHeight + 'px';

    curMenu = menu;
    displayMenu(true);
}
function mouseout () {
    tt = setTimeout('displayMenu(false)', 200);
}
function _mouseover () {
    if (tt) clearTimeout(tt);
    displayMenu(true);
}
function _mouseout () {
    displayMenu(false);
}
function displayMenu (display) {
    if (curMenu) {
        curMenu.style.display = display ? 'block' : 'none';
    }
}

Ext.onReady(function(){
	
	if(!Ext.getDom('hd')){
		return;
	}
	
	var activeMenu;
	
	function createMenu(name){
		var el = Ext.get(name+'-link');
		var tid = 0, menu, doc = Ext.getDoc();
		
		var handleOver = function(e, t){
			if(t != el.dom && t != menu.dom && !e.within(el) && !e.within(menu)){
				hideMenu();
			}	
		};
				
		var hideMenu = function(){
			if(menu){
				menu.hide();
				el.setStyle('text-decoration', '');
				doc.un('mouseover', handleOver);
				doc.un('mousedown', handleDown);
			}
		}
		
		var handleDown = function(e){
			if(!e.within(menu)){
				hideMenu();
			}
		}
		
		var showMenu = function(){
			clearTimeout(tid);
			tid = 0;
			
			if (!menu) {
				menu = new Ext.Layer({shadow:'sides',hideMode: 'display'}, name+'-menu');
			}
			menu.hideMenu = hideMenu;
				
			menu.el = el;
			if(activeMenu && menu != activeMenu){
				activeMenu.hideMenu();
			}
			activeMenu = menu;
			
			if (!menu.isVisible()) {
				menu.show();
				menu.alignTo(el, 'tl-bl?');
				menu.sync();
				el.setStyle('text-decoration', 'underline');
				
				doc.on('mouseover', handleOver, null, {buffer:150});
				doc.on('mousedown', handleDown);
			}
		}
		
		el.on('mouseover', function(e){
			if(!tid){
				tid = showMenu.defer(150);				
			}
		});
		
		el.on('mouseout', function(e){
			if(tid && !e.within(el, true)){
				clearTimeout(tid);
				tid = 0;				
			}
		});
	}
	
	createMenu('Business');
	createMenu('About');
	createMenu('HKREG');
	createMenu('SZREG');
	createMenu('BVIREG');
	createMenu('ENREG');
	createMenu('FAQ');
	createMenu('Brand');
	createMenu('Bank');
	createMenu('Article');
	
	// expanders
	Ext.getBody().on('click', function(e, t){
		t = Ext.get(t);
		e.stopEvent();
		
		var bd = t.next('div.expandable-body');
		bd.enableDisplayMode();
		var bdi = bd.first();
		var expanded = bd.isVisible();
		
		if(expanded){
			bd.hide();
		}else{
			bdi.hide();
			bd.show();
			bdi.slideIn('l', {duration:.2, stopFx: true, easing:'easeOut'});	
		}
		
		t.update(!expanded ? '<img src="/img/go_off.gif" alt="收缩栏目" class="simg"/>收缩栏目' : '<img src="/img/go_on.gif" alt="展开栏目" class="simg"/>展开栏目');
			
	}, null, {delegate:'a.expander'});
	
	var gs = Ext.get('gsearch-box');
	if(gs){
		gs.on('focus', function(){
			if(gs.getValue() == 'Search with google'){
				gs.dom.value = '';
				gs.up('div').addClass('gs-active');
			}
		});
		
		gs.on('blur', function(){
			if(gs.getValue() == ''){
				gs.dom.value = 'Search with google';
				gs.up('div').removeClass('gs-active');
			}
		});
		
		if(gs.getValue() == ''){
			gs.dom.value = 'Search with google';
		}
	}
	

});

