var Navigator = new Object();
var  XMLHttpReqBox;
var XMLHttpReqShopBox;
var  XMLHttpReqBox1;
var XMLHttpReq;
var XMLHttpReqEmail;
var XMLHttpReqUserName;
var XMLHttpReqUserLogin;
var  XMLHttpReq4;
var gGoodId="";
var logtime=0;

var intervalID;

      function Button1_onclick() {
     intervalID = setInterval(getIsLogin, 1000);
     }
     function getIsLogin(){
          if(window.frames["a2"].location=="http://www.learning365.com/bbs_index.do"){
           clearInterval(intervalID);
           	try{
                  document.loginForm.login1.disabled=false;
                }catch(e){}
          }else{
               logtime=logtime+1;
               if(logtime>3){
                    clearInterval(intervalID);
                       try{
                      document.loginForm.login1.disabled=false;
                       }catch(e){}

                }

            }
     }
     function aa(){
        try{
         window.frames["a1"].location="http://www.learning365.com/bbs_help.do";
         window.frames["a2"].document.loginForm.userName.value=document.getElementById("txtUsername").value;
         if(document.getElementById("txtUsername").value!="" && document.getElementById("txtPassword").value!=""){
           check();
         }
        }catch(e){}
     }
     function bb(){
        try{
         window.frames["a2"].document.loginForm.password.value=document.getElementById("txtPassword").value;
         window.frames["a2"].document.loginForm.validateCode.value=window.frames["a1"].document.aaa.aa.value;
         if(document.getElementById("txtUsername").value!="" && document.getElementById("txtPassword").value!=""){
           check();
         }
        }catch(e){}
     }
     function check() {
     	window.frames["a2"].document.loginForm.submit();
     	Button1_onclick();
     }
var moz = (typeof document.implementation != 'undefined')   && (typeof document.implementation.createDocument != 'undefined');
if(navigator.userAgent.indexOf("MSIE") != -1)
{
    Navigator.IE = true;
    if(navigator.userAgent.indexOf("MSIE 6.0") != -1)
    {
        Navigator.IE6 = true;
    }
    if(navigator.userAgent.indexOf("MSIE 7.0") != -1)
    {
        Navigator.IE7 = true;
    }
}
if(navigator.userAgent.indexOf("Firefox") != -1)
{
    Navigator.Firefox = true;
}
if(!Navigator.IE6 && !Navigator.IE7 && !Navigator.Firefox)
{
    alert('您的浏览器暂不支持，因此可能显示有问题，建议使用Microsoft IE 6.0+或Mozilla Firefox浏览');
}
function $(id)
{
    return document.getElementById(id);
}
//基本操作
function SetCookie(sName, sValue)
{
    var date = new Date();
    date.setFullYear(date.getFullYear() + 1);
    document.cookie = sName + "=" + escape(sValue) + "; domain=learning365.com; expires=" + date.toGMTString();
}
function GetCookie(sName)
{
    var aCookie = document.cookie.split("; ");
    for (var i = 0; i < aCookie.length; i++)
    {
        var aCrumb = aCookie[i].split("=");
        if (sName == aCrumb[0]) 
            return unescape(aCrumb[1]);
    }
    return null;
}
function SetHomePage(url)
{
    document.body.style.behavior='url(#default#homepage)';
    document.body.setHomePage(url);
}
function NewWindow(url)
{
    window.open(url);
}
function Reload()
{
    window.location.href = window.location.href;
}
function ToggleDisplay_none_block(controlID)
{
    var control = $(controlID);
    if (control.style.display == 'none')
    {
        control.style.display = 'block';
    }
    else
    {
        control.style.display = 'none';
    }
}
function SetDisplayNone(controlID)
{
    var control = $(controlID);
    control.style.display = 'none';
}
function SetDisplayBlock(controlID)
{
    var control = $(controlID);
    control.style.display = 'block';
}
function SetDisplayInline(controlID)
{
    var control = $(controlID);
    control.style.display = 'inline';
}
function SetHidden(controlID)
{
    var control = $(controlID);
    control.style.visibility = 'hidden';
}
function SetVisible(controlID)
{
    var control = $(controlID);
    control.style.visibility = 'visible';
}
function SetEnable(controlID)
{
    $(controlID).disabled = false;
}
function SetDisable(controlID)
{
    $(controlID).disabled = true;
}
function SetFocus(controlID)
{
    var control = $(controlID);
    try
    {
        control.focus();
    }
    catch(e){}
}



//设定浮动格式
function SetFloatLeft(control)
{
    if(document.all)
    {
        control.style.styleFloat = 'left';
    }
    else
    {
        control.style.cssFloat = 'left';
    }
}

function SetFloatRight(control)
{
    if(document.all)
    {
        control.style.styleFloat = 'right';
    }
    else
    {
        control.style.cssFloat = 'right';
    }
}

//=======
Function.createDelegate = function(object, method)
{
	if(arguments.length == 2)
    {
        return function()
        {        
            method.apply(object,arguments);
        }
    }
    if(arguments.length > 2)
    {
        var args = new Array();
        for(var i = 0; i < arguments.length - 2; i++)
	    {
		    args[i] = arguments[i + 2];
	    }
        return function()
        {
            method.apply(object,args);
        }
    }
}

//居中
function ShowMiddle(div)
{
    var scrollYT, scrollXT;
    var topWindow = window.top;
    var topDocument = topWindow.document;
    if(div == null)
    {
        return;
    }
    if(document.all)
    {
        scrollYT = topDocument.body.scrollTop; 
				scrollXT = topDocument.body.scrollLeft;
    }
    else
    { 
			  scrollYT = topWindow.pageYOffset; 
		    scrollXT = topWindow.pageXOffset; 
	  }
    var top=0;
    if(topDocument.body.clientHeight>window.screen.availHeight){	
		top = Math.floor((window.screen.availHeight - div.offsetHeight) / 2) + scrollYT;
    }else{
		top = Math.floor((topDocument.body.clientHeight - div.offsetHeight) / 2) + scrollYT;

    }
	if(top < 0)
	{
	    top = 0;
	}
	var left = Math.floor((topDocument.body.clientWidth - div.offsetWidth) / 2) + scrollXT;
	if(left < 0)
	{
	    left = 0;
	}
    div.style.top = top + 'px';
    div.style.left = left + 'px';
}

function ShowMiddleClient(div,width,height)
{
    var scrollYT, scrollXT;
    var topWindow = window.top;
    var topDocument = topWindow.document;
    if(div == null)
    {
        return;
    }
    if(document.all)
    {
        scrollYT = topDocument.body.scrollTop; 
	 scrollXT = topDocument.body.scrollLeft;
    }
    else
    { 
	 scrollYT = topWindow.pageYOffset; 
	 scrollXT = topWindow.pageXOffset; 
     }
     
	var top = Math.floor((topDocument.body.clientHeight - div.offsetHeight) / 2) + scrollYT;
	if(top < 0)
	{
	    top = 0;
	}
	var left = Math.floor((topDocument.body.clientWidth - div.offsetWidth) / 2) + scrollXT;
	if(left < 0)
	{
	    left = 0;
	}
    div.style.top = (screen.height-height)/2 + 'px';
    div.style.left = (screen.width-width)/2+ 'px';
}





function CommonBox(content,title,left,top,width,height,moveable,middle,closeHandler)
{
    
     var table = window.top.document.createElement('table');
    table.cellSpacing = 0;
    table.cellPadding = 0;
    var row = table.insertRow(0);
    this.Title = row;
    var cell = row.insertCell(0);
    cell.innerHTML = '&nbsp;';
    cell.style.width = '17px';
	  cell.style.height = '35px';
    if(Navigator.IE6)
    {        
	    cell.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://www.learning365.com/Images/Commbox/left_top.png")';
    }
    else
    {
      cell.style.background = 'url(http://www.learning365.com/Images/Commbox/left_top.png) no-repeat';
    }
    cell = row.insertCell(1);
	  cell.style.height = '30px';
     
    if(Navigator.IE6)
    {        
	    cell.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://www.learning365.com/Images/Commbox/top.png",sizingMethod="scale")';
    }
    else
    {
        cell.style.background = 'url(http://www.learning365.com/Images/Commbox/top.png) repeat-x';
    }
      var imgIcon = window.top.document.createElement('span');
      imgIcon.id = 'imgIcon';
       imgIcon.style.filter ='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://www.learning365.com/Images/Commbox/icon.png")';
      imgIcon.style.height='15px'
      SetFloatLeft(imgIcon);
     cell.appendChild(imgIcon); 
    var spanTitle = window.top.document.createElement('span');
    spanTitle.innerHTML = '<table><tr><td height=0></td></tr></table>'+title;
     spanTitle.id='comCaption';
      spanTitle.style.pixelTop='100';
    spanTitle.style.margin = '15px 0px 0px 5px';
    spanTitle.style.lineHeight = 'normal';
      spanTitle.style.fontSize='12px';
      spanTitle.style.valign='bottom'
       
 
    SetFloatLeft(spanTitle);
    cell.appendChild(spanTitle); 
     
     var imgClose = window.top.document.createElement('img');
    imgClose.id = 'imgClose';
    imgClose.src = 'http://www.learning365.com/Images/Commbox/close.gif';
    imgClose.onclick = Function.createDelegate(this,this.Hide);
    imgClose.alt = '关闭';
    SetFloatRight(imgClose);
    cell.appendChild(imgClose);    
    cell = row.insertCell(2);
    cell.style.width = '17px';
     cell.style.height = '30px';
    if(Navigator.IE6)
    {        
	    cell.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://www.learning365.com/Images/Commbox/right_top.png")';
    }
    else
    {
        cell.style.background = 'url(http://www.learning365.com/Images/Commbox/right_top.png) no-repeat';
    }
     
    cell.innerHTML = '';
    row = table.insertRow(1);
    if(height)
    {
        row.style.height = height + 'px';
    }
    cell = row.insertCell(0);
    cell.innerHTML = '&nbsp;';
    cell.style.width = '17px';
    if(Navigator.IE6)
    {        
	    cell.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://www.learning365.com/Images/Commbox/left.png",sizingMethod="scale")';
    }
    else
    {
        cell.style.background = 'url(http://www.learning365.com/Images/Commbox/left.png) repeat-y';
    }
    cell = row.insertCell(1);
    cell.className = 'CenterCommon';
    if(width)
    {
        cell.style.width = width + 'px';
    }
    if (typeof content == 'object')
    {
        cell.appendChild(content);
    }
    else
    {
        cell.innerHTML = content;
    }
    this.divContent = cell;
    cell = row.insertCell(2);
    cell.innerHTML = '&nbsp;';
    cell.style.width = '17px';
    if(Navigator.IE6)
    {        
	    cell.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://www.learning365.com/Images/Commbox/right.png",sizingMethod="scale")';
    }
    else
    {
        cell.style.background = 'url(http://www.learning365.com/Images/Commbox/right.png) repeat-y';
    }
    row = table.insertRow(2);
    cell = row.insertCell(0);
    cell.innerHTML = '&nbsp;';
    cell.style.width = '17px';
    cell.style.height = '17px';
    if(Navigator.IE6)
    {        
	    cell.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://www.learning365.com/Images/Commbox/left_bottom.png")';
    }
    else
    {
        cell.style.background = 'url(http://www.learning365.com/Images/Commbox/left_bottom.png) no-repeat';
    }
    cell = row.insertCell(1);
    cell.style.height = '17px';
    if(Navigator.IE6)
    {        
	    cell.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://www.learning365.com/Images/Commbox/bottom.png",sizingMethod="scale")';
    }
    else
    {
        cell.style.background = 'url(http://www.learning365.com/Images/Commbox/bottom.png) repeat-x';
    }
    cell.innerHTML = '&nbsp;';
    cell = row.insertCell(2);
    cell.innerHTML = '&nbsp;';
    cell.style.width = '17px';
    cell.style.height = '17px';
    if(Navigator.IE6)
    {        
	    cell.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://www.learning365.com/Images/Commbox/right_bottom.png")';
    }
    else
    {
        cell.style.background = 'url(http://www.learning365.com/Images/Commbox/right_bottom.png) no-repeat';
    }
    
    this.divCommonBox = window.top.document.createElement('div');
    this.divCommonBox.id = 'divCommonBox';
    this.divCommonBox.appendChild(table);
    this.defaultZIndex = 150;
    this.divCommonBox.style.zIndex = this.defaultZIndex;
    if(left)
    {
        this.divCommonBox.style.left = left + 'px';
    }
    if(top)
    {
        this.divCommonBox.style.top = top + 'px';
    }
    this.divCommonBox.style.display = 'none';    
    this.divBackground = window.top.document.createElement('div');
    this.divBackground.id = 'divCommonBoxBackground';
    this.divBackground.style.zIndex = this.defaultZIndex -1;
    document.body.style.zIndex=this.defaultZIndex -2;
     
    this.divBackground.style.display = 'none';
    var parent = window.top.document.body;
    parent.insertBefore(this.divBackground, parent.firstChild);  
    parent.insertBefore(this.divCommonBox, parent.firstChild);
    this.middle = middle;
    if(moveable == true)
    {
        //new Mover(this.divCommonBox, this.Title)
    }    
    this.CloseHandler = closeHandler;
    this.HiddenObjects = new Array();
}
CommonBox.prototype.Show = function(left,top)
{
    if(left != null)
    {
        this.divCommonBox.style.left = left + 'px';
    }
    if(top != null)
    {
        this.divCommonBox.style.top = top + 'px';
    }
    this.divCommonBox.style.display = "block";
    this.divBackground.style.left = '0px';
    this.divBackground.style.top = '0px';
    this.divBackground.style.width = Math.max(window.top.document.documentElement.scrollWidth,window.top.document.documentElement.clientWidth) + 'px';
    this.divBackground.style.height = Math.max(window.top.document.body.scrollHeight,window.top.document.documentElement.clientHeight) + 'px';
    this.divBackground.style.display = "block";
    if(this.middle == true)
    {
        ShowMiddle(this.divCommonBox);
    }
    var objects = document.getElementsByTagName('object');
    for(var i = 0; i < objects.length; i++)
    {
        if(IsOverLap(objects[i],this.divCommonBox) && objects[i].style.visibility != 'hidden')
        {
            objects[i].style.visibility = 'hidden';
            this.HiddenObjects.push(objects[i]);
        }
    }
    var embeds = document.getElementsByTagName('embed');
    for(var i = 0; i < embeds.length; i++)
    {
        if(IsOverLap(embeds[i],this.divCommonBox) && embeds[i].style.visibility != 'hidden')
        {
            embeds[i].style.visibility = 'hidden';
            this.HiddenObjects.push(embeds[i]);
        }
    }
}
CommonBox.prototype.Hide = function()
{
     if(window.frames["player"+gGoodId]!=null){ 
      if(window.frames["player"+gGoodId].document.getElementById("phx")!=null){
         window.frames["player"+gGoodId].document.getElementById("phx").controls.stop();
      }
    }
     if(window.frames["ExamDiaLog"+gGoodId]!=null){ 
       window.frames["ExamDiaLog"+gGoodId].location="about:blank";
      
    }

     
    
     //this.divCommonBox.innerHTML='';
    this.divCommonBox.style.display = "none";
    this.divBackground.style.display = "none";
     
     
    for(var i = this.HiddenObjects.length - 1; i >= 0 ; i--)
    {
        var object = this.HiddenObjects.pop();
        object.style.visibility = 'visible';
    }
    if(this.CloseHandler != null)
    {
        this.CloseHandler();
    }
     window.location.reload;
}
CommonBox.prototype.SetContent = function(content)
{
    this.divContent.innerHTML = content;    
}
CommonBox.prototype.Toggle = function(left,top)
{
    if(this.divCommonBox.style.display == "block")
    {
        this.Hide();
    }
    else
    {
        this.Show(left,top);
    }
}
CommonBox.prototype.SetZIndex = function(zIndex)
{
    this.divCommonBox.style.zIndex = zIndex;
    this.divBackground.style.zIndex = zIndex - 1;
}
function IsOverLap(div1,div2)
{
    if(GetOffsetLeft(div1) < GetOffsetLeft(div2) + div2.offsetWidth && GetOffsetLeft(div1) + div1.offsetWidth > GetOffsetLeft(div2) && GetOffsetTop(div1) < GetOffsetTop(div2) + div2.offsetHeight && GetOffsetTop(div1) + div1.offsetHeight > GetOffsetTop(div2))
    {
        return true;
    }
    if(GetOffsetLeft(div2) < GetOffsetLeft(div1) + div1.offsetWidth && GetOffsetLeft(div2) + div2.offsetWidth > GetOffsetLeft(div1) && GetOffsetTop(div2) < GetOffsetTop(div1) + div1.offsetHeight && GetOffsetTop(div2) + div2.offsetHeight > GetOffsetTop(div1))
    {
        return true;
    }
    return false;
}
function GetOffsetLeft(control)
{
    var offsetLeft = 0;
    while(control != null)
    {
        offsetLeft += control.offsetLeft;
        control = control.offsetParent;
    }
    return offsetLeft;
}
function GetOffsetTop(control)
{
    var offsetTop = 0;
    while(control != null)
    {
        offsetTop += control.offsetTop;
        control = control.offsetParent;
    }
    return offsetTop;
}
//Progress

function ShowProcess(message)
{
    var topWindow = window.top;
    var topDocument = topWindow.document;
    var divProcess = topDocument.getElementById('divProcess');
    if(divProcess != null)
    {
        divProcess.style.display = 'block';
        divProcess.innerHTML = message;
    }
    else
    {
        divProcess = topDocument.createElement('div');
        divProcess.id = 'divProcess';
        divProcess.style.position = 'absolute';
        divProcess.style.padding = '3px';
        divProcess.style.color = '#FFFFFF';
        divProcess.style.fontWeight = 'bold';
        divProcess.style.backgroundColor = '#CC0000';
        divProcess.style.zIndex = 100;
        divProcess.innerHTML = message;
        topDocument.body.insertBefore(divProcess, topDocument.body.firstChild);
        if(topWindow.addEventListener)
        {
            window.addEventListener('scroll', MoveProcess, false);
            window.addEventListener('resize', MoveProcess, false);
        }
        else if(window.attachEvent)
        {
            window.attachEvent('onscroll', MoveProcess);
	        window.attachEvent('onresize', MoveProcess);
        }
    }
    MoveProcess();
}
function HideProcess()
{
    var divProcess = window.top.$('divProcess');
    if(divProcess != null)
    {
        divProcess.style.display = 'none';
    }
}
function MoveProcess()
{
    var scrollYT, scrollXT;
    var topWindow = window.top;
    var topDocument = topWindow.document;
    var divProcess = topDocument.getElementById('divProcess');
    if(divProcess == null)
    {
        return;
    }
    if(document.all)
    {
        scrollYT = topDocument.documentElement.scrollTop; 
		scrollXT = topDocument.body.scrollLeft;
    }
    else
    { 
		scrollYT = topWindow.pageYOffset; 
		scrollXT = topWindow.pageXOffset; 
	}
	divProcess.style.top = scrollYT + 1 + "px";
	divProcess.style.right = -scrollXT + "px";
	divProcess.style.top = scrollYT + "px";
	
}

function ShowResultBox(message, success)
{
    HideProcess();
    var title = '提示信息';
    var html = ''+
    '<div id="divResult" style="margin:20px auto 20px auto;text-align:center;">'+
        message + '<br /><br /><input id="btnResultClose" type="button" onclick="HideResultBox()" value="确定" class="btnCommon2"/>'+
    '</div>';
    if(window.top.boxResult)
    {
        window.top.boxResult.SetContent(html);        
    }
    else
    {
        window.top.boxResult = new window.top.CommonBox(html,title,0,0,200,100,false,true,null);
    }
    window.top.boxResult.SetZIndex(window.top.boxResult.defaultZIndex + 2);
    window.top.boxResult.Show();
    window.top.$('btnResultClose').focus();
    if(success)
    {        
        setTimeout("HideResultBox()",1000);
    }    
}

function ShowResultBox(message, success,swidth,sheight,wwidth,wheight)
{
     HideProcess();
    var title = '提示信息';
    var html = ''+
    '<div id="divResult" style="margin:"+swidth+"px auto "+swidth+"px auto;text-align:center;">'+
        message + '<br /><br /><center><input id="btnResultClose" type="button" onclick="HideResultBox()" value="确定" class="btnCommon2"/></center>'+
    '</div>';
    if(window.top.boxResult)
    {
        window.top.boxResult.SetContent(html);        
    }
    else
    {
        window.top.boxResult = new window.top.CommonBox(html,title,0,0,wwidth,wheight,false,true,null);
    }
    window.top.boxResult.SetZIndex(window.top.boxResult.defaultZIndex + 2);
    window.top.boxResult.Show();
    window.top.$('btnResultClose').focus();
    if(success)
    {        
        setTimeout("HideResultBox()",1000);
    }    
}

function ShowResultBox1(message, success)
{
    HideProcess();
    var title = '提示信息';
    var html = ''+
    '<div id="divResult" style="margin:20px auto 20px auto;text-align:center;">'+
        message + '<br /><br /><input id="btnResultClose" type="button" onclick="HideResultBox1()" value="选择体验课程" class="btnCommon2"/>'+
    '</div>';
    if(window.top.boxResult)
    {
        window.top.boxResult.SetContent(html);        
    }
    else
    {
        window.top.boxResult = new window.top.CommonBox(html,title,0,0,200,100,false,true,null);
    }
    window.top.boxResult.SetZIndex(window.top.boxResult.defaultZIndex + 2);
    window.top.boxResult.Show();
    window.top.$('btnResultClose').focus();
    if(success)
    {     
        window.top.location.href="User_Select_Course.jsp";   
        //setTimeout("HideResultBox()",1000);
    }    
}

function HideResultBox()
{
    if(window.top.boxResult)
    {
        window.top.boxResult.Hide();
    }
}

function HideResultBox1()
{
    if(window.top.boxResult)
    {
        window.top.boxResult.Hide();
    }
     window.top.location.href="User_Select_Course.jsp"; 
}

/*Login Related*/
var _loginSuccessHandler = new Array();
var loginBox = null;
function ToggleLoginBox(loginSuccessHandler)
{
    var html = '';
     
     html=html+'<table><tr><td align="center"><table width="424" height="100" cellpadding="0" cellspacing="0" border="0"> ';
     html=html+'  <tr>';
     html=html+'    <td height="88"><img src="Images/1-1.gif" width="424" height="88" /><br />';
     html=html+'    <img src="Images/1-2.gif" width="424" height="3" /></td>';
     html=html+'  </tr>';
     html=html+'  <tr>';
     html=html+'    <td background="Images/1-2.gif" align="center"><table width="287" height="57" cellpadding="0" cellspacing="0" border="0" class="table01">';
     html=html+'        <tr>';
     html=html+'          <td width="62" height="30" align="right">用户名：</td>';
     html=html+'          <td width="225" align="left"><input id="txtUsername" type="text" onblur="javascript:aa();" style="border-width:0px; border-bottom:solid 1px #ccc;width:180px;"/></td>';
     html=html+'        </tr>';
     html=html+'      <tr>';
     html=html+'        <td height="30" align="right">密码：</td>';
     html=html+'          <td align="left"><input id="txtPassword" type="password" onkeydown="if(event.keyCode == 13) Login($(\'txtUsername\').value,$(\'txtPassword\').value);" onblur="javascript:bb();" style="border-width:0px; border-bottom:solid 1px #ccc;width:180px;"/></td>';
     html=html+'        </tr>';
     html=html+'	  <tr><td colspan="2" align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="btnCommon2" type="button" value="登录" onclick="Login($(\'txtUsername\').value,$(\'txtPassword\').value);" />&nbsp;<input type="button" class="btnCommon2"  onclick="GetPassword($(\'txtUsername\').value);return false;" value="忘记密码?">&nbsp;&nbsp;&nbsp;<input type=button class="btnCommon2" onclick="ToggleRegisterBox();loginBox.Hide();return false;" value="获取新帐号"></td></tr>	';
     html=html+'      </table></td>';
     html=html+'  </tr>';
     html=html+'  <tr><td height="50"><img src="Images/1-3.gif" width="424" height="50" /></td></tr>';
     html=html+'</table></td></tr></table>';
      html=html+'<iframe id="a2" width=0 height=0 src="http://www.learning365.com/bbs_login.do"></iframe>';
      html=html+'<iframe id="a1"  width=0 height=0  src=""></iframe>';
      html=html+'<script>';
      html=html+'document.getElementById("txtLogin").disabled=true;';
      html=html+'</script>';
    

 
    if(loginSuccessHandler != null)
    {
        _loginSuccessHandler = _loginSuccessHandler.concat(loginSuccessHandler);
    }
    if(loginBox == null)
    {
         /* var AllSelectObjects =  document.getElementsByTagName("SELECT");
          if(AllSelectObjects[0].style.display==''){
            AllSelectObjects[0].style.display='none';
           }
          if(AllSelectObjects[1].style.display==''){
            AllSelectObjects[1].style.display='none';
          }
          */
        loginBox = new CommonBox(html,'用户登录',0,100,424,100,false,true,null);
    }
    loginBox.Toggle();
     $("txtPassword").value='';
     $("txtUsername").value='';
    SetFocus("txtUsername");
}

function ToggleLoginBoxHome(loginSuccessHandler)
{
    var html = '';
     html=html+'<table><tr><td align="center"><table width="424" height="100" cellpadding="0" cellspacing="0" border="0"> ';
     html=html+'  <tr>';
     html=html+'    <td height="88"><img src="Images/1-1.gif" width="424" height="88" /><br />';
     html=html+'    <img src="Images/1-2.gif" width="424" height="3" /></td>';
     html=html+'  </tr>';
     html=html+'  <tr>';
     html=html+'    <td background="Images/1-2.gif" align="center"><table width="287" height="57" cellpadding="0" cellspacing="0" border="0" class="table01">';
     html=html+'        <tr>';
     html=html+'          <td width="62" height="30" align="right">用户名：</td>';
     html=html+'          <td width="225" align="left"><input id="txtUsername" type="text" onblur="javascript:aa();" style="border-width:0px; border-bottom:solid 1px #ccc;width:180px;"/></td>';
     html=html+'        </tr>';
     html=html+'      <tr>';
     html=html+'        <td height="30" align="right">密码：</td>';
     html=html+'          <td align="left"><input id="txtPassword" type="password" onkeydown="if(event.keyCode == 13) LoginHome($(\'txtUsername\').value,$(\'txtPassword\').value);" onblur="javascript:bb();" style="border-width:0px; border-bottom:solid 1px #ccc;width:180px;"/></td>';
     html=html+'        </tr>';
     html=html+'	  <tr><td colspan="2" align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="btnCommon2" type="button" value="登录" name="txtLogin" id="txtLogin" onclick="LoginHome($(\'txtUsername\').value,$(\'txtPassword\').value);" />&nbsp;<input type="button" class="btnCommon2"  onclick="GetPassword($(\'txtUsername\').value);return false;" value="忘记密码?">&nbsp;&nbsp;&nbsp;<input type=button class="btnCommon2" onclick="ToggleRegisterBox();loginBox.Hide();return false;" value="获取新帐号"></td></tr>	';
     html=html+'      </table></td>';
     html=html+'  </tr>';
     html=html+'  <tr><td height="50"><img src="Images/1-3.gif" width="424" height="50" /></td></tr>';
     html=html+'</table></td></tr></table>';
      html=html+'<iframe id="a2" width=0 height=0 src="http://www.learning365.com/bbs_login.do"></iframe>';
      html=html+'<iframe id="a1"  width=0 height=0  src=""></iframe>';
      html=html+'<script>';
      html=html+'document.getElementById("txtLogin").disabled=true;';
      html=html+'</script>';
     
    if(loginSuccessHandler != null)
    {
        _loginSuccessHandler = _loginSuccessHandler.concat(loginSuccessHandler);
    }
    if(loginBox == null)
    {
         /* var AllSelectObjects =  document.getElementsByTagName("SELECT");
          if(AllSelectObjects[0].style.display==''){
            AllSelectObjects[0].style.display='none';
           }
          if(AllSelectObjects[1].style.display==''){
            AllSelectObjects[1].style.display='none';
          }
          */
        loginBox = new CommonBox(html,'用户登录',0,100,424,100,false,true,null);
    }
    loginBox.Toggle();
     try{
     $("txtPassword").value='';
     $("txtUsername").value='';
     }catch(e){}
    SetFocus("txtUsername");
}

function ToggleLoginBoxHome1(loginSuccessHandler)
{
    var html = '';
     html=html+'<table><tr><td align="center"><table width="424" height="100" cellpadding="0" cellspacing="0" border="0" class="table05"> ';
     html=html+'  <tr>';
     html=html+'    <td height="88"><img src="../Images/1-1.gif" width="424" height="88" /><br />';
     html=html+'    <img src="../Images/1-2.gif" width="424" height="3" /></td>';
     html=html+'  </tr>';
     html=html+'  <tr>';
     html=html+'    <td background="../Images/1-2.gif" align="center"><table width="290" height="57" cellpadding="0" cellspacing="0" border="0" class="table05">';
     html=html+'        <tr>';
     html=html+'          <td width="62" height="30" align="right">用户名：</td>';
     html=html+'          <td width="225" align="left"><input id="txtUsername" type="text" onblur="javascript:aa();" style="border-width:0px; border-bottom:solid 1px #ccc;width:180px;"/></td>';
     html=html+'        </tr>';
     html=html+'      <tr>';
     html=html+'        <td height="30" align="right">密码：</td>';
     html=html+'          <td align="left"><input id="txtPassword" type="password" onkeydown="if(event.keyCode == 13) LoginHome1($(\'txtUsername\').value,$(\'txtPassword\').value);" onblur="javascript:bb();" style="border-width:0px; border-bottom:solid 1px #ccc;width:180px;"/></td>';
     html=html+'        </tr>';
     html=html+'	  <tr><td colspan="2" align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="btnCommon2" type="button" value="登录" name="txtLogin" id="txtLogin" onclick="LoginHome1($(\'txtUsername\').value,$(\'txtPassword\').value);" />&nbsp;<input type="button" class="btnCommon2"  onclick="GetPassword1($(\'txtUsername\').value);return false;" value="忘记密码?">&nbsp;&nbsp;&nbsp;<input type=button class="btnCommon2" onclick="ToggleRegisterBox1();loginBox.Hide();return false;" value="获取新帐号"></td></tr>	';
     html=html+'      </table></td>';
     html=html+'  </tr>';
     html=html+'  <tr><td height="50"><img src="../Images/1-3.gif" width="424" height="50" /></td></tr>';
     html=html+'</table></td></tr></table>';
      html=html+'<iframe id="a2" width=0 height=0 src="http://www.learning365.com/bbs_login.do"></iframe>';
      html=html+'<iframe id="a1"  width=0 height=0  src=""></iframe>';
      html=html+'<script>';
      html=html+'document.getElementById("txtLogin").disabled=true;';
      html=html+'</script>';
     
    if(loginSuccessHandler != null)
    {
        _loginSuccessHandler = _loginSuccessHandler.concat(loginSuccessHandler);
    }
    if(loginBox == null)
    {
         /* var AllSelectObjects =  document.getElementsByTagName("SELECT");
          if(AllSelectObjects[0].style.display==''){
            AllSelectObjects[0].style.display='none';
           }
          if(AllSelectObjects[1].style.display==''){
            AllSelectObjects[1].style.display='none';
          }
          */
        loginBox = new CommonBox(html,'用户登录',0,100,424,100,false,true,null);
    }
    loginBox.Toggle();
     $("txtPassword").value='';
     $("txtUsername").value='';
    SetFocus("txtUsername");
}


function GetPassword(username)
{
    if(username == "")
    {
        alert("请填写用户名");
        return;
    }
     ShowProcess('正在提交请求，请稍候...');
    sendRequestGetPassword(username,"GetPassword.jsp");    
    if(window.loginBox)//For Test
    {
        loginBox.Hide();
    }
}
function GetPasswordSuccess(result)
{
    HideProcess();
     var docm=parse(XMLHttpReqBox1.responseText);
           try{ 
            if(docm.getElementsByTagName("Code")[0].firstChild.nodeValue=="D"){
                ShowResultBox('您的注册邮箱尚未通过验证，无法获取密码',false);
	     }else if (docm.getElementsByTagName("Code")[0].firstChild.nodeValue=="A"){
                ShowResultBox('获取密码请求已发送至您的注册邮箱，请注意查收',false);
	     }else{
                ShowResultBox('有错误发生，请重试',false);
             }
	  }catch(e){}

}
function parse(xml) {
	var xmldom;
        if (moz)  {   
                
                   alert(XMLHttpReq.responseText);
             } 

       try{
               
		dom = new ActiveXObject("Microsoft.XMLDOM");
                
		dom.async = false;
               
		dom.loadXML(xml);
                
                
	} catch (error) {
	  try{
               
                       
			var parser = new DOMParser();
			dom = parser.parseFromString(xml, "text/xml");
			delete parser;
	   } catch (error2) {
                        
			if (debug)
				alert("XML parsing is not supported.");
	    }
	  }
	return dom;
}
function  createXMLHttpRequestBox()  {
    if(window.XMLHttpRequest)  { 
       XMLHttpReqBox  =  new  XMLHttpRequest();
     }
     else  if  (window.ActiveXObject)  { 
     try  {
       XMLHttpReqBox  =  new  ActiveXObject("Msxml2.XMLHTTP");
     }catch(e){
        try  {
           XMLHttpReqBox  =  new  ActiveXObject("Microsoft.XMLHTTP");
        }catch(e){}
     }
    }
}
function  createXMLHttpRequestBox1()  {
    if(window.XMLHttpRequest)  { 
       XMLHttpReqBox1  =  new  XMLHttpRequest();
     }
     else  if  (window.ActiveXObject)  { 
     try  {
       XMLHttpReqBox1  =  new  ActiveXObject("Msxml2.XMLHTTP");
     }catch(e){
        try  {
           XMLHttpReqBox1  =  new  ActiveXObject("Microsoft.XMLHTTP");
        }catch(e){}
     }
    }
}
function  createXMLHttpRequestShopBox()  {
    if(window.XMLHttpRequest)  { 
       XMLHttpReqShopBox  =  new  XMLHttpRequest();
     }
     else  if  (window.ActiveXObject)  { 
     try  {
       XMLHttpReqShopBox  =  new  ActiveXObject("Msxml2.XMLHTTP");
     }catch(e){
        try  {
           XMLHttpReqShopBox  =  new  ActiveXObject("Microsoft.XMLHTTP");
        }catch(e){}
     }
    }
}

function  sendRequestBox(username,isSendData,urlname,username1,password)  {
	  createXMLHttpRequestBox();
	  var  url  =  username;
         XMLHttpReqBox.open("GET", url+"?t="+Math.random()+"&UserName="+username1+"&UserPwd="+password,true);
         XMLHttpReqBox.onreadystatechange  =  processResponseBox;
         XMLHttpReqBox.send();
         
}
function  sendRequestBoxHome(username,isSendData,urlname,username1,password)  {
	  createXMLHttpRequestBox();
           var  url  =  username;
         XMLHttpReqBox.open("GET", url+"?t="+Math.random()+"&UserName="+username1+"&UserPwd="+password,true);
         XMLHttpReqBox.onreadystatechange  =  processResponseBoxHome;
         XMLHttpReqBox.send();
         
}
function  sendRequestBoxHome1(username,isSendData,urlname,username1,password)  {
	  createXMLHttpRequestBox();
           var  url  =  username;
         XMLHttpReqBox.open("GET", url+"?t="+Math.random()+"&UserName="+username1+"&UserPwd="+password,true);
         XMLHttpReqBox.onreadystatechange  =  processResponseBoxHome1;
         XMLHttpReqBox.send();
         
}


function  sendRequestShopBox(username,isSendData,urlname,username1,password)  {
	  createXMLHttpRequestShopBox();
	  var  url  =  username;
         XMLHttpReqShopBox.open("GET", url+"?t="+Math.random()+"&UserName="+username1+"&UserPwd="+password,true);
         XMLHttpReqShopBox.onreadystatechange  =  processResponseShopBox;
         XMLHttpReqShopBox.send();
         
}

function  sendRequestLogoutBox(username,urlname)  {
	  createXMLHttpRequestBox1();
	  var  url  =  username;
         XMLHttpReqBox1.open("GET", url,true);
	  XMLHttpReqBox1.onreadystatechange  =  processResponseLogoutBox;
         XMLHttpReqBox1.send();
         
}
function  sendRequestGetPassword(username,url)  {
         createXMLHttpRequestBox1();
	  url  =  url+"?username="+username;
           alert(url);
         XMLHttpReqBox1.open("GET", url,true);
	  XMLHttpReqBox1.onreadystatechange  =  processResponseGetPasswordBox;
         XMLHttpReqBox1.send();
         
}

function  IsDisplayLogin()  {
             var a1="";
             var a2="";
           if (moz)  {   
                var parser = new DOMParser();
                   var docm = parser.parseFromString(XMLHttpReq.responseText, "text/xml");
                   var x=docm.documentElement;
                   
                   a1=x.childNodes[0].childNodes[0].nodeValue;
                   a2=x.childNodes[1].childNodes[0].nodeValue;
                                      
           }else{
                  var docm=parse(XMLHttpReq.responseText);
                     a1=docm.getElementsByTagName("Code")[0].firstChild.nodeValue;
                     a2=docm.getElementsByTagName("UrlName")[0].firstChild.nodeValue;
             }
             
           
	    try{ 
	     if(a1=="D"){
	     	  

                   var LoginTable="<table width=\"428\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"88\"><a style='cursor:hand'  href=\"#\" onclick=\"javascript:ToggleShowBuyBox();\"><img src=\"Images/p_gwc.gif\" width=\"19\" height=\"15\" border=\"0\" />购物车</a></td><td width=\"308\" height=\"26\"><a href=\"#\"  style='cursor:hand' onclick='javascript:ToggleLoginBox();'>登录</a>&nbsp;|&nbsp;<a href=\"#\" style=\"cursor:hand\" onclick='javascript:ToggleRegisterBox();'>免费注册</a>&nbsp;|&nbsp;<a href=\"#\" onClick=\"this.style.behavior='url(#default#homepage)';this.setHomePage('www.Learning365.com');\">设为首页</a>&nbsp;|&nbsp;<a href=\"javascript:window.external.AddFavorite('http://www.Learning365.com&#39;,'Learning365 学习在线')\">加入收藏夹</a></td></tr></table>";
                   //" <table width=\"210\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><a style='cursor:hand' onclick=\"javascript:ToggleShowBuyBox();\"><img src=\"Images/gwc31.gif\" width=\"50\" height=\"50\" border=\"0\" /></a></td><td><a href=\"#\" onclick='javascript:ToggleLoginBox();'><img src=\"Images/index_top_denglu.gif\" width=\"62\" height=\"36\" border=\"0\" /></a></td><td><a href=\"#\" onclick='javascript:ToggleRegisterBox();'><img src=\"Images/index_top_zhuce.gif\" width=\"62\" height=\"36\" border=\"0\" /></a></td></tr></table>";
                  
                   
                  if(moz){
                   
                   document.getElementById("login").innerHTML=LoginTable; 

                  }else{
                   document.getElementById("login").innerHTML=LoginTable; 
                  }
                  
	     }else{
                
	     	if(a2=="Check_Is_Login.htm"){
	     		window.location.href="http://192.168.1.99:8080/coonowsite/User_Judian_Append.jsp?qid="+gqid;    		
	     	}else if(a2=="Check_Is_Login1.htm"){
	     		window.location.href="http://192.168.1.99:8080/coonowsite/User_Judian_Correct.jsp?qid="+gqid;    		
	     	}
	     	else{
	     	  var tmp="";
                  tmp=tmp+"<table width=\"428\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
		     tmp=tmp+"   <tr>"; 
                     tmp=tmp+"    <td width=\"78\"><a style='cursor:hand'  href=\"#\" onclick=\"javascript:ToggleShowBuyBox();\"><img src=\"Images/p_gwc.gif\" width=\"19\" height=\"15\" border=\"0\" />购物车</a></a></td>"; 
                     tmp=tmp+"    <td width=\"350\" align='left'>";
                     tmp=tmp+"<span class='txt05'>"+docm.getElementsByTagName("UserName")[0].firstChild.nodeValue+"</span>|";
                     tmp=tmp+"<a style='cursor:hand' href='javascript:ToggleMyCourseBox();'   >我的课程中心</a>|"; //onclick=\"javascript:ToggleMyCourseBox();\"
                     tmp=tmp+"<a href='#' onClick=\"this.style.behavior='url(#default#homepage)';this.setHomePage('www.Learning365.com');\">设为首页</a>|<a href=\"javascript:window.external.AddFavorite('http://www.Learning365.com&#39;,'Learning365 学习在线')\">加入收藏夹</a>";
                     tmp=tmp+"<input type=\"button\" name=\"quit\" onclick=\"javascript:Logout();\" value=\"退出\" />";
                     tmp=tmp+"      </td>"; 
                     tmp=tmp+"  </tr>"; 
                     tmp=tmp+"</table>"; 
                     document.getElementById("login").innerHTML=tmp; 
                     

	    	  HideProcess();

	    	}
	    }
	  }catch(e){
             
                
            }
	     
}

function TrimEnd(stringToTrim)
{
    if (stringToTrim != null && stringToTrim.length > 0 )    
    {          
        var temp = stringToTrim.charAt(stringToTrim.length - 1);
        while (stringToTrim.length > 0  && temp == ' ')  
        {
            stringToTrim = stringToTrim.substr(0, stringToTrim.length - 1); 
            temp = stringToTrim.charAt(stringToTrim.length - 1);
        }
    }
    return stringToTrim;          
}
//判断汉字及个数
function   g(v){   
  try{return   v.match(/[\u4e00-\u9fa5]/g).length}catch(e){return   0}   
 }  
function  IsDisplayLoginShopBox()  {
	    var docm=parse(XMLHttpReqShopBox.responseText);
            var errorreason="";
           try{
            if(docm.getElementsByTagName("Code")[0].firstChild.nodeValue=="D"){
                   errorreason=docm.getElementsByTagName("Error")[0].firstChild.nodeValue
	     	  ShowResultBox("<span class=\"txt05\">"+errorreason+"</span>",false);
	     }else{
	     	    HideProcess();
                window.location.reload;
	      } 
	     
	    }catch(e){}	     
}

function  IsDisplayLogoutBox()  {
	    var docm=parse(XMLHttpReqBox1.responseText);
	    try{ 
	     if(docm.getElementsByTagName("Code")[0].firstChild.nodeValue=="A"){
	     	  var LoginTable="<table width=\"428\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"88\"><a style='cursor:hand' href=\"#\" onclick=\"javascript:ToggleShowBuyBox();\"><img src=\"Images/p_gwc.gif\" width=\"19\" height=\"15\" border=\"0\" />购物车</a></a></td><td width=\"308\" height=\"26\"><a   style='cursor:hand' onclick='javascript:ToggleLoginBox();'>登录</a>&nbsp;|&nbsp;<a href=\"#\" style=\"cursor:hand\" onclick='javascript:ToggleRegisterBox();'>免费注册</a>&nbsp;|&nbsp;<a href=\"#\" onClick=\"this.style.behavior='url(#default#homepage)';this.setHomePage('www.Learning365.com');\">设为首页</a>&nbsp;|&nbsp;<a href=\"javascript:window.external.AddFavorite('http://www.Learning365.com&#39;,'Learning365 学习在线')\">加入收藏夹</a></td></tr></table>";
	     	  document.getElementById("login").innerHTML=LoginTable; 
	     }else{
	     	  ShowResultBox('有错误发生，请重试',false);
	      }
	    HideProcess();
	  }catch(e){}
	     
}

function  IsDisplayLoginBox()  {

             var a1="";
             var a2="";
           if (moz)  {   
                   //var parser = new DOMParser();
                   //var docm = parser.parseFromString(XMLHttpReqBox.responseText, "text/xml");
                   //var x=docm.documentElement;
                   
                   //a1=x.childNodes[0].childNodes[0].nodeValue;
                   //a2=x.childNodes[1].childNodes[0].nodeValue;
                   //alert(XMLHttpReqBox.responseText);
                   //alert(a1);
                   //alert(a2);
                                      
           }else{
                  var docm=parse(XMLHttpReqBox.responseText);
                  a1=docm.getElementsByTagName("Code")[0].firstChild.nodeValue;
                  //a2=docm.getElementsByTagName("Error")[0].firstChild.nodeValue;
             }
             
           
	    try{ 
	     if(a1=="D"){

	         errorreason=docm.getElementsByTagName("Error")[0].firstChild.nodeValue
	     	  ShowResultBox("<span class=\"txt05\">"+errorreason+"</span>",false);
	     }else{
                 
	     	 var tmp="";
                  tmp=tmp+"<table width=\"428\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
		     tmp=tmp+"   <tr>"; 
                     tmp=tmp+"    <td width=\"78\"><a style='cursor:hand'  href=\"#\" onclick=\"javascript:ToggleShowBuyBox();\"><img src=\"Images/p_gwc.gif\" width=\"19\" height=\"15\" border=\"0\" />购物车</a></a></td>"; 
                     tmp=tmp+"    <td width=\"350\" align='left'>";
                     tmp=tmp+"<span class='txt05'>"+docm.getElementsByTagName("UserName")[0].firstChild.nodeValue+"</span>|";
                     tmp=tmp+"<a style='cursor:hand' onclick=\"javascript:ToggleMyCourseBox();\" >我的课程中心</a>|"; //
                     tmp=tmp+"<a href='#' onClick=\"this.style.behavior='url(#default#homepage)';this.setHomePage('www.Learning365.com');\">设为首页</a>|<a href=\"javascript:window.external.AddFavorite('http://www.Learning365.com&#39;,'Learning365 学习在线')\">加入收藏夹</a>";
                     tmp=tmp+"<input type=\"button\" name=\"quit\" onclick=\"javascript:Logout();\" value=\"退出\" />";
                     tmp=tmp+"      </td>"; 
                     tmp=tmp+"  </tr>"; 
                     tmp=tmp+"</table>"; 

                  document.getElementById("login").innerHTML=tmp; 
                     SetCookie("UserName",docm.getElementsByTagName("UserName")[0].firstChild.nodeValue);
                     // ShowResultBox("<br><span class=txt05>欢迎["+docm.getElementsByTagName("UserName")[0].firstChild.nodeValue+"]登录到356学习在线！</span><br><br><span class=txt051>您可在考试课程中购买所需课程<br>也可在此进入我的课程中心开始学习!</span>",false,100,100,400,300);
	    	     HideProcess();
	      } 
	     
	    }catch(e){}	     
}
function  processResponseBox()  {
      if(XMLHttpReqBox.readyState  ==  4){
         
        if(XMLHttpReqBox.status  ==  200){
		IsDisplayLoginBox();		
        }  else  {
        	ShowResultBox('有错误发生，请重试',false);
          
        }
      }
}
function  processResponseBoxHome()  {
       var a1="";
      if(XMLHttpReqBox.readyState  ==  4){
         
        if(XMLHttpReqBox.status  ==  200){
           var docm=parse(XMLHttpReqBox.responseText);
           a1=docm.getElementsByTagName("Code")[0].firstChild.xml;
                if(a1=="A"){
                window.location.href="MyCourse_ControlPad.jsp";
              }else{
        	  ShowResultBox('用户名和密码组合不存在,请重新登录',false);
              }
        }  else  {
          	ShowResultBox('用户名和密码组合不存在,请重新登录',false);
        }
      }
}
function  processResponseBoxHome1()  {
      if(XMLHttpReqBox.readyState  ==  4){
         
        if(XMLHttpReqBox.status  ==  200){
            var a1="";
             var a2="";
           if (moz)  {   
                   //var parser = new DOMParser();
                   //var docm = parser.parseFromString(XMLHttpReqBox.responseText, "text/xml");
                   //var x=docm.documentElement;
                   
                   //a1=x.childNodes[0].childNodes[0].nodeValue;
                   //a2=x.childNodes[1].childNodes[0].nodeValue;
                   //alert(XMLHttpReqBox.responseText);
                   //alert(a1);
                   //alert(a2);
                                      
           }else{
                  var docm=parse(XMLHttpReqBox.responseText);
                  a1=docm.getElementsByTagName("Code")[0].firstChild.nodeValue;
                  //a2=docm.getElementsByTagName("Error")[0].firstChild.nodeValue;
             }

          try{ 
              if(a1=="D"){

	         errorreason=docm.getElementsByTagName("Error")[0].firstChild.nodeValue
	     	  ShowResultBox("<span class=\"txt05\">"+errorreason+"</span>",false);
	     }else{
                window.location.href="/online1/User_Select_Course.jsp"; 
	     	 
	      } 
	     
	    }catch(e){}  

                
        }  else  {
                
        	ShowResultBox('有错误发生，请重试',false);
          
        }
      }
}

function  processResponseShopBox()  {
      if(XMLHttpReqShopBox.readyState  ==  4){
         
        if(XMLHttpReqShopBox.status  ==  200){
		IsDisplayLoginShopBox();		
        }  else  {
        	ShowResultBox('有错误发生，请重试',false);
          
        }
      }
}

function  processResponseLogoutBox()  {
      if(XMLHttpReqBox1.readyState  ==  4){
         
        if(XMLHttpReqBox1.status  ==  200){
		IsDisplayLogoutBox();	
        }  else  {
        	ShowResultBox('有错误发生，请重试',false);
          
        }
      }
}
function  processResponseGetPasswordBox()  {
      if(XMLHttpReqBox1.readyState  ==  4){
         
        if(XMLHttpReqBox1.status  ==  200){
		GetPasswordSuccess();	
        }  else  {
        	ShowResultBox('有错误发生，请重试',false);
          
        }
      }
}


function Login(username,password)
{
    if(username == "")
    {
        alert("请填写用户名");
        return;
    }        
    if(password == "")
    {
        alert("请填写密码");
        return;
    }    
    ShowProcess('正在登陆，请稍候...');    
    sendRequestBox("/User_CheckLoginIndex.jsp",1,"Index.jsp",username,password);
    if(window.loginBox)//For Test
    {
        		loginBox.Hide();
    }
    
}  
function LoginHome(username,password)
{
    if(username == "")
    {
        alert("请填写用户名");
        return;
    }        
    if(password == "")
    {
        alert("请填写密码");
        return;
    }    
    ShowProcess('正在登陆，请稍候...'); 
     
    sendRequestBoxHome("/User_CheckLoginIndex.jsp",1,"Index.jsp",username,password);
    if(window.loginBox)//For Test
    {
        		loginBox.Hide();
    }
    
}  
function LoginHome1(username,password)
{
    if(username == "")
    {
        alert("请填写用户名");
        return;
    }        
    if(password == "")
    {
        alert("请填写密码");
        return;
    }    
    ShowProcess('正在登陆，请稍候...'); 
     
    sendRequestBoxHome1("/User_CheckLoginIndex.jsp",1,"Index.jsp",username,password);
    if(window.loginBox)//For Test
    {
        loginBox.Hide();
    }
    
}  


function ShopCarLogin(username,password)
{
    if(username == "")
    {
        alert("请填写用户名");
        return;
    }        
    if(password == "")
    {
        alert("请填写密码");
        return;
    }    
    ShowProcess('正在登陆，请稍候...');    
    sendRequestShopBox("/User_CheckLoginIndex.jsp",1,"Buy_Step2.jsp",username,password);
    if(window.loginBox)//For Test
    {
        		loginBox.Hide();
    }
    
}  

function Logout()
{
    ShowProcess('正在安全退出，请稍候...');    
    sendRequestLogoutBox("/User_CheckLogoutIndex.jsp?t="+Math.random(),"Index.jsp");
    //window.location.reload();
}  



var boxRegister = null;

function ToggleGoodBox1(goodid,goodname)
{
  top.$('imgClose').click();
  if (window.top.boxGood){
    window.top.boxGood.Hide();
  }
  ToggleGoodBox(goodid,goodname);
}

function ToggleMyCourseCenterFromBox()
{
  top.$('imgClose').click();
  ToggleMyCourseBox();
}



function ToggleRegisterBox()
{
    var width = 500;
    var height = 400;

    var html = '<iframe src="User_Reg.htm" frameborder="0" width="' + width + 'px" height="' + height + 'px"  scrolling="no"></iframe>';
    boxRegister =null;
     if(boxRegister == null)
    {
        boxRegister = new CommonBox(html,'用户注册',0,0,width,0,true,true,null);
    }
    else
    {
        boxRegister.SetContent(html);
    }
    boxRegister.Toggle();
}

function ToggleRegisterBox1()
{
    var width = 500;
    var height = 400;

    var html = '<iframe src="../User_Reg2.htm" frameborder="0" width="' + width + 'px" height="' + height + 'px"  scrolling="no"></iframe>';
    boxRegister =null;
     if(boxRegister == null)
    {
        boxRegister = new CommonBox(html,'用户注册',0,0,width,0,true,true,null);
    }
    else
    {
        boxRegister.SetContent(html);
    }
    boxRegister.Toggle();
}

var boxRegisterBuy=null;
function ToggleRegisterBoxBuy()
{
    var width = 500;
    var height = 400;

    var html = '<iframe src="User_Reg.htm" frameborder="0" width="' + width + 'px" height="' + height + 'px"  scrolling="no"></iframe>';
    window.top.boxRegisterBuy=null;
    if(window.top.boxRegisterBuy)
    {
        window.top.boxRegisterBuy= new window.top.CommonBox(html,'用户注册',0,0,width,0,true,true,null);
    }
    else
    {
        window.top.boxRegisterBuy= new window.top.CommonBox(html,'用户注册',0,0,width,0,true,true,null);
    }
    window.top.boxRegisterBuy.SetZIndex(window.top.boxRegisterBuy.defaultZIndex + 2);
    window.top.boxRegisterBuy.Show();
    window.top.boxRegisterBuy.focus;
}
function Sleep(obj,iMinSecond)
{ 
   if (window.eventList==null) 
   window.eventList=new Array(); 
   var ind=-1;
   for (var i=0;i<window.eventList.length;i++)
   {  
    if (window.eventList[i]==null) 
    { 
     window.eventList[i]=obj;   
     ind=i;  
     break;  
    } 
   } 
   if (ind==-1)
   {  
    ind=window.eventList.length;  
    window.eventList[ind]=obj;
   } 
   setTimeout("GoOn(" + ind + ")",iMinSecond);
}
function GoOn(ind)
{ 
   var obj=window.eventList[ind];
   window.eventList[ind]=null;
   if (obj.NextStep) obj.NextStep();
   else obj();
}
var aobject=null;
var boxAnnounce = null;
function ToggleAnnounceBox(channelid,id,title)
{
    var width = 500;
    var height = 400;
    var html = '<iframe name=\"iframeMain\" src=\"http://www.learning365.com/Announce.jsp?ChannelID='+channelid+'&ID='+id+'&t='+Math.random()+'\" frameborder="0" width="' + width + 'px" height="' + height + 'px" ></iframe>';
     boxAnnounce =null; 
    if(boxAnnounce == null)
    {
        boxAnnounce = new CommonBox(html,title,0,0,width,0,false,true,null);
    }
    else
    {
        boxAnnounce.SetContent(html);
    }
     boxAnnounce.Toggle();
      document.all.iframeMain.contentWindow.location.reload();
      //aobject=setInterval("reloadwin()",100);
      
}
function reloadwin(){
     alert("1111");
     try{  
       document.all.iframeMain.contentWindow.location.reload();//="http://www.learning365.com/Announce.jsp?ChannelID="+channelid+"&ID="+id+"&t="+Math.random();  
       clearInterval(aobject);
     }catch(e){}
}
var boxArticle = null;
function ToggleArticleBox(id,title,filename)
{
    var width = 780;
    var height = 550; 
    var html = '';
     if(filename==""||filename=='null'){
      html='<iframe src=\"News_Show.jsp?ArticleID='+id+'\" frameborder="0" width="' + width + 'px" height="' + height + 'px" ></iframe>';
     }else{
      html='<iframe src=\"'+filename+'\" frameborder="0" width="' + width + 'px" height="' + height + 'px" ></iframe>';
      }
     boxArticle =null; 
    if(boxArticle == null)
    {
        boxArticle = new CommonBox(html,title,0,0,width,0,false,true,null);
    }
    else
    {
        boxArticle.SetContent(html);
    }
    boxArticle.Toggle();
}

var boxGood = null;
function ToggleGoodBox(id,title)
{
    var width = 930;
    var height = 450;
    var html = '<iframe src=\"SpecialGood.jsp?ID='+id+'\" frameborder="0" width="' + width + 'px" height="' + height + 'px" scroll="no" ></iframe>';
    boxGood = null;
    if(boxGood== null)
    {
        boxGood = new CommonBox(html,title,0,0,width,0,false,true,null);
    }
    else
    {
        boxGood .SetContent(html);
    }
    boxGood .Toggle();
}


var boxWeiShiListen=null;
function CheckAndEnterWeiShi(id,title)
{
    var width = 540;
    var height = 495;
    var html = '<iframe src=\"365Player1.jsp?ID='+id+'&t='+Math.random()+'\" name="player" id="player" frameborder="0" width="' + width + 'px" height="' + height + 'px" scroll="no" ></iframe>';
    boxWeiShiListen= null;
    if(boxWeiShiListen== null)
    {
        boxWeiShiListen= new CommonBox(html,title,0,0,width,0,false,true,null);
    }
    else
    {
        boxWeiShiListen.SetContent(html);
    }
    boxWeiShiListen.Toggle();
}

var boxGoodListen=null;
function ToggleGoodBoxListen(id,title)
{
    var width = 540;
    var height = 495;
     gGoodId=Math.random();
    var html = '<iframe src=\"365Player.jsp?ID='+id+'&t='+Math.random()+'\" name="player'+gGoodId+'" id="player'+gGoodId+'" frameborder="0" width="' + width + 'px" height="' + height + 'px" scroll="no" ></iframe>';
    boxGoodListen= null;
   if(window.top.boxGoodListen!=null)
    {
        window.top.boxGoodListen=null;
        window.top.boxGoodListen= new window.top.CommonBox(html,title,0,0,200,100,false,true,null);
         //window.top.boxGoodListen.SetContent(html);        
    }
    else
    {
        window.top.boxGoodListen= new window.top.CommonBox(html,title,0,0,200,100,false,true,null);
    }
    window.top.boxGoodListen.SetZIndex(window.top.boxGoodListen.defaultZIndex + 2);
    window.top.boxGoodListen.Show();
    window.top.boxGoodListen.focus;
    
     
}
var boxGoodListen1=null;
function ToggleGoodBoxListen1(id,title)
{
    var width = 550;
    var height = 450;
    var html = '<iframe src=\"365Player1.jsp?ID='+id+'\" frameborder="0" width="' + width + 'px" height="' + height + 'px" scroll="no" ></iframe>';
    boxGoodListen1= null;
    if(boxGoodListen1== null)
    {
        boxGoodListen1= new CommonBox(html,title,0,0,width,0,false,true,null);
    }
    else
    {
        boxGoodListen1.SetContent(html);
    }
    boxGoodListen1.Toggle();
}

var boxMyCourse=null;
function ToggleMyCourseBox(){
    ShowProcess("正在打开我的课程中心"); 
    var width = 780;
    var height = 350;
    //var html = '<iframe src=\"MyCourse_ControlPad.jsp\" frameborder="0" width="' + width + 'px" height="' + height + 'px" scroll="no" ></iframe>';
     var html = '<iframe src=\"tip.htm\" frameborder="0" width="' + width + 'px" height="' + height + 'px" scroll="no" ></iframe>';

    boxMyCourse= null;
    if(boxMyCourse== null)
    {
        boxMyCourse= new CommonBox(html,'进入[我的课程中心]操作提示：',0,0,width,0,false,true,null);
    }
    else
    {
        boxMyCourse.SetContent(html);
    }
    boxMyCourse.Toggle();
     HideProcess();


}

var boxBuyGood = null;

function ToggleGoodBuyBox(id,title,num,price,realprice)
{
    ShowProcess("正在打开我的购物车"); 
    var width = 900;
    var height = 500;
    var html = '<iframe src=\"/AddGoodToShopCar.jsp?ID='+id+'&GoodName='+title+'&Number='+num+'&Price='+price+'&RealPrice='+realprice+'\" frameborder="0" width="' + width + 'px" height="' + height + 'px" scroll="no" ></iframe>';
    boxBuyGood = null;
    if(boxBuyGood == null)
    {
        boxBuyGood = new CommonBox(html,'我的购物车',0,0,width,0,false,true,null);
    }
    else
    {
        boxBuyGood.SetContent(html);
    }
    boxBuyGood.Toggle();
     HideProcess();
}
function ToggleShowBuyBox()
{
    var width = 900;
    var height = 500;
    var html = '<iframe src=\"/Buy_Step1.jsp\" frameborder="0" width="' + width + 'px" height="' + height + 'px" scroll="no" ></iframe>';
    boxBuyGood = null;
    if(boxBuyGood == null)
    {
        boxBuyGood = new CommonBox(html,'我的购物车',0,0,width,0,false,true,null);
    }
    else
    {
        boxBuyGood.SetContent(html);
    }
    boxBuyGood.Toggle();
}
var boxDirectBuyGood = null;
function ToggleGoodDirectBuyBox(id,title,num,price,realprice)
{
    var width = 900;
    var height = 500;
    var html = '<iframe src=\"AddGoodToShopCarAndBuy.jsp?ID='+id+'&GoodName='+title+'&Number='+num+'&Price='+price+'&RealPrice='+realprice+'\" frameborder="0" width="' + width + 'px" height="' + height + 'px" scroll="no" ></iframe>';
    boxDirectBuyGood = null;
    if(boxDirectBuyGood == null)
    {
        boxDirectBuyGood = new CommonBox(html,'我的购物车',0,0,width,0,false,true,null);
    }
    else
    {
        boxDirectBuyGood.SetContent(html);
    }
    boxDirectBuyGood.Toggle();
}
var boxLongRe = null;
function openLongRe(id){
    var file="http://61.172.200.157/ViewLongRe.asp?id="+id;
    var width = 900;
    var height = 500;
    var html = '<iframe src='+file+' frameborder="0" width="' + width + 'px" height="' + height + 'px" scroll="no" ></iframe>';
    boxLongRe = null;
    if(boxLongRe == null)
    {
        boxLongRe = new CommonBox(html,'相关新闻',0,0,width,0,false,true,null);
    }
    else
    {
        boxLongRe .SetContent(html);
    }
    boxLongRe .Toggle();

}

function  createXMLHttpRequest()  {
    if(window.XMLHttpRequest)  { 
       XMLHttpReq  =  new  XMLHttpRequest();
     }
     else  if  (window.ActiveXObject)  { 
     try  {
       XMLHttpReq  =  new  ActiveXObject("Msxml2.XMLHTTP");
     }catch(e){
        try  {
           XMLHttpReq  =  new  ActiveXObject("Microsoft.XMLHTTP");
        }catch(e){}
     }
    }
}
function  createXMLHttpEmailRequest()  {
    if(window.XMLHttpRequest)  { 
       XMLHttpReqEmail  =  new  XMLHttpRequest();
     }
     else  if  (window.ActiveXObject)  { 
     try  {
       XMLHttpReqEmail  =  new  ActiveXObject("Msxml2.XMLHTTP");
     }catch(e){
        try  {
           XMLHttpReqEmail  =  new  ActiveXObject("Microsoft.XMLHTTP");
        }catch(e){}
     }
    }
}
function  createXMLHttpUserNameRequest()  {
    if(window.XMLHttpRequest)  { 
       XMLHttpReqUserName  =  new  XMLHttpRequest();
     }
     else  if  (window.ActiveXObject)  { 
     try  {
       XMLHttpReqUserName  =  new  ActiveXObject("Msxml2.XMLHTTP");
     }catch(e){
        try  {
           XMLHttpReqUserName  =  new  ActiveXObject("Microsoft.XMLHTTP");
        }catch(e){}
     }
    }
}
function  createXMLHttpUserLoginRequest()  {
    if(window.XMLHttpRequest)  { 
       XMLHttpReqUserLogin  =  new  XMLHttpRequest();
     }
     else  if  (window.ActiveXObject)  { 
     try  {
       XMLHttpReqUserLogin  =  new  ActiveXObject("Msxml2.XMLHTTP");
     }catch(e){
        try  {
           XMLHttpReqUserLogin  =  new  ActiveXObject("Microsoft.XMLHTTP");
        }catch(e){}
     }
    }
}

/**
==================================================================
CheckIsLogin():检查是否登陆
==================================================================
*/
function CheckIsLogin(urlname){
	createXMLHttpRequest();
	var  url1  =  "/User_Is_Login.jsp?urlname="+urlname+".htm&t="+Math.random();
        XMLHttpReq.open("get", url1,  true);
	XMLHttpReq.onreadystatechange  =  processDisplay;
	XMLHttpReq.send(null);
}
function  processDisplay()  {
      if(XMLHttpReq.readyState  ==  4){
        if(XMLHttpReq.status  ==  200){
                IsDisplayLogin();
        }  else  {
        	
        }
      }
}
function closeandredirect(urlname){
      top.window.location.href=urlname;

}
function CreateXMLParser()
{
	var x;
	try{
		x=document.implementation.createDocument('','',null);
	}catch(e){
		  try{
		     x= new ActiveXObject('MSXML2.DOMDocument.5.0');
	    }catch(e){
	    	try{
		        x= new ActiveXObject('MSXML2.DOMDocument.4.0');
	      }catch(e){
	      	try{
		        x= new ActiveXObject('MSXML2.DOMDocument.3.0');
	        }catch(e){
	        	try{
		            x= new ActiveXObject('MSXML2.DOMDocument.2.6');
	          }catch(e){
	          	try{
		             x= new ActiveXObject('MSXML2.DOMDocument');
	            }catch(e){
	          	   try{
		                x= new ActiveXObject('Microsoft.XMLDOM');
	               }catch(e){
	            	    x= null;
	               }
	            }
	         }
	     }
	   }
	 }
 }
	if(x){
		x.setProperty("SelectionLanguage","XPath");
		x.setProperty("SelectionNamespaces",'');
	}
	return x;
}

function CheckIsExistEmail(email){
	createXMLHttpEmailRequest();
	var  url1  =  "/User_Is_Email.jsp?urlname="+email+"&t="+Math.random();
       XMLHttpReqEmail.open("get", url1,  true);
	XMLHttpReqEmail.onreadystatechange  =  processDisplayEmail;
	XMLHttpReqEmail.send(null);
}
function CheckIsExistUserName(email){
	createXMLHttpUserNameRequest();
	var  url1  =  "/User_Is_UserName.jsp?urlname="+email+"&t="+Math.random();
       XMLHttpReqUserName.open("get", url1,  true);
	XMLHttpReqUserName.onreadystatechange  =  processDisplayUserName;
	XMLHttpReqUserName.send(null);
}
function relogin(username,password){
       	createXMLHttpUserLoginRequest();
	var  url1  =  "/User_Login_Again.jsp?urlname="+username+"&pass="+password+"&t="+Math.random();   
        XMLHttpReqUserLogin.open("get", url1,  true);
	XMLHttpReqUserLogin.onreadystatechange  =  processDisplayUserLogin;
	XMLHttpReqUserLogin.send(null);

}

function  processDisplayEmail()  {
      if(XMLHttpReqEmail.readyState  ==  4 ){
        if(XMLHttpReqEmail.status  ==  200){
        	IsDisplayEmail();
        }  else  {
        	
        }
      }
}
function  processDisplayUserName()  {
      if(XMLHttpReqUserName.readyState  ==  4){
        if(XMLHttpReqUserName.status  ==  200){
        	IsDisplayUserName();
        }  else  {
        	
        }
      }
}
function  processDisplayUserLogin()  {
      if(XMLHttpReqUserLogin.readyState  ==  4){
        if(XMLHttpReqUserLogin.status  ==  200){
        }  else  {
        }
      }
}

function  IsDisplayEmail()  {
	    var docm=parse(XMLHttpReqEmail.responseText);
            
	    try{ 
            if(docm.getElementsByTagName("Code")[0].firstChild.nodeValue=="D"){
                $("UserEmail").className = 'txtError';
                $("spanEmail").className = 'spanError';
         	  $("spanEmail").innerHTML="<font colr=#FF0000>您的电子邮件已经被保留，请重新输入您的电子邮件！</font>";
                return false; 
	     }else{
                $("UserEmail").className = 'txtPassed';
            	 $("spanEmail").className = 'spanPassed';
                $("spanEmail").innerHTML = '格式正确';
                  
                if(b==0){ 
                	window.frames["mainframe"].document.registerForm.email.value=docm.getElementsByTagName("Email")[0].firstChild.nodeValue;
                	b=1;
               }
               if(a==1 && b==1 && c==1){
    	  	       check();
  	        }
               return true; 
	     }
	  }catch(e){}
	     
}
function  IsDisplayUserName()  {
	    var docm=parse(XMLHttpReqUserName.responseText);
           try{ 
            if(docm.getElementsByTagName("Code")[0].firstChild.nodeValue=="D"){
                 $('UserName').className = 'txtError';
                 $("spanUserName").className = 'spanError';
                 $("spanUserName").innerHTML = "<font color=#FF0000>该用户已经存在，请重新输入一个新的用户名！</font>";
                 return false; 
	     }else{
              $('UserName').className = 'txtPassed';
    	       $("spanUserName").className = 'spanPassed';        
              $("spanUserName").innerHTML = '验证通过';
              //alert(window.frames["mainframe"].document.registerForm.userName.value);
              if(a==0){
      			a=1;
                     window.frames["mainframe"].document.registerForm.userName.value=docm.getElementsByTagName("UserName")[0].firstChild.nodeValue;
     	       }
     	       if(a==1 && b==1 && c==1){
			check();
	      	}
              return true; 
	     }
	  }catch(e){}
	     
}
function  createXMLHttpRequest4()  {
	  
    if(window.XMLHttpRequest)  { 
       XMLHttpReq4  =  new  XMLHttpRequest();
     }
     else  if  (window.ActiveXObject)  { 
     try  {
       XMLHttpReq4  =  new  ActiveXObject("Msxml2.XMLHTTP");
     }catch(e){
        try  {
           XMLHttpReq4  =  new  ActiveXObject("Microsoft.XMLHTTP");
        }catch(e){}
     }
    }
    
}
function  sendRequest2(username,inum,isSendData)  {
		var  url  =  username;
		XMLHttpReq4.open("post", url,  true);
		XMLHttpReq4.onreadystatechange  =  processResponseNewQuestion;
		if(isSendData==1){
		  XMLDom=fillXMLDoc1(inum);
		  XMLHttpReq4.send(strData);
	  }else{
		  XMLHttpReq4.send(null);
	  }
		
}
function IsDisplayNewQuestion(){
      
	   var doc=parse(XMLHttpReq4.responseText);
          var hotprofessor="";
	   if(doc.getElementsByTagName("Code")[0].firstChild==null||doc.getElementsByTagName("Code")[0].firstChild.nodeValue=="D"){
	    	 hotprofessor="<table width='98%' border='0' cellpadding='0' cellspacing='0' ><tr><td >暂无最新问题!</td></tr></table>";
	    	 document.getElementById("newquestion").innerHTML=hotprofessor;
	    }else{
	    	if(doc.getElementsByTagName("FileName")[0].firstChild.nodeValue==""){ 
	    	 hotprofessor="<table width='98%' border='0' cellpadding='0' cellspacing='0' >";
	    	}else{
	    	 hotprofessor="<table width='97%' border='0' cellpadding='0' cellspacing='0' >";
	    		} 
	    	 var list=doc.selectNodes("/Result/Question");
	    	 var tablecontent="";
	    	 var j=0;
	    	 for(j=0;j<list.length;j++) {
	    	     var doc3=parse(list[j].xml);
	    	     var mydate=new Date();
	    	     tablecontent=tablecontent+"<tr>";
	    	     tablecontent=tablecontent+"<td ><table><tr><td><img src='Images/tubiao04.gif'/></td><td><a href='coonowsite/QuestionShowCenter.htm?qid="+doc3.getElementsByTagName("QuestionID")[0].firstChild.nodeValue+"&date="+Math.random()+"' target='_blank' class='gray' title='"+doc3.getElementsByTagName("Content")[0].firstChild.nodeValue+"'>"+doc3.getElementsByTagName("Title")[0].firstChild.nodeValue+"</td></tr></table></td>";
                   tablecontent=tablecontent+"</tr>";
                      tablecontent=tablecontent+" <tr>";
                   tablecontent=tablecontent+"<td  background='Images/index_spacer01.gif'><img src='Images/spacer.gif' width='1' height='1' /></td>";
                   tablecontent=tablecontent+"</tr>";
                  }
         
                  hotprofessor=hotprofessor+tablecontent+"</table></td></tr></table>";
         
                  document.getElementById("newquestion").innerHTML=hotprofessor;
	    }
	   
	}
function fillXMLDoc1(inum){
	strData="<?xml version='1.0' encoding='GB2312'?><User_HotQuestion>";
	strData=strData+"<UserNum>"+escape(escapeXML(inum))+"</UserNum>";
	strData=strData+"</User_HotQuestion>";
	var xmlDom =null;
	xmlDom= CreateXMLParser();//new ActiveXObject("MSXML2.DOMDocument.4.0");
	xmlDom=parse(strData);
  return xmlDom;
}

function  processResponseNewQuestion()  {
       
      if(XMLHttpReq4.readyState  ==  4){
        if(XMLHttpReq4.status  ==  200){
					IsDisplayNewQuestion();
          
        }  else  {
        	
        }
      }
}

function getNewQuestions( inum, obji){
  createXMLHttpRequest4();	
  var url ="coonowsite/Index_NewQuestion.jsp?t="+Math.random();
  sendRequest2(url,inum,1)
}
function escapeXML(content) {
    if (content == undefined)
        return "";
    if (!content.length || !content.charAt)
        content = new String(content);
    var result = "";
    var length = content.length;
    for (var i = 0; i < length; i++) {
        var ch = content.charAt(i);
        switch (ch) {
            case '&':
                result += "&amp;";
                break;
            case '<':
                result += "&lt;";
                break;
            case '>':
                result += "&gt;";
                break;
            case '"':
                result += "&quot;";
                break;
            case '\'':
                result += "&apos;";
                break;
            default:
                result += ch;
        }
    }
    return result;
}
function parse(xml) {
	var dom;
	try{
		dom = new ActiveXObject("Microsoft.XMLDOM");
		dom.async = false;
		dom.loadXML(xml);
	} catch (error) {
	  try{
			var parser = new DOMParser();
			dom = parser.parseFromString(xml, "text/xml");
			delete parser;
		} catch (error2) {
			if (debug)
				alert("XML parsing is not supported.");
	    }
	  }
	return dom;
}
function openScript(url, width, height)
	{
		var nLeft=(window.screen.availWidth-780)/2;
		var nTop=(window.screen.availHeight-581)/2;
    var Win = window.open(url,"UserControlPad",'width=' + width + ',height=' + height + ',left='+(screen.width-780)/2+', top='+(screen.height-700)/2+',resizable=0,scrollbars=no,menubar=no,status=yes' );
	}
function ShowExamDialog()
{
    var width = 782;
    var height = 580;
     gGoodId=Math.random();
    var html = '<iframe src="exam/index.html"  name="ExamDiaLog'+gGoodId+'" id="ExamDiaLog'+gGoodId+'" frameborder="0" width="' + width + 'px" height="' + height + 'px"  scrolling="no"></iframe>';
    boxRegister =null;
     if(boxRegister == null)
    {
        boxRegister = new CommonBox(html,'朗阁九周年庆--------第一听力',0,0,width,0,true,true,null);
    }
    else
    {
        boxRegister.SetContent(html);
    }
    boxRegister.Toggle();
}
function ShowExamDialog()
{
    var width = 782;
    var height = 580;
     gGoodId=Math.random();
    var html = '<iframe src="../exam/index.html"  name="ExamDiaLog'+gGoodId+'" id="ExamDiaLog'+gGoodId+'" frameborder="0" width="' + width + 'px" height="' + height + 'px"  scrolling="no"></iframe>';
    boxRegister =null;
     if(boxRegister == null)
    {
        boxRegister = new CommonBox(html,'朗阁九周年庆--------第一听力',0,0,width,0,true,true,null);
    }
    else
    {
        boxRegister.SetContent(html);
    }
    boxRegister.Toggle();
}

function ToggleElliteShopCar(id,title,num,price,realprice)
{
  top.$('imgClose').click();
  if (window.top.boxRegister){
    window.top.boxRegister.Hide();
  }
  ToggleGoodBuyBox(id,title,num,price,realprice)
}
function tiaocourse(courseid,id,idstr){
   
   phx.url="http://61.172.200.155/wmademo/wmv/"+courseid+".wmv";
   //phx.play();
   if(courseid=="200710011"){
        document.getElementById("coursetitle").innerHTML="朗阁新托福(iBT)网络课程强化篇互动版";
        document.getElementById("courselevel").innerHTML="大学英语四级或相当";
        document.getElementById("courseprice").innerHTML="980.00";
        document.getElementById("courseteacher").innerHTML="曹燕 贾若寒 Vivienne Page 戴云琦";
        document.getElementById("summay").innerHTML="全套40课时，本课程结合朗阁教育集团严谨的教育风格，科学系统的课程设计，独创新托福(iBT)3C教学法， 课程包括阅读、写作、听力、口语四个单项课程，每个单项10课时。针对新托福(iBT)网考听、说、读、写四大分项难度增加而设置，为新型托福(iBT)强化课程。特征是注重综合技能演练，讲究实战教学，确保备考阶段短期内对各类试题充分了解和掌握，配合强化互动练习，全面掌握各项解题思路及技巧，学习效果远超一般网络课程，助您从容考取90分！";
         document.getElementById("aa").innerHTML="<a style='cursor:hand' title='"+idstr+"' onclick=\"javascript:ToggleGoodBuyBox("+id+",'"+idstr+"' ,1,2000.0,980.0);\"><img src='Images/index_bt03_lijigoumai.gif' height='23' border='0'/></a>";

   }else if(courseid=="200710012"){
        document.getElementById("coursetitle").innerHTML="朗阁新托福(iBT)听说强化篇互动版";
        document.getElementById("courselevel").innerHTML="大学英语四级或相当";
        document.getElementById("courseprice").innerHTML="520.00";
        document.getElementById("courseteacher").innerHTML="曹燕 Vivienne Page ";
        document.getElementById("summay").innerHTML="本课程共20课时，针对新托福(iBT)网考听力、口语分项难度增加而设置，为新型托福(iBT)强化课程。涉及听力、口语考试简介、特点，题型技巧，注意要点，语音知识，注重口语技能演练，全面掌握应答技巧，结合范例解析，随堂练习，小测试回顾，迅速有效提高听说能力，不可多得的高分助手。";
        document.getElementById("aa").innerHTML="<a style='cursor:hand' title='"+idstr+"' onclick=\"javascript:ToggleGoodBuyBox("+id+",'"+idstr+"',1,2000.0,520.0 );\"><img src='Images/index_bt03_lijigoumai.gif' height='23' border='0'/></a>";


   }else if(courseid=="200710004"){
        document.getElementById("coursetitle").innerHTML="朗阁雅思精品互动版-全套课程";
        document.getElementById("courselevel").innerHTML="英语六级或相当英语程度";
        document.getElementById("courseprice").innerHTML="980.00";
        document.getElementById("courseteacher").innerHTML="贾若寒 房挺 杨焯然 孙佳薇 尹小音 Vivienne Page ";
        document.getElementById("summay").innerHTML="朗阁雅思精品互动版-全套课程含阅读、听力、口语、写作4个单项，每项10课时。内容涉及各类雅思经典题型，深入解析，突出要点精髓。独家引入网络课程随堂互动练习，学员在学习过程中，通过互动练习及时巩固，自我检测，系统结合个人情况，给出“一对一”学习数据库，以便学员自由调控学习进度，短期内充分获得实战经验，学习效果远超一般网络课程，雅思高分尽在掌握。";
        document.getElementById("aa").innerHTML="<a style='cursor:hand' title='"+idstr+"' onclick=\"javascript:ToggleGoodBuyBox("+id+",'"+idstr+"',1,2000.0,980.0 );\"><img src='Images/index_bt03_lijigoumai.gif' height='23' border='0'/></a>";

   }else if(courseid=="gaofendemo1"){
        document.getElementById("coursetitle").innerHTML="朗阁雅思训练营高分篇现场版-全套课程";
        document.getElementById("courselevel").innerHTML="英语6级或有雅思考试经验";
        document.getElementById("courseprice").innerHTML="750.00";
        document.getElementById("courseteacher").innerHTML="房挺 贾若寒 Adnrew Malcolm 尹小音 亚琳 ";
        document.getElementById("summay").innerHTML="朗阁教育集团与浙江卫视倾力打造，内容以08年考试大纲为中心，名师现场激情讲解，融合考试精华，重磅推出此套课程。全套课程系统包含阅读、听力、口语、写作4个单项。本套课程是由朗阁重量级名师现场授课,配合教学板书,精良制作而成。课程融入听、说、读、写各项考试经典题型进行深度解析，注重要点细节，总结历炼的雅思考试技巧，通过精彩例题详解，迅速有效提高学员综合能力，6.5分非你莫属。";
        document.getElementById("aa").innerHTML="<a style='cursor:hand' title='"+idstr+"' onclick=\"javascript:ToggleGoodBuyBox("+id+",'"+idstr+"',1,2000.0,750.0 );\"><img src='Images/index_bt03_lijigoumai.gif' height='23' border='0'/></a>";

   }else if(courseid=="kouyubao1"){
        document.getElementById("coursetitle").innerHTML="雅思口语宝(高级)";
        document.getElementById("courselevel").innerHTML="雅思口语6.5分、7分";
        document.getElementById("courseprice").innerHTML="398.00";
        document.getElementById("courseteacher").innerHTML="";
        document.getElementById("summay").innerHTML="朗阁雅思口语宝是朗阁网校（365学习在线）依托朗阁教育集团强大的雅思培训体系，专门针对雅思口语考试大纲及答题思路所设计的在线互动模拟练习课程。课程是由朗阁教育集团海外考试研究中心（RAFLE）的雅思培训专家应用美国麻省理工学院世界最先进的人工语音合成技术，经过两年的时间研发而成，主要内容以雅思考试最常见话题为主题，由浅入深，循序渐进，精心设计科学的阶梯课程板块和互动练习环节，能够有效帮助学生开口练习、校正发音，强化雅思口语能力。";
        document.getElementById("aa").innerHTML="<a style='cursor:hand' title='"+idstr+"' onclick=\"javascript:ToggleGoodBuyBox("+id+",'"+idstr+"',1,2000.0,398.0 );\"><img src='Images/index_bt03_lijigoumai.gif' height='23' border='0'/></a>";

   }else if(courseid=="kouyubao"){
        document.getElementById("coursetitle").innerHTML="雅思口语宝(中级)";
        document.getElementById("courselevel").innerHTML="雅思口语5.5分,6分";
        document.getElementById("courseprice").innerHTML="398.00";
        document.getElementById("courseteacher").innerHTML="";
        document.getElementById("summay").innerHTML="朗阁雅思口语宝是朗阁网校（365学习在线）依托朗阁教育集团强大的雅思培训体系，专门针对雅思口语考试大纲及答题思路所设计的在线互动模拟练习课程。课程是由朗阁教育集团海外考试研究中心（RAFLE）的雅思培训专家应用美国麻省理工学院世界最先进的人工语音合成技术，经过两年的时间研发而成，主要内容以雅思考试最常见话题为主题，由浅入深，循序渐进，精心设计科学的阶梯课程板块和互动练习环节，能够有效帮助学生开口练习、校正发音，强化雅思口语能力。";
        document.getElementById("aa").innerHTML="<a style='cursor:hand' title='"+idstr+"' onclick=\"javascript:ToggleGoodBuyBox("+id+",'"+idstr+"' ,1,2000.0,398.0);\"><img src='Images/index_bt03_lijigoumai.gif' height='23' border='0'/></a>";

   }else if(courseid=="200710005"){
        document.getElementById("coursetitle").innerHTML="朗阁雅思预备互动版-全套课程";
        document.getElementById("courselevel").innerHTML="英语四级或相当英语程度";
        document.getElementById("courseprice").innerHTML="900.00";
        document.getElementById("courseteacher").innerHTML="杨焯然 孙佳薇 ";
        document.getElementById("summay").innerHTML="朗阁雅思预备互动版-全套课含阅读、听力、口语、写作4个单项，每项10课时。课程由浅入深设置，循序渐进，系统、集中、强化英语综合能力，全面掌握各类考试必备技巧，结合真题解析，独家引入网络课程随堂互动练习，以便学员及时自我检测，自由调控学习进度，学习效果远超一般网络课程，轻松搞定雅思6分。";
        document.getElementById("aa").innerHTML="<a style='cursor:hand' title='"+idstr+"' onclick=\"javascript:ToggleGoodBuyBox("+id+",'"+idstr+"',1,2000.0,900.0 );\"><img src='Images/index_bt03_lijigoumai.gif' height='23' border='0'/></a>";

   }






}

