/* ボッシュ・イン・ジャパン */

jQuery( function( $ ) {
	// display ESC link in mainMenu as child of OE link
	moveMenuItems( { parent: '/jp/press/?mode=oe' , items: [ '/jp/press/?mode=esc' ] } );
	
	function moveMenuItems( param ) {
		// move menu items to be held in their parent item
		var parent = $( 'dl#mainMenu > dd:has( a[href=' + param.parent + '] )' );
		parent.append( '<dl class="movedItems"></dl>' );
		var holder = parent.find( '> dl.movedItems' );
		for ( var i = 0; i < param.items.length; i++ ) {
			var item = $( 'dl#mainMenu > dd:has( a[href=' + param.items[ i ] + '] )' );
			item.appendTo( holder );  // move item to the inner end of holder
		}
	}
} );


function openReleasePhotoSubWin ( image, width, height ) {
	// this function is used only for some of the old 2005 releases
	var window_width  = width  + 50;
	var window_height = height + 40;
	var features = "width=" + window_width + ", height=" + window_height + ", menubar=no, location=no, resizable=yes, scrollbars=yes";
	var subWin = window.open( image, "releasePhotoSubWin", features );
	subWin.document.open();
	subWin.document.write( "<html>" );
	subWin.document.write( "<head><title>Release Photo: " + image + "</title></head>" );
	subWin.document.write( "<body marginheight='0' marginwidth='0' topmargin='0' leftmargin='0' bgcolor='#ffffff'>" );
	subWin.document.write( "<table width='100%' height='100%' cellpadding='0' cellspacing='0'>" );
	subWin.document.write( "<tr>" );
	subWin.document.write( "<td align='center' valign='middle'>" );
	subWin.document.write( "<a href='javascript:self.close()'>" );
	subWin.document.write( "<img src='./images/" + image + "' width='" + width + "' height='" + height + "' border='0' alt='[Photo]'>" );
	subWin.document.write( "</a>" );
	subWin.document.write( "</td>" );
	subWin.document.write( "</tr>" );
	subWin.document.write( "</table>" );
	subWin.document.write( "</body>" );
	subWin.document.write( "<html>" );
	subWin.document.close();
	subWin.focus();
	subWin.opener = self;
	subWin.resizeTo( window_width, window_height + 40 );
}

