function $(name)
{
	return document.getElementById(name);
}







//创建XML对象


    function CreateXMLHTTP() 
    { 
        var xmlHttpRequest; 
        if (window.XMLHttpRequest) //For general cases. 
        { 
            //alert("0"); 
            xmlHttpRequest = new XMLHttpRequest(); 
        } 
        else //For IE. 
        { 
            if (window.ActiveXObject) 
            { 
                //alert("1"); 
                xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP"); 
            } 
        } 
        return xmlHttpRequest; 
    }





function PostInfox()//url,callback,arg1,value1,arg2,value2
{
	if(arguments.length >= 2)
	{
		var xmlhttp = CreateXMLHTTP();
		//alert(xmlhttp);
		var postUrl = arguments[0];
		
		var fn = arguments[1];
		var postStr = "?";
		
		if(arguments.length >= 3)
		{
			//postStr += "?";
			for(var i=2;i<arguments.length;i=i+2)
			{
				if(i>2)
					postStr += "&";
				postStr += arguments[i] + "=" + arguments[i+1];
			}
		}
		
		postUrl+=postStr;
		xmlhttp.open("get",postUrl,false); 
        xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");
        xmlhttp.setRequestHeader("Content-Length",postStr.length); 
        xmlhttp.setRequestHeader("Connection", "close");
      
        
		xmlhttp.onreadystatechange = function PostReady(){
		
		 
			if (xmlhttp.readyState == 4)
       			if (xmlhttp.status == 200)
       			{
       			
       			//alert(xmlhttp.responseXML);
       			    var responseText = xmlhttp.responseXML;
       			    xmlhttp = null;
       			    //alert(responseText);
         			return fn(responseText);
         	    }
       			else
       			{
       			    xmlhttp = null;
					return fn("读取数据失败,请稍候再试。<a href='javascript:CloseObj();'>Close</a>");
				}};
		xmlhttp.send(postStr);
		return;
	}
}




//function PostInfo()//url,callback,arg1,value1,arg2,value2
//{
//	if(arguments.length >= 2)
//	{ 
//		var xmlhttp = CreateXMLHTTP();
//		var postUrl = arguments[0];
//		var fn = arguments[1];
//		var postStr = "";
//		if(arguments.length >= 3)
//		{
//			//postStr += "?";
//			for(var i=2;i<arguments.length;i=i+2)
//			{
//				if(i>2)
//					postStr += "&";
//				postStr += arguments[i] + "=" + arguments[i+1];
//			}
//		}
//		xmlhttp.open("POST",postUrl,true); 
//        xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");
//        xmlhttp.setRequestHeader("Content-Length",postStr.length); 
//        xmlhttp.setRequestHeader("Connection", "close");
//		xmlhttp.onreadystatechange = function PostReady(){
//			if (xmlhttp.readyState == 4)
//       			if (xmlhttp.status == 200)
//       			{
//       			    var responseText = xmlhttp.responseText;
//       			    xmlhttp = null;
//         			return fn(responseText);
//         	    }
//       			else
//       			{
//       			    xmlhttp = null;
//					return fn("读取数据失败,请稍候再试。<a href='javascript:CloseObj();'>Close</a>");
//				}};
//		xmlhttp.send(postStr);
//		return;
//	}
//}




//Bulletin,080617
var isShowBulletin = false;
var BulletinInfoList = new Array();
function SetShowBulletin(isShow)
{
    isShowBulletin = isShow;
}
function ShowBulletinByID(id,obj)
{
    var divObj = "BulletinShowDiv";
    var ttop = obj.offsetTop;       //控件的定位点高 
    var tleft = obj.offsetLeft;     //控件的定位点宽
    var thei = obj.clientHeight;    //控件本身的高 
    var ttyp = obj.type;            //控件的类型   
    while(obj = obj.offsetParent){ttop+=obj.offsetTop;tleft+=obj.offsetLeft;}//取得总高宽
    $(divObj).style.top = ((ttyp=="image") ? ttop+thei : ttop+thei+10) + "px";
    $(divObj).style.left = tleft + 80 + "px"; 
    var outHtml = GetBulletinInfoByID(id);
    if(outHtml=="0")//缓存验证
    {
        $(divObj).innerHTML = "<div style=\"font-size:14px;text-align:center;padding-top:80px;\"><img src=\"/images/shinyway/hangzhou/loading.gif\" alt=\"loading...\" align=\"absmiddle\" /> 正在加载内容，请稍候...</div>";
        PostInfo("Ajax_BulletinShow.aspx",
	    function(data){
	        lastBulletinID = id;
            $(divObj).innerHTML = data;
            //保存信息
            BulletinInfoList[BulletinInfoList.length] = new Array(id,data);
          },
	    "i",id);
	}
	else
	{$(divObj).innerHTML = outHtml;}
	SetShowBulletin(true);
	$('BulletinShowDiv').style.display = 'block';
}
function GetBulletinInfoByID(id)
{
    var thisID = -1;
    var tempStr = "0";
    for(var i=0;i<BulletinInfoList.length;i++)
    {
        if(BulletinInfoList[i][0]==id)
        {
            thisID = i;
            break;
        }
    }
    if(thisID>=0)
    {
        tempStr = BulletinInfoList[thisID][1];
    }
    return tempStr;
}
function ClearShowBulletin()
{
    SetShowBulletin(false);
    setTimeout(ClearShowBulletinA,1200);
}
function ClearShowBulletinA()
{
    if(!isShowBulletin)
        $('BulletinShowDiv').style.display = 'none';
}








//Bulletin,080617
var isShowBulletin = false;
var BulletinInfoList = new Array();
function SetShowBulletin(isShow)
{
    isShowBulletin = isShow;
}
function ShowBulletinByID(id,obj)
{
    var divObj = "BulletinShowDiv";
    var ttop = obj.offsetTop;       //控件的定位点高 
    var tleft = obj.offsetLeft;     //控件的定位点宽
    var thei = obj.clientHeight;    //控件本身的高 
    var ttyp = obj.type;            //控件的类型   
    while(obj = obj.offsetParent){ttop+=obj.offsetTop;tleft+=obj.offsetLeft;}//取得总高宽
    $(divObj).style.top = ((ttyp=="image") ? ttop+thei : ttop+thei+10) + "px";
    $(divObj).style.left = tleft + 80 + "px"; 
    var outHtml = GetBulletinInfoByID(id);
    if(outHtml=="0")//缓存验证
    {
        $(divObj).innerHTML = "<div style=\"font-size:14px;text-align:center;padding-top:80px;\"><img src=\"/images/shinyway/hangzhou/loading.gif\" alt=\"loading...\" align=\"absmiddle\" /> 正在加载内容，请稍候...</div>";
        PostInfo("Ajax_BulletinShow.aspx",
	    function(data){
	        lastBulletinID = id;
            $(divObj).innerHTML = data;
            //保存信息
            BulletinInfoList[BulletinInfoList.length] = new Array(id,data);
          },
	    "i",id);
	}
	else
	{$(divObj).innerHTML = outHtml;}
	SetShowBulletin(true);
	$('BulletinShowDiv').style.display = 'block';
}



function GetBulletinInfoByID(id)
{
    var thisID = -1;
    var tempStr = "0";
    for(var i=0;i<BulletinInfoList.length;i++)
    {
        if(BulletinInfoList[i][0]==id)
        {
            thisID = i;
            break;
        }
    }
    if(thisID>=0)
    {
        tempStr = BulletinInfoList[thisID][1];
    }
    return tempStr;
}
function ClearShowBulletin()
{
    SetShowBulletin(false);
    setTimeout(ClearShowBulletinA,1200);
}
function ClearShowBulletinA()
{
    if(!isShowBulletin)
        $('BulletinShowDiv').style.display = 'none';
}


