		function add_smiley(id) {
			document.getElementById('gb_text').value = document.getElementById('gb_text').value+' *'+id+'*';
		}
		
		var view = 0;
		
		function smileys() {
			if (view == 0){
				//zobrazi smajliky
				document.getElementById("smileys_container").style.display = "block";
				view = 1;
			}else{
				//skryje smajliky
				document.getElementById("smileys_container").style.display = "none";
				view = 0;
			}
		}
		
		function edited() {
			if (document.getElementById("gb_nadpis").value=='' || document.getElementById("gb_nadpis").value=='Nadpis1') {
				document.getElementById("gb_nadpis").value = 'Nadpis1';
				document.getElementById("gb_info").value = '';
			} else {
				document.getElementById("gb_info").value = 'Nadpis2';
			}
		}
		
		
		//	services menu
		
		function services_menu_toogle(id) {
			
			var name_ul = "ul_"+id;
			var name_li = "li_"+id;
			
			if (document.getElementById(name_ul).style.display == "none") {
				//zobrazi submenu
				document.getElementById(name_ul).style.display = "block";
				document.getElementById(name_li).className = "aktivni";
			} else {
				//skryje submenu
				document.getElementById(name_ul).style.display = "none";
				document.getElementById(name_li).className = null;
			}
			
			
		}
		
		
		
		/**
			Ajax Engine
		**/
		
		function ajax_not_supported() {
			alert ("Váš prohlížeč nepodporuje technologii AJAX. \n Your browser does not support AJAX technology.");
		}
		
		
		var xmlHttp;
		var xmlHttp_sec;
		var xmlHttp_third;
		var xmlHttp_fourth;
		
		function createXmlHttpObject() {
			var xmlHttp = null;
			
			try {
				// Firefox, Opera 8.0+, Safari
				xmlHttp = new XMLHttpRequest();
				
			} catch (e) {
				
				// Internet Explorer
				try {
					xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
				} catch (e) {
					xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
				}
				
			}
			
			return xmlHttp;
		}
		
		function state_changed(uni_xmlHttp,loader,block) {
			
			if (uni_xmlHttp.readyState > 0 && uni_xmlHttp.readyState < 4) {
				document.getElementById(block).style.display = 'none';
				document.getElementById(loader).style.display = 'block';
			}
			
			if (uni_xmlHttp.readyState==4 || uni_xmlHttp.readyState=="complete") {
				document.getElementById(block).innerHTML = uni_xmlHttp.responseText;
				document.getElementById(loader).style.display = 'none';
				document.getElementById(block).style.display = 'block';
			}
			
		}
		
		function getPlanner(timestamp,absolute_url) {
			
			xmlHttp = createXmlHttpObject();
			
			if (xmlHttp==null) {
				ajax_not_supported();
				return false;
			} 
			
			var url = absolute_url + 'ajax_planner.php?timestamp='+timestamp;
			//xmlHttp.onreadystatechange = planner_stateChanged;
			
			xmlHttp.onreadystatechange = function () {
				state_changed(xmlHttp,'planner_loader','calendar_table');
			}
			
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);
			return true;
			
		}
		
		function getPlan(id,absolute_url) {
			
			xmlHttp_fourth = createXmlHttpObject();
			
			if (xmlHttp_fourth==null) {
				ajax_not_supported();
				return false;
			} 
			
			if (id == 'today') {
				var url = absolute_url + 'ajax_plans.php';
			} else {
				var url = absolute_url + 'ajax_plans.php?plan_id='+id;
			}
			
			
			
			xmlHttp_fourth.onreadystatechange = function () {
				state_changed(xmlHttp_fourth,'plans_loader','plans');
			}
			
			xmlHttp_fourth.open("GET",url,true);
			xmlHttp_fourth.send(null);
			return true;
		}
		
		function getCart(action,id,count,absolute_url) {
			
			xmlHttp_sec = createXmlHttpObject();
			
			if (xmlHttp_sec==null) {
				ajax_not_supported();
				return false;
			}
			
			send = true;
			
			if (action=='show') {
				var url = absolute_url + 'ajax_cart.php';
			} else {
				
				if (document.title=='Solid Team s.r.o. Objednávka') {
					send = false;
					alert('Pro smazání položky z košiku opusťe objednávkový formulář.');
				}
				
				var url = absolute_url + 'ajax_cart.php?action='+action+'&id='+id+'&count='+count;
			}
			
			xmlHttp_sec.onreadystatechange = function () {
				state_changed(xmlHttp_sec,'cart_loader','cart');
			}
			
			if (send){
				xmlHttp_sec.open("GET",url,true);
				xmlHttp_sec.send(null);
				return true;
			}
		}
		
		
		function cookie_test(absolute_url) {
			
			xmlHttp_third = createXmlHttpObject();
			
			if (xmlHttp_third==null) {
				ajax_not_supported();
				return false;
			} 
			
			var url = absolute_url + 'ajax_cookie_test.php?test=1';
			
			xmlHttp_third.onreadystatechange = function () {
				if (xmlHttp_third.readyState==4 || xmlHttp_third.readyState=="complete") {
					if (xmlHttp_third.responseText=='not_working') {
						alert('Váš prohlížeč nepodporuje soubory cookies. \nPro pohodlné prohlížení si je aktivujte.');
					}
				}
			}
			
			xmlHttp_third.open("GET",url,true);
			xmlHttp_third.send(null);
			return true;
			
		}
		
		function load(timestamp,absolute_url) {
			
			getPlanner(timestamp,absolute_url);
			getCart('show',0,0,absolute_url);
			getPlan('today',absolute_url);
			cookie_test(absolute_url);
			
		}
		

