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

					IEで開く（2002/09/09）
										written by sleepy

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

	var obj, document, id;

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

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

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

		objIE = WScript.CreateObject("InternetExplorer.Application");
		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 != ""){
						objIE.Visible = true;
						objIE.Navigate(adr);
					}
				}
				catch(error) {
				}
			}
		}

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

		if (adr != ""){
			objIE.Visible = true;
			objIE.Navigate(adr);
		}

		objIE = null;
		document = null;
	}

	obj = null;
