
		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.highpoint.sk/print.php?id=" + idecko;
			}
			else
			{
				file = "http://www.highpoint.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) {}

		var toggleContent = function(e)
		{
			var targetContent = $('ul', this.parentNode);
			if (targetContent.css('display') == 'none')
			{
				targetContent.slideDown(300);
			}
			else
			{
				targetContent.slideUp(300);
			}
			return false;
		};

		$(document).ready(
			function ()
			{
				$.ImageBox.init(
					{
						loaderSRC: 'http://www.highpoint.sk/styles/Default_Style/design/loadingAnimation.gif',
						closeHTML: 'zatvoriť (ESC)'
					}
				);

								$('ul#gallery').innerfade({
								speed: 900,
								timeout: 3000,
								type: 'sequence',
								containerheight: '160px'
				});
				
				$('#naviSide > li.menuparent > a').bind('click', toggleContent);


				// floating windows
				$('a.windowOpen').click(
						function(e)
						{
							var thisRel = $(this).attr('rel');
							var currentWindow = 'div.floatingWindow[@id=' + thisRel + ']';
							if($(currentWindow).css('display') == 'none')
							{
								$(currentWindow).css('left', 0);
								$(currentWindow).css('top', 0);
								if((e.pageX + $(currentWindow).width()) > $(window).width())
								{
									_left = ($(window).width() - $(currentWindow).width() - 20);
								}
								else if((e.pageX - ($(currentWindow).width() / 2)) < 0)
								{
									_left = 20;
								}
								else
								{
									_left = (e.pageX - ($(currentWindow).width() / 2));
								}
								_top = e.pageY - ($(currentWindow).height() / 2);
								$(currentWindow).css('left', _left);
								$(currentWindow).css('top', _top);
								$(currentWindow).show(500);
							}
						return false;
						}
					);
					$('img.floatingWindowClose').click(
						function()
						{
							var currentWindow = $(this.parentNode.parentNode);
							$(currentWindow).fadeOut(400);
						}
					);
					$('div.floatingWindow').Draggable(
							function()
							{
								handle: $(this.parentNode);
							}
						);
			}
		);

		window.defaultStatus="HIGH POINT - outdoorové športové oblečenie";
