function pwConfirm(title,position,callback){
	if (typeof(callback) != 'function') alert('error');
	var container 	= elementBind('div','','','width:200px;height:100px;margin:20px auto;position: absolute;');
	document.body.appendChild(container);
	
	var center_con	= elementBind('div','','menu-post','width:200px;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= '确 定';
	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 shareOtherType(id){
	if (getObj(id)) {
		var id = getObj(id);
		read.setMenu(id.innerHTML);
		read.menupz();
	} else {
		showDialog('error','指定id不存在');
	}
}

function postShareOtherType(type,id){
	var textarea	= read.menu.getElementsByTagName('textarea');
	var descrip	= textarea[0].value;
	ajax.send('mode.php?m=o&q=sharelink','type='+type+'&id='+id+'&descrip='+ajax.convert(descrip),function(){
		var rText = ajax.request.responseText;
		if (rText=='success') {
			showDialog('success','分享成功!',2);
			//closep();
		} else {
			ajax.guide();
		}
	});
}