(function($js,$){
	var	LIMIT_IMAGE_SIZE=40,
			HEADER="#header",
			BANNER=".bnr_area",
			JS_AREA="#js_area",
			CAMEL=/\-([a-z])/g,
			PX=/(\d+)px/;
	
	$.getStyle=function(elem){
		this[0]=elem.currentStyle || document.defaultView.getComputedStyle(elem,"")
		return this;
	}
	$.getStyle.prototype={
		getPropertyValue : function(key){
			var te=key.replace(CAMEL,function(all,i){
				return i.toUpperCase()
			})
			return ("getPropertyValue" in this[0])?this[0].getPropertyValue(key) : this[0][te];
		},
		getStyle : function(key){
			var te=key.replace(CAMEL,function(all,i){
				return i.toUpperCase()
			})
			return this[0][te];
		}
	}
	$.fn.extend({
		getComputedStyle : function(){
			return  new $.getStyle(this[0])
		}
	})
	
	
	$(function(){
	
		window.actionCls=$js.anonymous({
			__init__ : function(){
				this.images=$("a img[src$=.jpg][class!=not_fade]").filter(function(idx){
					return this.src.indexOf("_off.")<0 &&
					$(this).parents(HEADER).size()<1 &&
					$(this).parents(BANNER).size()<1 &&
					$(this).parents(JS_AREA).size()<1 &&
					($(this).width()>LIMIT_IMAGE_SIZE || $(this).height()>LIMIT_IMAGE_SIZE)
				})
				$("a img").each(function(){
					this.parentNode.className+=" no_bg";
				})
			},
			addAction : function(){
				this.images.bind("mouseover",function(){
					var	that=$(this),
							style=that.getComputedStyle().getPropertyValue('border-top-width');
							
					if(style.length<1){
						that.fadeTo(400,0.5);
					}else{
						that.addClass("colored_border").css("borderWidth",style).fadeTo(400,0.5)
					}
				})
				this.images.bind("mouseleave",function(){
					var that=$(this),
							style=that.getComputedStyle().getPropertyValue('border-top-width');
					if(style.length<1){
						that.fadeTo(400,1)
					}else{
						that.removeClass("colored_border").fadeTo(400,1)
					}
				})
			}
		})()
	
	
		window.actionCls.addAction();
	})
	
}).call(window,frameWork,jQuery)



//mouseoverで画像をリサイズ

//$('a.img_b img')
//  .mouseover(function(){
//      $(this).stop().animate( {backgroundPosition:"(0 -250px)"}, {duration:500})
//  })
//  .mouseout(function(){
//      $(this).stop().animate( {backgroundPosition:"(0 0)"}, {duration:500})
//  })
//  
// 
// 
// 
// $(function() {
//  $(window).bind('load', function() {
//    alert($('#image').width());
//    alert($('#image').height());
//  });
//});
 
 
// $(function() {
//  $("a.img_b img").bind('mouseover', function() {
//	var wiAfter = $(this).width()-6 ;
//	var hiAfter = $(this).height()-6 ;
//		 $(this).width(wiAfter);
//		 $(this).height(hiAfter);
//  });
//  
//  $("a.img_b img").bind('mouseout', function() {
//	var wi = $(this).width()+6 ;
//	var hi = $(this).height()+6 ;
//		 $(this).width(wi);
//		 $(this).height(hi);
//		 
//  });
//});


