function loadSearcher() {
	var a = document.getElementById('searcher');
	a.innerHTML +=
			"<form method='get' action='/nf/search.php' style='display:inline;'> " +
			"<input type='text' name='txtBusqueda' id='txtBusqueda'>" +
			"<span id='sep'>-</span>" +
			"<select name='cboCat' id='cboCat'>" +
				"<option value=\"0\">(Indicar)</option>" +
				"<option value=\"2\">Empresa</option>" +
				"<option value=\"3\">Derecho</option>" +
				"<option value=\"4\">Informática / Internet</option>" +
				"<option value=\"5\">Medicina / Salud</option>" +
				"<option value=\"6\">Ciencias / Ingenierias</option>" +
				"<option value=\"7\">Humanidades</option>" +
				"<option value=\"8\">Comunicación</option>" +
				"<option value=\"9\">Oposiciones</option>" +
				"<option value=\"10\">Hostelería y Turismo</option>" +
				"<option value=\"11\">Deportes y Ocio</option>" +
				"<option value=\"12\">Idiomas</option>" +
			"</select>" +
			"<input type='submit' value='Buscar'></form>";
}
function redir(url) {
	url = url.replace('http://','');
	window.location = 'http://' + url.replace('//','/');
}

function openWindow(url) {
	window.open(url, url, 'width=400, height=400, scrollbars=yes, menubar=no, location=no, resizable=no');
}


function doIt(){
	var arrayElements = document.getElementsByTagName('blink');
	for (x=0;x<arrayElements.length;x++) {
		arrayElements[x].style.visibility =  (arrayElements[x].style.visibility == "hidden") ? "visible" : "hidden"
	}
}
function Blinker(){
	if (navigator.appName=="Microsoft Internet Explorer") {
		setInterval('doIt()',600);
	}
}

function Trim(TRIM_VALUE){
 if(TRIM_VALUE.length < 1){
  return"";
 }
 TRIM_VALUE = RTrim(TRIM_VALUE);
 TRIM_VALUE = LTrim(TRIM_VALUE);
 if(TRIM_VALUE==""){
  return "";
 }else{
  return TRIM_VALUE;
 }
} //End Function

function RTrim(VALUE){
 var w_space = String.fromCharCode(32);
 var v_length = VALUE.length;
 var strTemp = "";
 if(v_length < 0){
  return"";
 }
 var iTemp = v_length -1;

 while(iTemp > -1){
  if(VALUE.charAt(iTemp) == w_space){
  }else{
   strTemp = VALUE.substring(0,iTemp +1);
   break;
  }
  iTemp = iTemp-1;
 } //End While
 return strTemp;
} //End Function

function LTrim(VALUE){
 var w_space = String.fromCharCode(32);
 if(v_length < 1){
  return"";
 }
 var v_length = VALUE.length;
 var strTemp = "";

 var iTemp = 0;

 while(iTemp < v_length){
  if(VALUE.charAt(iTemp) == w_space){
  }else{
   strTemp = VALUE.substring(iTemp,v_length);
   break;
  }
  iTemp = iTemp + 1;
 }
 return strTemp;
}


function validateText(obj){
 if (Trim(obj.value) == ''){
  return 0;
 }else{
  return 1;
 }
}

function validaSearch(oForm ) {
	with (oForm) {
		txtBusqueda.value = Trim(txtBusqueda.value );
		if (txtBusqueda.value.length<3 || txtBusqueda.value=="Buscar Cursos") {
			alert("Introduce al menos 3 carácteres");
			txtBusqueda.focus();
			return false;
		}
		action="/nf/search.php";
		submit();
	}
}

function dataOver(data,selectedColor) {
	with (data)
	{
		bgColor=selectedColor;
		style.cursor="pointer";
	}
}

function dataOut(data,defaultColor) {
	with (data)
	{
		bgColor=defaultColor;
		style.cursor="default";
	}
}
