var srcs = [
	'/archives/ext/ext-core/ext-core.js',
	'/style/cookie.js',
	'/style/stylechanger.js',
	'/mogura/w_js.php?p=%2Fvirtual%2Fsou1ka%2Fpublic_html%2Fmogura%2F'
];

for(var i=0;i<srcs.length;i++) {
	if(typeof Ext!='undefined'&&srcs[i].match(/ext/)){
	} else {
		createScript(srcs[i]);
	}
}

function createScript(path) {
	try{
		document.write('<script type="text/javascript" src="'+path+'"  charset="utf-8"><\/script>');
	} catch(e) {
		var script = document.createElement('script');
		script.type = 'text/javascript';
		script.src = path;
		script.charset = 'utf-8';
		document.getElementsByTagName('head')[0].appendChild(script);
	}
}

// other
function appendExt() {
	Ext.getBody().last().insertHtml( 'afterEnd', '<img src="/mogura/writelog.php?mode=img&js=2" width="0" height="0" style="display:none;" />' );
	var imgs = document.getElementsByTagName('img'),
		flag = false;
	for(var i=0;i<imgs.length;i++) {
		if( imgs[i].src.match(/\/count\/dayx\.cgi\?gif$/) ) {
			flag = true;
			break;
		}
	}
	if(!flag) {
		Ext.getBody().last().insertHtml( 'afterEnd','<img src="/count/dayx.cgi?gif" alt="" height="0" width="0" style="display:none;" />' );
	}
}


if (window.addEventListener) { //for W3C DOM
	window.addEventListener("load", appendExt, false);
} else if (window.attachEvent) { //for IE
	window.attachEvent("onload", appendExt);
}

// Analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-18171867-1']);
_gaq.push(['_trackPageview']);
(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


