var statusInput = document.getElementById("statusInput");
var statusPublished = document.getElementById("statusPublish_published");
if (screen.width<=800) {
	statusInput.style.width="135px";
	statusPublished.style.width="135px";
	
	var statusPublish = document.getElementById("statusPublish");
	var statusPublish_loading = document.getElementById("statusPublish_loading");
	
	statusPublish.style.display="none";
	statusPublish_loading.style.width="135px";
} else if (screen.width==1024) {
	statusInput.style.width="250px";
	statusPublished.style.width="332px";
} else {
	statusInput.style.width="350px";
	statusPublished.style.width="432px";
}
var statusPublish = document.getElementById("statusPublish");
statusPublish.blur();

function Publishing() {
	if (screen.width > 800) {
		var publishButton = document.getElementById("statusPublish");		
		publishButton.style.display='none';				
	} else {
		var publishInput = document.getElementById("statusInput");		
		publishInput.style.display='none';				
	}
	var publishButton_loading = document.getElementById("statusPublish_loading");
	publishButton_loading.style.display='';
}

function CancelPublishing() {	
	var publishInput = document.getElementById("statusInput");
	var publishButton_loading = document.getElementById("statusPublish_loading");	
	if (screen.width > 800) {
		var publishButton = document.getElementById("statusPublish");
		publishButton.style.display='';
		publishButton_loading.style.display='none';
		publishInput.value = document.getElementById("tmpText").value;
	} else {		
		publishButton_loading.style.display='none';
		publishInput.style.display='';
		publishInput.value = document.getElementById("tmpText").value;
	}	
}

function fadeout(id) {			
	if (document.getElementById(id)) {
		var speed = 5;
		var timer = 0;
			
		for(i = 100; i >= 0; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
		setTimeout("document.getElementById('" + id + "').style.display='none';",(timer * speed));
	}
}

function fadein(id) {					
	if (document.getElementById(id)) {						
		changeOpac(0, id);
		document.getElementById(id).style.display="";
		var speed = 5;
		var timer = 0;
			
		for(i = 0; i < 100; i++) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}
	
function changeOpac(opacity, id) {
	if (document.getElementById(id)) {
		var object = document.getElementById(id).style; 
		object.opacity = (opacity / 100);
		object.MozOpacity = (opacity / 100);
		object.KhtmlOpacity = (opacity / 100);
		object.filter = "alpha(opacity=" + opacity + ")";
	}
}