function ch_img(c) {
	document.getElementById('m_image').innerHTML = imgs[c].inner_html;
	var	l = imgs.length,
		a = l - 1,
		i, s = '', j = 0;
	for (i=0; i<l; i++) {
		if (i!=c) {
			mc = Math.ceil(a/3);
			s += imgs[i].small;
			if ((j+1 == mc) || (j+1 == a - mc + (a % 3 ? 1 : 0))) {
				s += '<br />';
			}
			j++;
		}
	}
	document.getElementById('sm_list').innerHTML = s;
}
function sw_img(img_s, w, h) {
	eval('opened=window.open("","none","top=100, left=100, width='+w+', height='+h+', resizable=0","replace=yes")');
	opened.document.open();
	opened.document.write('<body leftmargin=0 topmargin=0><img src="'+img_s+'"></body>');
	opened.document.close();
}
function getWinSize() {
	var ret = [0, 0],
		win = window,
		doc = document;
	if( typeof( win.innerWidth ) == 'number' ) {
		//Non-IE
		ret = [	win.innerWidth,	win.innerHeight ];
	} else if( doc.documentElement && ( doc.documentElement.clientWidth || doc.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		ret = [ doc.documentElement.clientWidth, doc.documentElement.clientHeight ];
	} else if( doc.body && ( doc.body.clientWidth || doc.body.clientHeight ) ) {
		//IE 4 compatible
		ret = [ doc.body.clientWidth, doc.body.clientHeight ];
	}
	return ret;
}
function rs_div() {
	var obj = document.getElementById('ciom'),
		wid = getWinSize();
	//alert(wid);
	wid = wid[0] - 490;
	//alert(wid);
	wid = wid - wid % 150 + 2;
	wid = wid < 452 ? 452 : wid;
	//alert(wid);
	obj.style.width = '' + wid + 'px';
}
