﻿// JScript 文件
function $(id) {
	return document.getElementById(id);
}
window.onload=setScroll;
window.onscroll=setScroll;
window.onresize=setScroll;
function setScroll()
{
    var TH=document.documentElement.clientHeight;//工作区域高度
    var RH=document.body.scrollHeight;//正文高度
    if(RH>TH)
    {

        document.body.scroll="yes";
      //  document.body.style.overflow="auto";
    }
    else
    {
        
        //document.body.style.overflow="hidden";
        document.body.scroll="no";
    }
    
    try
    {
      //document.body.focus();
       document.getElementById("mapBox").style.height=TH+"px";
        document.getElementById("mapFlash").style.height=TH+"px";

    }
    catch(e)
    {}
    try{
    doResize();
    }
    catch(e){}
    try{

    document.getElementById("hasCPanel3").style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-document.getElementById("hasCPanel3").offsetHeight)+"px";
 document.getElementById("hasCPanel3").style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementById("hasCPanel3").offsetWidth)+"px";

    }
    catch(e){}
}


function getPageSize(){
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
	var arrayPageSize = [w,h];
	return arrayPageSize;
}
function closeParentDiv()
{
    try{
        parent.alertCloseDiv();
        }
    catch(e){}
}
var startPageIOUrl="blank.html";



var MSMmaxLen = 500; //短信最大数量
function checkMaxInput(obj) {
    var maxLen = MSMmaxLen;
    var m = obj.value.length;

    var n = m;

    if (n > maxLen) {
        obj.value = obj.value.substring(0, maxLen);
        $("hasinput").innerHTML = '<br>最大可输入<font color="red">' + maxLen + '</font>字节,<font color="red">您已达到输入上限！</font><br />';
    }
    else {
        $("hasinput").innerHTML = '<br>最大可输入<font color="red">' + maxLen + '</font>字节,还可输入<font color="red">' + (maxLen - m) + '</font>字节<br />';
    }
    //ctl00_ContentPlaceHolder1_TeacherCommentControl1_hasinput
}
   