<style type="text/css">
.nlinput{
	border: 1px #707070;
	border-radius: 3px;
	background: #ddd;
	width: 100%;
	margin-bottom: 5px;
	padding: 3px;
}
#jobboldal{
	margin: 0 5px 0 0;
	float: right;
}
</style>

<? $user23 = $this->phpsession->get('user'); $mobil = $user23['mobil']; ?>
<div id="baloldal" style="margin-top: 0px; padding-top: 10px;">


<div class="hkheadertop"></div>
<div class="hkkeret">
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr>
	<td><img alt="tipoftheday logo" src="/public/img/tipoftheday/tipoftheday_logo_<?if(hun()):?>HUN<?else:?>ENG<?endif;?>.png" style="float: left;" /></td>
	<td id="levelcim" style="width: 400px; vertical-align: middle; height: 50px;" align="right"><h1 class="nl-cim"><?=$level->title?></h1></td>
	</tr>
	</table>
</div>
<div class="hkheaderbottom"></div>

<div class="hkheadertop"></div>
<div class="hkkeret" style="min-height: 350px;">
<?/*print_r($level);*/?>

   <div style="width: 435px; float: left;">
      <?if($level->video != "" && strpos($level->video,"youtube")>0 && !$mobil):?>
      <object width="425" height="349" class="hirlevelvideo">
         <param name="movie" value="<?=$level->video?>"></param>
         <param name="allowFullScreen" value="true"></param>
         <param name="allowscriptaccess" value="always"></param>
         <param name="wmode" value="opaque"></param>
         <embed src="<?=$level->video?>" type="application/x-shockwave-flash" width="425" height="349" allowscriptaccess="always" allowfullscreen="true" wmode="opaque"></embed>
      </object>
      <?endif;?>
      
      <?if(strpos($level->video,"youtube")===FALSE && trim($level->link)==""):?>
      <img src="<?=$level->video?>" alt="<?=$level->title?>" style="max-width: 425px; min-width: 425px; float: left;" />
      <?endif;?>
	  
      <?if(strpos($level->video,"youtube")===FALSE && trim($level->link)>""):?>
      <a href="http://www.archline.hu/multimedia/imagegallery/<?=base64_encode($level->link."/")?>" class="galeriaframe">
         <img src="<?=$level->video?>" alt="<?=$level->title?>" style="max-width: 425px; min-width: 425px; float: left;" />
      </a>
      <?endif;?>
	</div>

	<div style="margin-left: 435px;"><?=$level->text?></div>
	
	<div class="clear"></div>
</div>
<div class="hkheaderbottom"></div>
	
</div>


<div id="jobboldal" style="padding-top: 10px;">
	<div class="hkheadersmalltop"></div>
	<div class="hkkeretsmall" style="padding-bottom: 5px;">
		<div class="gal-cim2" style="margin-bottom: 10px;"><?=lang('latest_tips');?></div>
		<ul style="margin: 0px; padding: 0px;">
		<?for($i=0;$i<(count($levelek)>=6 ? 6 : count($levelek));$i++):?>
			<li class="nl" style="margin: 0 0 2px 15px; list-style-type: disc; color: #AAA; font-weight: bold;"><a href="/tipoftheday/show/<?=$levelek[$i]->url?>"><?=$levelek[$i]->title?></a></li>
		<?endfor;?>
		</ul>
		<?if(count($levelek) > 6):?>
		<p style="text-align: right">
		<a id="archivea" style="color: #DD8800; text-decoration: none; font-weight: normal; cursor: pointer;"><?=lang('archive')?></a>
		</p>
		<div id="archives" style="display: none;">
		<ul style="margin: 0px; padding: 0px;">
		<?for($i=6;$i<count($levelek);$i++):?>
			<li class="nl" style="margin: 0 0 2px 15px; list-style-type: disc; color: #AAA; font-weight: bold;"><a href="/tipoftheday/show/<?=$levelek[$i]->url?>"><?=$levelek[$i]->title?></a></li>
		<?endfor;?>
		</ul>
		<p style="text-align: right">
		<a id="archiveh" style="color: #DD8800; text-decoration: none; font-weight: normal; cursor: pointer;"><?=lang('hide')?></a>
		</p>
		</div>
		<?endif;?>
	</div>
	<div class="hkheadersmallbottom"></div>
	
	<div class="hkheadersmalltop"></div>
	<div class="hkkeretsmall" style="padding-bottom: 5px;">
		<div class="gal-cim2" style="margin-bottom: 10px;"><?=lang('nl_signup')?></div>
		<form action="/newsletter/signup" method="post" id="signupForm">
		<input type="text" name="url" class="rejtettelem" />
		<?=lang('name')?>:
		<div style="width: 90%; margin: auto;">
			<input type="text" name="name" id="name" class="nlinput" />
		</div>
		<?=lang('email')?>:
		<div style="width: 90%; margin: auto;">
			<input type="text" name="email" id="email" class="nlinput" /><br />
			<div style="text-align: right;">
			<input type="button" value="<?=lang('nl_signup')?>" style="margin-top: 5px;height: 20px; border-radius: 3px; padding: 2px 6px 3px 6px;border: 0 none;" onclick="checkForm()" />
			</div>
		</div>
		</form>
	</div>
	<div class="hkheadersmallbottom"></div>
</div>


<script type="text/javascript">
jQuery(document).ready(function($){
	$('#archivea').click(function(){
		$('#archives').toggle();
		$(this).toggle();
	});
	
	
	$('#archiveh').click(function(){
		$('#archives').toggle();
		$('#archivea').toggle();
	});
	
	<?/*
	<?if( is_dir($level->video) || (file_exists($level->video) && is_dir($level->link)) ):?>
	$('.galeriaframe').fancybox({
		padding: 0,
		margin:  0,
		width: 970,
		height: 670,
		transitionIn: 'none',
		transitionOut: 'none',
		type: 'iframe'
	});
	<?endif;?>
	*/?>
	
});


function checkForm()
	{
		var nameok  = false;
		var emailok = false;
		var at = '@';
		var dot = '.';

		var name  = jQuery('#name');
		var email = jQuery('#email');

		if(name.val() == '' || name.val() == '<?=$this->lang->line('downloads_error_empty_field')?>'){
			name.val('<?=$this->lang->line('downloads_error_empty_field')?>');
			name.css({ 'background-color': '#F9D3D3' });
		}
		else{
			name.css({ 'background-color': '#EEEEEE' });
			nameok = true;
		}


		if(email.val() == '' || email.val() == '<?=$this->lang->line('downloads_error_empty_field')?>'){
			email.val('<?=$this->lang->line('downloads_error_empty_field')?>');
			email.css({ 'background-color': '#F9D3D3' });
		}
		else{
			if(email.val().indexOf(at)==-1 || email.val().indexOf(at)==0 || email.val().indexOf(at)==email.val().length-1 || email.val().indexOf(dot)==-1 || email.val().indexOf(dot)==0 || email.val().indexOf(dot)>=email.val().length-2){
				email.val('<?=$this->lang->line('downloads_error_email_field')?>');
				email.css({ 'background-color': '#F9D3D3' });
			}
			else{
				email.css({ 'background-color': '#EEEEEE' });
				emailok = true;
			}

		}
		
		
		
		if( nameok==true && emailok==true )
		{
			jQuery('#signupForm').submit();
		}

    }
</script>
