
(function($){

	$(document).ready(function(){

		/* setup orllover */
		$('img.over, input.over').rollover();

		/* setup online shop nav. */
		$('#gnav li.online_shop')
			.find('div.brands')
				.hide()
				/* observe siblings hover status. */
				.hover(
					function(){
						$(this).siblings().trigger('mouseover');
					},
					function(){
						$(this).siblings().trigger('mouseout');
					}
				)
			.end()
			/* set sliding menu */
			.hover(
				function(){
					$('div.brands', this).stop(false, true).slideDown('fast');
				},
				function(){
					$('div.brands', this).stop(false, true).slideUp('fast');
				}
			)
		;

		// open link as '_blank'.
		$('a[rel=external]').click(function(){					
			window.open(this.href, '_blank');
			return false;
		});

		// open popup window.
		$('a[rel=popup]').click(function(){					
			var popup = window.open(this.href, 'repairPopup', 'location=yes,scrollbars=yes,resizable=yes,width=750,height=750');
			popup.focus();
			return false;
		});

		/* setup brand concept nav */
		$('#aside_brands h3 > a').colorbox({
			iframe: true,
			innerWidth: 810,
			innerHeight: 550,
			initialHeight: 300,
			maxWidth: screen.availWidth,
			maxHeight: screen.availHeight,
			opacity: 0.8
		});

	});

})(jQuery);

/*
 * jQuery tiny rollover plugin.
 *
 * @param {Object} Several options.
 * @return {Object} jQuery object.
 */
(function(a){a.fn.rollover=function(b){var d={suffix:"_on"};b=a.extend(d,b);var e="$1"+b.suffix+"$2";return a(this).each(function(){var c=new Image;c.src=this.src.replace(/^(.+)(\.[a-z]+)$/,e);a(this).data("rolloverImage",{defaultImage:this.src,hoverImage:c.src}).mouseover(function(){this.src=a(this).data("rolloverImage").hoverImage}).mouseout(function(){this.src=a(this).data("rolloverImage").defaultImage})})}})(jQuery);
