<script type="text/javascript"  src="js/gallery.js">
<!--
//-->

</script>
<div id="div_12">
<?php
include "../add_view.php";
if (isset($_GET['u'])){}else{$_GET['u'] = intval(mysql_num_rows(mysql_query("select jobid from obd_8 where jobid < 1000")) - 1);}
if ($_GET['u'] < 0 or $_GET['u'] > 3000){$_GET['u'] = intval(mysql_num_rows(mysql_query("select jobid from obd_8 where jobid < 1000")) - 1);}

$result = mysql_query("select * from obd_8 where jobid = " . $_GET['u']);
for ($i=0; $i<mysql_num_rows($result); $i++){
	$row = mysql_fetch_array($result);
}
$totalgal = 0;
$overflowgal = -1;
if ($_GET['u'] >= 2000){
	$glavagal = 'other/';
	$curpgal = $_GET['u'] - 2000;
}elseif ($_GET['u'] >= 1000){
	$glavagal = 'fon/';
	$curpgal = $_GET['u'] - 1000;
}else {
	$glavagal = 'interier/';
	$curpgal = $_GET['u'];
}
?>
<center>
<table cellpadding="0" cellspacing="0"><tr><td class="tdsmall btm">
<?php include "../proj_on_theme.php"; ?>
<?php
if ($row['more'] <> " "){
	echo "<div class='bl_w rgt'><span class='div_bbig2'>О работе</span></div><div class='bl_w2'>" . $row['more'] . "</div>";
}else{
	echo "<div class='bl_w rgt'><span class='div_bbig2'>О нас</span></div><div class='bl_w2'>" . $rek[mt_rand(0, 5)] . "</div>";
}
$myfn = "galary/full/" . $glavagal . $curpgal . ".zip";
$myfnraw = "galary/fullraw/" . $glavagal . $curpgal . ".jpg";
?>
</td><td class="lft" style="width:645px;">


<center>
<table cellpadding="0" cellpadding="0" style="width:645px;position:relative;top:+3px;">
<tr><td style="border-bottom: 1px solid #FCCE92;"><span style="position:relative;top:+3px;"><?php include "../is_rating.php"; ?></span></td></tr>
<tr><td><center><?php if (file_exists($myfnraw)){ ?><a id="bigpictraw" target='_blank' title='Открыть в новом окне полное изображение' href='<?php echo $myfnraw; ?>'><?php } ?><img id="bigpict" src="galary/big/<?php if ($_GET['u'] >= 2000){echo 'other/' . ($_GET['u'] - 2000);}elseif ($_GET['u'] >= 1000){echo 'fon/' . ($_GET['u'] - 1000);}else {echo 'interier/' . $_GET['u'];} ?>.jpg" alt="Увеличенное изображение" /><?php if (file_exists($myfnraw)){ echo "</a>"; } ?></center></td></tr>
<tr><td style="border-top: 1px solid #FCCE92;"><FORM METHOD="POST" style="position:relative;top:-3px;" class="black_block clr_or sm" id="fchangegal" action="/galary.php">
<select class="cinline " id="galary_glava" onchange="document.getElementById('fchangegal').setAttribute('action', '/galary.php?u=' + document.getElementById('galary_glava').value);document.getElementById('fchangegal').submit();">
<option value="0" <?php if ($glavagal == 'interier/') {echo "selected";} ?>>Дизайн интерьеров</option>
<option value="1000" <?php if ($glavagal == 'fon/') {echo "selected";} ?>>Фон</option>
<option value="2000" <?php if ($glavagal == 'other/') {echo "selected";} ?>>Рисунки</option>
</select>
<span class="bld">&nbsp;Автор: </span>
<span id="gA1">
<a name="auth" class="a_ow" title="Перейти к странице автора" href="user.php?u=<?php echo $row['userid']; ?>">
<?php echo $ousers[$row['userid']][0] . "</a>"; ?>
</span>
<span id="ocview">, <span id="gA2"><?php echo $row['format'];
if (file_exists($myfn)){
	echo ", ~" . (integer)(filesize($myfn)/1024) . " Кбайт";
}

 ?></span>, Просмотров:&nbsp; 
<?php
	mysql_select_db('onestyle_w');

	$result2 = mysql_query("select * from ocView_8 where c_word_id= " . $_GET['u']);
	if (mysql_num_rows($result2)){
		$row2 = mysql_fetch_array($result2);
		echo $row2['c_count'];
	}else{
		echo "0";
	}
	mysql_select_db('onestyle_testmy');
?>
</span>
</FORM>



</td></tr>
</table>
</center>
</td></tr></table></center>

<center>
<table cellpadding="0" cellspacing="0" style="width:100%;">
<tr class="bclr_w"><td colspan="3" class="sm" style="padding:3px 7px;">&nbsp;
<?php
echo 'Понравилась работа? Мы можем сделать для вас что-нибудь похожее. Подробнее об этом можно узнать <a class="bld" href="/d1.php?d=1">здесь</a>';
?>
</td><td colspan="1" class="sm" style="padding:3px 7px;">
<?php
if (file_exists($myfnraw)){
	echo "<div>&nbsp;<a class='bld' target='_blank' href='" . $myfnraw . "'>Отобразить</a> большое изображение, имеющее указанную ширину и высоту.</div>";
}else{echo "&nbsp;";}
?>
</td><td colspan="1" class="sm" style="padding:3px 7px;">
<?php
if (file_exists($myfn)){
	echo "<div>&nbsp;<a class='bld' href='" . $myfn . "'>Скачать</a> работу, ширина, высота, формат и размер которой указаны выше.</div>";
}else{echo "&nbsp;";}
?>
</td><td colspan="3" class="sm" style="padding:3px 7px;">&nbsp;
<?php
echo 'Работа вам что-нибудь напомнила или вам хочется поделиться своим мнением? Оставьте его в комментариях.';
?>
</td></tr>
<tr class="bclr_w"><td style="width:15%;" rowspan="2">&nbsp;</td><td rowspan="2" class="rgt top"><div class="rgt bclr_w" style="height:39px;width:40px;position:relative;left:+26px;padding:0px 3px 0px 0px;"><a href="javascript:showGal(-1);"><img id="galBack" alt="&lt;" src="img/leftarrow.gif" /></a></div></td>
<td class="rgt black_block">
<div id="gA3">
<?php if ($curpgal <> 0){ ?>
<a class="a_tags" href="/galary.php?u=<?php 
if ($_GET['u'] >= 2000){echo "2000";}elseif ($_GET['u'] >= 1000){echo "1000";}else {echo "0";}
?>">Первая работа</a>
<?php } ?>
&nbsp;</div>
</td>
<td class="black_block cntr clr_or ssm btm" colspan="2"><?php echo date("H:i, jS F"); ?></td>
<td class="lft black_block">
<div id="gA3">&nbsp;
<?php 
if ($_GET['u'] >= 2000){$maxnumb_pict = 2000 + intval(mysql_num_rows(mysql_query("select jobid from obd_8 where (jobid > 1999) and (jobid < 3000)")) - 1);}elseif ($_GET['u'] >= 1000){$maxnumb_pict = 1000 + intval(mysql_num_rows(mysql_query("select jobid from obd_8 where (jobid > 999) and (jobid < 2000)")) - 1);}else {$maxnumb_pict = intval(mysql_num_rows(mysql_query("select jobid from obd_8 where jobid < 1000")) - 1);}
if ($curpgal <> $maxnumb_pict){ ?>
<a class="a_tags" href="/galary.php?u=<?php echo $maxnumb_pict; ?>">Последняя работа</a>
<?php } ?>
</div>
</td>
<td rowspan="2" class="tdsmall" style="width:1px;"><div class="lft bclr_w" style="height:39px;width:40px;position:relative;left:-26px;padding:0px 0px 0px 3px;"><a href="javascript:showGal(1);"><img id="galNext" alt="&gt;" src="img/rightarrow.gif" /></a></div></td><td style="width:15%;" rowspan="2">&nbsp;</td></tr>
<tr class="bclr_w"><td class="tdsmall is200px"><a id="abiggal1" href="javascript:freplacepictgal(1);"><img class="img_gal" id="gal1" src="galary/small/<?php 
echo $glavagal . $curpgal;
switch ($glavagal){
case 'other/':
	$totalgal = mysql_num_rows(mysql_query("select jobid from obd_8 where ((jobid > " . $_GET['u'] . ") and (jobid < 3000))"));
	break;
case 'fon/':
	$totalgal = mysql_num_rows(mysql_query("select jobid from obd_8 where ((jobid > " . $_GET['u'] . ") and (jobid < 2000))"));
	break;
case 'interier/':
	$totalgal = mysql_num_rows(mysql_query("select jobid from obd_8 where ((jobid > " . $_GET['u'] . ") and (jobid < 1000))"));
	break;
} ?>.jpg" alt="Изображение 1" /></a></td>
<td class="tdsmall is200px"><a id="abiggal2" href="javascript:freplacepictgal(2);"><img class="img_gal" id="gal2" src="galary/small/<?php 
echo $glavagal;

switch ($glavagal){
case 'other/':
	if ($totalgal<1){
		$overflowgal += 1;
		echo ($overflowgal);
	}else{
		echo ($curpgal + 1);
	}
	break;
case 'fon/':
	if ($totalgal<1){
		$overflowgal += 1;
		echo ($overflowgal);
	}else{
		echo ($curpgal + 1);
	}
	break;
case 'interier/':
	if ($totalgal<1){
		$overflowgal += 1;
		echo ($overflowgal);
	}else{
		echo ($_GET['u'] + 1);
	}
	break;
} ?>.jpg" alt="Изображение 2" /></a></td>
<td class="tdsmall is200px"><a id="abiggal3" href="javascript:freplacepictgal(3);"><img class="img_gal" id="gal3" src="galary/small/<?php 
echo $glavagal;

switch ($glavagal){
case 'other/':
	if ($totalgal<2){
		$overflowgal += 1;
		echo ($overflowgal);
	}else{
		echo ($curpgal + 2);
	}
	break;
case 'fon/':
	if ($totalgal<2){
		$overflowgal += 1;
		echo ($overflowgal);
	}else{
		echo ($curpgal + 2);
	}
	break;
case 'interier/':
	if ($totalgal<2){
		$overflowgal += 1;
		echo ($overflowgal);
	}else{
		echo ($_GET['u'] + 2);
	}
	break;
} ?>.jpg" alt="Изображение 3" /></a></td>
<td class="tdsmall is200px"><a id="abiggal4" href="javascript:freplacepictgal(4);"><img class="img_gal" id="gal4" src="galary/small/<?php 
echo $glavagal;

switch ($glavagal){
case 'other/':
	if ($totalgal<3){
		$overflowgal += 1;
		echo ($overflowgal);
	}else{
		echo ($curpgal + 3);
	}
	break;
case 'fon/':
	if ($totalgal<3){
		$overflowgal += 1;
		echo ($overflowgal);
	}else{
		echo ($curpgal + 3);
	}
	break;
case 'interier/':
	if ($totalgal<3){
		$overflowgal += 1;
		echo ($overflowgal);
	}else{
		echo ($_GET['u'] + 3);
	}
	break;
} ?>.jpg" alt="Изображение 4" /></a></td></tr>
<tr><td colspan="8">
<?php include "../my_comment.php"; ?>
</td></tr>
</table></center>
</div>