//window.onload=switchContent;
function show(element){
	var displayedElem = document.getElementById(element);
	if(displayedElem.style.display == 'none' || displayedElem.style.display == ''){
		displayedElem.style.display = 'block';
		if(element == 'tagPropFrm'){
			displayedElem.childNodes[1].focus();
		}
	}
	else
		displayedElem.style.display = 'none';
}

function disableSelect(id){
	select = document.getElementById(id);
	select.disabled = true;
}

function enableSelect(id){
	select = document.getElementById(id);
	select.disabled = false;
}


function switchContent(id, owner){
	var d = document.getElementById(id);
	for (var i = 1; i<=4; i++) {
		if (document.getElementById('tab'+i)) {document.getElementById('tab'+i).style.display='none';}
	}
	if (d) {d.style.display='block';}

	var tabNav = document.getElementById('tabNav');
	for(var i=0; i<4; i++){
		var a = tabNav.childNodes[i].childNodes[0]
		a.setAttribute("onmouseover", "this.style.textDecoration=\"underline\"");
		a.setAttribute("onmouseout", "this.style.textDecoration=\"none\"");
		a.style.fontWeight="normal";
		a.style.cursor="pointer";
	}
	owner.style.textDecoration="none";
	owner.style.fontWeight="bold";
	owner.style.cursor="default";
	owner.setAttribute("onmouseover", "this.style.textDecoration=\"none\"");



}

function answer_comment(id)
{
	var idcomm=document.getElementById('idcomm');
	idcomm.value=id;
	show('commentFrm');
}


function remove_avatar()
{
	//alert('xxx');
	var avatar=document.getElementById('avatar');
	var id_avatar=document.getElementById('id_avatar');
	var no_photo=document.getElementById('no_photo');
	var del_photo=document.getElementById('del_photo');

	id_avatar.value=0;
	avatar.src=no_photo.value;
	del_photo.style.display='none';
	//alert('xxxx');
	//alert(no_photo.src);
}


function UrlReplace(link,param1)
{
	link=link.replace('*param1*',param1);
	document.location=link;
}

function selectAllFromField(owner){
	owner.focus();
	owner.select();
}