//加入收藏(如:h(this,'http://www.cq2x.cn '))
function h(obj,url){obj.style.behavior='url(#default#homepage)';obj.setHomePage(url);}
// 说明：用 JavaScript 实现网页图片等比例缩放 
// 整理：http://www.cq2x.cn  
function DrawImage(ImgD,FitWidth,FitHeight){
	var image=new Image();
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		if(image.width/image.height>= FitWidth/FitHeight){
			if(image.width>FitWidth){
				ImgD.width=FitWidth;
				ImgD.height=(image.height*FitWidth)/image.width;
			}else{
					ImgD.width=image.width;
					ImgD.height=image.height;
			}
		}else{
				if(image.height>FitHeight){
					ImgD.height=FitHeight;
					ImgD.width=(image.width*FitHeight)/image.height;
				}else{
						ImgD.width=image.width;
						ImgD.height=image.height;
				}
		}
	}
} 

/*
//检测用户登录
function CheckUserForm()
{
	if(document.mx_UserLogin.mx_UserName.value=="")
	{
		alert("请输入用户名！");
		document.mx_UserLogin.mx_UserName.focus();
		return false;
	}
	if(document.mx_UserLogin.mx_Password.value == "")
	{
		alert("请输入密码！");
		document.mx_UserLogin.mx_Password.focus();
		return false;
	}
}

//点击打开 下面内容

function show(n){
for(i=1;i<=2;i++){
if(n==i){
	document.getElementById("showT"+n).className='Showon';
	document.getElementById("ShowC"+n).style.display='';
}else{
	document.getElementById("showT"+i).className='Showout';
	document.getElementById("ShowC"+i).style.display='none';
}
}
}
function ShowC(n){
for(i=1;i<=5;i++){
if(n==i){
	document.getElementById("C"+n).style.display='';
}else{
	document.getElementById("C"+i).style.display='none';
}
}
}
*/

//页面加载Loading......

var t_id = setInterval(animate,20);
var pos=0;
var dir=2;
var len=0;
function animate()
{
    var elem = document.getElementById('progress');
    if(elem != null) {
    if (pos==0) len += dir;
    if (len>32 || pos>79) pos += dir;
    if (pos>79) len -= dir;
    if (pos>79 && len==0) pos=0;
    elem.style.left = pos;
    elem.style.width = len;
    }
}
function remove_loading() {
    this.clearInterval(t_id);
    var targelem = document.getElementById('loader_container');
    targelem.style.display='none';
    targelem.style.visibility='hidden';
}