function getEl(id){
	return document.getElementById(id)
}
function switchshortlong(srcElem,idhotel){
	var myElement = $(getEl("hoteltextln"+idhotel));
	if(myElement.hasClass('hoteltextlnshort')){
		myElement.removeClass('hoteltextlnshort');
		myElement.addClass('hoteltextlnlong');
		srcElem.childNodes[0].style.display='none'
		srcElem.childNodes[1].style.display=''
	}else{
		myElement.addClass('hoteltextlnshort');
		myElement.removeClass('hoteltextlnlong');
		srcElem.childNodes[0].style.display=''
		srcElem.childNodes[1].style.display='none'
	}
	
	
}

function ajaxAndReload(obj){
	obj['rand']=Math.random();
	
	var myAjax = new Ajax('/php/aw.php', 
					{data:obj , 
					method: 'post',
					onComplete:reloadPage}).request();
}
function reloadPage(){
	location.href=location.href;
}
function alertCustomPhrase(c){
	var myAjax = new Ajax('/php/aw.php', 
					{data:{action:'alertCustomPhrase',c:c,rand:Math.random()} , 
					method: 'get',
					onComplete:_alertCustomPhrase}).request();
}
function _alertCustomPhrase(rep){
	alert(rep);
}


function savecomment(ih){
	
	var fx = new Fx.Styles($('zecomm_'+ih), {duration:200, wait:false,transition:Fx.Transitions.Quart.easeIn});
	
	fx.start({	'background-color': '#A5ACB2'	}).chain(
		function(){
		
			new Ajax('/php/aw.php', 
					{data:{action:'saveComment',idhotel:ih,txt:$('zecomm_'+ih).value,rand:Math.random()} , 
					method: 'get',
					async: false,
					onComplete:fx.start({	'background-color': '#ffffff'	})
					}).request();
			
		}
	)

	
	
}
