function show(id) {
	document.getElementById(id).style.display="";
}
function hide(id) {
	document.getElementById(id).style.display="none";
}

function edittextarea(id,width,height) {
	var id_edit='edittextarea'+id;
	if ( document.getElementById(id_edit) != null )
	{
		document.getElementById(id_edit).innerHTML='<img src="edit2.png" alt="edit" align="right" width="20px">';
	}
	document.getElementById(id).innerHTML='<textarea class="textarea" name="'+id_edit+'" style="overflow:scroll;width:'+width+'px;height:'+height+'px;text-align:justify;">'+document.getElementById(id).innerHTML+'</textarea>';
}

function editinput(id,width) {
	var id_edit='editinput'+id;
	if ( document.getElementById(id_edit) != null )
	{
		document.getElementById(id_edit).innerHTML='<img src="images/edit2.png" alt="edit" border="0" width="20px" style="margin-top:0px">';
	}
	if (id.substring(4,8)=='date')
	{
		document.getElementById(id).innerHTML='<input  onClick="ds_sh(this);"  class="input" name="'+id_edit+'" value="'+document.getElementById(id).innerHTML+'" style="width:'+width+'px;height:20px;">';
	}
	else
	{
		document.getElementById(id).innerHTML='<input class="input" name="'+id_edit+'" value="'+document.getElementById(id).innerHTML+'" style="width:'+width+'px;height:20px;">';
	}
}

function editphoto(id,img,width,height,ishover) {
	if (ishover==1){
		id_edit='roomphoto'+id;
	} else if (ishover==2){
		id_edit='roomphotohover'+id;
	} else {
		id_edit='photo'+id;
	}
	if (id==1)		{	index=5;}
	else if (id==2)	{	index=4;}
	else if (id==3)	{	index=3;}
	else 			{	index=3;}
	
	margin=width-240;
	document.getElementById(id_edit).innerHTML=	'<div style="position:absolute;margin-top:0px;">'
													+'<input type="file" name="'+id_edit+'" id="'+id_edit+'" style="position:absolute;margin-left:'+margin+'px;text-align:right;z-index:'+index+';-moz-opacity:0;filter:alpha(opacity:0);opacity: 0;height:'+height+'px;"/>'
													+'<div style="position:absolute;top:0px;left:0px;z-index:1;">'
														+'<img src="images/'+img+'" align="center" width="'+width+'px" height="'+height+'px" border="0"/>'
													+'</div>'
												+'</div>';
}

function rafraichir(id)
{ 
	getDiv1(id, '?do='+id);
	setTimeout("rafraichir()", 1000);
}

function isTime(string,msg) { 
	
	if (string.search(/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9]$/) == -1)
		alert(msg);
}


