try{document.execCommand("BackgroundImageCache",false,true);}catch(e){};

$(function(){

	$('img.over').each(function(){
		var src = $(this).attr('src');
		if(src.indexOf('_off.')!=-1){
			var oversrc = src.replace('_off.','_on.');
			var $preloadimg = $('<img />').attr('src',oversrc);
	 		$(this).hover(
				function(){ $(this).attr('src',oversrc);},
				function(){ $(this).attr('src',src);}
			);
		}
	});

	$('a.pagetop, a.scroll').click(function(){
		$.scrollTo( $(this).attr('href'),800,{ axis:'y',easing:'easeOutExpo'});
		return false;
	});

});

$.fn.extend({

	'globalNav':function(){
		var $nav = $(this).find('a');
		var url = location.href.toLowerCase().split('/');
		url.shift();url.shift();url.shift();
		if(url[0].indexOf('index')==-1 && url[0].length>0){
			$nav.each(function(){
				var href = $(this).attr('href');
				if( href.indexOf(url[0])!=-1 ){
					$(this).css('cursor','default').find('img').attr('src', function(){return this.src.replace('_off.','_on.')});
				}
			});
		}
	}
,
	'productsList':function(){
		$(this).each(function(){
			$(this).find('div.product tr:even').css('backgroundColor','#f4f4f4');

			var $imgbox = $(this).find('div.image');
			if( $imgbox.find('ul.clearfix').length>0 ){
				var $Image = $imgbox.find('img:eq(0)')
				var imgBase = $Image.attr('src').replace(/\d\d\.(\w\w\w)/,'');
				var imgExtension = RegExp.$1;

				$imgbox.find('ul.clearfix img').each(function(){
					$(this).attr('src').match(/(\d\d)\.\w\w\w/);
					var clickImg = imgBase + RegExp.$1 + '.' + imgExtension;
					var $preloadimg = $('<img />').attr('src',clickImg);
					$(this).click(function(){
						$Image.attr('src', clickImg);
					});
				});
			}
		});
	}
,
	'faqSlide':function(){
		$(this).each(function(){
			$(this).find('dd').hide().end().find('strong').hover(
				function(){ $(this).css('color','#0c4d9c').css('textDecoration','underline');},
				function(){ $(this).css('color','#000000').css('textDecoration','none');}
			).click(function () {
				$(this).closest('dt').siblings('dd').slideToggle('fast');
			});
		});
	}
});










