// JScript 文件
function showask(num,str_url)
{ 
   try
   {
		var url="/ajax.aspx?act=getask&num="+num;
		var ai=new ajax_operation(url,display,1);
		ai.doGet();
		return false;
	}
	catch(error)
	{
	return false;
	};
    function display(str)
	{
	    document.getElementById(str_url).innerHTML=unescape(str);
	};	
}

function get_ask(str_url)
{ 
   try
   {
		var url="/ajax.aspx?act=get_ask";
		var ai=new ajax_operation(url,display,1);
		ai.doGet();
		return false;
	}
	catch(error)
	{
	return false;
	};
    function display(str)
	{
	    document.getElementById(str_url).innerHTML=unescape(str);
	};	
}
function indexQuestion(str_url)
{ 
   try
   {
		var url="/ajax.aspx?act=indexQuestion";
		var ai=new ajax_operation(url,display,1);
		ai.doGet();
		return false;
	}
	catch(error)
	{
	return false;
	};
    function display(str)
	{
	    document.getElementById(str_url).innerHTML=unescape(str);
	};	
}
function indexQuestionByCount(num,str_url)
{ 
   try
   {
		var url="/ajax.aspx?act=indexQuestion&num="+num;
		var ai=new ajax_operation(url,display,1);
		ai.doGet();
		return false;
	}
	catch(error)
	{
	return false;
	};
    function display(str)
	{
	    document.getElementById(str_url).innerHTML=unescape(str);
	};	
}
// 1029
String.prototype.Trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); }

function checkAction()
{
    if(document.getElementById("ask_title").value.Trim()=="")
    {
        alert("标题不能为空！");
        document.getElementById("ask_title").focus();
        return;
    }
    if(document.getElementById("ask_name").value.Trim()=="")
    {
        alert("请输入提问者名称！");
                document.getElementById("ask_name").focus();
        return;
    }
    if(document.getElementById("ask_context").value.Trim()=="")
    {
        alert("请输入你要提问的内容！");
                document.getElementById("ask_context").focus();
        return;
    }
    else
    {
        self.location.href="/ask.aspx?title="+escape(document.getElementById("ask_title").value)+
        "&info="+escape(document.getElementById("ask_context").value)+
        "&username="+escape(document.getElementById("ask_name").value);
    }
}
////
//window.onload = getMsg;
//        window.onresize = resizeDiv;
//        window.onerror = function(){
//        }
//        //短信提示使用(asilas添加)
//        var divTop, divLeft, divWidth, divHeight, docHeight, docWidth, objTimer, i = 0;
//        function getMsg(){
//            try {
//                divTop = parseInt(document.getElementById("eMeng").style.top, 10)
//                divLeft = parseInt(document.getElementById("eMeng").style.left, 10)
//                divHeight = parseInt(document.getElementById("eMeng").offsetHeight, 10)
//                divWidth = parseInt(document.getElementById("eMeng").offsetWidth, 10)
//                docWidth = document.body.clientWidth;
//                docHeight = document.body.clientHeight;
//                
//                document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop, 10) + docHeight + 10;// divHeight
//                document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft, 10) + docWidth - divWidth
//                
//                document.getElementById("eMeng").style.visibility = "visible"
//                objTimer = window.setInterval("moveDiv()", 10)
//            } 
//            catch (e) {
//            }
//        }
//        
//        function resizeDiv(){
//            i += 1
////            if (i > 1300) 
////                closeDiv() //客户想不用自动消失由用户来自己关闭所以屏蔽这句
//            try {
////                divHeight = parseInt(document.getElementById("eMeng").offsetHeight, 10)
////                divWidth = parseInt(document.getElementById("eMeng").offsetWidth, 10)
////                docWidth = document.body.clientWidth;
////                docHeight = document.body.clientHeight;
//                document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop, 10)
//                document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft, 10)
//            } 
//            catch (e) {
//            }
//        }
//        
//        function moveDiv(){
//            try {
//                if (parseInt(document.getElementById("eMeng").style.top, 10) <= (docHeight - divHeight + parseInt(document.body.scrollTop, 10))) {
//                    window.clearInterval(objTimer)
//                    objTimer = window.setInterval("resizeDiv()", 1)
//                }
//                divTop = parseInt(document.getElementById("eMeng").style.top, 10)
//                document.getElementById("eMeng").style.top = divTop - 1
//            } 
//            catch (e) {
//            }
//        }
//        
//        function closeDiv(){
//            document.getElementById('eMeng').style.visibility = 'hidden';
//            if (objTimer) 
//                window.clearInterval(objTimer)
//        }


var adinit=0;
	function inits()
	{
	    docWidth = document.body.clientWidth;
		document.getElementById("Layer2").style.left=document.documentElement.scrollWidth-38;//窗口的可视宽度减去层的宽度就是层的右边距
//        document.getElementById("Layer2").style.left=parseInt(document.body.scrollLeft, 10) + docWidth-18
		//窗口的可视高度加上层距离窗口头部的高度减去层的高度就是层距离窗口底部的高度
		document.getElementById("Layer2").style.top=document.documentElement.offsetHeight+document.getElementById("Layer2").style.pixelTop-430;
		document.getElementById("Layer1").style.left=document.documentElement.scrollWidth-290;
//        document.getElementById("Layer1").style.left=parseInt(document.body.scrollLeft, 10) + docWidth-370;
		document.getElementById("Layer1").style.top=document.documentElement.offsetHeight+document.getElementById("Layer1").style.pixelTop-130;
		
	}
	function moves()
	{
		//窗口的可视高度加上层距离窗口头部的高度再减去层的高度就是层距离可视窗口头部的高度
		document.getElementById("Layer1").style.pixelTop=document.documentElement.offsetHeight+document.documentElement.scrollTop-230;
		document.getElementById("Layer2").style.pixelTop=document.documentElement.offsetHeight+document.documentElement.scrollTop-250;
	}
	window.onscroll=moves;
	function closes()
	{
		document.getElementById("Layer1").style.display="none";
		document.getElementById("Layer2").style.display="none";
	}
