	
	function homepage_manage(action, idlift) {
		
		if (action == "0") {
			document.getElementById("div_add_home").style.visibility = "visible";
			document.getElementById("div_rem_home").style.visibility = "hidden";
		}
		else {
			document.getElementById("div_add_home").style.visibility = "hidden"
			document.getElementById("div_rem_home").style.visibility = "visible"
		}
		
		document.getElementById("fra_post").src = "http://www.forkliftinventory.com/post_edit_homepage.php?action=" + action + "&id=" + idlift;
				
	}
	
	function exclude(idlift) {
		
		document.getElementById("fra_post").src = "http://www.forkliftinventory.com/post_exclude.php?id=" + idlift;
		document.getElementById("div_exclude").style.visibility = "hidden"
		
	}

	function send_back() {
		
		document.frmresult.action = "http://www.forkliftinventory.com/search_form.php";
		document.frmresult.submit();
		
	}
	
	function send_back_manuf() {
		
		document.frmresult.action = "search/php/search_form.html";
		document.frmresult.submit();
		
	}

	function change_page(pag) {
		
		document.frmresult.action = "http://www.forkliftinventory.com/search_result.php?page=" + pag;
		document.frmresult.submit();
		
	}
	
	function change_page_manuf(nom_pag,pag) {
		window.location = nom_pag + "?page=" + pag;
	}
	
	function make_search() {
		
		//VALIDATE VALUES
		var err_numeric = "";
		
		
		if ((isNaN(document.getElementById('year_from').value)) || (isNaN(document.getElementById('year_to').value))) err_numeric += ", Year";	
		if ((isNaN(document.getElementById('capac_from').value)) || (isNaN(document.getElementById('capac_to').value))) err_numeric += ", Capacity";	
		
		if (!(err_numeric=="")) {
			alert(err_numeric.substring(2) + " must be a numeric value.");
		}
		else {
			document.frmSearch.submit();	
		}
	
	}

	//var path = "http://eliftruck.com/lg_images/";
	var path = "images/large/index.html";
	var pos_actual = 0;
	
	function ver_img(new_pos) {
				
		var arr_img = document.getElementById("img_arr").value.split("|");
		var largo_arr = arr_img.length;
		var pos = pos_actual;
						
		if ((new_pos==1) && (pos_actual!=largo_arr-1)) {
			pos++;
		}
		if ((new_pos==-1) && (pos_actual!=0)) {
			pos--;
		}
		
		mostrar_imagen(pos)
		
	}
	
	function mostrar_imagen(pos_array){
	
		var arr_img = $("img_arr").value.split("|");
		var arr_imgs_size = $("imgs_size").value.split("|");
		var largo_arr = arr_img.length;
		if (arr_imgs_size.length > 1) {
			$("div_thumb_" + pos_actual).className = "thumbs";
		}
		
		pos_actual = pos_array;
		
		var tamano = arr_imgs_size[pos_actual].split("-");
		var img_width = tamano[0];
		var img_height = tamano[1];
		
		if (arr_imgs_size.length > 1) {
			$("div_thumb_" + pos_actual).className = "thumbs_selected";
			$("img_pos").innerHTML = pos_actual + 1 + "/" + largo_arr;
		}
		
		$("img_lift").width = img_width;
		$("img_lift").height = img_height;
		$("img_lift").src = path + arr_img[pos_actual];
		
		
		$("view_larger").href = path + arr_img[pos_actual];
		$("large_img").href = path + arr_img[pos_actual];
		
	}
	
	function aparecer() {
		
		/*ARMAR ESTA FUNCION*/
		
	}
	

	
	function ver_thumb(pos) {
		
		var arr_img = document.getElementById("img_arr").value.split("|");
		pos_actual = pos;
		
		document.getElementById("img_lift").src = path + arr_img[pos_actual];
		document.getElementById("img_pos").innerHTML = pos_actual + 1 + "/" + largo_arr;
		
	}
