function focus(obj) {
	obj.focus();
	}

function changeSubmit() {
	obj = document.reservation;
	obj.submit();
	}

function showCalendar1() {
	obj = document.reservation.data1;
	obj.focus();
	}

function showCalendar2() {
	obj = document.reservation.data2;
	obj.focus();	
	}

function checkCalendar(obj) {
	data1 = document.getElementById('popup_start').value;
	data2 = document.getElementById('popup_end').value;
	if (data1 != '' && data2 != '')
		obj.submit()
	}

function loginLogin() {
	document.getElementById('login_login').style.display = 'block';
	document.getElementById('login_forgot').style.display = 'none';
	document.getElementById('login_go').value = 'login';
	}

function loginForgot() {
	document.getElementById('login_login').style.display = 'none';
	document.getElementById('login_forgot').style.display = 'block';
	document.getElementById('login_go').value = 'forgot';
	}

function regNew() {
	document.getElementById('reg_new').style.display = 'block';
	document.getElementById('reg_old').style.display = 'none';
	document.getElementById('reg_send').style.display = 'none';
	if (document.getElementById('lk_uitat'))
		document.getElementById('lk_uitat').style.display = 'none';
	document.getElementById('fb_trimite').style.display = 'none';
	document.getElementById('fb_rezerva').style.display = 'inline';
	}

function regOld() {
	document.getElementById('reg_new').style.display = 'none';
	document.getElementById('reg_old').style.display = 'block';
	document.getElementById('reg_send').style.display = 'none';
	if (document.getElementById('lk_uitat'))
		document.getElementById('lk_uitat').style.display = 'inline';
	document.getElementById('fb_trimite').style.display = 'none';
	document.getElementById('fb_rezerva').style.display = 'inline';
	}

function regSend() {
	document.getElementById('reg_new').style.display = 'none';
	document.getElementById('reg_old').style.display = 'none';
	document.getElementById('reg_send').style.display = 'block';
	document.getElementById('clientvechi').checked = false;
	document.getElementById('clientnou').checked = false;
	document.getElementById('lk_uitat').style.display = 'none';
	document.getElementById('fb_trimite').style.display = 'inline';
	document.getElementById('fb_rezerva').style.display = 'none';
	}

function goRoom(room,forgot,type,status) {
	data1 = document.getElementById('popup_start').value;
	data2 = document.getElementById('popup_end').value;
	if (data1 != '' && data2 != '')
		document.location = 'details.html?type='+type+'&status='+status+'&data1='+data1+'&data2='+data2+'&room='+room+forgot;
	}

function anuleaza(room,lang,id) {
	if (lang == 'ro')
		answer = confirm('Sigur doriti sa anulati rezervarea pentru Camera '+room+'?');
	if (lang == 'en')
		answer = confirm('Do you really want to cancel your reservation for Room '+room+'?');
	if (lang == 'it')
		answer = confirm('Realmente desiderate annullare la vostra prenotazione per Stanza '+room+'?');
	if (answer)
		document.location = 'account.html?del='+id;
	}

function sterge(username,user,lang) {
	answer = confirm('Sigur doriti sa stergeti utilizatorul '+username+'?');
	if (answer)
		document.location = 'index.php?page=users&del='+user;
	}

function stergeRez(rez) {
	answer = confirm('Sigur doriti sa stergeti aceasta rezervare?');
	if (answer)
		document.location = 'index.php?page=reservations&del='+rez;
	}

function stergeRezUser(rez,user) {
	answer = confirm('Sigur doriti sa stergeti aceasta rezervare?');
	if (answer)
		document.location = 'index.php?page=reservations&siteuser='+user+'&del='+rez;
	}

function stergeRezRoom(rez,room) {
	answer = confirm('Sigur doriti sa stergeti aceasta rezervare?');
	if (answer)
		document.location = 'index.php?page=reservations&room='+room+'&del='+rez;
	}


function showImgMid(img) {

	//alert(window.t);

	if ("t" in window) {

	slide = false;
	clearTimeout(t);
	switch (categ) {
		case 'general': total = pics_general; break;
		case 'agrement': total = pics_agrement; break;
		case 'agrement-mid': total = pics_agrement; break;
		case 'rooms': total = pics_camere; break;
		}
	if (img > total)
		img = img - total;
	//alert(img);
	blendimage("blenddiv","middle_img", img-1, fade_speed);
	pic_current = img;
	if (categ == 'agrement' || categ == 'agrement-mid')
		document.getElementById('pic_txt').innerHTML = pic_txt[img-1];

	}

	}

function showImg(img,categ) {
	wind = window.open('include/popup.php?categ='+categ+'&img='+img,'popup','resizable=0,toolbar=no,location=no,scrollbars=0,status=0,menubar=0,width=400,height=400');
	if (wind)
		wind.focus();
	}

function popHow(lang) {
	win = window.open('pages/'+lang+'_how.php','popup','resizable=0,toolbar=no,location=no,scrollbars=1,status=0,menubar=0,width=400,height=400');
	if (win)
		win.focus();
	}

function picNext(categ) {
	switch (categ) {
		case 'general': total = pics_general; break;
		case 'agrement': total = pics_agrement; break;
		case 'agrement-mid': total = pics_agrement; break;
		case 'rooms': total = pics_camere; break;
		}
	obj1 = document.getElementById('thumb_1');
	obj2 = document.getElementById('thumb_2');
	obj3 = document.getElementById('thumb_3');
	obj1td = document.getElementById('thumb_1_td');
	obj2td = document.getElementById('thumb_2_td');
	obj3td = document.getElementById('thumb_3_td');
	pic_crt = thumb[0];
	if (total >= pic_crt+3) {
		pic_crt += 3;
		} else {
		pic_crt = pic_crt + 3 - total;
		}
	pic1 = pic_crt;
	thumb[0] = pic1;
	obj1.src = 'include/thumb.php?source=../images/pic-'+categ+'-'+pic1+'.jpg';
	if (total >= pic_crt+1)
		pic_crt++;
		else
		pic_crt = pic_crt + 1 - total;
	pic2 = pic_crt;
	thumb[1] = pic2;
	obj2.src = 'include/thumb.php?source=../images/pic-'+categ+'-'+pic2+'.jpg';
	if (total >= pic_crt+1) {
		pic_crt++;
		} else {
		pic_crt = pic_crt + 1 - total;
		}
	pic3 = pic_crt;
	thumb[2] = pic3;
	obj3.src = 'include/thumb.php?source=../images/pic-'+categ+'-'+pic3+'.jpg';
	}

function picPrev(categ) {
	switch (categ) {
		case 'general': total = pics_general; break;
		case 'agrement':
		case 'agrement-mid': total = pics_agrement; break;
		case 'rooms': total = pics_camere; break;
		}
	obj1 = document.getElementById('thumb_1');
	obj2 = document.getElementById('thumb_2');
	obj3 = document.getElementById('thumb_3');
	obj1td = document.getElementById('thumb_1_td');
	obj2td = document.getElementById('thumb_2_td');
	obj3td = document.getElementById('thumb_3_td');
	pic_crt = thumb[0];
	if (0 < pic_crt-3) {
		pic_crt -= 3;
		} else {
		pic_crt = pic_crt - 3 + total;
		}
	pic1 = pic_crt;
	thumb[0] = pic1;
	obj1.src = 'include/thumb.php?source=../images/pic-'+categ+'-'+pic1+'.jpg';
	if (total >= pic_crt+1)
		pic_crt++;
		else
		pic_crt = pic_crt + 1 - total;
	pic2 = pic_crt;
	thumb[1] = pic2;
	obj2.src = 'include/thumb.php?source=../images/pic-'+categ+'-'+pic2+'.jpg';
	if (total >= pic_crt+1) {
		pic_crt++;
		} else {
		pic_crt = pic_crt + 1 - total;
		}
	pic3 = pic_crt;
	thumb[2] = pic3;
	obj3.src = 'include/thumb.php?source=../images/pic-'+categ+'-'+pic3+'.jpg';
	}

function switchPrice(price) {
	document.getElementById('price_i').innerHTML = price;
	}