/***************************************************************

				新しいウィンドウで開く（2002/09/09）
										written by sleepy

***************************************************************/

	var obj, document, id;

	var bActive = false;//開いたウィンドウをアクティブにしたい場合は false を true に変更

	obj = new ActiveXObject("Sleipnir.API");
	id = obj.GetDocumentID(obj.ActiveIndex);
	document = obj.GetDocumentObject(id);

	if (document != null){
		var frame, target, adr, wait;

		if (obj.IsBusy(id)){
			do {
				WScript.Sleep(500);
				wait = wait + 500;
			} while (obj.IsBusy(id) && (wait < 10000));// 10秒でタイムアウト
		}

		frames = document.frames;
		if (frames.length != 0){
			for (i=0; i<frames.length; i++){
				try {
					target = frames(i).document.activeElement;
					if (target.href != null){
						adr = target.href;
					}
					else {
						adr = "";
					}

					if (adr != ""){
						obj.NewWindow(adr,bActive);
					}
				}
				catch(error) {
				}
			}
		}

		target = document.activeElement;
		if (target.href != null){
			adr = target.href;
		}
		else {
			adr = "";
		}

		if (adr != ""){
			obj.NewWindow(adr,bActive);
		}

		document = null;
	}

	obj = null;
