function get_cookie(name_to_get) {

    var cookie_pair
    var cookie_name
    var cookie_value
    
    // Split all the cookies into an array
    var cookie_array = document.cookie.split("; ")
    
    // Run through the cookies
    for (counter = 0; counter < cookie_array.length; counter++) {
    
        // Split the cookie into a name/value pair
        cookie_pair = cookie_array[counter].split("=")
        cookie_name = cookie_pair[0]
        cookie_value = cookie_pair[1]
        
        // Compare the name with the name we want
        if (cookie_name == name_to_get) {
        
            // If this is the one, return the value
            return unescape(cookie_value)
        }
    }
    
    // If the cookie doesn't exist, return null
    return null
}

// Get the bgColor cookie
var bg_color = get_cookie("bgColor_cookie")
var main_font=get_cookie("font_cookie")

// Did the cookie exist?
//if (bg_color) {
//    document.bgColor = bg_color
//}

function set_color(color_val) {

    // Get the currently selected color
    //var color_list = color_form.color_name
    //var selected_color = color_list.options[color_list.selectedIndex].value
    
    // Change the color of the background
    //opener.document["bgColor"] = color_val
    
    // Save it in a cookie
    set_cookie("bgColor_cookie", color_val, 365, "/")
}

function set_font(font_val) {
   set_cookie("font_cookie", font_val, 365, "/")
}
function set_cookie(cookie_name, cookie_value, cookie_expire, cookie_path, cookie_domain, cookie_secure) {

    // Begin the cookie parameter string
    var cookie_string = cookie_name + "=" + cookie_value
    
    // Add the expiration date, if it was specified
    if (cookie_expire) {
        var expire_date = new Date()
        var ms_from_now = cookie_expire * 24 * 60 * 60 * 1000
        expire_date.setTime(expire_date.getTime() + ms_from_now)
        var expire_string = expire_date.toGMTString()
        cookie_string += "; expires=" + expire_string
    }
    
    // Add the path, if it was specified
    if (cookie_path) {
        cookie_string += "; path=" + cookie_path
    }

    // Add the domain, if it was specified
    if (cookie_domain) {
        cookie_string += "; domain=" + cookie_domain
    }
    
    // Add the secure Boolean, if it's true
    if (cookie_secure) {
        cookie_string += "; true"
    }
    
    // Set the cookie
    document.cookie = cookie_string
}
function doPrint(){
var str="<html>\n<meta http-equiv='content-type' content='text/html; charset=gb2312'>";
var article;
var css;
var strAdBegin="<!--NEWSZW_HZH_BEGIN-->";
var strAdEnd="<!--NEWSZW_HZH_END-->";
var strFontSize='<a href="javascript:doZoom(16)">´ó</a> <a href="javascript:doZoom(14)">ÖÐ</a> <a href="javascript:doZoom(12)">Ð¡</a> <font color=#ca90ef>|</font> '.toLowerCase()
var strdoPrint="doPrint()";
var strTmp;

 css="<style>"
 +"td,.f12{font-size:12px}"
 +"body{font-family:ËÎÌå}"
 +".f24 {font-size:24px;}"
 +".f14 {font-size:14px;}"
 +".title14 {font-size:14px;line-height:130%}"
 +".l17 {line-height:170%;}"
 +".x14 {font-size:14px;line-height:130%}"
         +"a.zwy:link,a.zwy:active,a.zwy:visited,a.zwy:hover{text-decoration:none;color: #311bad;}"
 +"a.htt:link,a.htt:active,a.htt:visited{text-decoration:none;color: #7b4109;}"
 +"</style>";

 str += css;
 str += '<meta http-equiv="content-type" content="text/html; charset=gb2312">';
 str += '<title>'+document.title+'</title>';
 str += "<body bgcolor=#ffffff topmargin=5 leftmargin=5 marginheight=5 marginwidth=5 onLoad='window.print()'>";
 
 str += "<table width=600 border=0 cellpadding=0 cellspacing=0 ><tr><td>";
 
  article=document.getElementById('article').innerHTML;
  if(article.indexOf(strAdBegin)!=-1){
   str +=article.substr(0,article.indexOf(strAdBegin));
   strTmp=article.substr(article.indexOf(strAdEnd)+strAdEnd.length, article.length);
  }else{
   strTmp=article
  }
  str +=strTmp
  str += "</td></tr></table></center>";
  str += "</body></html>";
  document.write(str);
  document.close();
}