function validateSimpleSearch(form){
	if(form.tc.value.length == 0){
		alert("Introduceti un text in casuta de cautare!");
		form.tc.focus();
		return false;
	}
	if(form.tc.value.length < 3){
		alert("Introduceti cel putin 3 litere!");
		form.tc.focus();
		return false;
	}
	if(form.categoryid.selectedIndex == 0){
		alert("Alegeti categoria de cautare!");
		form.categoryid.focus();
		return false;
	}
	return true;
}

function validateSearch2(form){
	checked = false;

	if ( form.categoryid.type + "" == "undefined" ) { //adica este un array
		for(i = 0; i < form.categoryid.length; i++){
			if ( form.categoryid[i].checked ) {
				checked = true;
				break;
			}
		}
		if ( !checked ) {
			alert ( "Va rugam alegeti o categorie pentru cautare!" );
			form.categoryid[0].focus();
			return false;
		}
	}
	else{

		if ( form.categoryid.selectedIndex == 0 ) {
			alert("Va rugam alegeti o categorie pentru cautare!");
			form.categoryid.focus();
			return false;
		}
	}
	
	if ( typeof(form.pricefrom) != "undefined" ) {
	
		if ( form.pricefrom.value != "minim" && form.pricefrom.value.length > 0){
			if( !isReal ( form.pricefrom ) ) {
				alert ( "Va rugam introduceti un pret minim corect!" ) ;
				form.pricefrom.focus();
				return false;
			}
		}
		else{
			form.pricefrom.value = "";
		}
		if ( form.priceto.value != "maxim" && form.priceto.value.length > 0){
			if( !isReal ( form.priceto ) ) {
				alert ( "Va rugam introduceti un pret maxim corect!" ) ;
				form.priceto.focus();
				return false;
			}
		}
		else{
			form.priceto.value = "";
		}
		
	}
		
	return true;
}


function deletePriceText ( textbox, text ) {
	if ( textbox.value == text) {
		textbox.value = "";
	}
}

function setPriceText ( textbox, text ) {
	if ( textbox.value == "") {
		textbox.value = text;
	}
}