function big_foto(w,h) {
	var url='';
	var win_name='big';
	var features='menubar=no,scrollbars=yes,resizable=yes,top=0,left=100,width='+w+',height='+h;
	window.open(url,win_name,features);
}

function LTrim( value ) {
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}
// Removes ending whitespaces
function RTrim( value ) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}
// Removes leading and ending whitespaces
function trim( value ) {
	return LTrim(RTrim(value));
}

function s_h(id) {
	var loer=document.getElementById('p_'+id);
	var map=document.getElementById('map_'+id);
	if (loer.style.display=='none') {
		map.src='/img/map_m.gif';
		loer.style.display='block';
	} else {
		map.src='/img/map_p.gif';
		loer.style.display='none';
	}
}

//this.parentNode.parentNode.parentNode.parentNode
//setCookie('top_',top_,'','/');
function s_top() {
	//alert(getCookie('top_'));
	setCookie('topnew['+top_+']','','','/');
	document.getElementById('top-new').style.display='block';
	document.getElementById('top-btn-s').style.display='none';
	
}
function h_top() {
	setCookie('topnew['+top_+']','none','','/');
	document.getElementById('top-new').style.display='none';
	document.getElementById('top-btn-s').style.display='block';
	//alert(document.getElementById('top-btn-s').style.display);
}

window.onload = function() {
	var inputs = document.getElementsByTagName("input");
	for (i=0;i<inputs.length;i++) {
		addHandler(inputs[i], "focus", focus_on.bind(inputs[i]));
		addHandler(inputs[i], "blur", focus_off.bind(inputs[i]));
		//addHandler(inputs[i], "click", submit.bind(inputs[i]));
	}
	textareas = document.getElementsByTagName("textarea");
	for (i=0;i<textareas.length;i++) {
		addHandler(textareas[i], "focus", focus_on.bind(textareas[i]));
		addHandler(textareas[i], "blur", focus_off.bind(textareas[i]));
	}
	
}