<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts Multicart                     |
// +----------------------------------------------------------------------+
// | Authors: Programmer<programmer@armia.com>        		              |
// +----------------------------------------------------------------------+
// | Copyrights Armia Systems, Inc and iScripts.com � 2005                |
// | All rights reserved                                                  |
// +----------------------------------------------------------------------+
// | This script may not be distributed, sold, given away for free to     |
// | third party, or used as a part of any internet services such as      |
// | webdesign etc.                                                       |
// +----------------------------------------------------------------------+
?>
<?php
include "includes/config.php";
include "includes/session.php";
include "includes/functions.php";

if (get_magic_quotes_gpc()) {
    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}

if (isset($_GET["id"]) and $_GET["id"] != "") {
    $id = $_GET["id"];
} else if (isset($_POST["id"]) and $_POST["id"] != "") {
    $id = $_POST["id"];
}
$prodimagedir = "products/";

$sql=" SELECT product_image_big FROM ".$tableprefix."products WHERE product_id = '".addslashes($id)."' ";

$rs = mysql_query($sql);
if(mysql_num_rows($rs)!=0){
	$row = mysql_fetch_array($rs);
	$img =$row["product_image_big"] ;
}
$cntplus=substr_count($img, '+');

$ulencodedimg=urlencode($img);
$cntplus1=substr_count($ulencodedimg, '+');

if($cntplus1>$cntplus){
$ulencodedimg=str_replace("+"," ",$ulencodedimg);
}
$src = $prodimagedir . $ulencodedimg;

?>
<script>
function resize(){

	var a = document.getElementById('image_');
	var width=a.width+40;
	var height = a.height+80;
	window.resizeTo(width,height);
}
</script>
<body onload='resize();'>
	<img id='image_' src = "<?php echo $src?>">

</body>