﻿var leftDiv = document.createElement("div");
var rightDiv = document.createElement("div");
with(leftDiv.style){zIndex=999;position = 'absolute'; width = '90px'; height = '371px'; background = 'red'; margin = 0; padding = 0; display = 'none';}
with(rightDiv.style){zIndex=999;position = 'absolute'; width = '100px'; height = '250px'; margin = 0; padding = 0; left = '20px';}
leftDiv.id = 'leftDiv';
rightDiv.id = 'rightDiv';
//注 ：图片地址是：SKPath+'image/';
//     网站地址是：DTPath;
//     载入时要放在body中
leftDiv.innerHTML = '<img border="0" src="/skin/default/image/leftduilian.gif" width="90" height="271">';
rightDiv.innerHTML = kfcontent;
document.body.appendChild(leftDiv);
document.body.appendChild(rightDiv);
function $(id){
	return document.getElementById(id);	
}
function show_duilian(){
	var Divtop = parseInt(getScrollTop()) + 160 + 'px';
	var DivLeft = parseInt(getScrollLeft()) + 20 + 'px';
	$('leftDiv').style.top = Divtop;
	$('leftDiv').style.left = DivLeft;
	$('rightDiv').style.top = Divtop;
	setTimeout("show_duilian()",1);
}

function close_duilian(){
	$('leftDiv').style.display = 'none';
	$('rightDiv').style.display = 'none';
}
function getScrollTop(){
    var scrollTop=0;
    if(document.documentElement&&document.documentElement.scrollTop){
        scrollTop=document.documentElement.scrollTop;
    }
    else if(document.body){
        scrollTop=document.body.scrollTop;
    }
    return scrollTop;
}
function getScrollLeft(){
    var scrollLeft=0;
    if(document.documentElement&&document.documentElement.scrollLeft){
        scrollLeft=document.documentElement.scrollLeft;
    }
    else if(document.body){
        scrollLeft=document.body.scrollLeft;
    }
    return scrollLeft;
}

document.onload = show_duilian();

