
		function setSmile(add,where)
		{
			/*document.getElementById(where).value = document.getElementById(where).value + (' '+add+' ');*/
			add = '<img src="' + add + '" alt="smile" />';
			inst = tinyMCE.getInstanceById(where);
			inst.execCommand('mceInsertContent',false, add);
			inst.execCommand('mceInsertContent',false, '&nbsp;');
		}
		function openpicture(file,width,height)
		{
			var param = "width="+width+",height="+height+",statusbar=0,menubar=0";
			newwin = window.open(file,"preview",param);
			newwin.moveTo(screen.width/2-width/2,200);
			return false;
		}
		function openprint(idecko, formPrint, formUserId)
		{
			var screenW = 640;
			if (parseInt(navigator.appVersion)>3) {
			 screenW = screen.width;
			}
			else if (navigator.appName == "Netscape"
			    && parseInt(navigator.appVersion)==3
			    && navigator.javaEnabled()
			   )
			{
			 var jToolkit = java.awt.Toolkit.getDefaultToolkit();
			 var jScreenSize = jToolkit.getScreenSize();
			 screenW = jScreenSize.width;
			}


			var param = "width=700,height=700,statusbar=0,menubar=0,scrollbars=1";
			var file = "";
			if(formPrint != 1)
			{
				file = "http://www.chatakinex.sk/print.php?id=" + idecko;
			}
			else
			{
				file = "http://www.chatakinex.sk/print.php?id=" + idecko + "&formPrint=1&formUserId=" + formUserId;
			}
			newwin = window.open(file,"print",param);
			newwin.moveTo(screenW.width/2-screenW/2,200);
			return false;
		}
		function uncheckAllRadios(whichForm, otazkaId)
		{

			var otazka = 'radio_answer_' + otazkaId;
			radios = document.getElementsByName(otazka);
			for (var i = 0; i < radios.length; i++)
			{
  				radios[i].checked = false;
  			}
		}
		try {
			document.execCommand("BackgroundImageCache", false, true);
		} catch(err) {}


		$(document).ready(
			function ()
			{
				$.ImageBox.init(
					{
						loaderSRC: 'http://www.chatakinex.sk/styles/Default_Style/design/loadingAnimation.gif',
						closeHTML: 'zatvoriť (ESC)'
					}
				);

				// floating windows
				$('#windowOpen').bind(
						'click',
						function()
						{
							if($('#window').css('display') == 'none')
							{
								$('#window').show(500);
							}
						return false;
						}
					);
					$('#windowClose').bind(
						'click',
						function()
						{
							$('#window').fadeOut(400);
						}
					);
					$('#window').Draggable(
							{
								handle: '#windowTop'
							}
						);
			}
		);

		window.defaultStatus="chatakinex.sk";
