﻿// JScript File
ysremind = function(){
	var isUcmp=arguments[0];
	var fbs_domain=arguments[1]+".yoosat.com";
	getdomainfont= function(){
		var iint=36;
		if(fbs_domain.length>16){
			iint=Math.ceil(36*16/fbs_domain.length);
		}
		return iint;
	}
	var domainfont=getdomainfont();
	var remindtype;
	function areabuilder(){
		document.writeln("<style type=\"text/css\">");
		document.writeln(".detail { background:url(/images/ggfw_03.gif); width:950px;margin:0 auto;}");
		document.writeln(".detail h2 { color:#CC3300; font-family:\"黑体\"; font-size:18px; padding:5px;}");
		document.writeln(".detail2 { background:url(/images/ggfw1_03.gif); width:950px; margin:0 auto;overflow:hidden;display:none;}");
		document.writeln(".detail2 ul { float:left;}");
		document.writeln(".detail2 ul li{ float:left;font-style:oblique;padding:60px 0 0 30px;font-size:48px;color:#CC3300;}");
		document.writeln(".detail3 { background:url(/images/ggfw3_01.gif); width:950px; margin:0 auto;overflow:hidden;display:none;}");
		document.writeln(".gg,.gg2,.gg3 {position:absolute;position:fixed; bottom:0; right:0; width:30px; height:377px;display:none;cursor:hand; }");
		document.writeln(".gg {background:url(/images/ggfw_07.gif) no-repeat;}");
		document.writeln(".gg2 {background:url(/images/ggfw1_07.gif) no-repeat;}");
		document.writeln(".gg3 {background:url(/images/gggw3_07.gif) no-repeat;}");
		document.writeln("* html .gg,* html .gg2,* html .gg3{position:absolute;right:18px;}");
		document.writeln("</style>");
		document.writeln("<div id=\"opendiv\" class=\"gg"+remindtype+"\"><span onclick=\"ysreminddoer.showtopad()\">重播</span></div>");
		document.writeln("<div id=\"closdiv\"></div>");
		document.writeln("<div id=\"bigad\" class=\"detail"+remindtype+"\" > ");
		document.writeln("<p style=\"float:right;width:40px;\"><a href=\"#\" onclick=\"ysreminddoer.closetopad()\"> 关闭 </a></p>");
		document.writeln("<ul>");
		if(remindtype=="2"){
			document.writeln("<li class=\"detext\" style=\"width:60px; \">"+isUcmp+"</li>");
			document.writeln("<li class=\"detext\" style=\"width:280px;font-size:36px;margin:10px 0 0 0; text-indent:9.2em;\"><font style=\"font-size:"+domainfont+"px\">"+fbs_domain+"</font></li>");
		}
		document.writeln("</ul></div>");
	}
	if(isUcmp>0){
		if(isUcmp<100){remindtype="";areabuilder();ysreminddoer.showtopad();}
		else{remindtype="2";isUcmp=isUcmp-100;areabuilder();ysreminddoer.showtopad();}
	}
	else if(isUcmp<0){
		remindtype="3";isUcmp="";areabuilder();ysreminddoer.showtopad();
	}
}
reminddoer = function(){
	var nowheight=0;    //初始广告层高度 
	var maxheight=220;    //广告层最大高度 
	var adobj=document.getElementById("bigad"); 
	var opendiv=document.getElementById("opendiv"); 
	var closdiv=document.getElementById("closdiv"); 
	var addfunc; 
	var handobj; 
	var reducefunc;         
	var speed=7;        //层卷动速度 
	this.showtopad=function(){
		adobj=document.getElementById("bigad"); 
		opendiv=document.getElementById("opendiv"); 
		closdiv=document.getElementById("closdiv"); 
		if (nowheight<=0) { 
		    opendiv.style.display="none"; 
		    adobj.style.display="block"; 
		    addfunc=setInterval("ysreminddoer.addheight()",1); 
		} 
	}
	this.closetopad=function() { 
	    if (nowheight>0) { 
	        ysreminddoer.callreduceheight(); 
	        if (typeof(handobj)=="number") { 
	            clearTimeout(handobj); 
	        } 
	    } 
	} 
	this.addheight=function() {
	    nowheight+=speed; 
	    if (nowheight>maxheight) {  
	        clearInterval(addfunc); 
	        closdiv.style.top=maxheight-30; 
	        closdiv.style.display="block"; 
	        handobj=setTimeout("ysreminddoer.callreduceheight()",5000); 
	        return; 
	    } 
	    adobj.style.height=nowheight+"px"; 
	} 
	this.callreduceheight=function() { 
	    closdiv.style.display="none"; 
	    reducefunc=setInterval("ysreminddoer.reduceheight()",1); 
	} 
	this.reduceheight=function() { 
	    adobj.style.height=nowheight+"px"; 
	    nowheight-=speed; 
	    if (nowheight<=0) { 
	        clearInterval(reducefunc); 
	        adobj.style.display="none"; 
	        opendiv.style.display="block"; 
	        return; 
	    } 
	} 
}
var ysreminddoer=new reminddoer();
