 $().ready(function() {
	    $('#dialog').jqm({modal: true});       
 });
 
 function start(){
 	 //用户是否登录
	 if(!isUserLogin()){
	 	  window.location="../login/login.jsp?flag=2";
	 	  return;
	 }
 	var res=doPay();
 	if(102==res){
 	    Tshow("您好,暂时不能访问哈哈网!");
 	}else{
 	    goPay(res);
 	}	 
 }
function goPay(type){
 	    $('#dialog').jqmHide();
 	    $('#resType').attr("value",type);
        document.getElementById("subForm").submit();
}
 function doPay(){
    var html = $.ajax({
	    	 type: "POST",
			 url: "../hahaAction",
			 async: false
	     }).responseText;
	return html;	
 }
 
 function isUserLogin(){
    var html = $.ajax({
	    	 type: "POST",
			 url: "../loginAjax",
			 async: false
	     }).responseText;
	    
	if(html=="1"){
		return true;
	}else{
		return false;
	}     
}
 function Tshow(content){
    var html="";
	html +=("<div id=\"Layer1\"><div id=\"tishiDiv\">");
	html +=("<div id=\"tishiDivTitle\"><\/div>");
	html +=("<div id=\"tishiDivTitle2\"><img class=\"jqmClose\" style=\"cursor: pointer;\" src=\"images\/tishi04.gif\" width=\"60\" height=\"24\" border=\"0\" \/><\/div>");
	html +=("<div id=\"tishiDivBody\"><table width=\"100%\"><tr><td height=\"80px\"  valign=\"middle\">"+content+"</td></tr></table><\/div>");
	html +=("<div id=\"tishiDivButtonDiv\"><img class=\"jqmClose\" style=\"cursor: pointer;\" src=\"images\/tishi01.gif\" width=\"65\" height=\"22\" border=\"0\" \/>&nbsp;<img style=\"cursor: pointer;\" class=\"jqmClose\" src=\"images\/tishi02.gif\" width=\"64\" height=\"22\" border=\"0\" \/><\/div>");
	html +=("<\/div>");
	html +=("<\/div>") 	
    $('#dialog').html("");
	$('#dialog').append(html);
	$('#dialog').jqmShow();
 }
 
 