function refresh_search(id)
{
	var frm = document.search;
	var id_program = eval("frm.id_program_"+id+".value"); //valuarea

	var tip_int = frm.tip_int;
	//alert(id_program);
	var tip = "";
	//alert(tip_int[0]);

	if(tip_int[0].checked==true)
	{
		tip = "and";
	}
	else
	{
		tip = "or";
	}

	window.location = "search_form.php?id_program_"+id+"="+id_program+"&tip_int="+tip;
}



function check_if_check(f)
{
	var ok = false;	

	for(var i=0; i<f.elements.length&&(!ok); i++)
	{
		if(f.elements[i].type=="checkbox")					
			ok = f.elements[i].checked;
			 

	}

	if(!ok)
	{
		alert("Please select at least one row!");
	}

	return ok;

}

//----------------------------------------------------------------------------------------------------
function check_delete(name)
{
	var ok = true;

	if(confirm("Are you sure you want to delete this "+name+" !"))
	{
		ok = true;
	}
	else
	{
		ok = false; 
	}

	
	return ok;
}
//-------------------------------------------------------------------------------------------------------

function mesaj(msg)
{
    status=msg;
	return true;
}
//-------------------------------------------------------------------------------------------------------



//--------------------------------------------------------------------------------------------------------
function check_register()
{
	f=document.register;

	if(isEmpty(f.name)) 
	{
		alert("Please fill in the name!");
		return false;
	}

	if(!validate_email(f.email, "Please fill in the email field\nwith a valid email address")) return false;

	return true;
}

function check_contact()
{
	f=document.contact;

	if(!validate_email(f.email, "Please fill in the email\nwith a valid email address")) return false;

	if(isEmpty(f.subject))
	{
		alert("Please fill in the subject!");
		return false;
	}
	if(isEmpty(f.message))
	{
		alert("Please fill in the message!");
		return false;
	}
}

