// Copyright (C) 2008-2009 Forest Corporation. All rights reserved.

var TopWinObj = null ;
var browse_url = null ;

function SetParentInfo() {
	TopWinObj.SetParentInfo(browse_url) ;
}

function LoadedSubWin() {
	browse_url = window.location.href ;
	TopWinObj.SetParentInfo(browse_url) ;
}

function OpenWebComWindowJump(shift) {
	//
	// 以下の条件でWebComを表示するサブウィンドウ画面を表示します
	//
	// channelmode=0 チャネルモードで開く。
	// dependant=1   IEでは無効（親ウィンドウが閉じた時に子ウィンドウも閉じる。）
	// fullscreen=0  フルスクリーンモードで開かない。
	// resizable=no  リサイズ不可能
	// toolbar=0     ツールバーなし
	// status=0      ステータスバーなし
	// scrollbars=no スクロールバーなし
	// location=0    場所ツールバーなし
	// menubar=0     メニューバーなし
	// directories=0 ユーザ設定ツールバーなし
	//
	var date = new Date() ;
	var no = Math.floor( Math.random() * 10000 );
	var url   = '../WebComTemplate/WebCom/webcom_jump_button.html?' + no ;
	for(var i=0 ; i < shift ; i++) url = "../" + url ;
	var name  = 'WebCom' + date.getHours() + date.getMinutes() + date.getSeconds() + date.getMilliseconds() ;
	var size  = 'width=326, height=198' ;
	var style = size + ', channelmode=0, dependant=1, fullscreen=0, resizable=yes, toolbar=0, status=0, scrollbars=no, location=0, menubar=0, directories=0' ;

	try {
		if ( TopWinObj == null ) {
			TopWinObj = window.open(url, name, style) ;
			browse_url = window.location.href ;
			WebComViewerObject("viewer_frame").openedWebComViewerJump();
		} else {
		}
	} catch(e) {
	}
}

function WebComViewerObject(viewerName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return WebComViewer.window[viewerName] ;
	} else {
		return WebComViewer.document[viewerName] ;
	}
}

