﻿/*

var _animate = false;

if (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7) {
    _animate = true;
}
if (_animate) {
    // Make the control use absolute positioning to hover
    // appropriately and move it to its new home
    document.getElementById("ads").style.position = 'absolute';
} else {
    // Make the control use fixed positioning to keep it from moving
    // while the content behind it slides around
    document.getElementById("ads").style.position = 'fixed';
}

var x = 0;
var y = 0;

// Compute the initial offset if we're animating
if (_animate) {
    if (document.documentElement && document.documentElement.scrollTop) {
        x = document.documentElement.scrollLeft;
        y = document.documentElement.scrollTop;
    } else {
        x = document.body.scrollLeft;
        y = document.body.scrollTop;
    }
}

var width = 600;
var height = 425;

HttpUrl = location.href;
if (HttpUrl.indexOf("En") != -1) {
    document.getElementById("ads").style.background = "url('../Images/Ad/En.gif')";
}
else if (HttpUrl.indexOf("Sc") != -1) {
    document.getElementById("ads").style.background = "url('../Images/Ad/Sc.gif')";
    height = 374;
}
else if (HttpUrl.indexOf("Jp") != -1) {
    document.getElementById("ads").style.background = "url('../Images/Ad/Jp.gif')";
    height = 374;
}
else {
    document.getElementById("ads").style.background = "url('../Images/Ad/En.gif')";
}
document.getElementById("ads").style.width = width + 'px';
document.getElementById("ads").style.height = height + 'px';

//x = Math.max(0, Math.floor(x + document.body.clientWidth / 2.0 - width / 2.0));
//y = Math.max(0, Math.floor(y + document.body.clientHeight / 2.0 - height / 2.0));
//alert(Math.max(0, Math.floor(x + document.body.clientWidth / 2.0 - width / 2.0)));
document.getElementById("ads").style.right = 0 + 'px';
document.getElementById("ads").style.bottom = 0 + 'px';
 
var time = 100;
var h = 0;
function addCount() {
    if (time > 0) {
        time--;
        h = h + 10;
    }
    else {
        return;
    }
    if (h > height)  //高度
    {
        return;
    }
    document.getElementById("ads").style.display = "";
    document.getElementById("ads").style.height = h + "px";
    setTimeout("addCount()", 30);
}
window.onload = function showAds() {
    addCount();
    setTimeout("noneAds()", 15000); //停留时间自己适当调整
}

var T = 100;
var N = height; //高度
function noneAds() {
    if (T > 0) {
        T--;
        N = N - 10;
    }
    else {
        return;
    }
    if (N < 0) {
        document.getElementById("ads").style.display = "none";
        return;
    }
    document.getElementById("ads").style.height = N + "px";
    setTimeout("noneAds()", 30);
}

function noneAds2() {
    document.getElementById("ads").style.display = "none";
}

*/