// enable IE "framset like" layout
function cssIe()	{
	var u = navigator.userAgent.toLowerCase();
	if ( contains(u,"msie") && contains(u,"win") ) {
		document.write('<style type="text/css" media="screen">@import "/css/u/ie.css";</style>');
	}	else	{
		document.write('<style type="text/css" media="screen">#main {overflow:auto}</style>');
	}
}
function contains(detect,string) {
	return detect.indexOf(string) + 1;
}
cssIe();

function getCenterW(width) {
	return parseInt( eval( (screen.width-parseInt(width))/2 ) );
}

function getCenterH(height) {
	return parseInt( eval( (screen.height-parseInt(height))/2 ) );
}
function openWin( name, path, width, height, scroll ) {
		if (!scroll || scroll != 'yes') { scroll = 'no' };
		var _win = window.open(path,name,'scrollbars=' + scroll + ',resizable=no,resize=no,width='+width+',height='+height+',screenX='+getCenterW(width)+',screenY='+getCenterH(height)+',top='+getCenterH(height)+',left='+getCenterW(width)+',locationbar=no,directories=no,dependent=yes' );
		if (_win)	_win.focus();
		//return _win;
}

var rImgNo, rImgCnt, rClient, rDir, rTitle;
function showPicture(imgNo, imgCnt, client, _dir, _title) {
	rImgNo = imgNo;
	rImgCnt = imgCnt;
	rClient = client;
	rDir = _dir;
	rTitle = _title;
	var w = openWin("ref", "/popup.php", 596, 478);
	return false;
}

function showPrice(imgNo,imgTitle) {
	rImgNo = imgNo;
	rTitle = imgTitle;
	var w = openWin("price","/popup-price.php",596,478)
}

