function change_both(tn, detail)
{
	top.tn_frame.location.href = tn;
	top.detail_frame.location.href = detail;
}

function add_sw()
{
	return 'sw=' + screen.width;
}

function Art(root_img_path, root_tn_path, img_w, img_h, tn_w, tn_h, col, val)
{
	for ( i = 0; i < col.length; ++i )
		this[ col[ i ] ] = val[ i ];
	this.root_img_path = root_img_path;
	this.root_tn_path = root_tn_path;
	this.img_w = img_w;
	this.img_h = img_h;
	this.tn_w = tn_w;
	this.tn_h = tn_h;
}
Art.prototype.get_pk = function () {
	return this[ "art_id" ];
}
Art.prototype.get_img_obj = function (property, root_path, path, file, onload) {
	var i = this[ property ];
	if ( null == i )
	{
		i = new Image();
		this[ property ] = i;

		if ( onload )
			i.onload = onload;
		i.src = root_path + this[ path ] + this[ file ];
	}
	else
	{
		i.onload = onload;
		i.onload();
	}

	return i;
}	
Art.prototype.get_img = function (onload) {
	return this.get_img_obj( "img", this.root_img_path, "image_path", "image_file", onload);
}
Art.prototype.get_tn = function (onload) {
	return this.get_img_obj( "tn", this.root_tn_path, "thumbnail_path", "thumbnail_file", onload);
}
Art.prototype.get_hi = function (onload) {
	return this.get_img_obj( "hi", this.root_img_path, "hires_path", "hires_file", onload);
}

