﻿// JavaScript Document
//对象函数
function getObject(objectId) {
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId);
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId);
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getObject
// JavaScript Document
//读取坐标函数
function getPosLeft(obj){ 
	var l = obj.offsetLeft; 
	while(obj = obj.offsetParent){ 
		l += obj.offsetLeft; 
	} 
	return l; 
}
function getPosTop(obj){ 
	var T = obj.offsetTop; 
	while(obj = obj.offsetParent){ 
		T += obj.offsetTop; 
	} 
	return T; 
}
function getMousey(){
	y=event.y+document.body.scrollTop;
	return y;
}
function getMousex(){
	x=event.x+document.body.scrollleft;
	return x;
}
// JavaScript Document
//语言选择菜单函数
function CaidanMulu_onmouseover(index){
	index.className="header_mainnavs";
	getObject("list_LanguageSelect").style.pixelTop=getPosTop(index)+21;
	getObject("list_LanguageSelect").style.pixelLeft=getPosLeft(index)+26;
	getObject("list_LanguageSelect").style.visibility='visible';
}
function CaidanMulu_onmouseout(index){
	index.className='header_mainnav';
	getObject("list_LanguageSelect").style.pixelTop=0;
	getObject("list_LanguageSelect").style.pixelLeft=0;
	getObject("list_LanguageSelect").style.visibility='hidden';
}
function addBookmark(title,url) {
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,""); 
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	}
}
function WriteHeanderMenu(){
	document.write('<div class="header_mainnav" onmousemove="CaidanMulu_onmouseover(this);" onmouseout="CaidanMulu_onmouseout(this);">Select Website');
	document.write('<div id="list_LanguageSelect">');
	document.write('<a href="/en/">Global</a>');
	document.write('<a href="/cn/">简 体 中 文</a>');
	document.write('<a href="http://biz.erke.com/big5/">繁 体 中 文</a>');
	document.write('<a href="http://www.chinahongxing.com.sg/" target="_blank">新加坡</a>');
	document.write('<a href="http://erkesports.nl/" target="_blank">Netherlands</a>');
	//document.write('<a href="http://erkesports.nl/" target="_blank">Netherlands</a>');
	//document.write('<a href="javascript:void(null);">España</a>');
	document.write('</div>');
	document.write('</div>');
}