function ChangePos(NewValue)
{
	Pos = document.getElementById('Pos');		
	Pos.value = parseInt(NewValue);
}
function open_win(file,wid,hei)
{
	window.open(file,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=yes, width="+parseInt(wid)+", height="+parseInt(hei))
}
function open_win_title(file,title,wid,hei)
{
	win = window.open(file,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=yes, width="+parseInt(wid)+", height="+parseInt(hei));
	win.document.write("<title>" + title + "</title>");
	win.document.write('<img src="' + file + '"/>');
}

function open_full_win(file)
{
	window.open(file,"_blank","toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes")
}

function OpenPopup(path,descr,width,height,status,resize) {
	window.open(path , descr, 'toolbar=no, location=no, directories=no, status='+status+', menubar=no, scrollbars=yes, resizable='+resize+', width='+width+', height='+height);
}

function ShowAccType(type)
{
	//alert(type);
	div = document.getElementById('agentie');
	if(type == 'f' || type == 'd') div.style.display = 'block';
	else div.style.display = 'none';
	div = document.getElementById('agentie2');
	if(type == 'f' || type == 'd') div.style.display = 'block';
	else div.style.display = 'none';
}
function ShowSearch()
{		
	divTip = document.getElementById('sImobil');
	Tip = divTip.value;
	
	divSearchAp = document.getElementById('searchAp');
	divSearchT = document.getElementById('searchT');
	divSearchCSH = document.getElementById('searchCSH');
		
	
	divSearchAp.style.display = 'none';
	divSearchT.style.display = 'none';
	divSearchCSH.style.display = 'none';
			
					
	if(Tip == 'garsoniera') divSearchAp.style.display = 'block';
	if(Tip == 'apartament') divSearchAp.style.display = 'block';
	if(Tip == 'teren') divSearchT.style.display = 'block';	
	if(Tip == 'casa') divSearchCSH.style.display = 'block';
	if(Tip == 'vila') divSearchCSH.style.display = 'block';
	if(Tip == 'birou') divSearchCSH.style.display = 'block';
	if(Tip == 'spatiu') divSearchCSH.style.display = 'block';
	if(Tip == 'hala') divSearchCSH.style.display = 'block';
	if(Tip == 'hotel') divSearchCSH.style.display = 'block';
	if(Tip == 'pensiune') divSearchCSH.style.display = 'block';

}
function ShowPublicare(Status)
{	
	divAgent = document.getElementById('pAgent');
	divAgentie = document.getElementById('pAgentie');
	divProprietar = document.getElementById('pProprietar');
	
	divAgent.style.display = 'none';
	divAgentie.style.display = 'none';
	divProprietar.style.display = 'none';
	
	if(Status == 0)
	{
		//divAgent.style.display = 'none';
		//divAgentie.style.display = 'none';
		divProprietar.style.display = 'block';
	}
	if(Status == 1)
	{
		divAgent.style.display = 'block';
		//divAgentie.style.display = 'none';
		divProprietar.style.display = 'block';
	}
	if(Status == 2)
	{
		//divAgent.style.display = 'none';
		//divAgentie.style.display = 'none';
		divProprietar.style.display = 'block';
	}
	if(Status == 3)
	{
		//divAgent.style.display = 'none';
		//divAgentie.style.display = 'none';
		divProprietar.style.display = 'block';
	}
	if(Status == 4)
	{
		//divAgent.style.display = 'none';
		divAgentie.style.display = 'block';
		divProprietar.style.display = 'block';
	}
}
function ShowFormCautare()
{		
	divForm = document.getElementById('cautare');
	if(divForm.style.display == 'none') divForm.style.display = 'block';
	else divForm.style.display = 'none';
}
function ShowUser(divID)
{		
	divUser = document.getElementById(divID);
	
	if(divUser.style.display == 'none')	divUser.style.display = 'block';
	else divUser.style.display = 'none';
}
function SchimbaJudet()
{
	selectJudet = document.getElementById('SelJudet');
	Judet = selectJudet.value;
	document.location = 'http://www.imobiliare-ro.ro/' + Judet + '/30';
}
function CautaDupaID()
{
	ID = document.SearchForm2.SearchID.value;
	if(ID == '') alert('Introduceti ID-ul');
	else
	{
		document.location = ru + 'adauga-oferta/0/' + ID + '.html';
	}
}
function VizCautaDupaID()
{
	ID = document.SearchForm2.SearchID.value;
	if(ID == '') alert('Introduceti ID-ul');
	else
	{
		document.location = ru + 'anunt/' + ID + '/cauta.html';
	}
}

function getConfirm(message, url) 
{
	if (confirm(message)) {
		document.location = url;
	}
}

function postConfirm(message) {
	if (confirm(message) == false) {
		return false;
	}
}

// Show contact form
function ShowForm(Tip)
{		
	if(Tip == 1 || Tip == 2 || Tip == 3)
	{
		divTip = document.getElementById('cTip');
		divTip.value = Tip;

		divTelefon  = document.getElementById('cTelefon');
		divPrieten  = document.getElementById('cPrieten');
		divIncorect = document.getElementById('cIncorect');
		divContact  = document.getElementById('cContact');
		div1H3      = document.getElementById('c1H3');
		div2H3      = document.getElementById('c2H3');
		div3H3      = document.getElementById('c3H3');		
		divRaspuns  = document.getElementById('cRaspuns');	
		
		divTelefon.style.display = 'none';
		divPrieten.style.display = 'none';
		divIncorect.style.display = 'none';
		divContact.style.display = 'none';
		div1H3.style.display = 'none';
		div2H3.style.display = 'none';
		div3H3.style.display = 'none';
		divRaspuns.style.display = 'none';
		
		if(Tip == '1') divTelefon.style.display = 'block';
		if(Tip == '1') divContact.style.display = 'block';		
		if(Tip == '1') div1H3.style.display = 'block';		
		if(Tip == '2') divPrieten.style.display = 'block';		
		if(Tip == '2') div2H3.style.display = 'block';		
		if(Tip == '3') divIncorect.style.display = 'block';				
		if(Tip == '3') div3H3.style.display = 'block';				
	}
}

function ShowNavMenu(divShow)
{
	HideNavMenu();

	document.getElementById('l' + divShow).style.color = '#ffcd1f';

	show = document.getElementById(divShow);
	show.style.display = 'block';
}

function HideNavMenu()
{
	document.getElementById('mav').style.display  = 'none';
	document.getElementById('mai').style.display  = 'none';
	document.getElementById('mpv').style.display  = 'none';
	document.getElementById('mpi').style.display  = 'none';
	document.getElementById('mpcc').style.display = 'none';
	document.getElementById('mpci').style.display = 'none';

	document.getElementById('lmav').style.color  = '#fff';
	document.getElementById('lmai').style.color  = '#fff';
	document.getElementById('lmpv').style.color  = '#fff';
	document.getElementById('lmpi').style.color  = '#fff';
	document.getElementById('lmpcc').style.color = '#fff';
	document.getElementById('lmpci').style.color = '#fff';
}
function ChangeColor(id)
{
	document.getElementById(id).style.color = '#ffe691';
}
