function showCalendar(fieldName, imageObj, type, checkType, checkInterval) {
		var tt = imageObj;
		var iframe = document.getElementById("calendarIframe");
		if (!iframe){
			iframe = document.createElement("IFRAME");
			iframe.style.position="absolute" ;
			iframe.style.zIndex = 9998 ;
			iframe.id = "calendarIframe";
			iframe.width = "192px";
			iframe.height = "190px";
			iframe.frameBorder = "0";
			iframe.scrolling = "no";
			
			document.body.appendChild(iframe);
		} 

		if(type == '1'){
			url = "../../htm/calendar.html?timestamp=" + (new Date());
		}else{
			url = "../htm/calendar.html?timestamp=" + (new Date());	
		}		
		
		if (checkType != ""){
			url = url + "&checkType=" + checkType + "&checkInterval=" + checkInterval;
		}
		
		iframe.src = url;
	
		var obj = document.getElementById(fieldName);
		if (obj == null){
			obj1 = document.getElementsByName(fieldName);
		        if(obj1 != null && obj1.length > 0)   
		            obj = obj1[0];   
		}
		iframe.fieldObj = obj; 
		iframe.imageObj = imageObj;
		iframe.style.display = "block";
		var ttop  = tt.offsetTop;
		var thei  = tt.clientHeight; 
		var tleft = tt.offsetLeft;   
	
		var ttyp  = tt.type;         

		while (tt = tt.offsetParent){ttop+=tt.offsetTop; tleft+=tt.offsetLeft;}
		iframe.style.top  = (ttyp=="image")? ttop+thei : ttop+thei+6 + "px";
		iframe.style.left = tleft + "px";
	}

	/*
	function document.onclick() { 
	    calendarCloseLayer();
	}
	*/
	
	if(window.addEventListener){ // Mozilla, Netscape, Firefox
		document.addEventListener('click', calendarCloseLayer, false);
	} else { // IE
		document.attachEvent('onclick', calendarCloseLayer);
	}
	
	
	function calendarCloseLayer(evt)  {
		var o = document.getElementById("calendarIframe");
		var eventObj = evt.srcElement? evt.srcElement:evt.target;
		
		if (o != null && eventObj!=o.fieldObj && eventObj!=o.imageObj) {
			o.style.display="none";
			
			// \u4fee\u6539\u4fdd\u5355\u5230\u671f\u65e5\u671f\u4e3a\u8d77\u4fdd\u65e5\u671f\u7684\u540e\u4e00\u5e74\u524d\u4e00\u5929
			var contractEndDate = document.getElementById("contractEndDate");
			if(contractEndDate) {
				showEndDate();
			}
		}
	}

	function calendarCloseLayerWithoutEvent()  {
		var o = document.getElementById("calendarIframe");
		if (o != null) {
			o.style.display="none";
		}
	
		var contractEndDate = document.getElementById("contractEndDate");
		if(contractEndDate) {
			showEndDate();
		}
	}

