// JavaScript Document

	function PopDet (URL)
	{
		w = 600;
		h = 600;
		imgwindow = window.open(URL,"imgwindow"," scrollbar=no, toolbar=no, fullscreen=no, resizable=yes,width="+w+",height="+h);
		imgwindow.focus();
		 
	}


	function Get_P(str)
	{
		if (document.all)
		{
			return document.all[str];
		}
		else
			return document.getElementById(str);
	}
	function HideAll()
	{
		if (document.all)
		{
		document.all['item_1'].style.visibility = 'hidden';
		document.all['item_1'].style.display = 'none';
		document.all['item_2'].style.visibility = 'hidden';
		document.all['item_2'].style.display = 'none';
		}
		else
		{
		document.getElementById('item_1').style.visibility = 'hidden';
		document.getElementById('item_1').style.display='none';
		document.getElementById('item_2').style.visibility ='hidden';
		document.getElementById('item_2').style.display='none';
		
		}
	}

	function show(Element) 
	{	
		if (Element.substring(0,4)=='item')
		
		{
//			alert(Element);
		var obj = Get_P(Element);
		if (obj.style.visibility == 'visible')
		{
			obj.style.visibility = 'hidden';
			obj.style.display = 'none';
			//HideAll();	
		}
		else
		{
			HideAll();
			obj.style.visibility = 'visible';
			obj.style.display ='block';
		}
		}
	}
	
	function checkSearch()
		{
			if(document.cautare.zona.value == 'zona')
			{
				alert('Va rugam sa alegeti o zona');
				document.cautare.zona.focus();
				return false;
			}
			
			if(document.cautare.tipImobil.value == 'tip imobil')
			{
				alert('Va rugam sa alegeti un tip de imobil');
				document.cautare.tipImobil.focus();
				return false;
			}
		}
		
	function checkContact()
		{
			if(document.contact.txtNume.value == '')
			{
				alert('Va rugam sa introduceti numele d-voastra');
				document.contact.txtNume.focus();
				return false;
			}
			
			if(document.contact.txtTelefon.value == '')
			{
				alert('Va rugam sa introduceti nr. d-voastra de telefon');
				document.contact.txtTelefon.focus();
				return false;
			}
			
			if(document.contact.txtEmail.value == "" || document.contact.txtEmail.value.indexOf('.','@', 0) == -1)
			{
				alert('Va rugam sa introduceti o adresa de email valida');
				document.contact.txtEmail.focus();
				return false;
			}
			
			if(document.contact.txtMesaj.value == '')
			{
				alert('Va rugam sa introduceti mesajul d-voastra');
				document.contact.txtMesaj.focus();
				return false;
			}
		}
		
	function isNumberKey(evt)
	  {
		 var charCode = (evt.which) ? evt.which : event.keyCode
		 if (charCode > 31 && (charCode < 48 || charCode > 57))
			return false;         
		 return true;
	  }
		
