function sAlert(txt){
	var eSrc=(document.all)?window.event.srcElement:arguments[1];
	var shield = document.createElement("DIV");
	shield.id = "shield";
	shield.style.position = "absolute";
	shield.style.left = "0px";
	shield.style.top = "0px";
	shield.style.width = "100%";
	shield.style.height = document.body.scrollHeight+"px";
	shield.style.background = "#fff";
	shield.style.textAlign = "center";
	shield.style.zIndex = "10000";
	shield.style.filter = "alpha(opacity=0)";
	shield.style.opacity = 0;
	var alertFram = document.createElement("DIV");
	alertFram.id="alertFram";
	alertFram.style.position = "absolute";
	alertFram.style.left = "50%";
	alertFram.style.top = "45%";
	alertFram.style.marginLeft = "-225px" ;
	alertFram.style.marginTop = -75+document.documentElement.scrollTop+"px";
	alertFram.style.width = "398px";
	alertFram.style.height = "150px";
	alertFram.style.background = "#ccc";
	alertFram.style.textAlign = "center";
	alertFram.style.lineHeight = "150px";
	alertFram.style.zIndex = "10001";

	strHtml  = "<ul style=\"list-style:none;margin:0px;padding:0px;width:100%;border:1px solid #498AC2;background:url(../../images/alter_bg.gif) #fff;\">\n";
	strHtml += "	<li style=\"background:url(../../images/alter_bar.gif) no-repeat #45A0EE;text-align:left;padding-left:20px;font-size:12px;color:#fff;font-weight:bold;height:25px;line-height:25px;\">第一商业地产网提示</li>\n";
	strHtml += "	<li style=\"text-align:center;font-size:12px;color:#327FC6;height:100px;line-height:120px;\">"+txt+"</li>\n";
	strHtml += "	<li style=\"text-align:center;height:35px;line-height:25px;\"><input type=\"button\" class=\"input_Alter\" value=\"确 定\" id=\"do_OK\" onclick=\"doOk()\" /></li>\n";
	strHtml += "</ul>\n";
	alertFram.innerHTML = strHtml;
	document.body.appendChild(alertFram);
	document.body.appendChild(shield);
	this.setOpacity = function(obj,opacity){
		if(opacity>=1)opacity=opacity/100;
		try{ obj.style.opacity=opacity; }catch(e){}
		try{ 
			if(obj.filters.length>0&&obj.filters("alpha")){
				obj.filters("alpha").opacity=opacity*100;
			}else{
				obj.style.filter="alpha(opacity=\""+(opacity*100)+"\")";
			}
		}catch(e){}
	}
	var c = 0;
	this.doAlpha = function(){
		if (++c > 20){clearInterval(ad);return 0;}
		setOpacity(shield,c);
	}
	var ad = setInterval("doAlpha()",1);
	this.doOk = function(){
		document.body.removeChild(alertFram);
		document.body.removeChild(shield);
		eSrc.focus();
		document.body.onselectstart = function(){return true;}
		document.body.oncontextmenu = function(){return true;}
	}
	document.getElementById("do_OK").focus();
	eSrc.blur();
	document.body.onselectstart = function(){return false;}
	document.body.oncontextmenu = function(){return false;}
}

function myAlert(str){
   var msgw,msgh,bordercolor;
   msgw=400;//提示窗口的宽度
   msgh=100;//提示窗口的高度
   titleheight=25 //提示窗口标题高度
   bordercolor="#498AC2";//提示窗口的边框颜色
   titlecolor="#99CCFF";//提示窗口的标题颜色
   
   var sWidth,sHeight;
   sWidth=document.body.offsetWidth;
   sHeight=document.body.offsetHeight;

   var bgObj=document.createElement("div");
   bgObj.setAttribute('id','bgDiv');
   bgObj.style.position="absolute";
   bgObj.style.top="0";
   bgObj.style.background="#fff";
   bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
   bgObj.style.opacity="0.6";
   bgObj.style.left="0";
   bgObj.style.width=sWidth + "px";
   bgObj.style.height=sHeight + "px";
   bgObj.style.zIndex = "10000";
   document.body.appendChild(bgObj);
   
   var msgObj=document.createElement("div")
   msgObj.setAttribute("id","msgDiv");
   msgObj.setAttribute("align","center");
   msgObj.style.background="white";
   msgObj.style.border="1px solid " + bordercolor;
      msgObj.style.position = "absolute";
            msgObj.style.left = "50%";
            msgObj.style.top = "50%";
            msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
            msgObj.style.marginLeft = "-225px" ;
            msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px";
            msgObj.style.width = msgw + "px";
            msgObj.style.height =msgh + "px";
            msgObj.style.textAlign = "center";
            msgObj.style.lineHeight = (msgh-titleheight) + "px";
            msgObj.style.zIndex = "10001";
   
     var title=document.createElement("h4");
     title.setAttribute("id","msgTitle");
     title.setAttribute("align","right");
     title.style.margin="0";
     title.style.padding="3px";
     title.style.background=bordercolor;
     title.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
     title.style.opacity="0.75";
     title.style.border="1px solid " + bordercolor;
     title.style.height="18px";
     title.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif";
     title.style.color="white";
     title.style.cursor="pointer";
     title.innerHTML="关闭";
     title.onclick=function(){
							  document.body.removeChild(bgObj);
							  document.getElementById("msgDiv").removeChild(title);
							  document.body.removeChild(msgObj);
							}
     document.body.appendChild(msgObj);
     document.getElementById("msgDiv").appendChild(title);
     var txt=document.createElement("p");
     txt.style.margin="0em 0"
     txt.setAttribute("id","msgTxt");
     txt.innerHTML=str;
	 document.getElementById("msgDiv").appendChild(txt);
}

function loadMemo(caseId,caseType,path){
		//alert(caseId+path);
		var ajaxurl = path;	
		var data={caseId:caseId,caseType:caseType};
      	jQuery.ajax({url: ajaxurl,  
	            type:'POST',
	            data:data,   
	            dataType: 'json',  
	            timeout: 10000, 
	            error: function(){
	            	//alert('Error loading XML document');
	            	alert("数据请求失败，可能是因为您在当前页面滞留时间过长，请重新登录!"); 
	            	location.href='/pages/common/login.jsp';  
	            },  
	            success: function(data){	            	
	            	//alert("success->"+data.proHtml);
	            	document.getElementById("dealMemo").value=data.proHtml;
	            	document.getElementById("viewdemo").title ="驳回原因："+ data.proHtml ;
	            }  
	    }); 
}

function showMenpiao(caseId,caseType,path){		
		//jQuery("#menpiaoDiv"+caseId).show();
		//alert(caseId+path);
		var ajaxurl = path;	
		var data={caseId:caseId,caseType:caseType};
      	jQuery.ajax({url: ajaxurl,  
	            type:'POST',
	            data:data,   
	            dataType: 'json',  
	            timeout: 20000, 
	            error: function(){
	            	//alert('Error loading XML document');
	            	alert("数据请求失败，可能是因为您在当前页面滞留时间过长，请重新登录!"); 
	            	location.href='/pages/common/login.jsp';  
	            },  
	            success: function(data){
	            	//alert("success->"+data.proHtml);
		            var lef = jQuery("#menpiao"+caseId).offset().left;
		 			var tpo = jQuery("#menpiao"+caseId).offset().top;
		 			jQuery("#menpiaoDiv"+caseId).css("left",lef-180+"px");
		 			jQuery("#menpiaoDiv"+caseId).css("top",tpo+19+"px");
		 			jQuery("#menpiao"+caseId).attr("class","menpiao_on");	            	
	            	
	            	jQuery("#menpiaoDiv"+caseId).html("<TABLE border=0 cellSpacing=0 cellPadding=0 width='100%'><TBODY><TR><TD>"+data.proHtml+"</TD></TR></TBODY></TABLE>");
	            	jQuery("#menpiaoDiv"+caseId).show();
	            }  
	    }); 
}

function divHidden(st){
	jQuery("#menpiao"+st).attr("class","menpiao");
	jQuery("#menpiaoDiv"+st).hide();
}

function showScheme(caseId,caseType,context){
	//jQuery("#menpiaoDiv"+caseId).show();
	//alert(caseId+path);
	var ajaxurl = context;	
	var left = jQuery("#schemeType"+caseId).offset().left;
	var top = jQuery("#schemeType"+caseId).offset().top;
	var data={caseId:caseId,caseType:caseType,proType:left,infoType:top,date:Math.random()};
  	jQuery.ajax({url: ajaxurl,  
            type:'POST',
            data:data,   
            dataType: 'json',  
            timeout: 20000, 
            error: function(){
            	//alert('Error loading XML document');
            	alert("数据请求失败，可能是因为您在当前页面滞留时间过长，请重新登录!"); 
            	//location.href='/pages/common/login.jsp';  
            },  
            success: function(html){            	
	 			//jQuery("#schemeTypeDiv"+caseId).css("left",left-180+"px");
	 			//jQuery("#schemeTypeDiv"+caseId).css("top",top+19+"px");
	 			//jQuery("#schemeType"+caseId).attr("class","menpiao_on");	  
	 			// jQuery("schemeType").append(html.proHtml); 	 			
	 			var statusStr = "\[已预约\]";            
	 			jQuery("#schemeType"+caseId).html(statusStr+html.proHtml);
            	jQuery("#schemeTypeDiv").show("fast");
            }  
    }); 
}

function closeSchemeDiv(caseId){	
	//jQuery(".closeScheme").parent().hide("fast");	//等同于 jQuery("#schemeTypeDiv").hide("fast");
	var closeDiv = document.getElementById("schemeTypeDiv");
	var img = document.getElementById("closeScheme");
	document.getElementById("schemeTypeDiv").removeChild(img);	
	document.getElementById("schemeType"+caseId).removeChild(closeDiv);
	//alert(document.getElementById("schemeType"+caseId).innerHTML);
	//var statusStr = "<span id='schemeType"+caseId+"\' style='color:#af0000;cursor:hand'>[已预约]</span>";		
	//jQuery("#schemeType"+caseId).html("\[已预约\]");	
}


