function CreatePopupWindow(title, html_content) {
	var div_content = document.getElementById('content');
	var container_width, container_height;
	if(div_content) {
		container_width = div_content.offsetWidth;
		container_height = div_content.offsetHeight;
	} else {
		container_width = document.body.offsetWidth;
		container_height = document.body.offsetHeight;
	}
	var div_root = document.getElementById('popup_window');
	if(div_root) {
		document.body.removeChild(div_root);
	}
	div_root = document.createElement('div');
	div_root.id = 'popup_window';
	div_root.className = 'popup_box';
	var div_title_bar = document.createElement('div');
	div_title_bar.className = 'title_bar';
	var div_title = document.createElement('div');
	div_title.className = 'title';
	div_title.innerHTML = title;
	var div_close = document.createElement('div');
	div_close.className = 'close';
	div_close.innerHTML = '<a href="#" onclick="ClosePopupWindow();return false;">x</a>';
	div_title_bar.appendChild(div_close);
	div_title_bar.appendChild(div_title);
	div_root.appendChild(div_title_bar);
	var div_body = document.createElement('div');
	div_body.className = 'body';
	div_body.innerHTML = html_content;
	div_root.appendChild(div_body);
	div_root = document.body.appendChild(div_root);
	div_root.style.left = ((container_width-div_root.offsetWidth)/2)+'px';
	div_root.style.top = ((container_height-div_root.offsetHeight)/2)+'px';
	return;
}

function ClosePopupWindow() {
	var div_root = document.getElementById('popup_window');
	if(div_root) {
		document.body.removeChild(div_root);
	}	
}

function AdjustSize() {
	var body_children = document.body.childNodes;
	var max_bottom_pos = 0; 
	var i;
	for(i = 0; i < body_children.length; i ++) {
		if((body_children[i].offsetTop+ body_children[i].offsetHeight)) {
			if(max_bottom_pos < body_children[i].offsetTop + body_children[i].offsetHeight) {
				max_bottom_pos = body_children[i].offsetTop + body_children[i].offsetHeight;
			}
		}
	}
	window.frameElement.height = max_bottom_pos;
}

function RrefreshRelatedBox(prefix) {
	var _container = window.parent;
	for(i = 0; i < _container.frames.length; i ++) {
		var _frame = _container.frames[i];
		if(_frame.name.indexOf(prefix) == 0) {
			var _original_href = _frame.location.href;
			_frame.location.href =_original_href;		
		}
	}
}

function AdjustSize1(target) {
	var body_children = target.document.body.childNodes;
	var max_bottom_pos = 0; 
	var i;
	for(i = 0; i < body_children.length; i ++) {
		if((body_children[i].offsetTop+ body_children[i].offsetHeight)) {
			if(max_bottom_pos < body_children[i].offsetTop + body_children[i].offsetHeight) {
				max_bottom_pos = body_children[i].offsetTop + body_children[i].offsetHeight;
			}
		}
	}
	target.frameElement.height = max_bottom_pos;
}


function check(msg){
	var resualt=false;
	  if(confirm(msg))
	    {
		  resualt=true;
	    }
	  return resualt;
	}