<?php
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
if(preg_replace("/https?:\/\/([^\:\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) != preg_replace("/([^\:]+).*/", "\\1", $_SERVER['HTTP_HOST'])) {
	exit('');
}
define('THIS_SCRIPT', 'dv_getcode.js');
require_once 'global.php';
$w=(isset($_GET["w"])?intval($_GET["w"]):0);
$h=(isset($_GET["h"])?intval($_GET["h"]):0);
$d=(isset($_GET["d"])?intval($_GET["d"]):0);
$qs=isset($_SERVER['QUERY_STRING'])?"?".$_SERVER['QUERY_STRING']:"";
$basepath="./".str_repeat("../",$d);
$fv="basepath=".$basepath."\&qs=".$qs; 
      echo "function setObjSize(obj,w,h)\n{\nif(!obj)return;\nobj.width=w;\nobj.height=h;\n}\n";     
if(strtolower($cercode_image)=="swf"){
	  echo "document.write('";
	  echo '<span><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="cercode"'
	      .' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'.strval($w).'" height="'.strval($h).'">'
         .'<param name="movie" value="'.$basepath.'dv_getcode/Dv_getCode_Fla.swf" />'
         .'<param name="quality" value="high" />'
         .'<param name="FlashVars" value="'.$fv.'" />' 
         .'<embed src="'.$basepath.'dv_getcode/Dv_getCode_Fla.swf" FlashVars="'.$fv.'" quality="high"'
         .' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width=100 height=24>'
         .'</object></span>';
      echo "')";
}else{
	 echo "document.write('";
	 echo '<img src="'.$basepath.'dv_getcode.php'.$qs.'"  id="cercode" alt="" class="simg" style="cursor : pointer;" onclick="this.src=\\\''.$basepath.'dv_getcode.php'.$qs.'&d=\\\'+Date();" onmouseover="this.className=\\\'bigimg\\\';" onmouseout="this.className=\\\'simg\\\';" align="absmiddle" width="'.strval($w).'" height="'.strval($h).'" border="0">';
     echo "')";
}  

?>       