﻿// JScript 文件




function getCookie(name) {

  var search;

  search = name + "="
  offset = document.cookie.indexOf(search) 
  if (offset != -1) {
    offset += search.length ;
    end = document.cookie.indexOf(";", offset) ;
    if (end == -1)
      end = document.cookie.length;
    return document.cookie.substring(offset, end);
  }
  else
    return "";
}


function setCookie(name,value)
{
    var date = new Date();
    date.setTime(date.getTime() + 3600*1000*24);
    document.cookie = name+"="+value+"; expires="+date.toGMTString()+"; path=/; ";
}


function clearAllCookie()
{
    var cookies = document.cookie;
    var cookieArray = cookies.split(";");
    var tcookie;
    for(var i=0;i<cookieArray.length;i++)
    {
        tcookie = cookieArray[i].split("=");
        if(tcookie[0] != null)
        {
            clearAlwaysCookie(tcookie[0]);
        }
    }
}


function clearAlwaysCookie(name)
{
    var date = new Date();
    date.setTime(date.getTime() - 10000);
    document.cookie = name+"="+value+"; expires="+date.toGMTString()+"; path=/; ";
}

function clearCookie(name)
{
    setCookie(name,"");
}

function dp() {
if (window.print)
{
var div1 = document.getElementById("info").innerHTML ;

window.open("/GasgooPrintPreview.htm",null,"height=640,width=640,resizable=yes,status=yes,scrollbars=yes,toolbar=no,menbar=no,location=no");
}else{window.alert("亲爱的用户非常抱歉，您的浏览器暂不支持我们的打印技术")}
}


function SetFontSize(Class)
{
    this.classIndex = Class || 0;
    this.className = "font-size:12px";
    var fontConfig =[{id:0,className:"d_font"},{id:1,className:"d_font"},{id:2,className:"d_font"}];
    var get = function (name)
    {
        return document.getElementById(name);
    }
    switch(this.classIndex)
    {
        case 0:
        this.className = "font-size:12px";
        break;
        case 1:
        this.className = "font-size:14px";
        break;
        case 2:
        this.className = "font-size:16px";
        break;
    }
    for(var i = 0;i< fontConfig.length;i++)
    {
        if(i==this.classIndex)
        {
           get("sfz"+i+"").className = "fontActive";
           continue;
        }
        get("sfz"+i+"").className = fontConfig[i].className;
    }
    get("content").style.cssText = this.className;
  //  GetChlidNodesByChild(get("content"),className);
    
}

function GetChlidNodesByChild(child,className)
{
    var nodeList = child.childNodes;
    for(var i in nodeList)
    {
        if(nodeList[i].nodeType == 1)
        {
            nodeList[i].style.cssText = className;
        }
        GetChlidNodesByChild(nodeList[i],className);
    }
}

function setcopy()
{
    if(navigator.appName=="Microsoft Internet Explorer")
    {
        window.clipboardData.setData('Text',location.href); alert('链接地址已复制!');
    }
    else
    {
        prompt('请按“Ctrl+C”复制下列地址', location.href);

    }
}

function setFrame()
{
    if(typeof(pathinfo) != "undefined")
    {
        document.getElementById('playf').src='/GasgooFrame.aspx?path='+pathinfo;
    }
}