
//随滚动条上下移动
function scrollImg(){
    var posX,posY;
    if (window.innerHeight) {
        posX = window.pageXOffset;
        posY = window.pageYOffset;
    }
    else if (document.documentElement && document.documentElement.scrollTop) {
        posX = document.documentElement.scrollLeft;
        posY = document.documentElement.scrollTop;
    }
    else if (document.body) {
        posX = document.body.scrollLeft;
        posY = document.body.scrollTop;
    }

    var ad=document.getElementById("onlineserver"); //要移动的id
    ad.style.top = posY + 150 +"px";
    ad.style.right = posX+"px";
	
	
    var ad1=document.getElementById("onlineShare"); //要移动的id
    ad1.style.top =  posY + 120 +"px";
    ad1.style.right = posX+"px";
	
    setTimeout("scrollImg()",10);
}

// JavaScript Document
in_ID=out_ID=null
var left_Int = 0;
n4 = (document.layers)?1:0
e4 = (document.all)?1:0;

function init(obj) {
	menu = document.getElementById(obj);
	menuW = menu.offsetWidth;
	menu.visibility = "visible";
}

function menuIn() {
	clearTimeout(out_ID)
	if(left_Int < menuW ) { 
		left_Int +=8;
		in_ID = setTimeout("menuIn()", 1)
	}
	
	if(left_Int >= menuW){left_Int=menuW}
	menu.style.left = left_Int + "px"
}

function menuOut() {
	clearTimeout(in_ID)
	
	if(left_Int > menuW-10) { 
		left_Int -= 8
		out_ID = setTimeout("menuOut()", 1)
	}
	else if(left_Int > 0) {
		left_Int -= 8;
		out_ID = setTimeout("menuOut()", 1)
	}
	
	if(left_Int < 0){left_Int=0}
	menu.style.left = left_Int + "px";
	
}


function addLoadEvent(func){
	var oldonload = window.onload;
	if(typeof window.onload != 'function'){
		window.onload = func;
	}else{
		window.onload = function(){
			oldonload();
			func();
		}	
	}
}

