/*
function killErrors() { 
	return true; 
} 
window.onerror = killErrors; 
*/
/* 滑鼠指向效果 -START-- ***************************/
// Preloading Images

// Left Menu
if (document.images) {

	img1_on =new Image(); img1_on.src ="gklpic/left_menu/mabout_c.jpg"; 
	img1_off=new Image(); img1_off.src="gklpic/left_menu/mabout.jpg"; 

	img2_on =new Image(); img2_on.src ="gklpic/left_menu/mshopkeeper_c.jpg"; 
	img2_off=new Image(); img2_off.src="gklpic/left_menu/mshopkeeper.jpg"; 

	img3_on =new Image(); img3_on.src ="gklpic/left_menu/mdog_c.jpg"; 
	img3_off=new Image(); img3_off.src="gklpic/left_menu/mdog.jpg"; 

	img4_on =new Image(); img4_on.src ="gklpic/left_menu/mpuppy_c.jpg"; 
	img4_off=new Image(); img4_off.src="gklpic/left_menu/mpuppy.jpg"; 

	img5_on =new Image(); img5_on.src ="gklpic/left_menu/malbum_c.jpg"; 
	img5_off=new Image(); img5_off.src="gklpic/left_menu/malbum.jpg"; 

	img6_on =new Image(); img6_on.src ="gklpic/left_menu/mnews_c.jpg"; 
	img6_off=new Image(); img6_off.src="gklpic/left_menu/mnews.jpg"; 

	img7_on =new Image(); img7_on.src ="gklpic/left_menu/mhotel_c.jpg"; 
	img7_off=new Image(); img7_off.src="gklpic/left_menu/mhotel.jpg";

	img8_on =new Image(); img8_on.src ="gklpic/left_menu/mdogbeauty_c.jpg"; 
	img8_off=new Image(); img8_off.src="gklpic/left_menu/mdogbeauty.jpg";

	img9_on =new Image(); img9_on.src ="gklpic/left_menu/mbeautytutor_c.jpg"; 
	img9_off=new Image(); img9_off.src="gklpic/left_menu/mbeautytutor.jpg";

	img10_on =new Image(); img10_on.src ="gklpic/left_menu/mboard_c.jpg"; 
	img10_off=new Image(); img10_off.src="gklpic/left_menu/mboard.jpg";

	img11_on =new Image(); img11_on.src ="gklpic/left_menu/mcontact_c.jpg"; 
	img11_off=new Image(); img11_off.src="gklpic/left_menu/mcontact.jpg";

	img12_on =new Image(); img12_on.src ="gklpic/left_menu/mdiary_c.jpg"; 
	img12_off=new Image(); img12_off.src="gklpic/left_menu/mdiary.jpg";

}


// Album
if (document.images) {
	img100_on =new Image(); img100_on.src ="gklpic/gklalbum/gklalbum_49_p01b.jpg"; 
	img100_off=new Image(); img100_off.src="gklpic/gklalbum/gklalbum_49_p01d.jpg"; 

	img101_on =new Image(); img101_on.src ="gklpic/gklalbum/gklalbum_49_p02b.jpg"; 
	img101_off=new Image(); img101_off.src="gklpic/gklalbum/gklalbum_49_p02d.jpg"; 

	img102_on =new Image(); img102_on.src ="gklpic/gklalbum/gklalbum_49_p03b.jpg"; 
	img102_off=new Image(); img102_off.src="gklpic/gklalbum/gklalbum_49_p03d.jpg"; 

}

// -----
function movr(k) {
	if (document.images) 
		eval('document.img'+k+'.src=img'+k+'_on.src');
}

function mout(k, src) {
	if (document.images) 
		eval('document.img'+k+'.src=img'+k+'_off.src');
}

/* 滑鼠指向效果 -END-- ***************************/



/* 濾鏡特效 -START-- ***************************/
var Opacity = 100;
var Timer;
var counter = 0;
function FadeOutImage(isrc) {
		clearInterval(Timer);
		psrc = isrc;
		Timer = setInterval("FadeChange(psrc)", 80);
}


function FadeChange(isrc) {
	if (Opacity == 100) {
		Opacity = 70;
	} else {
		Opacity =100;
	}
	psrc = isrc;
	document.getElementById(psrc).style.filter =
			"alpha(style=0,opacity=" + Opacity + ")";
	counter +=1 ;

	if (counter >= 7){
		FadeBackImage(psrc);
	}

}
function FadeBackImage(isrc) {
	clearInterval(Timer);
	psrc = isrc;
	document.getElementById(psrc).style.filter = "alpha(style=0,opacity=100)";
	counter = 0;
}
/* 濾鏡特效 -END-- ***************************/




/* 鼠標 Mouse trail  -START-- ***************************/
/*********************************************
   Flying through stars script
   Written by Mark Wilton-Jones, 14/6/2002
   re-written 19-20/9/2002 to use proper formulae
 **********************************************

Please see http://www.howtocreate.co.uk/jslibs/ for details and a demo of this script
Please see http://www.howtocreate.co.uk/jslibs/termsOfUse.html for terms of use
*/
var xcoord = -1000, ycoord = -1000, trailSpeed, xcoordOff, ycoordOff, trailoffsetsx, trailoffsetsy, trlElast, setUpIntr, trlSpeedX = [], trlSpeedY = [];
function setUpInit() {
	if( !getRefToDivNest('msTrlDiv'+(numTrails-1)) ) { return; }
	window.clearInterval(setUpIntr); var oPix = document.childNodes ? 'px' : 0;
	for( var x = 0; x < numTrails; x++ ) {
		var divRef = getRefToDivNest('msTrlDiv'+x);
		if( divRef.style ) { divRef = divRef.style; }
		divRef.top = ( -1000 ) + oPix; //start them out of sight
		divRef.left = ( -1000 ) + oPix;
	}
	setUpIntr = window.setInterval('mvTrDivs();',trailSpeed);
}
function mvTrDivs() {
	var oPix = document.childNodes ? 'px' : 0;
	if( trailFix ) { //fixed speed
		trlSpeedX[0] = xcoord; trlSpeedY[0] = ycoord;
		for( var x = numTrails - 1; x >= 0; x-- ) {
			var divRef = getRefToDivNest('msTrlDiv'+x); if( divRef.style ) { divRef = divRef.style; }
			//each one assumes the position that the last one was at at the last interval (plus offsets)
			divRef.top = trlSpeedY[x] + oPix; divRef.left = trlSpeedX[x] + oPix;
			trlSpeedY[x+1] = parseInt( divRef.top ) + trailoffsetsy;
			trlSpeedX[x+1] = parseInt( divRef.left ) + trailoffsetsx;
		}
	} else { //variable speed
		var lastx = xcoord, lasty = ycoord;
		for( var x = 0; x < numTrails; x++ ) {
			var divRef = getRefToDivNest('msTrlDiv'+x); if( divRef.style ) { divRef = divRef.style; }
			//these two complicated lines move each trail one xth of the way towards the one before it
			//all of that floor, ceil and > 0 stuff ensures that they end up exactly on top of each other
			//the ( trlSpeedY[x] * trlElast ) bit adds on any elasticity
			trlSpeedY[x] = ( trlSpeedY[x] * trlElast ) + ( ( lasty - parseInt( divRef.top ) > 0 ) ? Math.ceil( ( lasty - parseInt( divRef.top ) ) / ( x + 1 ) ) : Math.floor( ( lasty - parseInt( divRef.top ) ) / ( x + 1 ) ) );
			trlSpeedX[x] = ( trlSpeedX[x] * trlElast ) + ( ( lastx - parseInt( divRef.left ) > 0 ) ? Math.ceil( ( lastx - parseInt( divRef.left ) ) / ( x + 1 ) ) : Math.floor( ( lastx - parseInt( divRef.left ) ) / ( x + 1 ) ) );
			divRef.top = ( parseInt( divRef.top ) + trlSpeedY[x] ) + oPix;
			divRef.left = ( parseInt( divRef.left ) + trlSpeedX[x] ) + oPix;
			lastx = parseInt( divRef.left ) + trailoffsetsx; lasty = parseInt( divRef.top ) + trailoffsetsy;
		}
	}
}
function getRefToDivNest( divID, oDoc ) {
	if( !oDoc ) { oDoc = document; }
	if( document.layers ) {
		if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
			for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
				y = getRefToDivNest(divID,oDoc.layers[x].document); }
			return y; } }
	if( document.getElementById ) { return document.getElementById(divID); }
	if( document.all ) { return document.all[divID]; }
	return document[divID];
}
function msIsMv(e) { if( !e ) { e = window.event; } if( !e || ( typeof( e.pageX ) != 'number' && typeof( e.clientX ) != 'number' ) ) { return; }
	if( typeof( e.pageX ) == 'number' ) { xcoord = e.pageX; ycoord = e.pageY; } else {
		xcoord = e.clientX; ycoord = e.clientY;
		if( !( ( window.navigator.userAgent.indexOf( 'Opera' ) + 1 ) || ( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) || window.navigator.vendor == 'KDE' ) ) {
			if( document.documentElement && ( document.documentElement.scrollTop || document.documentElement.scrollLeft ) ) {
				xcoord += document.documentElement.scrollLeft; ycoord += document.documentElement.scrollTop;
			} else if( document.body && ( document.body.scrollTop || document.body.scrollLeft ) ) {
				xcoord += document.body.scrollLeft; ycoord += document.body.scrollTop;
			} } } xcoord += xcoordOff; ycoord += ycoordOff;
}
function createMouseTrail(numT,spdT,conT,msOfX,msOfY,tOffX,tOffY,elAs,isFix,trSty) {
	trailSpeed = spdT; xcoordOff = msOfX; ycoordOff = msOfY; trailoffsetsx = tOffX; trailoffsetsy = tOffY; trlElast = elAs; trailFix = isFix;
	//NS4 does not like inline styles in dynamic layers, so I use invalid style (not in head)
	if( document.layers && navigator.mimeTypes['*'] ) {
		document.write('<style type="text/css"><!--\n.trailStyle { '+trSty+' }\n--></style>'); trSty = 'class="trailStyle"';
	} else { trSty = 'style="position:absolute;left:0px;top:0px;'+trSty+'"'; }
	if( numT < 1 ) { numTrails = conT.length; window.isNoLen = conT; } else { numTrails = numT; }
	for( var x = 0; x < numTrails; x++ ) {
		trlSpeedX[x] = 0; trlSpeedY[x] = 0;
		if( window.isNoLen ) { if( typeof( window.isNoLen ) != 'string' ) { conT = window.isNoLen[x]; } else { conT = window.isNoLen.charAt( x ); } } //split layers
		if( document.layers ) { //releave NS4 bug
			document.write('<layer id="msTrlDiv'+x+'" left="0" top="0" '+trSty+'>'+conT+'</layer>');
		} else {
			document.write('<div '+trSty+' id="msTrlDiv'+x+'">'+conT+'</div>');
		}
	}
	if(document.captureEvents) { if(Event.MOUSEMOVE) { document.captureEvents(Event.MOUSEMOVE); } }
	document.onmousemove = msIsMv;
	setUpIntr = window.setInterval('setUpInit();',100);
}

//for one trail for each string given in an array (where number of trails == 0)
trailContents = ['<img src="./gklpic/dogcursor.gif" height="70" width="90" alt="">'];

createMouseTrail(
	1, //number of trails (0 will make one trail for each letter or array entry) try not to make
	   //more than about 7-8 trails unless using fixed speed where upto thirty can be used
	75, //speed of trails - 50-75 is about right - higher numbers are slower. You may want to use 25 for fixed speed
	trailContents, //contents of each trail or contents to be spread across trails
	30, //x offset from mouse
	-20, //y offset from mouse
	0, //x offset between trails
	0, //y offset between trails
	0, //elasticity (0 is none, 0.6 is about max - after that they start to jitter)
	true, //fixed speed - elasticity will be ignored - all trails will move as fast as each other
	'font-weight: bold;' //stylesheet for trails
);
/* 鼠標 Mouse trail  -END-- ***************************/





