// JavaScript Document

	UTF8 = {
	encode: function(s){
		for(var c, i = -1, l = (s = s.split("")).length, o = String.fromCharCode; ++i < l;
			s[i] = (c = s[i].charCodeAt(0)) >= 127 ? o(0xc0 | (c >>> 6)) + o(0x80 | (c & 0x3f)) : s[i]
		);
		return s.join("");
	},
	decode: function(s){
		for(var a, b, i = -1, l = (s = s.split("")).length, o = String.fromCharCode, c = "charCodeAt"; ++i < l;
			((a = s[i][c](0)) & 0x80) &&
			(s[i] = (a & 0xfc) == 0xc0 && ((b = s[i + 1][c](0)) & 0xc0) == 0x80 ?
			o(((a & 0x03) << 6) + (b & 0x3f)) : o(128), s[++i] = "")
		);
		return s.join("");
	}
	};
	
	var bg_sections = Array('home','news','photo','text','bio','video','down','contact','msg');

	var cz_sections = Array('domu','aktuality','fotky','texty','bio','video','stahnout','kontakt','vzkazy');
	
	var cz_sections_complete = Array('česká verze','aktuality','fotky','texty','bio','video','stáhnout','kontakt','vzkazy');
	
	var en_sections = Array('home','news','photos','lyrics','bio-en','video-en','downloads','contact','messages');
	
	var en_sections_complete = Array('english version','news','photos','lyrics','bio','video','downloads','contact me','messages');
	
	var url_base = 'http://new.martinkraussl.com';
	
	var lang = '';
			
	function visible(id) {
		document.getElementById(id).style.visibility='visible';	
	}
				
	function hidden(id){
		document.getElementById(id).style.visibility='hidden';			
	}
	
	
	function show(id)
		{
		document.getElementById(id).style.display='block';	
		}
		
	function hide(id)
		{
		document.getElementById(id).style.display='none';			
		}
		
	function show_hide(id)
		{			
		if (document.getElementById(id).style.display == 'block')
			{
			document.getElementById(id).style.display='none';	
			}
		else
			{
			document.getElementById(id).style.display ='block';	
			}
		}	
			
	function check_form_contact()
	 	{
		var error = new Array;	
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;  
		
		if (document.getElementById('name').value == '')
			{
			error.push(' \n\t - zadejte jméno');
			}
			
		if(reg.test(document.getElementById('email').value) == false)	
			{
			error.push(' \n\t - zadejte e-mail');
			}	
						
		if (document.getElementById('phone').value == '')
			{
			error.push(' \n\t - zadejte telefon');
			}
			
		if (document.getElementById('subject').value == '')
			{
			error.push(' \n\t - zadejte předmět');
			}
			
		if (document.getElementById('text').value == '')
			{
			error.push(' \n\t - zadejte text');
			}	
			
		if (document.getElementById('spam').value == '')
			{
			error.push(' \n\t - zadejte spamovou kontrolu');
			}			

		if (error.length != 0)
			{
			alert('Prosím, opravte následující chyby: \n' + error);		
			return false;
			}
		else
			{
			return true;
			}	
		}	
