
function loadImages()
{
    var d=document; if(d.images)
               {
                     if(!d.MM_p) d.MM_p=new Array();
                     var i,j=d.MM_p.length,a=loadImages.arguments; 
                     for(i=0; i<a.length; i++)
                     {
                            if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}
                     }   
               }
}
//-->

//背景设置
function bgico(){
	document.getElementById("link").style.display="none";
	var background=document.getElementById("background");
	var marginTop=470;
	var height=16;
	var num=5;
	var maxHeight=241;
	var maxMarginTop=245;
var Alter_Star = function(){        
if(height<maxHeight){
	if(height+num>maxHeight){
	background.style.marginTop=maxMarginTop + "px";
	background.style.height=maxHeight + "px";
		}
	else{
	background.style.marginTop=marginTop-num + "px";
	background.style.height=height+num + "px";
	height+=num;
	marginTop-=num;
	}
	}
	else{
    window.clearInterval(BoxAction);
	}
			}
			
var Alter_Close = function(){        
if(height<maxHeight){
	if(height+num>maxHeight){
	background.style.marginTop=marginTop + "px";
	background.style.height=height + "px";
		}
	else{
	background.style.marginTop=maxMarginTop+num + "px";
	background.style.height=maxHeight-num + "px";
	maxHeight-=num;
	maxMarginTop+=num;
	}
	}
	else{
    window.clearInterval(BoxAction);
	}
			}
if(parseInt(background.style.marginTop)==maxMarginTop){
var BoxAction = window.setInterval(Alter_Close,1);
			}
else{
var BoxAction = window.setInterval(Alter_Star,1);
	}
}

function bgicoClose(bgURL){
	document.getElementById("link").style.display="none";
	//document.getElementById("main").className="bg2";
	document.getElementById("main").style.backgroundImage="url(images/bg"+bgURL+".jpg)";
	var background=document.getElementById("background");
	var marginTop=245;
	var height=241;
	var num=5;
	var maxHeight=16;
	var maxMarginTop=470;
var Alter_Close = function(){        
if(height>maxHeight){
	if(height-num<maxHeight){
	background.style.marginTop=maxMarginTop + "px";
	background.style.height=maxHeight + "px";
		}
	else{
	background.style.marginTop=marginTop+num + "px";
	background.style.height=height-num + "px";
	height-=num;
	marginTop+=num;
	}
	}
	else{
    window.clearInterval(BoxAction);
	}
			}
var BoxAction = window.setInterval(Alter_Close,1);
}

function closeLink(){
var Alter_Close = function(){  
	document.getElementById("link").style.display="none";
    window.clearInterval(BoxAction);
}
	if(document.getElementById("link").style.display=="block"){
var BoxAction = window.setInterval(Alter_Close,500);
	}
}


//判断鼠标是否在指定的div区域
function getELXY(e){
	return {x:e.offsetLeft,y:e.offsetTop};
}
function getELWH(e){
	return {w:e.offsetWidth,h:e.offsetHeight};
}
function getClientXY(e){
	e=e||event;
	return {cx:e.clientX,cy:e.clientY};
}
