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

	「IEの艦これ画面を800x480に」Ver. 1.00

					Produced by sakura

	IEの艦これ画面（Flash直開き）を800x480に変更します。

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

/* 設定 */
var constrSettingFileName = 'kcsSettingJSON.txt';

function Main(){
	var fobjShell, fstrUri, i;
	fobjShell = WScript.CreateObject('Shell.Application');
	for (i=0;i<fobjShell.Windows().Count; i++){
		try {
			fobjShell.Windows().Item(i).FullName;
		} catch (e){
			continue;
		}
		if ((/iexplore\.exe$/i).test(fobjShell.Windows().Item(i).FullName)){
			fstrUri = fobjShell.Windows().Item(i).LocationURL;
			if ((/^http\:\/\/\d+\.\d+\.\d+\.\d+\/kcs\/mainD2\.swf\?api_token\=[0-9a-z]+\&api_starttime\=\d+$/).test(fstrUri)){
				fobjIEApp = fobjShell.Windows().Item(i);
				fintx = fobjIEApp.Document.body.clientWidth || fobjIEApp.Document.documentElement.clientWidth;
				finty = fobjIEApp.Document.body.clientHeight || fobjIEApp.Document.documentElement.clientHeight;
				if (fintx != 800) fobjIEApp.Width = 800 + fobjIEApp.Width - fintx;
				if (finty != 480) fobjIEApp.Height = 480 + fobjIEApp.Height - finty;
			}
		}
	}
}

Main();
