<?
/*
function video_html($pcsoport){
	$videokvegyes = $this->db->query("SELECT * FROM videos WHERE csoport='{$pcsoport}' AND sorszam > 0 ORDER BY sorszam")->result();
	
	$videok = array();
	foreach($videokvegyes as $video){
		$csoport = $video->csoport;
		if( !is_array($videok[$csoport]) )
			$videok[$csoport] = array();
		
		$videok[$csoport][] = $video;
	}
	
	return $this->strcsere($pcsoport,$videok[$pcsoport]);
}
*/


function video_strcsere($csoport,$csoport2,$videok){
		$ret = "";
		$ret .= "<div style=\"background: url('/public/img/welcome/2012/box_video.png') no-repeat; margin-left: -17px; width: 970px;\">\n";
		$ret .= "	<div id=\"vh{$csoport}\" title=\"The Second Video\" style=\"height: 350px; width: 425px; float: left; padding: 13px 20px 10px 12px; margin-top: 0px;\">\n";
				
		$ret .= "		<object width=\"425\" height=\"349\">\n";
		$ret .= "		<param name=\"movie\" value=\"http://www.youtube.com/v/{$videok[0]->youtubeid}?fs=1&amp;hl=hu_HU\"></param>\n";
		$ret .= "		<param name=\"allowFullScreen\" value=\"true\"></param>\n";
		$ret .= "		<param name=\"allowscriptaccess\" value=\"always\"></param>\n";
		$ret .= "		<param name=\"wmode\" value=\"opaque\"></param>\n";
		$ret .= "		<embed src=\"http://www.youtube.com/v/{$videok[0]->youtubeid}?fs=1&amp;hl=hu_HU\" type=\"application/x-shockwave-flash\" width=\"425\" height=\"349\" allowscriptaccess=\"always\" allowfullscreen=\"true\" wmode=\"opaque\"></embed>\n";
		$ret .= "		</object>\n";
		$ret .= "	</div>\n";
		$ret .= "	<div id=\"videojobb\" style=\"height: 378px; width: 515px; margin-left: 450px;\">\n";
		$ret .= "		<div class=\"welboxtit\" style=\"padding-top: 10px;\"><strong>{$csoport2->cim}</strong></div>\n";
		$ret .= "		<div style=\"margin: 0px 5px 0px 5px;\">{$csoport2->leiras}</div>\n";
				
		$ret .= "		<div class=\"videoklistakeret scroll-pane\" style=\"width: 500px; height: 300px;\">\n";
				
			foreach($videok as $video){
		$ret .= "		<div style=\"height: 58px; overflow: hidden; cursor: pointer; padding: 5px;\" class=\"video\" rel=\"{$video->youtubeid}\" name=\"{$csoport}\">\n";
		
		if(!file_exists($video->kep)){
			$ret .= "			<img src=\"http://i1.ytimg.com/vi/".$video->youtubeid."/default.jpg\" style=\"float: left; width: 60px; height: 48px; margin-right: 5px;\" alt=\"{$video->cim}\" />\n";
		}
		else
			$ret .= "			<img src=\"/{$video->kep}\" style=\"float: left; width: 60px; height: 48px; margin-right: 5px;\" alt=\"{$video->cim}\" />\n";
		
		$ret .= "			<h3 style=\"margin: 0px 0px 4px 65px; font-weight: bold;\">{$video->cim}</h3>\n";
		$ret .= $video->leiras;
		$ret .= "		</div>\n";
		$ret .= "		<div class=\"clear\"></div>\n";
			}
				
				
		$ret .= "		</div>\n";
				
		$ret .= "	</div>\n";
		$ret .= "</div>";
		
		return $ret;
	}

?>