document.write("<style type=\"text/css\">")
/*
document.write("body{margin:0; padding:0; font-size:12px; background:#fff;}")
document.write("form,p,h1{margin:0; padding:0;}")
document.write("input,select{margin:0px; font-size:12px; vertical-align:absmiddle;}")
document.write("img{margin:0; padding:0; border:0;}")
document.write("ul,li{float:left; margin:0; list-style-type:none;}")
document.write("h1{font-size:14px; font-weight:bold; width:163px; text-align:center;}")
document.write(".clear{line-height:0px; font-size:0px; height:0px; overflow:hidden;}")
document.write(".space5{line-height:0px; font-size:0px; height:5px; }")
document.write(".space{line-height:0px; font-size:0px; height:8px; }")
*/
document.write("a.qiandai:link{color:#444; text-decoration:underline;}")
document.write("a.qiandai:visited{color:#444; text-decoration:underline;}")
document.write("a.qiandai:hover{color:#f60; text-decoration:underline;}")
document.write(".redqiandai{color:#f00;}")
document.write(".red-qiandai{color:#f00; text-decoration:underline;}")
document.write(".red-qiandai:hover{color:#0000CC; text-decoration:underline;}")
document.write("#mainqiandai{margin:0 auto; width:350px;}")
document.write(".b1qiandai{float:left; height:19px; width:330px; background:url(jifen/images/z-jifen-top.gif) no-repeat; padding:5px 10px 0px 10px; color:#d60;}")
document.write(".b1qiandai span{float:right;}")
document.write(".b2qiandai{float:left; width:328px; border-left:1px solid #F5A917; border-right:1px solid #F5A917; border-top:1px solid #F5A917;  padding:15px 10px 15px 10px; text-align:center;}")
document.write(".b3qiandai{float:left; width:308px; padding:10px 20px 10px 20px; border-bottom:1px solid #F5A917;  border-left:1px solid #F5A917; border-right:1px solid #F5A917;}")
document.write(".b3qiandai .tsqiandai{float:left; padding-bottom:10px; font-size:13px; width:308px; }")
document.write("</style>")






document.write("<style type=\"text/css\">*{padding:0; margin:0}.close{float:right;cursor:default}</style>")

function getjifen(){
   var nowTime = new Date().getTime();//获取当前时间作为随机数 
   var url = "AjaxLogin.do?flag=5"+"&time="+nowTime;
   var request = new Ajax.Request(url, {method:"post", onComplete:onGetJifenComplete});  
   var readyState  = request.transport.readyState;			    
   if(readyState != 4) {   
            //alert("退出失败！");
					
    }    
}

function onGetJifenComplete(transport) {                        
    var readyState = transport.readyState;  	         	
    if(readyState == 4) {      	   
        if(transport.status == 200) {   
           var jifen =transport.responseText;		   
		   jifen = getjsonobj(jifen);	
		 //AlertqiandaiMsg("我的钱袋",jifen.allscores,jifen.usedscores,jifen.nowscores,jifen.coin,jifen.addscores,jifen.usertype);
		 AlertqiandaiMsg("我的钱袋",jifen.nowcoin,jifen.nowscores,jifen.addcoin,jifen.addscores,jifen.usertype);
		  

        }   
    }      
}

function linkurl(usertype,flag){
	//flag: 0：积分查询 1：积分兑换 2：积分规则 3：抢沙发赚积分  4：邀请好友转积分 
	//      5：联通充值卡充值  6：首信易支付 7：神州行充值卡充值 8：银行转帐或邮局汇款
	CloseqiandaiMsg();
	if(flag==0 ){
		if(usertype==0 || usertype==1 || usertype==2 || usertype==6 ){			
			window.open("userCenter.do?str=jfmingxi&str1=5");
		}
		if(usertype==3){
			window.open("docleft.do?page=jfmingxi&parent=zh");
		}
		if(usertype==7){
			window.open("hospBack.do?str=hospjf&type=zh");
		}		
	}else if(flag==1){
		if(usertype==0 || usertype==1 || usertype==2 || usertype==6 ){			
			window.open("userCenter.do?str=jf&str1=5");
		}
		if(usertype==3){
			window.open("docleft.do?page=jbjifen&parent=zh");
		}
		if(usertype==7){
			window.open("hospBack.do?str=hospjf&type=zh");
		}
	}else if(flag==2){
		window.open("http://www.51etong.com/jifen/jifen.jsp");
	}else if(flag==3){
		window.open("qsf.do");
	}else if(flag==4){
		window.open("invite.do");
	}else if(flag==5){
		window.open("paynum.do?cardTypeCombine=1");
	}else if(flag==6){
		window.open("shouXin.do");
	}else if(flag==7){
		window.open("paynum.do?cardTypeCombine=");
	}else if(flag==8){
		window.open("http://www.51etong.com/payConter/other.html");
	}
}

function AlertqiandaiMsg(title,nowcoin,nowscores,addcoin,addscores,usertype){
//当前金币数：nowcoin 
//当前积分数： nowscores 
//新增金币数：addcoin 
//新增积分数：addscores  
var msgw,msgh,msgbg,msgcolor,bordercolor,titlecolor,titlebg,content; 

	content="<div id=\"mainqiandai\">  <div class=\"b2qiandai\">	<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"328\" height=\"289\" id=\"FlashVars\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\"jifen/qiandai.swf?nowcoin="+nowcoin+"&nowscores="+nowscores+"&addcoin="+addcoin+"&addscores="+addscores+"\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><param name=\"wmode\" value=\"transparent\" /><embed src=\"jifen/qiandai.swf?nowcoin="+nowcoin+"&nowscores="+nowscores+"&addcoin="+addcoin+"&addscores="+addscores+"\" quality=\"high\" bgcolor=\"#ffffff\" width=\"328\" height=\"289\" wmode=\"transparent\" name=\"FlashVars\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"/> </object>   </div>	  <div class=\"b3qiandai\">    <div class=\"tsqiandai\"><a href=\"javascript:linkurl("+usertype+",0);\" class=\"qiandai\">积分查询</a>　　　　　<a href=\"javascript:linkurl("+usertype+",1);\" class=\"qiandai\">积分兑换</a>　　　　　<a href=\"javascript:linkurl("+usertype+",2);\" class=\"red-qiandai\">积分规则</a></div>    <div class=\"tsqiandai\"><a href=\"javascript:linkurl("+usertype+",3);\" class=\"qiandai\">抢沙发赚积分</a>　　　<a href=\"javascript:linkurl("+usertype+",4);\" class=\"red-qiandai\">邀请好友赚金币</a></div>    <div class=\"tsqiandai\"><b>充值方法：</b></div>    <div class=\"tsqiandai\"><a href=\"javascript:linkurl("+usertype+",5);\" class=\"qiandai\">联通充值卡充值</a>　　　　　<a href=\"javascript:linkurl("+usertype+",6);\" class=\"red-qiandai\">银行卡充值</a></div>    <div class=\"tsqiandai\"><a href=\"javascript:linkurl("+usertype+",7);\" class=\"qiandai\">神州行充值卡充值</a>　　　　<a href=\"javascript:linkurl("+usertype+",8);\" class=\"qiandai\">银行转账和邮局汇款</a></div>    </div></div>";






//弹出窗口设置
    msgw = 350;   //窗口宽度 
    msgh = 505;   //窗口高度 
    msgbg = "#FFF";    //内容背景
    msgcolor = "#000";   //内容颜色
    bordercolor = "#000"; //边框颜色 
    //titlecolor = "#FFF"; //标题颜色
	titlecolor = "#d60"; //标题颜色	
	//titlebg = "#369";   //标题背景
    titlebg = "url(jifen/images/z-jifen-top.gif) no-repeat";   //标题背景
   

	
//遮罩背景设置 
    var sWidth,sHeight; 
    sWidth = screen.availWidth; 
    sHeight = document.body.scrollHeight;
    //sHeight = screen.availHeight;
     
//创建遮罩背景 
    var maskObj = document.createElement("div"); 
    maskObj.setAttribute('id','maskdiv'); 
    maskObj.style.position = "absolute"; 
    maskObj.style.top = "0"; 
    maskObj.style.left = "0"; 
    maskObj.style.background = "#777"; 
    maskObj.style.filter = "Alpha(opacity=30);"; 
    maskObj.style.opacity = "0.3"; 
    maskObj.style.width = sWidth + "px"; 
    maskObj.style.height = sHeight + "px"; 
    maskObj.style.zIndex = "10000"; 
    document.body.appendChild(maskObj); 
//创建弹出窗口
    var msgObj = document.createElement("div") 
    msgObj.setAttribute("id","msgdiv"); 
    msgObj.style.position ="absolute";
    //msgObj.style.top = 180 + "px";
    //msgObj.style.left = 200 + "px";


	msgObj.style.top = (screen.availHeight - msgh) / 2 + getScrollTop() -55+ "px";
    msgObj.style.left = (screen.availWidth - msgw) / 2 + "px";
    msgObj.style.width = msgw + "px";
    msgObj.style.height = msgh + "px";
    msgObj.style.fontSize = "12px";
    msgObj.style.background = msgbg;
    //msgObj.style.border = "1px solid " + bordercolor; 
    msgObj.style.zIndex = "10001"; 

//创建标题
    var thObj = document.createElement("div");
    thObj.setAttribute("id","msgth"); 
    thObj.className = "DragAble";
    thObj.title = "按住鼠标左键可以拖动窗口！";
    thObj.style.cursor = "move";
    thObj.style.padding = "5px 10px 0px 10px";
    thObj.style.color = titlecolor;
    thObj.style.background = titlebg;
	thObj.style.height="19px";
    //var titleStr = "<a class='close' title='关闭' onclick='CloseqiandaiMsg()' >关闭</a>"+"<span>"+ title +"</span>";
	var titleStr = "<span style='float:right'><a href='javascript:CloseqiandaiMsg();'><img src='jifen/images/close.gif' width='8' height='9' /></a></span>"+"<b>"+ title +"</b>";
	
    thObj.innerHTML = titleStr;

//创建内容
    var bodyObj = document.createElement("div");
    bodyObj.setAttribute("id","msgbody"); 
    bodyObj.style.padding = "0px";
    bodyObj.style.lineHeight = "1.5em";
    //var txt = document.createTextNode(content)
    bodyObj.innerHTML = content ;
    //bodyObj.appendChild(txt);
//生成窗口
    document.body.appendChild(msgObj);


   //$("msgdiv").appendChild(thObj); //modi by ban 2010-01-28 与jquery冲突
   document.getElementById("msgdiv").appendChild(thObj);

    //$("msgdiv").appendChild(bodyObj);//modi by ban 2010-01-28 与jquery冲突
	document.getElementById("msgdiv").appendChild(bodyObj);

}


function CloseqiandaiMsg(){
//移除对象

    //document.body.removeChild($("maskdiv")); //modi by ban 2010-01-28 与jquery冲突
	document.body.removeChild(document.getElementById("maskdiv"));
    //$("msgdiv").removeChild($("msgth")); //modi by ban 2010-01-28 与jquery冲突
	document.getElementById("msgdiv").removeChild(document.getElementById("msgth"));
    //$("msgdiv").removeChild($("msgbody")); //modi by ban 2010-01-28 与jquery冲突
	document.getElementById("msgdiv").removeChild(document.getElementById("msgbody"));	
    //document.body.removeChild($("msgdiv")); //modi by ban 2010-01-28 与jquery冲突
	document.body.removeChild(document.getElementById("msgdiv")); 
}
//拖动窗口

var ie = document.all;   
var nn6 = document.getElementById&&!document.all;   
var isdrag = false;   
var y,x;   
var oDragObj;   

function moveMouse(e) {   
if (isdrag) {   
oDragObj.style.top = (nn6 ? nTY + e.clientY - y : nTY + event.clientY - y)+"px";   
oDragObj.style.left = (nn6 ? nTX + e.clientX - x : nTX + event.clientX - x)+"px";   
return false;   

}   
}   

function initDrag(e) {   
var oDragHandle = nn6 ? e.target : event.srcElement;   
var topElement = "HTML";   
while (oDragHandle.tagName != topElement && oDragHandle.className != "DragAble") {   
oDragHandle = nn6 ? oDragHandle.parentNode : oDragHandle.parentElement;   
}   
if (oDragHandle.className=="DragAble"){   
isdrag = true;   
oDragObj = oDragHandle.parentNode;   
nTY = parseInt(oDragObj.style.top);   
y = nn6 ? e.clientY : event.clientY;   
nTX = parseInt(oDragObj.style.left);   
x = nn6 ? e.clientX : event.clientX;   
document.onmousemove = moveMouse;  

return false;   
}   
}   
document.onmousedown = initDrag;   
document.onmouseup = new Function("isdrag=false");   
//--> 





