/*
Toggles the visibility of an element with a specified ID.

ARGUMENTS
elementId
	Id of the element to toggle.

RETURN VALUE
None.
*/
function ToggleVisibility(elementId){
	var element = document.getElementById(elementId);
	if(!element){
		return;
	}
	if(element.style.display != "block"){
		element.style.display = "block";
	}
	else{
		element.style.display = "none";
	}
	return;
}

function checkSize(id){
	var prod = 'prod_'+id;
	$(prod).addEvent('load',function(){
		if($(prod).width>120){
			var w = $(prod).width;
			var h = $(prod).height;
			var r = w/h;
			$(prod).width = 120;
			$(prod).height = (120/r);
			if($(prod).height<120){
				var rest = 120 - $(prod).height;
				$(prod).style.paddingTop = rest/2+'px';
			}
		}
	});
}

window.getScrollTop = function(){
	return this.pageYOffset || document.documentElement.scrollTop;
}

var msgRedraw = function(){
	$('Notification').setStyle('top', window.getScrollTop() + 10 + 'px')
};