<?php 
ini_set("display_errors","1");
ini_set("display_startup_errors","1");
set_magic_quotes_runtime(0);

include("include/dbcommon.php");
include("include/pf_sensorxcamara_variables.php");


//connect database
$conn = db_connect();

include('libs/Smarty.class.php');
$smarty = new Smarty();


$includes=
"<STYLE>
	.vis1	{ visibility:\"visible\" }
	.vis2	{ visibility:\"hidden\" }
</STYLE>
<script language=\"JavaScript\" src=\"include/calendar.js\"></script>
<script language=\"JavaScript\" src=\"include/jsfunctions.js\"></script>\r\n";
if ($useAJAX) {
$includes.="<script language=\"JavaScript\" src=\"include/jquery.js\"></script>
<script language=\"JavaScript\" src=\"include/ajaxsuggest.js\"></script>\r\n";
}
$includes.="<script language=\"JavaScript\" type=\"text/javascript\">\r\n".
"var locale_dateformat = ".$locale_info["LOCALE_IDATE"].";\r\n".
"var locale_datedelimiter = \"".$locale_info["LOCALE_SDATE"]."\";\r\n".
"var bLoading=false;\r\n".
"var TEXT_PLEASE_SELECT='".addslashes("Por favor seleccione")."';\r\n";
if ($useAJAX) {
$includes.="var SUGGEST_TABLE = \"pf_sensorxcamara_searchsuggest.php\";\r\n".
"var SUGGEST_LOOKUP_TABLE='pf_sensorxcamara_lookupsuggest.php';\r\n".
"var AUTOCOMPLETE_TABLE=\"pf_sensorxcamara_autocomplete.php\";\r\n";
}
$includes.="var detect = navigator.userAgent.toLowerCase();

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}


function ShowHideControls()
{
	document.getElementById('second_LecturaDirModulo').style.display =  
		document.forms.editform.elements['asearchopt_LecturaDirModulo'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_LecturaDirTipo').style.display =  
		document.forms.editform.elements['asearchopt_LecturaDirTipo'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_id_camara').style.display =  
		document.forms.editform.elements['asearchopt_id_camara'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_id_status').style.display =  
		document.forms.editform.elements['asearchopt_id_status'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_Nombre_modulo').style.display =  
		document.forms.editform.elements['asearchopt_Nombre_modulo'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_limite_minimo').style.display =  
		document.forms.editform.elements['asearchopt_limite_minimo'].value==\"Between\" ? '' : 'none'; 
	document.getElementById('second_limite_maximo').style.display =  
		document.forms.editform.elements['asearchopt_limite_maximo'].value==\"Between\" ? '' : 'none'; 
	return false;
}
function ResetControls()
{
	var i;
	e = document.forms[0].elements; 
	for (i=0;i<e.length;i++) 
	{
		if (e[i].name!='type' && e[i].className!='button' && e[i].type!='hidden')
		{
			if(e[i].type=='select-one')
				e[i].selectedIndex=0;
			else if(e[i].type=='select-multiple')
			{
				var j;
				for(j=0;j<e[i].options.length;j++)
					e[i].options[j].selected=false;
			}
			else if(e[i].type=='checkbox' || e[i].type=='radio')
				e[i].checked=false;
			else 
				e[i].value = ''; 
		}
		else if(e[i].name.substr(0,6)=='value_' && e[i].type=='hidden')
			e[i].value = ''; 
	}
	ShowHideControls();	
	return false;
}";

if ($useAJAX) {
$includes.="
$(document).ready(function() {
	document.forms.editform.value_LecturaDirModulo.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_LecturaDirModulo,'advanced')};
	document.forms.editform.value1_LecturaDirModulo.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_LecturaDirModulo,'advanced1')};
	document.forms.editform.value_LecturaDirModulo.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_LecturaDirModulo,'advanced')};
	document.forms.editform.value1_LecturaDirModulo.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_LecturaDirModulo,'advanced1')};
	document.forms.editform.value_LecturaDirTipo.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_LecturaDirTipo,'advanced')};
	document.forms.editform.value1_LecturaDirTipo.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_LecturaDirTipo,'advanced1')};
	document.forms.editform.value_LecturaDirTipo.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_LecturaDirTipo,'advanced')};
	document.forms.editform.value1_LecturaDirTipo.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_LecturaDirTipo,'advanced1')};
	document.forms.editform.value_id_camara.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_id_camara,'advanced')};
	document.forms.editform.value1_id_camara.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_id_camara,'advanced1')};
	document.forms.editform.value_id_camara.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_id_camara,'advanced')};
	document.forms.editform.value1_id_camara.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_id_camara,'advanced1')};
	document.forms.editform.value_id_status.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_id_status,'advanced')};
	document.forms.editform.value1_id_status.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_id_status,'advanced1')};
	document.forms.editform.value_id_status.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_id_status,'advanced')};
	document.forms.editform.value1_id_status.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_id_status,'advanced1')};
	document.forms.editform.value_Nombre_modulo.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_Nombre_modulo,'advanced')};
	document.forms.editform.value1_Nombre_modulo.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_Nombre_modulo,'advanced1')};
	document.forms.editform.value_Nombre_modulo.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_Nombre_modulo,'advanced')};
	document.forms.editform.value1_Nombre_modulo.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_Nombre_modulo,'advanced1')};
	document.forms.editform.value_limite_minimo.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_limite_minimo,'advanced')};
	document.forms.editform.value1_limite_minimo.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_limite_minimo,'advanced1')};
	document.forms.editform.value_limite_minimo.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_limite_minimo,'advanced')};
	document.forms.editform.value1_limite_minimo.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_limite_minimo,'advanced1')};
	document.forms.editform.value_limite_maximo.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value_limite_maximo,'advanced')};
	document.forms.editform.value1_limite_maximo.onkeyup=function(event) {searchSuggest(event,document.forms.editform.value1_limite_maximo,'advanced1')};
	document.forms.editform.value_limite_maximo.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value_limite_maximo,'advanced')};
	document.forms.editform.value1_limite_maximo.onkeydown=function(event) {return listenEvent(event,document.forms.editform.value1_limite_maximo,'advanced1')};
});
</script>
<div id=\"search_suggest\"></div>
";
} else {
$includes.="
function OnKeyDown(e)
{ if(!e) e = window.event; 
if (e.keyCode == 13){ e.cancel = true; document.forms[0].submit();} }

</script>";
}

$smarty->assign("includes",$includes);
$smarty->assign("noAJAX",!$useAJAX);

$onload="onLoad=\"javascript: ShowHideControls();\"";
$smarty->assign("onload",$onload);

if(@$_SESSION[$strTableName."_asearchtype"]=="or")
{
	$smarty->assign("any_checked"," checked");
	$smarty->assign("all_checked","");
}
else
{
	$smarty->assign("any_checked","");
	$smarty->assign("all_checked"," checked");
}

$editformats=array();

// LecturaDirModulo 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["LecturaDirModulo"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["LecturaDirModulo"];
	$smarty->assign("value_LecturaDirModulo",@$_SESSION[$strTableName."_asearchfor"]["LecturaDirModulo"]);
	$smarty->assign("value1_LecturaDirModulo",@$_SESSION[$strTableName."_asearchfor2"]["LecturaDirModulo"]);
}	
if($not)
	$smarty->assign("not_LecturaDirModulo"," checked");
//	write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_LecturaDirModulo\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_LecturaDirModulo",$searchtype);
//	edit format
$editformats["LecturaDirModulo"]="Text field";
// LecturaDirTipo 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["LecturaDirTipo"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["LecturaDirTipo"];
	$smarty->assign("value_LecturaDirTipo",@$_SESSION[$strTableName."_asearchfor"]["LecturaDirTipo"]);
	$smarty->assign("value1_LecturaDirTipo",@$_SESSION[$strTableName."_asearchfor2"]["LecturaDirTipo"]);
}	
if($not)
	$smarty->assign("not_LecturaDirTipo"," checked");
//	write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_LecturaDirTipo\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_LecturaDirTipo",$searchtype);
//	edit format
$editformats["LecturaDirTipo"]="Text field";
// id_camara 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["id_camara"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["id_camara"];
	$smarty->assign("value_id_camara",@$_SESSION[$strTableName."_asearchfor"]["id_camara"]);
	$smarty->assign("value1_id_camara",@$_SESSION[$strTableName."_asearchfor2"]["id_camara"]);
}	
if($not)
	$smarty->assign("not_id_camara"," checked");
//	write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_id_camara\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_id_camara",$searchtype);
//	edit format
$editformats["id_camara"]="Text field";
// id_status 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["id_status"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["id_status"];
	$smarty->assign("value_id_status",@$_SESSION[$strTableName."_asearchfor"]["id_status"]);
	$smarty->assign("value1_id_status",@$_SESSION[$strTableName."_asearchfor2"]["id_status"]);
}	
if($not)
	$smarty->assign("not_id_status"," checked");
//	write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_id_status\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_id_status",$searchtype);
//	edit format
$editformats["id_status"]="Text field";
// Nombre_modulo 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["Nombre_modulo"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["Nombre_modulo"];
	$smarty->assign("value_Nombre_modulo",@$_SESSION[$strTableName."_asearchfor"]["Nombre_modulo"]);
	$smarty->assign("value1_Nombre_modulo",@$_SESSION[$strTableName."_asearchfor2"]["Nombre_modulo"]);
}	
if($not)
	$smarty->assign("not_Nombre_modulo"," checked");
//	write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_Nombre_modulo\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_Nombre_modulo",$searchtype);
//	edit format
$editformats["Nombre_modulo"]="Text field";
// limite_minimo 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["limite_minimo"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["limite_minimo"];
	$smarty->assign("value_limite_minimo",@$_SESSION[$strTableName."_asearchfor"]["limite_minimo"]);
	$smarty->assign("value1_limite_minimo",@$_SESSION[$strTableName."_asearchfor2"]["limite_minimo"]);
}	
if($not)
	$smarty->assign("not_limite_minimo"," checked");
//	write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_limite_minimo\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_limite_minimo",$searchtype);
//	edit format
$editformats["limite_minimo"]="Text field";
// limite_maximo 
$opt="";
$not=false;
if(@$_SESSION[$strTableName."_search"]==2)
{
	$opt=@$_SESSION[$strTableName."_asearchopt"]["limite_maximo"];
	$not=@$_SESSION[$strTableName."_asearchnot"]["limite_maximo"];
	$smarty->assign("value_limite_maximo",@$_SESSION[$strTableName."_asearchfor"]["limite_maximo"]);
	$smarty->assign("value1_limite_maximo",@$_SESSION[$strTableName."_asearchfor2"]["limite_maximo"]);
}	
if($not)
	$smarty->assign("not_limite_maximo"," checked");
//	write search options
$options="";
$options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contiene"."</option>";
$options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equivale"."</option>";
$options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Empieza con"."</option>";
$options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."Más que"."</option>";
$options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Menos que"."</option>";
$options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Igual o más"."</option>";
$options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Igual o menos"."</option>";
$options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Entre"."</option>";
$options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Vacio"."</option>";
$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_limite_maximo\" SIZE=1 onChange=\"return ShowHideControls();\">";
$searchtype .= $options;
$searchtype .= "</SELECT>";
$smarty->assign("searchtype_limite_maximo",$searchtype);
//	edit format
$editformats["limite_maximo"]="Text field";

$linkdata="";

if ($useAJAX) {
	$linkdata .= "<script type=\"text/javascript\">\r\n";
	$linkdata .= "$(document).ready(function(){ \r\n";
	$linkdata .= "
function loadSelectContent(txt, selectControl, selectValue) 
{
	$('#'+selectControl).get(0).options[0]=new Option(TEXT_PLEASE_SELECT,'');
	var str = txt.split('\\n');
	var index = 0;
	for(i=0,j=0; i < str.length - 1; i=i+2, j++) {
		$('#'+selectControl).get(0).options[j+1]=new Option(unescape(str[i+1]),unescape(str[i]));
		if ( unescape(str[i]) == selectValue ) {index = j+1;}
	}
	$('#'+selectControl).get(0).selectedIndex = index;
}"."\r\n";
	$linkdata .= "});\r\n";
	$linkdata .= "</script>\r\n";
} else {
}

$smarty->assign("linkdata",$linkdata);

$templatefile = "pf_sensorxcamara_search.htm";
if(function_exists("BeforeShowSearch"))
	BeforeShowSearch($smarty,$templatefile);

$smarty->display($templatefile);

?>