

document.observe("dom:loaded", function() {
	if(Prototype.Browser.IE6){
        pngfix();
    }
	var w = $$('html')[0].getWidth();
	if(w < 1010 && w > 850){
		$$("body")[0].setSyle({
			overflowX : "hidden"
		});
	}

	$$('.delme')[0].observe('focus', function() {
		if ($(this).match('input')) {
			var orival = $(this).getValue();
			$(this).value = "";
		}else{
			var orival = $(this).innerHtml;
			$(this).update("");
		}

		$(this).observe('blur', function() {
			if($(this).match('input')){
				if ($(this).getValue() != "" && $(this).getValue() != orival) {
					$(this).removeClassName('delme').stopObserving('blur').stopObserving('focus');
				}else{
					$(this).value = orival;
				}
			}else{
				if ($(this).innerHtml != "" && $(this).innerHtml != orival) {
					$(this).removeClassName('delme').stopObserving('blur').stopObserving('focus');
				}else if ($.browser.safari && $(this).getValue() != "" && $(this).getValue() != orival) {
					$(this).removeClassName('delme').stopObserving('blur').stopObserving('focus');
				}else{
					$(this).update(orival);
				}
			}
		});
	});
});

//
//$(function(){
//	var w = $("html").width();
//	if(w < 1010 && w > 850){
//		$("body").css({
//			overflowX : "hidden"
//		});
//	}
//
//	//Input con valoreche scompare al passaggio del mouse
//
//	$(".delme").focus(function(){
//		if ($(this).is('input')) {
//			var orival = $(this).val();
//			$(this).val("");
//		}else{
//			var orival = $(this).html();
//			$(this).html("");
//		}
//
//		$(this).blur(function(){
//			if($(this).is('input')){
//				if ($(this).val() != "" && $(this).val() != orival) {
//					$(this).removeClass('delme').unbind('blur').unbind('focus');
//				}else{
//					$(this).val(orival);
//				}
//			}else{
//				if ($(this).html() != "" && $(this).html() != orival) {
//					$(this).removeClass('delme').unbind('blur').unbind('focus');
//				}else if ($.browser.safari && $(this).val() != "" && $(this).val() != orival) {
//					$(this).removeClass('delme').unbind('blur').unbind('focus');
//				}else{
//					$(this).html(orival);
//				}
//			}
//
//		});
//	});
//});