
//左右对联--------------------------------------------------------------------------------
document.ns = navigator.appName == "Microsoft Internet Explorer"

var imgleft
window.screen.width>800 ? imgheight=70:imgheight=70
window.screen.width>800 ? imgleft=15:imgleft=20
var imgheight
window.screen.width>800 ? imgheight=100:imgheight=100

//输出对联广告
function outputCouplet() {
    if (1 == getCookie('CCCloseAd')) {return;}
    
    //左对联
    var ad_float_left_url = "active/logo11.htm";
    var ad_float_left_src = "/images/duilian.gif";
    var ad_float_left_type = "gif";
    //右对联
    var ad_float_right_url = "vote/default.htm";
    var ad_float_right_src = "/images/duilianleft.gif";
    var ad_float_right_type = "gif";

    //左联
    if(document.ns){
        if(ad_float_left_type!="swf") {
            document.write("<div id=myleft style='display:none;position: absolute;width:80;top:30;left:5;visibility: visible;z-index: 1'>");
            if ("" != ad_float_left_url) {
                document.write("<a href='" + ad_float_left_url + "' target = '_blank'><img WIDTH=100 HEIGHT=229 src='" + ad_float_left_src + "'  border = 0></a>");
            } else {
                document.write("<img WIDTH=100 HEIGHT=229 src='" + ad_float_left_src + "'>");
            }
            document.write("<div vlaign='bottom' align='right' style='height:20;width:90'><a href='#' onclick='hideleft();return false;'>关闭</a></div></div>");
        } else {
            document.write("<div id=myleft style='display:none;position: absolute;width:80;top:30;left:5;visibility: visible;z-index: 1'><EMBED src='" + ad_float_left_src + "' quality=high WIDTH=100 HEIGHT=229 TYPE='application/x-shockwave-flash' id=changhongout ></EMBED><div vlaign='bottom' align='right' style='height:20;width:90'><a href='#' onclick='hideleft();return false;'>关闭</a></div></div>");
        }
        loadleft();
    }

    //右联
    if(document.ns){
        if(ad_float_right_type!="swf") {
            document.write("<div id=myright style='display:none;position: absolute;width:80;top:30;top:0;left:578;visibility: visible;z-index: 1'>");
            if ("" != ad_float_left_url) {
                document.write("<a href='" + ad_float_right_url + "' target = '_blank'><img WIDTH=100 HEIGHT=229 src='" + ad_float_right_src + "' border = 0></a>");
            } else {
                document.write("<img WIDTH=100 HEIGHT=229 src='" + ad_float_right_src + "'>");
            }
            document.write("<div vlaign='bottom' align='right' style='height:20;width:90'><a href='#' onclick='hideright();return false;'>关闭</a></div></div>");
        } else {
            document.write("<div id=myright style='display:none;position: absolute;width:80;top:0;left:578;visibility: visible;z-index: 1'><EMBED src='" + ad_float_right_src + "' quality=high WIDTH=100 HEIGHT=229 TYPE='application/x-shockwave-flash'></EMBED><div vlaign='bottom' align='right' style='height:20;width:90'><a href='#' onclick='hideright();return false;'>关闭</a></div></div>");
        }
        loadright();
    }
}

function loadleft() {
    myleft.style.top = document.body.scrollTop + imgheight;
    myleft.style.left = imgleft;
    myleft.style.display = '';
    leftmove();
}

function leftmove() { 
    myleft.style.top = document.body.scrollTop + imgheight;
    myleft.style.left = imgleft;
    setTimeout("leftmove();",50)
}

function hideleft() { 
    if (('undefined' != typeof(myright))) {
        myright.style.display = 'none';
    }
    if (('undefined' != typeof(myleft))) {
        myleft.style.display = 'none';
    }
    setCookie("CCCloseAd", 1);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
    if (init==true) with (navigator) {
        if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
            document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; 
        }
    } else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) {
        location.reload();
    }
}

function loadright() {
    myright.style.top = document.body.scrollTop + imgheight;
    myright.style.left = document.body.offsetWidth-120;
    myright.style.display = '';
    mymove();
}
function mymove() {
    myright.style.top = document.body.scrollTop + imgheight;
    myright.style.left = document.body.scrollLeft+document.body.offsetWidth-120;
    setTimeout("mymove();",50)
}

function hideright() { 
    if (('undefined' != typeof(myright))) {
        myright.style.display = 'none';
    }
    if (('undefined' != typeof(myleft))) {
        myleft.style.display = 'none';
    }
    setCookie("CCCloseAd", 1);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
//end 左右对联--------------------------------------------------------------------------------
