﻿// JScript 文件
var info_body = document.getElementById("info_body");
var weburl = location.href.toLowerCase();
if(info_body != null)
{
    var seriesId = 0;
    if (weburl.indexOf("room")> -1)
    {
       seriesId=getQueryString("rid");
       if(seriesId==null || !isNumber(seriesId)) seriesId = 0;
    }
    info_body.innerHTML = GetAjaxData.GetInfoData_Course(21,7,seriesId).value; 
}

var bbs_body = document.getElementById("bbs_body");
if(bbs_body != null)
{
    var seriesId = 0;
    if (weburl.indexOf("room.aspx")> -1 || weburl.indexOf("room_admin.aspx")> -1)
    {
       seriesId=getQueryString("rid");
       if(seriesId==null || !isNumber(seriesId)) seriesId = 0;
    }
    bbs_body.innerHTML = GetAjaxData.GetBbsData_Course(69,10,seriesId).value; 
}

//获得URL参数值
function getQueryString(name) {
   var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i");
   var r = window.location.search.substr(1).match(reg);
   if (r!=null) return unescape(r[2]); return null;
}


var quicklink = document.getElementById("quicklink");
if(quicklink != null)
{
    if(weburl.indexOf("default.aspx") > -1 || weburl.lastIndexOf("/") == (weburl.length - 1))
        quicklink.style.display = "";
    else
        quicklink.style.display = "none";
}

function showBooking(layerId,nType)
{
  var oLayer = document.getElementById("Layera" + layerId);
  var oImg = document.getElementById("Img" + layerId);
  if(oLayer==null || oImg==null) return;
  if(nType==1){
  	oLayer.style.display="block";
	oImg.style.filter="alpha(opacity=40)";
  }
  else
  {
  	oLayer.style.display="none";
	oImg.style.filter="alpha(opacity=100)";
  }	
}

function logout()
{
    top.location='/UserLogin.aspx?OperType=logout&Url=' + top.location.href;
}

function playCourse(url)
{
    if(url==""){alert("暂时没有演示课程!");return false;}
    window.open(url);
}


function back()
{
    if(history.length == 0)
        window_close();
    else
        history.go(-1);
}


function window_close()
{
   if(window.opener!=undefined) window.opener=null;
	window.open('','_self'); 
	window.close();
}