/*----------------------------------------------------
1.jhover
----------------------------------------------------*/
$(document).ready(function(){
	$("img.jhover").fadeTo(0,1.0);
	$("img.jhover").hover(function(){
	        $(this).fadeTo(100,0.6);
	    },
	    function(){
	        $(this).fadeTo(100,1);
	    });
});

/*==================================================

2.link
==================================================*/
function clickLink( URL, target )
{
	if ( URL != "" )
	{
		if ( target == "_top" )
		{
			top.location.href = URL;
		}
		else if( target == "_blank" || target == "blank" )
		{
			window.open( URL, "" );
		}
		else
		{
			location.href = URL;
		}
	}
}

$(function()
{
	var _obj = $( ".clickableArea .clickable:has( a ), .clickable:has( a )" );
	
	_obj.css( 'cursor', 'pointer' );
	_obj.hover(
		function()
		{
			$( this ).addClass( "over" );
			$( this ).find( ".fadee img" ).each(function()
			{
				$( this )
					.stop()
					.fadeTo( 100, 0.6 );
			})
		},
		function()
		{
			$( this ).removeClass( "over" );
			$( this ).find( ".fadee img" ).each(function()
			{
				$( this )
					.stop()
					.fadeTo( 100, 1 );
			})
		}
	)
	.click( function( e )
	{
		// default cancel
		e.preventDefault();
		
		var _href = $( this ).find( "a" ).attr( "href" );
		var _target = $( this ).find( "a" ).attr( "target" );
		clickLink( _href, _target );
	})
});

/*----------------------------------------------------
3.slideToggle 
----------------------------------------------------*/
$(function(){
	$(".allview").click(function(){
      $(".slideBox").slideToggle("slow");
	});
});


/*----------------------------------------------------
3.pagetop 
----------------------------------------------------*/
$(function(){
  $("#toTop a").click(function(){
  $('html,body').animate({ scrollTop: $($(this).attr("href")).offset().top }, 'slow','swing');
  return false;
  })
});
