<?

$r=$_REQUEST['r'];
$p=$_REQUEST['p'];
//if (!is_numeric($r)) exit;
//if (!is_numeric($p)) exit;

if (!@$db){
	set_include_path(get_include_path() . PATH_SEPARATOR . "./bo");
	include_once("db/dbMini.class.php");
	$db=new dbMini;
}


//echo "$r $p";

$sql="select * from revista_pagina where idCat=$r and num_pagina=$p limit 1";
$result=mysql_query($sql);
$zoom=mysql_fetch_array($result);
//$zoom=$db->getLinha("revista_pagina", 2);
?>
<style>
#pagzoom { zoom: 1.3;  transform-origin: 0 0; }
.zoom_old { -moz-transform: scale(1.3); -webkit-transform: scale(1.3); -o-transform: scale(1.3); transform: scale(1.3); }

#popup #topo{ width: 100%; background:#CCC;}
#popup #topo{ border-bottom: 1px solid white; }
#popup #topol{ width: 275px; font-size:28px; vertical-align: middle;padding-left:20px;}
#popup #topor{ width: 28px;text-align:center;}
#popup #topor A{ color: black; font-size:28px; text-decoration: none;}
#popup img{ display: block;}
#fancybox-outer {background: white}

.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.clearfix{display: inline-block;}
* html .clearfix{height: 1%;}
.clearfix{display: block;}

.esq{float: left; position: relative; display: inline;}
.dir{float: right; position: relative;}

#pagzoom table.esquerda{
	margin: 20px 44px 61px 36px;
}

#pagzoom table.direita{
	margin: 20px 36px 61px 44px;
}

</style>
<div id="popup">
<?header('Content-Type: text/html; charset=iso-8859-1')?>
	<div id="topo" class="clearfix">
		<div id="topol" class="esq">ZOOM</div>
		<div id="topor" class="dir"><a href="javascript:;" onclick="$.fancybox.close();">X</a></div>
	</div>
	<div style="scroll:auto; width:652px; height:823px; margin:0; background:white;">
		<div id="pagzoom">
			<?	if ($zoom['background']) {
				$style="style=\"background: url('".$zoom['background']."') no-repeat\"";
			} else {
				$style="style=\"background: white\"";
			} ?>
			<div class="pag" id="pag" <?=$style?>>	
				<?=$zoom['texto']?>
			</div>
						
		</div>
	</div>

	
</div>
<script>
$(document).ready(function() {
	if (!isPropertySupported("zoom"))
		$("#pagzoom").addClass("zoom_old");
});
function isPropertySupported(property){ return property in document.body.style; }
</script>
