﻿// JScript 文件
function goask()
{
//window.event.returnValue= false;
document.getElementById("form1").action="/Question/ask.aspx";
document.getElementById("form1").submit(); 
}
//获取文字的gb2312编码
function gb2312Encode(str)
{
    var string = "";
    c = s = "";
    var high = "";
    var low = "";
    for(var i = 0; i < str.length; i++)
    {
        c = Asc(str.charAt(i));
        if(Math.abs(c) < 0xFF)
           string += str.charAt(i);
        else
        {
           if(c < 0) c += 0x10000;
           high = ((c & 0xFF00) >> 8) & 0x00FF;
           low = c & 0xFF;
           string += "%" + Hex(high) + "%" + Hex(low);
        }
    }
    return string;
}
function Hex(n)
{   
    c = n;
    execScript("c = Hex(c)", "vbscript");
    return c;
}
//返回文字的AscaII编码, 调用的是vbscript的Asc函数
function Asc(s)
{
    c = s;
    execScript("c = Asc(c)", "vbscript");
    return c;
}

 String.prototype.Trim = function() 
        { 
            return this.replace(/(^\s*)|(\s*$)/g, ""); 
        } 

        String.prototype.LTrim = function() 
        { 
            return this.replace(/(^\s*)/g, ""); 
        } 

        String.prototype.RTrim = function() 
        { 
            return this.replace(/(\s*$)/g, ""); 
        } 

