﻿/***以下需要自行设定***/
var movediv_title='Must-have Investment Guide';/*设置标题*/
var movediv_time=5000;/*设置多少显示时间*/
var movediv_iframe_url='/FP-ecourses.htm';/*设置iframe地址*/
var movediv_top='30px';/*设置宽度*/
//	top:300px;

/******设定结束******/

var movediv_timeID = null;
var movediv_width;
function leftpx(){
	return $('.popupwin').css({left:'-'+movediv_width+'px'});
}
function divleft(){
	return ($("body").width()-movediv_width)/2;
}
function movein(){
	$('.popupwin').animate({left: divleft()},"slow",function(){clearTimeout(movediv_timeID);});
}
function moveout(){
	$('.popupwin').animate({left: $("body").width()},"slow",function(){leftpx();});
}
$(document).ready(function(){
$('body').append('<div class="popupwin">'+
'<div class="movediv">'+
'<div class="movediv_title_c">'+
'<span class="movediv_title">'+movediv_title+'</span>'+
//'<div class="movediv_close closebnt" title="关闭">X</div>'+
'<div class="movediv_close"><a href="javascript:void(0);" class="closebnt" title="关闭">X</a></div>'+
'</div>'+
'<div class="movediv_content">'+
'<iframe src="'+movediv_iframe_url+'" width="100%" height="100%" scrolling="no" frameborder="0"></iframe>'+
'</div></div>'+
'<IFRAME width="100%" height="100%" style="position:absolute; top:0px; z-index:-1; border-style:none;" frameborder="0"></IFRAME>'+
'</div>');
	movediv_width=$('.popupwin').width()+4;
	//$('.movein').click(function(){movein()});
	//$('.moveout').click(function(){moveout()});
	$('.closebnt').click(function(){moveout()});
	leftpx().show();
	movediv_timeID=setTimeout('movein()',movediv_time);    
	//clearTimeout(timeID);
});
/*function MoveLayer(layerName) {
var x = 600;//浮动广告层固定于浏览器的x方向位置
var y = 300;//浮动广告层固定于浏览器的y方向位置
var diff = (document.body.scrollTop + y - document.all.AdLayer.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = y");
eval("document.all." + layerName + ".style.posLeft = x");//移动广告层
setTimeout("MoveLayer('AdLayer');", 20);//设置20毫秒后再调用函数MoveLayer()
}*/