function openWin(event,name,caption,url,width,height) {
	if(typeof event=='undefined'){var event = event || window.event;}
	var objDivID     = name+'_div';
	var objCaptionID = name+'_caption';
	var objIframeID  = name+'_iframe';
	var objMaskID  = name+'_mask';

	if(!width){
			var width  = 300;
	}
	if(!height){
			var height  = 250;
	}


	if( !document.getElementById(objDivID) ) {
		var objDiv = document.createElement("div");
		objDiv.id  = objDivID;
		objDiv.style.position = "absolute";
		objDiv.style.zIndex = "9999";
		objDiv.style.display='none';
		objDiv.style.fontSize='12px';
		objDiv.style.width  = width+'px';
		objDiv.style.height = height+'px';

		objDiv.style.top 	= event.clientY+'px';	
		//objDiv.style.left	= ((event.clientX+width>window.screen.availWidth)?(event.clientX-width):event.clientX)+'px';	
		objDiv.style.left	= (event.clientX-width)+'px';	

		objDiv.style.background = "#FFFFFF";
		objDiv.style.border = "1px solid #CCCCCC";

		var objCaption = document.createElement("div");
		objCaption.id  = objCaptionID;
		objCaption.style.width  = width+'px';
		objCaption.style.height = '17px';
		objCaption.style.background = "#F5F5F5";
		objCaption.style.borderBottom = "1px solid #CCCCCC";
		
		objCaption.innerHTML = "<table width='100%' cellpadding='0' cellspacing='0' style='text-align:center;'><tr><td>"+caption+"</td><td width='20px' onclick=\"deleteWin('"+name+"')\" style='text-align:center;cursor:pointer'>X</td></tr></table>";
		objDiv.appendChild(objCaption);

		var objIframe = document.createElement("iframe");
		objIframe.id     = objIframeID;
		objIframe.name   = objIframeID;
		objIframe.width  = '100%';
		objIframe.height = '100%';
		objIframe.frameBorder  = '0';
		objIframe.scrolling    = 'no';
		objIframe.src		   = url;
		
		objDiv.appendChild(objIframe);

		document.body.appendChild(objDiv);

		var objMask = document.createElement("div");
		objMask.id    = objMaskID;
		objMask.style.cssText = "width:100%;height:100%;position:absolute;left:0px;top:0px;margin: auto;padding:0px;z-index:1000;background:#999;filter:Alpha(opacity=30);-moz-opacity:0.2;";

		document.body.appendChild(objMask);

	}else {		
		var objMask =document.getElementById(objMaskID);
		var objDiv =document.getElementById(objDivID);
	}
	objMask.style.display	 = '';	
	objDiv.style.display	 = '';	
}
function closeWin(name,value){
	var obj  = parent.document.getElementById(name);
	var objDiv  = parent.document.getElementById(name+'_div');
	var objMask = parent.document.getElementById(name+'_mask');
	objDiv.style.display  = 'none';
	objMask.style.display = 'none';
	obj.value = value;
	deleteWin(name);
}
function closeWinList(name,value){
	var obj  = parent.document.getElementById(name);
	var objDiv  = parent.document.getElementById(name+'_div');
	var objMask = parent.document.getElementById(name+'_mask');
	objDiv.style.display  = 'none';
	objMask.style.display = 'none';
	obj.value = obj.value+value;
	deleteWin(name);
}
function deleteWin(name) {
	var objDiv  = document.getElementById(name+'_div');
	var objMask = document.getElementById(name+'_mask');
	if( objDiv ) {		
		objDiv.parentNode.removeChild(objDiv);
	}
	if( objMask ) {		
		objMask.parentNode.removeChild(objMask);
	}
	try
	{
		parent.location.reload();
	}
	catch (e)
	{
	}
}



