function locate_elm(n, d)

	{

		var p,i,x;

		

		if(!d) d=document;

		

		if((p=n.indexOf("?"))>0&&parent.frames.length)

			{

				d=parent.frames[n.substring(p+1)].document;

				n=n.substring(0,p);

			}

		

		if(!(x=d[n])&&d.all)

		x=d.all[n];

		

		for (i=0;!x&&i<d.forms.length;i++)

		x=d.forms[i][n];

		

		for(i=0;!x&&d.layers&&i<d.layers.length;i++)

		x=gaseste(n,d.layers[i].document);

		

		if(!x && d.getElementById)

		x=d.getElementById(n);

		

		return x;

	}

	

function new_win_print(ucn)

	{

			

		if(document.all)

			{

				sx=window.screenLeft;

				sy=window.screenTop;

			}

		else

			{

				sx=window.screenX;

				sy=window.screenY;

			}

			

		if(document.all)

			{

				if(document.compatMode == "CSS1Compat")

					{

						tx=document.body.parentNode.scrollLeft;

						ty=document.body.parentNode.scrollTop;

					}

				else

					{

						tx=document.body.scrollLeft;

						ty=document.body.scrollTop;

					}

			}

		else

			{

				tx=window.scrollX;

				ty=window.scrollY;

			}

		

		if(cursor.y<130)

			{

				y=10;

			}

		else

			{

				y=cursor.y-130;

			}

		if(cursor.x<380)

			{

				x=10;

			}

		else

			{

				x=cursor.x-380;

			}

		

		x=x+sx-tx;

		y=y+sy-ty;

  		window.open("print?ucn="+ucn, "", "WIDTH=620,HEIGHT=520, scrollbars=yes, TOP="+y+" ,LEFT="+x+"");

	}

	



function FormatNumberBy3(num, decpoint, sep) {

  // check for missing parameters and use defaults if so

  if (arguments.length == 2) {

    sep = ",";

  }

  if (arguments.length == 1) {

    sep = ",";

    decpoint = ".";

  }

  // need a string for operations

  num = num.toString();

  // separate the whole number and the fraction if possible

  a = num.split(decpoint);

  x = a[0]; // decimal

  y = a[1]; // fraction

  z = "";





  if (typeof(x) != "undefined") {

    // reverse the digits. regexp works from left to right.

    for (i=x.length-1;i>=0;i--)

      z += x.charAt(i);

    // add seperators. but undo the trailing one, if there

    z = z.replace(/(\d{3})/g, "$1" + sep);

    if (z.slice(-sep.length) == sep)

      z = z.slice(0, -sep.length);

    x = "";

    // reverse again to get back the number

    for (i=z.length-1;i>=0;i--)

      x += z.charAt(i);

    // add the fraction back in, if it was there

    if (typeof(y) != "undefined" && y.length > 0)

      x += decpoint + y;

  }

  return x;

}	

	

function fa_lei()

	{

		var ie, iu, sl, se, su;

		ie=locate_elm('in_euro');

		iu=locate_elm('in_usd');

		sl=locate_elm('suma_lei');

		se=locate_elm('suma_euro');

		su=locate_elm('suma_usd');

	

		

		vie=parseFloat(ie.value.replace(/\./g, '').replace(/\,/g, '.'));

		viu=parseFloat(iu.value.replace(/\./g, '').replace(/\,/g, '.'));

		vsl=parseFloat(sl.value.replace(/\./g, '').replace(/\,/g, '.'));

		vse=parseFloat(se.value.replace(/\./g, '').replace(/\,/g, '.'));

		vsu=parseFloat(su.value.replace(/\./g, '').replace(/\,/g, '.'));

		

		vse2=vsl/vie*100;

		vse2=Math.round(vse2);

		vse2=vse2/100;

		

		

		vsu2=vsl/viu*100;

		vsu2=Math.round(vsu2);

		vsu2=vsu2/100;

		

		se.value=FormatNumberBy3(vse2).replace(/\,/g , 'x').replace(/\./g, ',').replace(/x/g, '.');

		su.value=FormatNumberBy3(vsu2).replace(/\,/g , 'x').replace(/\./g, ',').replace(/x/g, '.');

		

		if(se.value=='NaN')

			{

				se.value='';

			}

		if(su.value=='NaN')

			{

				su.value='';

			}

		

		

	}	

	

function fa_eur()

	{

		var ie, iu, sl, se, su;

		ie=locate_elm('in_euro');

		iu=locate_elm('in_usd');

		sl=locate_elm('suma_lei');

		se=locate_elm('suma_euro');

		su=locate_elm('suma_usd');

		

		

		

		vie=parseFloat(ie.value.replace(/\./g, '').replace(/\,/g, '.'));

		viu=parseFloat(iu.value.replace(/\./g, '').replace(/\,/g, '.'));

		vsl=parseFloat(sl.value.replace(/\./g, '').replace(/\,/g, '.'));

		vse=parseFloat(se.value.replace(/\./g, '').replace(/\,/g, '.'));

		vsu=parseFloat(su.value.replace(/\./g, '').replace(/\,/g, '.'));

		

		vsl2=vse*vie*100;

		vsl2=Math.round(vsl2);

		vsl2=vsl2/100;

		

		vsl=vsl2;

		

		vsu2=vsl/viu*100;

		vsu2=Math.round(vsu2);

		vsu2=vsu2/100;

		

		sl.value=FormatNumberBy3(vsl2).replace(/\,/g , 'x').replace(/\./g, ',').replace(/x/g, '.');

		su.value=FormatNumberBy3(vsu2).replace(/\,/g , 'x').replace(/\./g, ',').replace(/x/g, '.');

		

		

		if(sl.value=='NaN')

			{

				sl.value='';

			}

		if(su.value=='NaN')

			{

				su.value='';

			}

		

		

	}	

	

function fa_usd()

	{

		var ie, iu, sl, se, su;

		ie=locate_elm('in_euro');

		iu=locate_elm('in_usd');

		sl=locate_elm('suma_lei');

		se=locate_elm('suma_euro');

		su=locate_elm('suma_usd');

		

		

		

		vie=parseFloat(ie.value.replace(/\./g, '').replace(/\,/g, '.'));

		viu=parseFloat(iu.value.replace(/\./g, '').replace(/\,/g, '.'));

		vsl=parseFloat(sl.value.replace(/\./g, '').replace(/\,/g, '.'));

		vse=parseFloat(se.value.replace(/\./g, '').replace(/\,/g, '.'));

		vsu=parseFloat(su.value.replace(/\./g, '').replace(/\,/g, '.'));

		

		vsl2=vsu*viu*100;

		vsl2=Math.round(vsl2);

		vsl2=vsl2/100;

		

		vsl=vsl2;

		

		vse2=vsl/vie*100;

		vse2=Math.round(vse2);

		vse2=vse2/100;

		

		sl.value=FormatNumberBy3(vsl2).replace(/\,/g , 'x').replace(/\./g, ',').replace(/x/g, '.');

		se.value=FormatNumberBy3(vse2).replace(/\,/g , 'x').replace(/\./g, ',').replace(/x/g, '.');

		

		

		if(sl.value=='NaN')

			{

				sl.value='';

			}

		if(se.value=='NaN')

			{

				se.value='';

			}



		

		

	}





	

var cursor = {x:0, y:0};

if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }

else { document.onmousemove = UpdateCursorPosition; }

	

	

function new_win_user(s, p, lang)

	{

			

		if(document.all)

			{

				sx=window.screenLeft;

				sy=window.screenTop;

			}

		else

			{

				sx=window.screenX;

				sy=window.screenY;

			}

			

		if(document.all)

			{

				if(document.compatMode == "CSS1Compat")

					{

						tx=document.body.parentNode.scrollLeft;

						ty=document.body.parentNode.scrollTop;

					}

				else

					{

						tx=document.body.scrollLeft;

						ty=document.body.scrollTop;

					}

			}

		else

			{

				tx=window.scrollX;

				ty=window.scrollY;

			}

		

		if(cursor.y<325)

			{

				y=10;

			}

		else

			{

				y=cursor.y-325;

			}

		if(cursor.x<410)

			{

				x=10;

			}

		else

			{

				x=cursor.x-410;

			}

		

		x=x+sx-tx;

		y=y+sy-ty;

  		window.open("pop.php?id="+s+"&pagina="+p+"&lang="+lang,"","WIDTH=820,HEIGHT=670, TOP="+y+" ,LEFT="+x+"");

	}

	

	

	

	

function new_win_user_locatie(s, p, lang)

	{

			

		if(document.all)

			{

				sx=window.screenLeft;

				sy=window.screenTop;

			}

		else

			{

				sx=window.screenX;

				sy=window.screenY;

			}

			

		if(document.all)

			{

				if(document.compatMode == "CSS1Compat")

					{

						tx=document.body.parentNode.scrollLeft;

						ty=document.body.parentNode.scrollTop;

					}

				else

					{

						tx=document.body.scrollLeft;

						ty=document.body.scrollTop;

					}

			}

		else

			{

				tx=window.scrollX;

				ty=window.scrollY;

			}

		

		if(cursor.y<325)

			{

				y=10;

			}

		else

			{

				y=cursor.y-325;

			}

		if(cursor.x<410)

			{

				x=10;

			}

		else

			{

				x=cursor.x-410;

			}

		

		x=x+sx-tx;

		y=y+sy-ty;

  		window.open("pop_locatie.php?id="+s+"&pagina="+p+"&lang="+lang,"","WIDTH=820,HEIGHT=670, TOP="+y+" ,LEFT="+x+"");

	}

	

	

function new_win_user_hotel(s, p, lang)

	{

			

		if(document.all)

			{

				sx=window.screenLeft;

				sy=window.screenTop;

			}

		else

			{

				sx=window.screenX;

				sy=window.screenY;

			}

			

		if(document.all)

			{

				if(document.compatMode == "CSS1Compat")

					{

						tx=document.body.parentNode.scrollLeft;

						ty=document.body.parentNode.scrollTop;

					}

				else

					{

						tx=document.body.scrollLeft;

						ty=document.body.scrollTop;

					}

			}

		else

			{

				tx=window.scrollX;

				ty=window.scrollY;

			}

		

		if(cursor.y<325)

			{

				y=10;

			}

		else

			{

				y=cursor.y-325;

			}

		if(cursor.x<410)

			{

				x=10;

			}

		else

			{

				x=cursor.x-410;

			}

		

		x=x+sx-tx;

		y=y+sy-ty;

  		window.open("pop_hotel.php?id="+s+"&pagina="+p+"&lang="+lang,"","WIDTH=820,HEIGHT=670, TOP="+y+" ,LEFT="+x+"");

	}

	

	

	

function new_win_user3(s)

	{

			

		if(document.all)

			{

				sx=window.screenLeft;

				sy=window.screenTop;

			}

		else

			{

				sx=window.screenX;

				sy=window.screenY;

			}

			

		if(document.all)

			{

				if(document.compatMode == "CSS1Compat")

					{

						tx=document.body.parentNode.scrollLeft;

						ty=document.body.parentNode.scrollTop;

					}

				else

					{

						tx=document.body.scrollLeft;

						ty=document.body.scrollTop;

					}

			}

		else

			{

				tx=window.scrollX;

				ty=window.scrollY;

			}

		

		if(cursor.y<130)

			{

				y=10;

			}

		else

			{

				y=cursor.y-130;

			}

		if(cursor.x<380)

			{

				x=10;

			}

		else

			{

				x=cursor.x-380;

			}

		

		x=x+sx-tx;

		y=y+sy-ty;

  		window.open("popp.php?id="+s,"","WIDTH=700,HEIGHT=520, TOP="+y+" ,LEFT="+x+"");

	}

	



function new_win_user2(s, p, lang)

	{

			

		if(document.all)

			{

				sx=window.screenLeft;

				sy=window.screenTop;

			}

		else

			{

				sx=window.screenX;

				sy=window.screenY;

			}

			

		if(document.all)

			{

				if(document.compatMode == "CSS1Compat")

					{

						tx=document.body.parentNode.scrollLeft;

						ty=document.body.parentNode.scrollTop;

					}

				else

					{

						tx=document.body.scrollLeft;

						ty=document.body.scrollTop;

					}

			}

		else

			{

				tx=window.scrollX;

				ty=window.scrollY;

			}

		

		if(cursor.y<130)

			{

				y=10;

			}

		else

			{

				y=cursor.y-130;

			}

		if(cursor.x<380)

			{

				x=10;

			}

		else

			{

				x=cursor.x-380;

			}

		

		x=x+sx-tx;

		y=y+sy-ty;

  		window.open("pop2.php?id="+s+"&pagina="+p+"&lang="+lang,"","WIDTH=600,HEIGHT=600, TOP="+y+" ,LEFT="+x+"");

	}





function UpdateCursorPosition(e)

	{

		cursor.x = e.pageX;

		cursor.y = e.pageY;

	}

function UpdateCursorPositionDocAll(e)

	{

		cursor.x = event.clientX;

		cursor.y = event.clientY;

	}

	

	

function schimba_data_default()

{

	

	el_data_start=locate_el('data_start');

	el_data_final=locate_el('data_final');





			var XHT=GetXmlHttpObjectdum();

			if (XHT==null)

			  {

			  alert ("Your browser does not support AJAX!");

			  return;

			  }

			

			var url="actions/schimba_data_default.php";

			url=url+"?data_start="+el_data_start.value;

			url=url+"&sid="+Math.random();

			

			XHT.onreadystatechange=function() {

				schimba_data_default_fill(XHT);

			}

			

			

			XHT.open("GET",url,true);

			XHT.send(null);



}



function schimba_data_default_fill(XHT) 

{ 



if (XHT.readyState==4)

{

	response=XHT.responseText;

	el_data_final=locate_el('data_final');

	el_data_final.value=response;

}

}





function bookmarksite(title,url){

if (window.sidebar) // firefox

	window.sidebar.addPanel(title, url, "");

else if(window.opera && window.print){ // opera

	var elem = document.createElement('a');

	elem.setAttribute('href',url);

	elem.setAttribute('title',title);

	elem.setAttribute('rel','sidebar');

	elem.click();

} 

else if(document.all)// ie

	window.external.AddFavorite(url, title);

}





function show_send_friend_panel(oid)

{

	xmlHttp=GetXmlHttpObject();

	if (xmlHttp==null)

	  {

	  alert ("Your browser does not support AJAX!");

	  return;

	  }

	

	var url="actions/req_send_to_friend.php";

	url=url+"?oid="+oid;

	url=url+"&sid="+Math.random();

	

	xmlHttp.onreadystatechange=function()

		{

			show_form_send_friend();

		}

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}



function show_form_send_friend() 

{ 

if (xmlHttp.readyState==4)

{

	response=xmlHttp.responseText;

	elsendfriend=locate_el('sendtofriend');

	

	elsendfriend.innerHTML=response;

}

}





function trimiteprieten()

{

	

	elucn=locate_el('ucn');

	elfriendemail=locate_el('friendemail');

	elsendername=locate_el('sendername');

	elcode=locate_el('code');



	xmlHttp=GetXmlHttpObject();

	if (xmlHttp==null)

	  {

	  alert ("Your browser does not support AJAX!");

	  return;

	  }

	

	var url="actions/act_send_to_friend.php";

	url=url+"?ucn="+elucn.value;

	url=url+"&friendemail="+elfriendemail.value;

	url=url+"&sendername="+elsendername.value;

	url=url+"&code="+elcode.value;

	url=url+"&sid="+Math.random();

	



	xmlHttp.onreadystatechange=function()

		{

			show_sendfrresult();

		}

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}







function show_sendfrresult() 

{ 

if (xmlHttp.readyState==4)

{

	response=xmlHttp.responseText;

	responses=xmlHttp.responseText.split('#ER#');

	elsendfriend=locate_el('sendtofriend');

	elerrors1=locate_el('errors1');

	

	if(responses[0]=='OK')

		{

			elsendfriend.innerHTML=responses[1];	

		}

	else

		{

			elerrors1.innerHTML=responses[1];

		}

	

}

}


function change_label(ln)
{
	el=locate_el('hotel_'+ln);
	if(el.checked)
		{
			el.checked=false;
		}
	else
		{
			el.checked=true;
		}
}



function act_adano()
{
	load_categorii_now_added();
	load_locatii_now_added();
	load_hoteluri_now_added();
	load_tipuricamere_now_added();
	Toggle();
	Toggle_servicii();
}


function act_emo(ucn)
{
	load_categorii_now_added();
	load_locatii_now_added();
	load_hoteluri_now_added();
	load_tipuricamere_now_added();
	Toggle();
	Toggle_servicii();
	req_images(ucn);
}


function act_advs()
{
	load_categorii_advs();
	load_locatii_advs();
}