﻿// JScript 文件
var attestationContent_1 ="";
var attestationContent_2 ="";
var attestationContent_4 ="";
function getAttestation(id){
    Sys.UI.DomElement.removeCssClass($get("attestation_1"), "ind_train_lk_1");
    Sys.UI.DomElement.removeCssClass($get("attestation_2"), "ind_train_lk_1");
    Sys.UI.DomElement.removeCssClass($get("attestation_4"), "ind_train_lk_1");
    Sys.UI.DomElement.addCssClass($get("attestation_1"), "ind_train_lk_2");
    Sys.UI.DomElement.addCssClass($get("attestation_2"), "ind_train_lk_2");
    Sys.UI.DomElement.addCssClass($get("attestation_4"), "ind_train_lk_2");
    Sys.UI.DomElement.removeCssClass($get("attestation_" + id), "ind_train_lk_2");
    Sys.UI.DomElement.addCssClass($get("attestation_" + id), "ind_train_lk_1");
    if(eval("attestationContent_"+id).length>0){
        $get("Train_Content").innerHTML = eval("attestationContent_"+id);
        return;
    }
    AttestationWebService.GetAttestation(id,onGetAttestationSuccess,null,id);
}

function onGetAttestationSuccess(result,id){
    $get("Train_Content").innerHTML = result;
    eval("attestationContent_"+id +"=result;");
}


function sDiv(){
    this.start = function(){
        var obj = $get("qhDiv");
        if(obj){
            if(obj.childNodes.length<=1){
                var obj2 = obj.childNodes[0].cloneNode(true);
                obj.appendChild(obj2);
            }
            if(obj.offsetTop + obj.childNodes[0].clientHeight<=0)
                obj.style.top = 0;
            else{
                obj.style.top = obj.offsetTop -24;
            }            
        }
    }
}
var scroll = new  sDiv();
setInterval("scroll.start();",1500);


var tips; var theTop = 150; var old = theTop;
function initFloatTips() {
  tips = document.getElementById('ad_shaoqian');
  moveTips();
};
function moveTips() {
  var tt=50;
  if (window.innerHeight) {
    pos = window.pageYOffset
  }
  else if (document.documentElement && document.documentElement.scrollTop) {
    pos = document.documentElement.scrollTop
  }
  else if (document.body) {
    pos = document.body.scrollTop;
  }
  pos=pos-tips.offsetTop+theTop;
  pos=tips.offsetTop+pos/10;
  if (pos < theTop) pos = theTop;
  if (pos != old) {
    tips.style.top = pos+"px";
    tt=10;
  }
  old = pos;
  setTimeout(moveTips,tt);
}

function Ad_close(T_obj){
	document.getElementById(T_obj).style.display="none";

}