<script type="text/JavaScript">
	jQuery(function() {
		jQuery(".prev").hide();
		jQuery(".next").hide();
			jQuery('#box_icon_video').hover(function() {			
				 jQuery(this).find('.prev').stop(true, true).fadeIn(300);
				 jQuery(this).find('.next').stop(true, true).fadeIn(300);
			}, function() {
				 jQuery(this).find('.prev').stop(true, true).fadeOut(300);
				 jQuery(this).find('.next').stop(true, true).fadeOut(300);
			});
	});
</script>
<?php
    if(isset($_GET['video_id'])){
		$v=$_GET['video_id'];
	}else{
		$video=mysql_query("Select * From tblvideo ORDER BY RAND()");
		$row_video=mysql_fetch_array($video);
		$v = $row_video['v_id'];
	}
?>
<div id="box_viedo">

	 <div id="viedo">
	   <!--<img src="images/vd.jpg" />-->
	   <!--<div id="ytplayer_div">You need Flash player 8+ and JavaScript enabled to view this video.</div>	    
		<script type="text/javascript">
		  swfobject.embedSWF(
			'http://www.youtube.com/v/<?php //echo $row_video['v_id']; ?>&enablejsapi=1&rel=0&fs=1',
			'ytplayer_div',
			'596',
			'365',
			'8',
			false,
			false,
			{
			  allowScriptAccess: 'always',
			  allowFullScreen: 'true',
			  wmode:'opaque',
			  quality:'high',
			  bgcolor:'#000000',
			  salign:'tl'
			},
			{
			  id: 'ytplayer_object'
			}
		  );
		</script>
		
		<script type="text/javascript">
		  function ytplayer_loadvideo( id ) {
			var o = document.getElementById( 'ytplayer_object' );
			if( o ) {
			  o.loadVideoById( id );
			}
		  }
		</script>-->
		<!--<iframe width="560" height="315" src="//www.youtube.com/embed/M7FIvfx5J10" frameborder="0" allowfullscreen></iframe>-->
		<!--<iframe src="http://www.youtube.com/v/<?php echo $v; ?>?fs=1&autoplay=1&amp;hl=en_US&amp;rel=0&amp;hd=1" allowscriptaccess="always" allowfullscreen="true" style="border: 2px solid #000;" width="596" height="365"></iframe>-->
		<iframe src="//www.youtube.com/embed/<?php echo $v; ?>?wmode=transparent;fs=1&autoplay=1&amp;hl=en_US&amp;rel=0&amp;hd=1" frameborder="0" allowscriptaccess="always" style="border: 2px solid #000;" width="596" height="365" frameborder="0"></iframe>
		
	 </div>
	 <div class="clear" style="height: 12px;"></div>
	 <div id="box_icon_video">
	     <div id="pre" class="prev" title="Prev"></div>
	     <div id="next" class="next" title="Next"></div>
		 <div class="ytplayer">
			  <div class="newsticker-jcarousellite">  
				<?php $sql_vd = mysql_query("Select * From tblvideo"); ?>			  
				<ul style="list-style:none;">
				<?php while($video = mysql_fetch_array($sql_vd)){ ?>
				   <li>
					 <a href="?video_id=<?php echo $video['v_id']; ?>#viedo">
						<?php echo'<div id="cover_thumbnail"><div id="thumbnail" style="background: url(\'http://img.youtube.com/vi/'.$video['v_id'].'/mqdefault.jpg\') no-repeat center center;"></div></div>'; ?>
					 </a>
					 <div id="th_shadow"></div> 
				   </li>
				<?php } ?>   
				</ul>	 
			 </div>	 
		</div>
	</div>
</div>	
<div id="box_news">
	<div id="hot_news">ព័ត៌មានថ្មីៗ</div>
	<div class="clear" style="height: 6px;"></div>
	<?php
	   $sql_news = mysql_query("Select * From tbl_news ORDER BY id DESC LIMIT 0,4");
	   while($row_news = mysql_fetch_array($sql_news)){
	   $str=$row_news['title'];
	   $title=strlen($str);
	?>
		<div id="cover_news" style="overflow: hidden;"> 
			<?php echo'<a href="?p=news&n_id='.$row_news['id'].'&action=b_show#txt" title="'.$row_news['title'].'" style="text-decoration: none;"><div id="news_img" style="background: url(\'images/news/s/'.$row_news['image'].'\') no-repeat center center;"></div></a>'; ?>
			<div id="news_desc">
				 <div id="news_title">
					<?php //echo substr($row_news['title'],0,180).'...'; 
					   if($title > 178){
							$sp=substr($str,0,178);
							$sp1=$sp.'...';
						}else{
							$sp1=$str;
						}
						echo'<a href="?p=news&n_id='.$row_news['id'].'&action=b_show#txt">'.strip_tags($sp1).'</a>';
					?>
				 </div>
				 <?php echo substr(strip_tags($row_news['detail']),0,150).'...'; ?>
				 <span><a href="?p=news&n_id=<?php echo $row_news['id']; ?>&action=b_show#txt">អានបន្ត</a><span>
			</div>
			<div class="clear"></div>
		</div>
		<div class="clear" style="height: 12px;"></div>					
		<div id="news_line"></div>
		<div class="clear" style="height: 12px;"></div>
	<?php } ?>				
</div>

<div class="clear"></div>