// Replaces getElementById
function get_obj(id)
{
	return document.getElementById(id);
}

function popOre(obj, ora_data, ora_id)
{
	var populateOre = function(ore) {
		deleteItems(obj);
		
		var oOption = document.createElement("OPTION");
		obj.options.add(oOption);
		oOption.innerHTML = '- ora -';
		oOption.value = '';
			
		ore.each(function(ora) {
			var oOption = document.createElement("OPTION");
			obj.options.add(oOption);
			var nr = ora.ora;
			nr++;
			oOption.innerHTML = ora.ora+' - '+nr;
			oOption.value = ora.ora;
			if (ora.selected=='1')
				oOption.selected='selected';
		});
	};

	var request = new Request.JSON({
		url: '/index.php?obj=ajax&action=get_ore&data='+ora_data+'&ora_id='+ora_id,
		async: false, 
		method: 'post',
		onComplete: function(data) {
			populateOre(data.ore);
		}
	}).send();
}

function contact_submit()
{
	xval=getBusyOverlay(document.getElementById('contact_form'), {color:'white', opacity:0.75, text:'se trimite', style:'text-shadow: 0 0 3px black; font-weight:bold; font-size:16px; color:black'}, {color:'#000', size:36, type:'t'});
	if(xval)
	{
		//return true;
			
		xval.ntime=window.setInterval(function()
		{
			if (document.getElementById('contact_sent').value>0)
			{
				if (document.getElementById('contact_sent').value==1)
				{
					$('contact_form').style.display='none';
					$('contact_mesaj').style.display='block';
				}
				window.clearInterval(xval.ntime); xval.remove();
			}
		},100);
	}
}

function contact_submitted(value)
{
	window.parent.document.getElementById('contact_sent').value=value;
	
	if (value==2)
	{
		setTimeout('window.parent.document.getElementById("contact_sent").value="0"', 101);
	}
}
