<head>

<script language="javascript">
var paginaactual=0;
var valorpagina=0;
function modiframe(destino)
{
    if(document.frames)
    var bodyIframe = document.frames.icontenido //.location=destino
    else
    var bodyIframe = icontenido.contentDocument; //.location=destino;
    bodyIframe.location=destino;
}

function onpresion(objGrid, objCell) {
    //alert('ok');
		//alert(objGrid.variable);
		// var val = objGrid.getCellValue(objGrid.getCellByRow(1,1));
	var indice = objGrid.getCellValueString(objGrid.getCellByRow(objGrid.getRowByCell(objCell), 1));
	var tipo=objGrid.variable;
	// objGrid.getCellRowId(objCell) +'&cell='+ objGrid.getCellId(objCell) 
	//	+'&item='+objGrid.getCellValueString(objGrid.getCellByRow(
   // objGrid.getRowByCell(objCell), 0));
    modiframe('basic.php?id='+indice+'&tipo='+tipo +'&r=' + Math.random());
   // objGrid.getRowByCell(objCell), 0)));
}
function getSource(objArgs) {
//$tmp.= "    currentPage: 1,\n";
//$tmp.= "    sortColumn: '',\n";
//$tmp.= "    sortDesc: '',\n";
//$tmp.= "    variable: '55',\n";
    document.getElementById('prueba').innerHTML='phone2.php?currentPage=' + escape(objArgs.currentPage)+'&sortColumn='+escape(objArgs.sortColumn)
				+'&sortDesc='+escape(objArgs.sortDesc)+'&rowsPerPage='+escape(objArgs.rowsPerPage)+'&variable='+escape(objArgs.variable)+'&r=' + Math.random();
		//'phone2.php?args=' + escape(southprojects.Transport.serializeJsonObj(objArgs))
    return {
        source: 'phone2.php?currentPage=' + escape(objArgs.currentPage)+'&sortColumn='+escape(objArgs.sortColumn)
				+'&sortDesc='+escape(objArgs.sortDesc)+'&rowsPerPage='+escape(objArgs.rowsPerPage)+'&variable='+escape(objArgs.variable),
        sourceType: 'json/url'
    };
}
</script> 

	<script type='text/javascript' src='ajaxlib/utils/southprojects.js'></script>	
  <script type="text/javascript" src="ajaxlib/spgrid/src/spgrid.js"></script>
	<script type="text/javascript" src="ajaxlib/demo.js"></script>
	<script type="text/javascript" src="ajaxlib/zpslider/src/slider.js"></script>	
	<!-- ALL demos need these css -->
	<link href="ajaxlib/website/css/zpcal.css" rel="stylesheet" type="text/css">
	<link href="ajaxlib/website/css/template.css" rel="stylesheet" type="text/css">
	<link href="ajaxlib/spgrid/themes/layout.css" rel="stylesheet" type="text/css" />

	<style>
		body {
			width: 760px;
		}
	</style>
</head>	
	
	
  


  



<body>	

	<div id='prueba'>dato</div>


  




<?

function crear_grilla($nomb_obj,$tabla,$campos) {
$tmp="<div id='div_$nomb_obj'></div>\n";
$tmp.= "<script type=\"text/javascript\">\n";
$tmp.= "  var obj_$nomb_obj = new southprojects.Grid({\n";
$tmp.= "    dataOnDemand: true,\n";
$tmp.= "    callbackSource: getSource,\n";
$tmp.= "    theme: 'lightblue',\n";
$tmp.= "    container: 'div_$nomb_obj',\n";
$tmp.= "    rowsPerPage: 10,\n";
$tmp.= "    callbackCellOnClick: onpresion,\n";
$tmp.= "    multipleSelect: false,\n";
//$tmp.= "    currentPage: 1,\n";
$tmp.= "    sortColumn: '',\n";
$tmp.= "    sortDesc: '',\n";
$tmp.= "    variable: '$tabla',\n";
$tmp.= "    eventListeners: {\n";
$tmp.= "      'gridInitialized': onGridInit\n";
$tmp.= "    }\n";
$tmp.= "  });\n";
$tmp.= "</script>\n";
return $tmp;
}
echo crear_grilla("grilla",'PROVEEDOR','');
echo crear_grilla("grilla2",'CAMARA','');
?>

	<iframe id="icontenido" src="iframe1.htm" frameborder="0" height="200" width="100%" scrolling="yes" align="top"></iframe>

<p>aqui va el toolbar<input type="button" name="boton" onclick="javascript:modiframe('iframe2.htm');" value="Procesos"> <input type="button" name="boton" onclick="javascript:modiframe('iframe1.htm');" value="boton"></p>
		<div class="footer" style='width: 740px; text-align:center; margin-top:2em'>
		&copy; 2006 <strong> <a href='http://www.southprojects.com/'>SouthProjects</a> </strong>
		</div>
</body>
