﻿// JavaScript Document

//下拉菜单相关代码
 var h;
 var w;
 var l;
 var t;
 var topMar = 1;
 var leftMar = -2;
 var space = 1;
 var isvisible;
 var MENU_SHADOW_COLOR='#999999';//定义下拉菜单阴影色  #999999
 var global = window.document
 global.fo_currentMenu = null
 global.fo_shadows = new Array

function HideMenu() 
{
 var mX;
 var mY;
 var vDiv;
 var mDiv;
	if (isvisible == true)
{
		vDiv = document.all("menuDiv");
		mX = window.event.clientX + document.body.scrollLeft;
		mY = window.event.clientY + document.body.scrollTop;
		if ((mX < parseInt(vDiv.style.left)) || (mX > parseInt(vDiv.style.left)+vDiv.offsetWidth) || (mY < parseInt(vDiv.style.top)-h) || (mY > parseInt(vDiv.style.top)+vDiv.offsetHeight)){
			vDiv.style.visibility = "hidden";
			isvisible = false;
		}
}
}

function ShowMenu(vMnuCode,tWidth) {
	vSrc = window.event.srcElement;
	vMnuCode = "<table id='submenu' cellspacing=1 cellpadding=3 style='width:"+tWidth+"' class=tableborder1 onmouseout='HideMenu()'><tr height=23><td nowrap align=left class=tablebody1>" + vMnuCode + "</td></tr></table>";

	h = vSrc.offsetHeight;
	w = vSrc.offsetWidth;
	l = vSrc.offsetLeft + leftMar+4;
	t = vSrc.offsetTop + topMar + h + space-2;
	vParent = vSrc.offsetParent;
	while (vParent.tagName.toUpperCase() != "BODY")
	{
		l += vParent.offsetLeft;
		t += vParent.offsetTop;
		vParent = vParent.offsetParent;
	}

	menuDiv.innerHTML = vMnuCode;
	menuDiv.style.top = t;
	menuDiv.style.left = l;
	menuDiv.style.visibility = "visible";
	isvisible = true;
    makeRectangularDropShadow(submenu, MENU_SHADOW_COLOR, 4)
}

function makeRectangularDropShadow(el, color, size)
{
	var i;
	for (i=size; i>0; i--)
	{
		var rect = document.createElement('div');
		var rs = rect.style
		rs.position = 'absolute';
		rs.left = (el.style.posLeft + i) + 'px';
		rs.top = (el.style.posTop + i) + 'px';
		rs.width = el.offsetWidth + 'px';
		rs.height = el.offsetHeight + 'px';
		rs.zIndex = el.style.zIndex - i;
		rs.backgroundColor = color;
		var opacity = 1 - i / (i + 1);
		rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
		el.insertAdjacentElement('afterEnd', rect);
		global.fo_shadows[global.fo_shadows.length] = rect;
	}
}
//控制面板菜单
var controllist= '<a style=font-size:9pt;line-height:14pt; href=\"modifyuser1.asp\">修改个人资料</a><br><a style=font-size:9pt;line-height:14pt; href=\"changepw.asp\">修改密码</a><br><a style=font-size:9pt;line-height:14pt; href=\"managenews.asp\">信息管理</a><br><a  onclick="toquit()" style=font-size:9pt;line-height:14pt; href=\"\">安全退出</a>'

var controllist_en= '<a style=font-size:9pt;line-height:14pt; href=\"modifyuser1.asp\">Modify personal data</a><br><a style=font-size:9pt;line-height:14pt; href=\"changepw.asp\">Change Password</a><br><a style=font-size:9pt;line-height:14pt; href=\"managenews.asp\">Information Management</a><br><a onclick="toquit()" style=font-size:9pt;line-height:14pt; href=\"\">Quit</a>'

//控制面板菜单
var controllist1= '<a style=font-size:9pt;line-height:14pt; href=\"modifyuser1.asp\">修改个人资料</a><br><a style=font-size:9pt;line-height:14pt; href=\"changepw.asp\">修改密码</a><br><a style=font-size:9pt;line-height:14pt; href=\"managenews.asp\">信息管理</a><br><a style=font-size:9pt;line-height:14pt; href=\"picmanage.asp\">个人图片管理</a><br><a onclick="toquit()" style=font-size:9pt;line-height:14pt; href=\"\">安全退出</a>'

var controllist1_en= '<a style=font-size:9pt;line-height:14pt; href=\"modifyuser1.asp\">Modify personal data</a><br><a style=font-size:9pt;line-height:14pt; href=\"changepw.asp\">Change Password</a><br><a style=font-size:9pt;line-height:14pt; href=\"managenews.asp\">Information Management</a><br><a style=font-size:9pt;line-height:14pt; href=\"picmanage.asp\">Personal Image Management</a><br><a onclick="toquit()" style=font-size:9pt;line-height:14pt; href=\"\">Quit</a>'


//CMYG介绍菜单
var cmyglist= '<a style=font-size:9pt;line-height:14pt; href=\"about.asp\">CMYG简介</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_values.asp\">CMYG价值观</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_YJandRW.asp\">CMYG远景</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_aboutServers.asp\">CMYG服务范围</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_menbers.asp\">CMYG团队成员</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_zhangcheng.asp\">CMYG章程</a>'

var cmyglist_en= '<a style=font-size:9pt;line-height:14pt; href=\"about.asp\">CMYG Introduction</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_values.asp\">CMYG Values</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_YJandRW.asp\">CMYG Long-term</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_aboutServers.asp\">CMYG scope of services</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_menbers.asp\">CMYG Members</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_zhangcheng.asp\">CMYG Regulation</a>'

//新闻列表
var newslist = '<a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=1\">CMYG内部新闻</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=2\">国内行业新闻</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=3\">国际行业新闻</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=4\">CMYG活动计划</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=7\">健康安全环境HSE</a>'

var newslist_en = '<a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=1\">CMYG Internal News</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=2\">Domestic Industry News</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=3\">International Industry News</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=4\">CMYG Activity Program</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=7\">HSE</a>'

//赞助商列表
var Sponsorslist = '<a style=font-size:9pt;line-height:14pt; href=\"#\">赞助商信息</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=5\">赞助商相关活动</a>'

var Sponsorslist_en = '<a style=font-size:9pt;line-height:14pt; href=\"#\">Sponsor Information</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=5\">Sponsor-related activities</a>'

//企业会员列表
var MemberCompanieslist = '<a style=font-size:9pt;line-height:14pt; href=\"applyBusinesMember.asp\">企业会员制度介绍</a><br><a style=font-size:9pt;line-height:14pt; href=\"BusinesMember.asp\">企业会员资料</a>'

var MemberCompanieslist_en = '<a style=font-size:9pt;line-height:14pt; href=\"applyBusinesMember.asp\">System introduced</a><br><a style=font-size:9pt;line-height:14pt; href=\"BusinesMember.asp\">Member information</a>'

//服务列表
var Serviceslist = '<a style=font-size:9pt;line-height:14pt; href=\"cmyg_servers.asp\">市场分析---MA</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_servers.asp\">市场导入---ME</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_servers.asp\">商务活动---CA</a><br><a style=font-size:9pt;line-height:14pt; href=\"#\">人才储备---HRSS</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_servers.asp\">企业政府关系---CGR & PR</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_servers.asp\">对外矿业投资---RIA</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=7\">促进HSE</a>'

var Serviceslist_en = '<a style=font-size:9pt;line-height:14pt; href=\"cmyg_servers.asp\">Market Analysis---MA</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_servers.asp\">Market Entry---ME</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_servers.asp\">Commercial Activity---CA</a><br><a style=font-size:9pt;line-height:14pt; href=\"#\">HR Structuring Strategy---HRSS</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_servers.asp\">Corporate & Governments\' Relationship---CGR & PR</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_servers.asp\">Resource Investment Abroad---RIA</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=7\">Health, Safety, Environment---HSE</a>'

//工作机会
var worklist = '<a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=12\">求职信息</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=11\">招聘信息</a>'

var worklist_en = '<a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=12\">Job Information</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=11\">Recruitment Information</a>'

//商业机会
var Businesslist = '<a style=font-size:9pt;line-height:14pt; href=\"#\">合作</a><br><a style=font-size:9pt;line-height:14pt; href=\"#\">投资</a><br><a style=font-size:9pt;line-height:14pt; href=\"#\">代理</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=6\">招投标</a>'

var Businesslist_en = '<a style=font-size:9pt;line-height:14pt; href=\"#\">Cooperation</a><br><a style=font-size:9pt;line-height:14pt; href=\"#\">Investment</a><br><a style=font-size:9pt;line-height:14pt; href=\"#\">Acting</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_news.asp?newstype=6\">Bidding</a>'

//顾问委员会列表
var AdvisoryBoardlist = '<a style=font-size:9pt;line-height:14pt; href=\"cmyg_menbers6.asp\">商业顾问委员会</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_menbers7.asp\">专业顾问委员会</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_menbers8.asp\">行业政府顾问委员会</a>'

var AdvisoryBoardlist_en = '<a style=font-size:9pt;line-height:14pt; href=\"cmyg_menbers6.asp\">Business Advisory Board</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_menbers7.asp\">Professional Advisory Board</a><br><a style=font-size:9pt;line-height:14pt; href=\"cmyg_menbers8.asp\">Government Industry Advisory Board</a>'

//专业导航
var Guidelist = '<a style=font-size:9pt;line-height:14pt; href=\"http://www.min-eng.com/directory/journals/index.html\" target=\"_blank\">全球矿业传媒</a><br><a style=font-size:9pt;line-height:14pt; href=\"http://app.chinamining.com.cn/bbs/viewthread.php?tid=7584&extra=page%3D1\" target=\"_blank\">矿业网站导航</a>'

var Guidelist_en = '<a style=font-size:9pt;line-height:14pt; href=\"http://www.min-eng.com/directory/journals/index.html\" target=\"_blank\">Worldwide Mining Media</a><br><a style=font-size:9pt;line-height:14pt; href=\"http://app.chinamining.com.cn/bbs/viewthread.php?tid=7584&extra=page%3D1\" target=\"_blank\">Mining Web Guide</a>'

//写Cookies
function SetCookie(name,value)
{
   var argv=SetCookie.arguments;
   var argc=SetCookie.arguments.length;
   var expires=(2<argc)?argv[2]:null;
   var path=(3<argc)?argv[3]:null;
   var domain=(4<argc)?argv[4]:null;
   var secure=(5<argc)?argv[5]:false;
   document.cookie=name+"="+escape(value)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"");
}

//读Cookies
function GetCookie(Name)
{
   var search = Name + "=";
   var returnvalue = "";
   if (document.cookie.length > 0) 
   {
      offset = document.cookie.indexOf(search);
   if (offset != -1)
   { 
   offset += search.length;
         end = document.cookie.indexOf(";", offset); 
   if (end == -1)
            end = document.cookie.length;
         returnvalue=unescape(document.cookie.substring(offset,end));
       }
    }
    return returnvalue;
}

function setLanguage(ltype){
	SetCookie("Language",ltype);
	document.execCommand('Refresh');
	}

function toquit(){
	SetCookie("cmygaccount","");
	}
