function pwConfirm(title,position,callback){
	if (typeof(callback) != 'function') alert('error');
	var container 	= elementBind('div','','','width:300px;height:100px;margin:20px auto;position: absolute;');
	document.body.appendChild(container);
	
	var center_con	= elementBind('div','','menu-post','width:300px;position:absolute;');
	var inner_con	= elementBind('div','','menu-b');
	var content		= elementBind('div','','f14 b p10');
	content.innerHTML = title;
	var input_con	= elementBind('div','','tar pdD');
	var ok	= elementBind('input','','bt3','width:80px;');
	ok.type = 'button';
	ok.value= '½T ©w';
	ok.onclick = function(){
		container.parentNode.removeChild(container);
		callback();
	}
	input_con.appendChild(ok);
	var cancel = elementBind('input','','bt','margin-left:4px;');
	cancel.type = 'button';
	cancel.value= '¨ú®ø';
	cancel.onclick = function(){
		container.parentNode.removeChild(container);
	}
	input_con.appendChild(cancel);
	var angle = elementBind('b','','angle');
	inner_con.appendChild(content);
	inner_con.appendChild(input_con);
	inner_con.appendChild(angle);
	center_con.appendChild(inner_con);
	container.appendChild(center_con);
	if (typeof(position)!='object') {
		container.style.top  = (ietruebody().clientHeight - container.offsetHeight)/3 + getTop() + 'px';
		container.style.left = (ietruebody().clientWidth - container.offsetWidth)/2 + 'px';
	} else {
		var top  = findPosY(position);
		var left = findPosX(position);
		top = getTop() + top - container.offsetHeight - position.offsetHeight;
		left = left - container.offsetWidth + position.offsetWidth/2 + 35;

		container.style.top  = top  + 'px';
		container.style.left = left + 'px';
	}
	container.style.display = '';
}


function dateFormat(date,format){
	var o = {
		"Y+" :  date.getFullYear(),
		"M+" :  date.getMonth()+1,  //month
		"m+" :  date.getMonth()+1,  //month
		"d+" :  date.getDate(),     //day
		"h+" :  date.getHours(),    //hour
		"i+" :  date.getMinutes(),  //minute
		"s+" :  date.getSeconds(), //second
		"q+" :  Math.floor((date.getMonth()+3)/3),  //quarter
		"S"  :  date.getMilliseconds() //millisecond
	}
	if(/(y+)/.test(format)) {
		format = format.replace(RegExp.$1, (date.getFullYear()+"").substr(4 - RegExp.$1.length));
	}
	for(var k in o) {
		if(new RegExp("("+ k +")").test(format)) {
			format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
		}
	}
	return format;
}

function char_cv(str){
	if (str != ''){
		str = str.replace(/</g,'&lt;');
		str = str.replace(/%3C/g,'&lt;');
		str = str.replace(/>/g,'&gt;');
		str = str.replace(/%3E/g,'&gt;');
		str = str.replace(/'/g,'&#39;');
		str = str.replace(/"/g,'&quot;');
	}
	return str;
}
