function showItemId(checkbox, deathId ) {

	if ( checkbox.checked ) {
		if ( document.getElementById ) {
			id = document.getElementById( deathId );
			id.style.display = 'block';
		} else if (document.all) {
			document.all[deathId].style.display = 'block';
		}
	} else {
		if ( document.getElementById ) {
			id = document.getElementById( deathId );
			id.style.display = 'none';
		} else if (document.all) {
			document.all[deathId].style.display = 'none';
		}
	}
}


function showBig(id) {
	newWindow = window.open('popup.php?id=' + id, '', 'menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=yes, status=no, width=800, height=600');
	newWindow.focus();
}

function showBigBlog(id) {
	newWindow = window.open('popup_blog.php?id=' + id, '', 'menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=yes, status=no, width=800, height=600');
	newWindow.focus();
}


function validateDogAdd(form, badName, badCountry, badArea, badWeight) {

	if ( form.name.value == '' ) {
		alert(badName);
		form.name.focus();
		return false;
	}
	
	if ( form.country_id.value == 'empty' ) {
		alert(badCountry);
		form.country_id.focus();
		return false;
	}

	if ( form.area_id.value == 'empty' ) {
		alert(badArea);
		form.area_id.focus();
		return false;
	}
	
	pattern = /^[0-9]+$/;
	
	if (  form.weight.value.match( pattern ) == null  ) {
		alert(badWeight);
		form.weight.focus();
		return false;
	}


	
}


function validateNewUser(form, text) {
	if (! form.terms.checked ) {
		alert(text);
		return false;
	}
	return true;
}


function enableElement(id) {
	if ( document.getElementById ) {
		document.getElementById(id).disabled = false;
	} else if ( document.all ) {
		document.all[id].disabled = false;
	}
}


function confirmDeletePostBlog(question) {
	return confirm(question);
}

function confirmDeleteCommentBlog(question) {
	return confirm(question);
}


function confirmDelete(question) {
	return confirm(question);
}

function submitForm(id) {
	if ( document.getElementById ) {
		document.getElementById(id).submit();
	} else if ( document.all ) {
		document.all[id].submit();
	}
}

function showId(id) {
	if ( document.getElementById ) {
		document.getElementById(id).style.display = 'block';
	} else if ( document.all ) {
		document.all[id].style.display = 'block';
	}
}

function hideId(id) {
	if ( document.getElementById ) {
		document.getElementById(id).style.display = 'none';
	} else if ( document.all ) {
		document.all[id].style.display = 'none';
	}
}

function goToURL(link) {
	window.location = link;

}


