function getParameter(name,cancelBubble){
	var r = new RegExp("(\\?|#|&)"+name+"=([^&#]*)(&|#|$)")
	var m = location.href.match(r)
	if ((!m || m=="") && !cancelBubble) m = top.location.href.match(r)
	return (!m?"":m[2]);
}
function IsDigit(digitnum){
	if (digitnum)return false;
	if (typeof digitnum != "string")return false;
	var re=/[^0-9]/;
	var ret = digitnum.match(re);
	if (ret == null)
		return true;
	else
		return false;
}
function MyParseInt(digitnum){
	if (IsDigit(digitnum)){
		if (digitnum == "")
			return 0;
		else
			return parseInt(digitnum);
	}else{
			return 0;
	}
}
function checkRate(obj){
    var re = /^[0-9]+[0-9]*$/;   //判断字符串是否为数字     //判断正整数 /^[1-9]+[0-9]*]*$/   
    if (!re.test(obj.value)){
        alert("请输入数字");
		obj.focus();
		obj.select();
		obj.value="0";
        return false;
    }
}
function h(obj,url){
	obj.style.behavior='url(#default#homepage)';
	obj.setHomePage(url);
}
function checkclick(msg){
	if(confirm(msg))
		return true;
	else
		return false;
}
function ShowProList(id){
	if($(id)!=undefined){
		if($(id).style.display=="none")
			$(id).style.display="";
		else
			$(id).style.display="none";
	}else return;
}
function ChangeCode(obj){
	if(!$CHKID(obj))return;
	$(obj).src="/inc/GetCode.asp?"+Math.random();
}
//图片效果
function cotrolimg(e, o){
	var zoom = parseInt(o.style.zoom, 10) || 100;
	zoom += event.wheelDelta / 12;
	if (zoom > 0) o.style.zoom = zoom + '%';
	return false;
}
//用于防止页面的图片太大。
function piclimit(img){
	if(img.width>900)img.width=900;
}

//按比例缩小
function ControlImg(mypic){ 
	if(mypic.height>mypic.width){
		mypic.height=80;
	}else{
		mypic.width=82;
	}
} 


function $(obj){
	return document.getElementById(obj);
}
function $CHKID(obj){
	if($(obj)!= undefined)
		return true;
	else
		return false;
}

//ajax
var xmlhttp=false; 

function AjaxGetData(url,method,callback,flag){
	var xmlhttp = Gethttp_request();
	xmlhttp.onreadystatechange = function(){
		if (xmlhttp.readyState == 4&&xmlhttp.status == "200"){ //加载完之后的处理
			if(callback != undefined)
				callback(xmlhttp,flag);    
		}
	}	
	var sPoststr = "";
	if (method == "GET")
		sPoststr = "";
	else
		sPoststr = url;
	var _type=true;
	if(flag!=undefined)_type=flag;
	xmlhttp.open(method, url, _type);	
	xmlhttp.setRequestHeader("If-Modified-Since","0");
	xmlhttp.setRequestHeader("Content-Type","text/html");	
	xmlhttp.send(sPoststr);	
	return;
}
//初始化XMLHttpRequest对象
function Gethttp_request(){
	xmlhttp = false;
    if (window.XMLHttpRequest) {
		xmlhttp = new XMLHttpRequest();
		if (xmlhttp.overrideMimeType) {
			xmlhttp.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) {
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!xmlhttp) {
		alert("不能创建XMLHttpRequest对象实例");
		return false;
	}
	return xmlhttp;
}

GetData={
	divobj:"",
	ShowLeft:function(){
		AjaxGetData("/getdata.asp?act=getleft","GET",function(){
			var xDoc = xmlhttp.responseText;
			try{$("bodyleft").innerHTML=xDoc;}catch(e){;}	
		},false);
	}	
}

function ChangeTopImg(id){
	try{
		$("top_"+id).src="/images/botton_0"+id+".jpg";
	}catch(e){;}
}
