$( document ).ready ( function ()
	{
		$( "#navbar li" ).hover ( function ()
			{
				$( this ).css ( "background-color", "#D0C6C3" );
			}, function () {
				$( this ).css ( "background-color", "#FFF" );
			}
		);	
	
		$( "#navbar li" ).click ( function ()
			{
				id = $( this ).attr ( "id" );
				if ( id.indexOf ( ":" ) !== -1 ) {
					url = 'chapter.php?pg=' + id.substr ( 1 );
				} else if ( id == "buy" ) {
					url = 'http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2FKnife-Skills-Illustrated-Users-Manual%2Fdp%2F0393061787%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1173856464%26sr%3D8-2&tag=knifskilillu-20&linkCode=ur2&camp=1789&creative=9325';
				} else {
					url = 'index.php?pg=' + id;
				}
				location.replace ( url );
				return false;
			}
		);
	}
);

function _showAudio ( name ) {
	nWide = 280;
	xPosition = ( screen.width - nWide ) / 2 - 10;
	if ( screen.width <= ( nWide + 20 )) {
		nWide = screen.width - 40;
		xPosition = 0;
	}
	nHigh = 56;
	yPosition = ( screen.height - nHigh ) / 2 - 10;
	if ( screen.height <= ( nHigh + 20 )) {
		nHigh = screen.height - 40;
		yPosition = 0;
	}

	args = "width=" + nWide + "," 
	+ "height=" + nHigh + "," 
	+ "location=no," 
	+ "menubar=no,"
	+ "resizable=yes,"
	+ "scrollbars=yes,"
	+ "status=mo," 
	+ "titlebar=no,"
	+ "toolbar=no,"
	+ "hotkeys=no,"
	+ "screenx=" + xPosition + ","  //NN Only
	+ "screeny=" + yPosition + ","  //NN Only
	+ "left=" + xPosition + ","     //IE Only
	+ "top=" + yPosition;           //IE Only
	
	url = "audio.php?" + name;
	movieWindow = window.open( url, 'audio', args );
	movieWindow.focus();
}

function _showVideo ( name ) {
	nWide = 360;
	xPosition = ( screen.width - nWide ) / 2 - 10;
	if ( screen.width <= ( nWide + 20 )) {
		nWide = screen.width - 40;
		xPosition = 0;
	}
	nHigh = 350;
	yPosition = ( screen.height - nHigh ) / 2 - 10;
	if ( screen.height <= ( nHigh + 20 )) {
		nHigh = screen.height - 40;
		yPosition = 0;
	}

	args = "width=" + nWide + "," 
	+ "height=" + nHigh + "," 
	+ "location=no," 
	+ "menubar=no,"
	+ "resizable=yes,"
	+ "scrollbars=yes,"
	+ "status=mo," 
	+ "titlebar=no,"
	+ "toolbar=no,"
	+ "hotkeys=no,"
	+ "screenx=" + xPosition + ","  //NN Only
	+ "screeny=" + yPosition + ","  //NN Only
	+ "left=" + xPosition + ","     //IE Only
	+ "top=" + yPosition;           //IE Only
	
	url = "video.php?" + name;
	movieWindow = window.open( url, 'audio', args );
	movieWindow.focus();
}

function _showBlog ( name ) {
	url = "http://" + name;
	movieWindow = window.open( url, 'audio' );
	movieWindow.focus();
}
