.category {
	font-family:Arial, Helvetica, sans-serif;
	font-size:16px;
}
.pager {
	font-family:Arial, Helvetica, sans-serif;
	font-size:10px;
	font-weight:bold;
	color: #000000;
}
.pager a {
	font-family:Arial, Helvetica, sans-serif;
	font-size:12px;
	color: #FFF;
}
.title {
	font-family:Arial, Helvetica, sans-serif;
	font-size:24px;
	font-weight:bold;
}
.comment {
	font-family:Arial, Helvetica, sans-serif;
	font-size:12px;
}
.description {
	font-family:Arial, Helvetica, sans-serif;
	font-size:16px;
}
.thumbnail {
	margin:3px;
	border: 3px solid #fff;
}
.thumbnail_live {
	margin:3px;
	border: 3px solid #00194B;
}
form {
	margin:3px;
	padding:3px;
}
body { background-color:#113067 }
h1 {
	font-family:Arial, Helvetica, sans-serif;
	font-size:36px;
	font-weight:bold;
	color:#FFFFFF;
}
* {
	font-family:Arial, Helvetica, sans-serif;
	font-size:16px;
	color:#FFFFFF;
}
input { 
    color:#000000; 
} 

catalog_custom.html

<table  border="0" width="100%"  style="color:#FFFFFF "><tr><td bgcolor="#072655" align="left">

<SCRIPT language="JavaScript" type="text/javascript">

var count = 0;
var id_curr = 0;
var id_next_ = 0;
var id_prev = 0;
var items_ = new Array();
var position = 0;

photo_loading = new Image(); 
photo_loading.src="html/<?php echo $html['config']['path']?>/img/loading.gif"; 
function exchange(position_)
{
	if(position_ >count-1)
	{
		position = count-1;
		return;
	}
	if(position_ <0)
	{
		position = 0;		
		return;
	}
	position = position_;

	_path_filename_normal = './rwx_gallery/'+items_[position_]["filename_normal"];
	_size_w = (items_[position_]["size_w"]>0)?' width="'+items_[position_]["size_w"]+'"':'';
	_size_h = (items_[position_]["size_h"]>0)?' height="'+items_[position_]["size_h"]+'"':'';

	_ext = (_path_filename_normal.substr(_path_filename_normal.lastIndexOf('.')));
	_ext = _ext.toLowerCase();

	if(_ext == ".swf")
	{
		_inner_html = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" '+_size_w+_size_h+' >';
		_inner_html += ' <PARAM NAME=movie VALUE="'+_path_filename_normal+'"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> ';
		_inner_html += ' <EMBED src="'+_path_filename_normal+'" quality=high bgcolor=#FFFFFF  '+_size_w+_size_h+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>';
		_inner_html += ' </OBJECT>';
	}
	else if(_ext == ".mov" || _ext == ".pano")
	{
		_inner_html = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '+_size_w+_size_h+' codebase="http://www.apple.com/qtactivex/qtplugin.cab" id="qtvrObject">';
		_inner_html += ' <param name="autoplay" value="true">';
		_inner_html += ' <param name="controller" value="true">';
		_inner_html += ' <param name="pluginspage" value="http://www.apple.com/quicktime/download/indext.html">';
		_inner_html += ' <param name="target" value="myself">';
		_inner_html += ' <param name="type" value="video/quicktime">';
		_inner_html += ' <param name="src" value="'+_path_filename_normal+'">';
		_inner_html += ' <embed src="'+_path_filename_normal+'" '+_size_w+_size_h+' autoplay="true" controller="true" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html" target="myself" type="video/quicktime"  name="qtvrObject" EnableJavaSript="true" ></embed>';
		_inner_html += ' </object>';
	} 
	else if(_ext == ".jpg" || _ext == ".jpeg" || _ext == ".png" || _ext == ".gif")
	{
		_inner_html = '<IMG id="photo_img_id" src="html/<?php echo $html["config"]["path"]?>/img/loading.gif" '+_size_w+_size_h + ' >';
	} 
	else 
	{
		_inner_html = '';
	}

	document.getElementById("photo_img").innerHTML = _inner_html;
	if(_ext == ".jpg" || _ext == ".jpeg" || _ext == ".png" || _ext == ".gif")
	{
		document.getElementById("photo_img_id").src = 'core/watermark.php?id=.'+items_[position_]["id"]; 

	document.getElementById("photo_title").innerHTML = items_[position_]["title"];
	document.getElementById("photo_comment").innerHTML = items_[position_]["comment"];
	document.getElementById("photo_description").innerHTML = items_[position_]["description"];
	<?php if($this->html["config"]["sc_active"]=="Y"){?>
	document.getElementById("photo_price").innerHTML = "$"+items_[position_]["price"];
	document.getElementById("photo_buy_href").href = "shopcart.php?action=add&item_id="+items_[position_]["id"];
	<?php } ?> 
	for (i=0;i<items_.length;i++)
	{
		document.getElementById("asdf_"+i).className="thumbnail";
	}
	document.getElementById("asdf_"+position_).className="thumbnail_live";


}
</SCRIPT>

		<table border="0"cellpadding="0" cellspacing="0" width="760" >
		  <tr>
		    <td valign="top">

			<!-- LEFT CONTENT -->

			<table border="0" cellpadding="0" cellspacing="0" width="280" >
			  <tr>
			    <td>

				<table border="0" cellpadding="0" cellspacing="8" width="100%" bgcolor="gray">
				  <tr>
				    <td align="center" class="category">
<?php
$this->cats->categs_parents = array(); 
$this->cats->categs_parents[] = $this->cats->_get_childs_for_parent($this->html["cat"]["id"]);
$this->cats->get_parents(@$this->html["cat"]["parent_id"],@$this->html["cat"]["id"]);
for($i=count($this->cats->categs_parents)-1;$i>=0;$i--)
{
	$_parent = $this->cats->categs_parents[$i];
	foreach($_parent as $_category)
	{
		?> <a href="?cat=<?php echo $_category['id']?>" style="color:white;" ><?php 
		if(@$_category["active"])echo "[<b>";
		echo $_category["title"] ;	
		if(@$_category["active"])echo "</b>]"; 
		?></a><?php		
	}
	if($i>0)echo "<br>";
}
?>
					</td>
				  </tr>
				 </table>
			    </td>
			  </tr>
			  <tr>
			    <td>

				<table border="1" cellpadding="1" cellspacing="8" width="280">
				  <tr>
				  	<?php  
						$count = 0;$i=0;
						foreach($html['items'] as $item){ 
							if( $count++ % 3 == 0 && $count > 1) { ?>
						</tr><tr>
					<?php }; ?>
				    <td align="center" valign="middle" bgcolor="silver">
				    <a href="#" onclick="javascript:exchange(<?php echo $i?>);return false;"><img 
					class="thumbnail" id = "asdf_<?php echo $i?>"
	 src="./rwx_gallery/thumbs/<?php echo $item["filename_thumb"]?>"  alt="<?php echo $item["title"]?>" title="<?php echo $item["title"]?>"></a>
				    
<SCRIPT language="JavaScript" type="text/javascript">
items_[count] = Array();
items_[count]["id"] = <?php echo $item['id']?>;
items_[count]["filename_normal"] = "<?php echo $item['filename_normal']?>";
items_[count]["title"] = "<?php echo Misc::_safe_js_text($item['title'])?>";
items_[count]["comment"] = "<?php echo Misc::_safe_js_text($item['comment'])?>";
items_[count]["description"] = "<?php echo Misc::_safe_js_text($item['description'])?>";
items_[count]["size_w"] = <?php echo $item['size_w']?>;
items_[count]["size_h"] = <?php echo $item['size_h']?>;
items_[count]["price"] = "<?php echo sprintf("%.2f",$item['price'])?>";
count++;
</SCRIPT><?php $i++;}?>				    
				  </td> 
				  </tr>
				 </table>

			    </td>
			  </tr>
			  <tr>
			    <td align="center">
				<table border="0" cellpadding="0" cellspacing="8" width="100%" bgcolor="gray">
				  <tr>
				    <td align="center" class="pager"><?php include(dirname(__FILE__)."/pagination.html")?></td>
				  </tr>
				 </table>

			    </td>
			  </tr>
			 </table>

		    </td>
		    <td valign="top" align="center" style="padding-left:10px ">
			<!-- RIGHT CONTENT -->
			<form name="form_img" action="" style="margin:0; padding:0 ">
			<table border="0" cellpadding="0" cellspacing="0"  >
			   <tr>
			    <td align="center" style=" background-color:#999999;color:#FFFFFF ">
					<b id="photo_title" class="title"></b>
			    </td>
			  </tr>
			  <tr>
			    <td align="center" >
					<div id="photo_img" ></div>
				</td>
			  </tr>
			  <tr>
			    <td align="center" style=" background-color:#999999; color:#FFFFFF >"
					<table><tr><td style="color:white"><span id="photo_comment" class="comment"></span>
					<br><span id="photo_description" class="description"></span></td></tr></table>&nbsp;
			    </td>
			  </tr>
			 </table>
			</form><?php 
			if($this->html["config"]["sc_active"]=="Y"){?>
			<table><tr>
				<td><span id="photo_price" class="price"></span></td>
				<td><a href="?" id="photo_buy_href"><img src="<?php echo $html['path']?>img/buy.gif" alt="" border="0"/></a></td>
			</tr></table>
			<?php } ?>

		    </td>
		  </tr>
		 </table>
</td>
</tr>
</table>
<SCRIPT type="text/javascript">
position = 0; 
<?php
if(isset($_GET["id"]))
{
	$id = $_GET["id"];
	$position = 0;
	$i = 0;
	foreach($html['items'] as $item)
	{ 
		if($item["id"]==$id)
			$position = $i;
		$i++;
	}
//	var_dump($_GET);
	echo "position=$position;";
}
?>
exchange(position);</SCRIPT>

