//MOVE TEXT-----------------------------------------------------

(function($) {
		$(document).ready(function() {
			$('.move').hover(function() { 
				$(this).animate({ paddingLeft: '10px' },200);
			}, function() { 
				$(this).animate({ paddingLeft: 0 }, 100);
			});
		});
})(jQuery);


//PAGE TOP------------------------------------------------------

function PAGETOP() {
	var aTagList = document.getElementsByTagName('a');
	for (var i = 0; i < aTagList.length; i++) {
		if (aTagList[i].href.match(/#PAGETOP/i)) {
			aTagList[i].onclick = goPageTop;
		}
	}
}
var MOVE = 20;
var POSITION;
function goPageTop() {
	var yPos = document.body.scrollTop || document.documentElement.scrollTop;
	mObj(yPos);
	return false;
}
function mObj(y, s) {
	if (s) MOVE = s;
	POSITION = parseInt(y - y * 2 / MOVE);
	scrollTo(0, POSITION);
	if (POSITION > 0) setTimeout('mObj(POSITION, MOVE)', 1);
}
if (window.addEventListener) window.addEventListener('load', PAGETOP, false);
if (window.attachEvent) window.attachEvent('onload', PAGETOP);


//CHANGE&FADE IMAGES----------------------------------------------

jQuery.fn.menu =

function( a, b ) {
		$(this).mouseover(function() {
			cur = $(this).fadeTo(1 , 0.5).attr('src');

			if( cur == a ) {
				$(this).attr('src', b);
			} else if( cur == b ) {
				$(this).attr('src', a);
			}
		});

		$(this).mouseout(function() {
			cur = $(this).fadeTo(700 , 1).attr('src');
		
			if( cur == a ) {
				$(this).attr('src', b);
			} else if( cur == b ) {
				$(this).attr('src', a);
			}
		});
	}

$(document).ready(function() {
		$('#top').menu('img/menu/top_a.jpg','img/menu/top_b.jpg')
		$('#info').menu('img/menu/info_a.jpg','img/menu/info_b.jpg')
		$('#works').menu('img/menu/works_a.jpg','img/menu/works_b.jpg')
		$('#gallery').menu('img/menu/gallery_a.jpg','img/menu/gallery_b.jpg')
		$('#store').menu('img/menu/store_a.jpg','img/menu/store_b.jpg')
		$('#blog').menu('img/menu/blog_a.jpg','img/menu/blog_b.jpg')
		$('#mail').menu('img/menu/mail_a.jpg','img/menu/mail_b.jpg')
		$('#profile').menu('img/menu/profile_a.jpg','img/menu/profile_b.jpg')
		$('#link').menu('img/menu/link_a.jpg','img/menu/link_b.jpg')
	}); 


