function resizeup(obj) {
	var newheight = parseInt(document.getElementById(obj).style.height, 10) + 50;
	document.getElementById(obj).style.height = newheight + 'px';
}
function resizedown(obj) {
	var newheight = parseInt(document.getElementById(obj).style.height, 10) - 50;
	if(newheight > 0) {
		document.getElementById(obj).style.height = newheight + 'px';
	}
}
function checkAll(type, form, value, checkall, changestyle) {
	var checkall = checkall ? checkall : 'chkall';
	var value = value ? value : 'selectall';
	for(var i = 0; i < form.elements.length; i++) {
		var e = form.elements[i];
		if(type == 'option' && e.type == 'radio' && e.value == value && e.disabled != true) {
			e.checked = true;
		} else if(type == 'value' && e.type == 'checkbox' && e.value == value) {
			e.checked = form.elements[checkall].checked;
		} else if(type == 'prefix' && e.name && e.name != checkall && (!value || (value && e.name.match(value)))) {
			e.checked = form.elements[checkall].checked;
			if(changestyle && e.parentNode && e.parentNode.tagName.toLowerCase() == 'li') {
				e.parentNode.className = e.checked ? 'checked' : '';
			}
		}
	}
}

function doit(operation) {
	$('#doit').val(operation);
	$('#form1').submit();
}

function submit(form) {
	$('#' + form).submit();
}

function getalltag() {
	var width = 400;
	var x = new Ajax('statusid', 'XML');
	x.get(blogurl + 'getxml.php?action=getalltag', function(s) {
		if(document.getElementById("ajax-div-tagshow")) {
			var oDiv = document.getElementById("ajax-div-tagshow");
		} else {
			var oDiv = document.createElement("DIV");
			oDiv.id = "ajax-div-tagshow";
			oDiv.className = "ajaxdiv";
			document.body.appendChild(oDiv);
		}
		var oDivStyle = oDiv.style;
		oDivStyle.display = "";
		oDivStyle.width = width + "px";

		var clientHeight = scrollTop = 0;
		if(is_opera) {
			clientHeight = document.body.clientHeight /2;
			scrollTop = document.body.scrollTop;
		} else {
			clientHeight = document.documentElement.clientHeight /2;
			scrollTop = document.documentElement.scrollTop;
		}
		oDiv.innerHTML = s.lastChild.firstChild.nodeValue;
		oDivStyle.left = (document.documentElement.clientWidth /2 +document.documentElement.scrollLeft - width/2)+"px";
		oDivStyle.top = (clientHeight +　scrollTop - oDiv.clientHeight/2)+"px";
	});
}


function sa_alert(content) {
	var oDiv = document.getElementById('statusmsg');
	var oDivStyle = document.getElementById('statusmsg').style;
	var width = 200;

	//判断显示的位置-居中
	var clientHeight = scrollTop = 0; 
	if(is_opera) {
		clientHeight = document.body.clientHeight / 2;
		scrollTop = document.body.scrollTop;
	} else {
		clientHeight = document.documentElement.clientHeight / 2;
		scrollTop = document.documentElement.scrollTop;
	}
	oDivStyle.display = '';
	oDivStyle.left = (document.documentElement.clientWidth / 2 + document.documentElement.scrollLeft - width / 2) + 'px';
	oDivStyle.top = scrollTop + 'px';
	//by angel
	oDivStyle.position = 'absolute';
	oDivStyle.fontSize = '12px';
	oDivStyle.fontFamily = 'Verdana';
	oDivStyle.width = width + 'px';
	oDivStyle.padding = '5px';
	oDivStyle.backgroundColor = '#f00';
	oDivStyle.color = '#fff';
	oDivStyle.textAlign = 'center';
	oDiv.innerHTML = '<span style="float:right;"><a style="color:#fff;" href="javascript:;" onclick="document.getElementById(\'statusmsg\').style.display=\'none\';">X</a></span><span style="float:left;">' + content + '</span>';
}
