/* horizontalni menu IE6 fix */

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {

		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}

		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

/* hlavni menu IE6 fix */

sfHoverMain = function() {
	var sfEls = document.getElementById("menu-main").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {

		sfEls[i].onmouseover=function() {
			this.className+=" sfhovermain";
			this.className+=" sfhovermainsub";
		}

		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhovermain\\b"), "");
			this.className=this.className.replace(new RegExp(" sfhovermainsub\\b"), "");
		}
	}
}

/* own menu IE6 fix */

sfHoverOwn = function() {
	var sfEls = document.getElementById("menu-own").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {

		sfEls[i].onmouseover=function() {
			this.className+=" sfhoverown";
		}

		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhoverown\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);
if (window.attachEvent) window.attachEvent("onload", sfHoverMain);
if (window.attachEvent) window.attachEvent("onload", sfHoverOwn);

/* animace pridani do kosiku */
/*
(function($) {

	$.extend({
		add2cart: function(source_id, target_id, callback) {
    
      var source = $('#' + source_id );
      var target = $('#' + target_id );
      
      var shadow = $('#' + source_id + '_shadow');
      if( !shadow.attr('id') ) {
          $('body').prepend('<div id="'+source.attr('id')+'_shadow" style="display: none; background-color: green; border: solid 1px darkgray; position: static; top: 0px; z-index: 100000;">&nbsp;</div>');
          var shadow = $('#'+source.attr('id')+'_shadow');
      }
      
      if( !shadow ) {
          alert('Cannot create the shadow div');
      }
      
      shadow.width(source.css('width')).height(source.css('height')).css('top', source.offset().top).css('left', source.offset().left).css('opacity', 0.5).show();
      shadow.css('position', 'absolute');
      
      shadow.animate( { width: target.innerWidth(), height: target.innerHeight(), top: target.offset().top, left: target.offset().left }, { duration: 1500 } )
        .animate( { opacity: 0 }, { duration: 100, complete: callback } );
        
		}
	});
})(jQuery);
*/
