/**
 *	dotted line erased
 */
window.onload = function() {
	var aobj = document.getElementsByTagName("a");
	for (i=0; i < aobj.length; i++ ) {
		aobj[i].onfocus = function() {
			this.blur();
		}
	}
}

/**
 *	page scroll
 */
function getScroll(){
	var x, y;
	if(document.all !== void(0)){
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
	}else if(document.layers !== void(0) || (navigator.userAgent.indexOf("Opera") != -1 || window.opera !== void 0)){
		x = window.pageXOffset;
		y = window.pageYOffset;
	}else if(navigator.userAgent.indexOf("Gecko") != -1){
		x = window.scrollX;
		y = window.scrollY;
	}else{
		x = y = 0;
	}
	return {x: x, y: y};
}

var SCROLL;
var divCountScroller = 15;
function scroller(x, y, count){
	if(count === void(0)){
		count = 0;
		SCROLL = getScroll();
	}	
	if(count++ < divCountScroller){
		var c = count/divCountScroller;
		
		var nx = SCROLL.x+(x-SCROLL.x)*c;
		var ny = SCROLL.y+(y-SCROLL.y)*c;
		window.scrollTo(nx, ny);	
		setTimeout("scroller("+x+","+y+","+count+");", 5);
	}
}

/**
 *	globel menu
 */
$(function() {
	var num = 1;
	$('#gnav ul li')
	// mouseover
	.each(function(){
		$(this).css('background', 'url(http://pet99.net/shared/imgs/gmenu' + num + '.gif) no-repeat 0px -45px')
		num++;
	})
	.find('img').hover(
		function(){  
			$(this).stop().animate({'opacity' : '0'}, 500);  
		},
		function(){
			$(this).stop().animate({'opacity' : '1'}, 1000);
		}
	); 
});


/**
 *	link font color
 */
$(function() {
      $("a").jFade({trigger: 'mouseover',property: 'color',end: 'cc0033',duration: 60});
	  $("a").jFade({trigger: 'mouseout',property: 'color',end: '000000',duration: 60});
	  $("article a").jFade({trigger: 'mouseover',property: 'color',end: '3399ff',duration: 60});
	  $("article a").jFade({trigger: 'mouseout',property: 'color',end: '3399cc',duration: 60});
	  $("footer a").jFade({trigger: 'mouseover',property: 'color',end: 'ffff00',duration: 60});
	  $("footer a").jFade({trigger: 'mouseout',property: 'color',end: 'b4b4b4',duration: 60});
	  $(".worktable a").jFade({trigger: 'mouseover',property: 'color',end: 'b5b6b5',duration: 60});
	  $(".worktable a").jFade({trigger: 'mouseout',property: 'color',end: '343e63',duration: 60});
 });


