// JavaScript Document

/*// 取得对象Y坐标
function findPosY(obj) {
   var curtop = 0;
   if (obj.offsetParent) {
    while (obj.offsetParent) {
     curtop += obj.offsetTop;
     obj = obj.offsetParent;
    }
   } else if (obj.y) curtop += obj.y;
   return curtop;
}
// 取得对象X坐标
function findPosX(obj) {
   var curleft = 0;
   if (obj.offsetParent) {
    while (obj.offsetParent) {
     curleft += obj.offsetLeft;
     obj = obj.offsetParent;
    }
   } else if (obj.x) curleft += obj.x;
   return curleft;
}*/

// 弹出菜单 JS
	function OppMenu(_this, obj) {
		try {
		
		
		var o = document.getElementById(obj);
		o.style.display = "block";
		
		/*var x,y;
			x = window.screen.width;
			y = window.screen.height;
		
		if (x == 1024 && y == 768) 
			o.className = "menu_list1024";
			
		if (x == 1280 && y == 800)
			o.className = "menu_list1280";
		
		if (x == 1680 && y == 1050)
			o.className = "menu_list1680";
			
		if (x == 1920 && y == 1200) 
			o.className = "menu_list1920";*/

		

		// 设置鼠标触发时的动作
		_this.onmouseout = function() { o.style.display = "none";}
		o.onmouseover = function() { o.style.display = "block"; }
		o.onmouseout  = function() { o.style.display = "none"; }
		
		//alert(findPosY(_this) + "\n" + findPosX(_this));
		/*var x,y;
			x = findPosX(_this); y = findPosY(_this);
			o.style.left = x;
			o.style.top  = y;*/
		
/*		// 根椐浏览器不同设置X,Y坐标
		var app = window.navigator.appName;
		// 判断浏览器类型 Netsapce、Internet Explorer

		switch(app)
		{
			case "Netscape":
			alert();
			o.style.left = o.style.left +23;
			break;	
		}	*/	
		} catch(e){}
	}

// 回到顶部 Js

/*function BackTop() {
	var stl = document.body.scrollHeight;
	alert(stl);
}*/

// 根椐屏幕分辨率设置 Body背景
/*function SetBodyColor() {
	try {
		

		return;
		
		var x,y,Body;
			x = window.screen.width;
			y = window.screen.height;
		
		if (x == 1024 && y == 768) 
			document.body.className = "bodyBgColor-1024";
			
		if (x == 1280 && y == 800)
			document.body.className = "bodyBgColor-1280";
		
		if (x == 1680 && y == 1050)
			document.body.className = "bodyBgColor-1680";
			
		if (x == 1920 && y == 1200) 
			document.body.className = "bodyBgColor-1920";
		//alert(x +"\n" + y);
	} catch(e){}
}
*/
// 加入收藏
function AddFavorite(sURL, sTitle)
{
    try
    {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e)
    {
        try
        {
            window.sidebar.addPanel(sTitle, sURL, "");
        }
        catch (e)
        {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
}
// 设为首页
function SetHome(obj,vrl){
        try{
                obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
        }
        catch(e){
                if(window.netscape) {
                        try {
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
                        } 
                        catch (e)  {
                                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入\"about:config\"并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'"); 
                        }
                        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                        prefs.setCharPref('browser.startup.homepage',vrl);
                 }
        }
}

// 设置返回顶部(Top)位置
function SetTop() {
	var appName = window.navigator.appName;

	if (appName == "Microsoft Internet Explorer")
		var obj = document.getElementById("MaxTopBtn");
		obj.style.top = document.documentElement.scrollTop + 400;
		window.setTimeout("SetTop()",100);	
}

// 加载时执行
window.onload = function()
{
	SetTop();
	//SetBodyColor(); 
}

	   
