
<?$this->load->view('downloads/tabs')?>

<h2><?=$this->lang->line('downloads_h2_itc')?></h2>

<div class="float-50">
	<p>
		<?=form_open('downloads/validate', array('id' => 'downloadForm_itc'))?>
		<?=form_hidden('do','itc')?>
			<table width="100%">
				<tr>
					<td width="75">
						<strong><?=lang('name')?>:</strong>
					</td>
					<td width="auto">
						<input type="text" size="27" name="first_itc" id="first_itc" onfocus="checkError_itc('first_itc')" />
					</td>
				</tr>
				<tr>
					<td width="100">
						<strong><?=lang('country')?>:</strong>
					</td>
					<td>
						<select name="country_itc" id="country" style="width:188px;">
						    <?if(eng()):?>
						    <option value="-1" selected="selected">--Choose--</option>
						    <?endif;?>
						<?foreach($ctr as $row):?>
							<option value="<?if(hun()):?><?=$row->ctrNameHun?><?else:?><?=$row->ctrNameEng?><?endif;?>" <?if(hun()):?><?if($row->ctrNameHun=='Magyarország'):?><?='selected="selected"'?><?endif;?><?elseif(jap()):?><?if($row->ctrNameEng=='Japan'):?><?='selected="selected"'?><?endif;?><?endif;?>
							<?if( esp() && $row->ctrNameEng=='Spain'){ print'selected="selected"'; }?>
							>
								<?if(hun()):?>
									<?=$row->ctrNameHun?>
								<?else:?>
									<?=$row->ctrNameEng?>
								<?endif;?>
							</option>
						<?endforeach;?>
						</select>
					</td>
				</tr>
				
				<tr>
					<td width="100">
						<strong><?=lang('email')?>:</strong>
					</td>
					<td>
						<input type="text" size="27" name="email" id="email" onfocus="checkError_itc('email')" />
					</td>
				</tr>
				
				<tr>
					<td width="100">
						<?=lang('tel')?>:
					</td>
					<td>
						<input type="text" size="27" name="tel_itc" id="tel_itc" onfocus="checkError_itc('tel_itc')" />
					</td>
				</tr>
				<tr>
					<td width="100">
						<?if(hun()):?>Szoftver<?else:?>Software<?endif;?>:
					</td>
					<td>
						<?=form_checkbox('prog_archline',1)?> ARCHLine <br />
						<?=form_checkbox('prog_autocad',1)?> AutoCAD <br />
						<?//=form_checkbox('prog_archicad',1)?>
						
					</td>
				</tr>
			</table>
			<br />
			<center>
				<img style="border:0" onclick="checkForm_itc()" onmouseover="style.cursor='pointer'" src="/public/img/gombok/download_button_<?=$this->muser->user['lang']?>.png" height="30" width="250" alt="Submit Form" />
				<br />
				<div id="message"></div>
			</center>

		</form>
	</p>
</div>


<?if(hun()):?>
<div class="float-50">
	<p><strong>Az ITC Items - Online objektumkönyvtárak közvetlenül a gyártóktól</strong></p>
	</p>Egy új modul a lakberendezők, belső építészek, építészek számára, mely a gyártó cégek naprakész gyártmánykészletét tartalmazza. Az adatbázisok ingyenesek, a gyártó cégek új termékeikkel folyamatosan bõvítik.</p>
	</p></p>
	
</div>
<?else:?>

<?endif;?>

<script type="text/javascript">
	
	window.onload = focus();
	
	function focus()
	{
		document.getElementsByName('first_itc')[0].focus();
		
		var firstname = document.getElementById('first_itc').value;
		var email = $('email').value;
		
		$('first_itc').style.backgroundColor = '#FDDA10';
		$('email').style.backgroundColor = '#FDDA10';
	}
	
	function checkError_itc(inputID)
	{
		if($(inputID).value == '<?=$this->lang->line('downloads_error_empty_field')?>' || $(inputID).value == '<?=$this->lang->line('downloads_error_email_field')?>')
		{
			$(inputID).value = '';
		}
	}
	
	function checkForm_itc()
	{
		var countryok = false;
		var firstnameok_itc = false;
		var emailok_itc = false;
		var at = '@';
		var dot = '.';
		
		var country = jQuery('#country');
		
		var firstname_itc = document.getElementById('first_itc').value;
		var email = $('email').value;
		
		var message = $('message').value;
		$('message').innerHTML = '<?=$this->lang->line('downloads_wait')?>';
		
		if(firstname_itc == '' || firstname_itc == '<?=$this->lang->line('downloads_error_empty_field')?>')
		{
			$('first_itc').value = '<?=$this->lang->line('downloads_error_empty_field')?>';
			$('first_itc').style.backgroundColor = '#F9D3D3';
		}
		else
		{
			$('first_itc').style.backgroundColor = 'white';
			firstnameok_itc = true;
		}
		
		
		if(email == '' || email == '<?=$this->lang->line('downloads_error_empty_field')?>')
		{
			$('email').value = '<?=$this->lang->line('downloads_error_empty_field')?>';
			$('email').style.backgroundColor = '#F9D3D3';
		}
		else
		{
			if(email.indexOf(at)==-1 || email.indexOf(at)==0 || email.indexOf(at)==email.length-1 || email.indexOf(dot)==-1 || email.indexOf(dot)==0 || email.indexOf(dot)>=email.length-2)
			{
				$('email').value = '<?=$this->lang->line('downloads_error_email_field')?>';
				$('email').style.backgroundColor = '#F9D3D3';
			}
			else
			{
				$('email').style.backgroundColor = 'white';
				emailok_itc= true;
			}
		}
		
		if(country.val()==-1)
		{
			country.css({ 'border': '1px red solid', 'background-color': '#F9D3D3' });
		}
		else
		{
			countryok = true;
		}
		
		if(firstnameok_itc==true && emailok_itc==true && countryok==true)
		{
			$('downloadForm_itc').submit();
		}
		else
		{
			$('message').innerHTML = '<?=$this->lang->line('downloads_error_div')?>';
		}
    }
</script>