//
//ページ読み込み時処理
//
	var popup = new PopupBase();
	var offsetY = 100;

//
//PopupImageオブジェクト
//

//コンストラクタ
function PopupBase(){
	//プロパティ定義
	this.base = document.createElement('div');
	this.base.className = 'popupelement';
	this.base.id = 'popupelementid';
	this.img = new Image();
	this.title = document.createElement('div');
	this.title.className = 'j14';
	this.title.appendChild(document.createTextNode(""));
	this.title.style.textAlign="left";
	this.title.style.color="#f08200";
	this.title.style.margin="5px";
	this.closetxt = document.createElement('div');
	this.closetxt.className = 'j14';
	this.closetxt.appendChild(document.createTextNode('画像をクリックすると閉じます。'));

	//メソッド定義
	this.show = function(url, text, x, y){
		this.img.src = url;
		this.img.style.width=x;
		this.img.style.height=y;
		this.img.style.borderColor='#333333';
		this.img.style.borderWidth='2px';
        this.img.style.borderStyle = 'solid';
		this.title.innerHTML=text;

		if(document.all){	//IE
			this.base.style.top = (document.body.scrollTop + offsetY) + 'px';
		}else if(document.implementation){	//NN
			this.base.style.top = (window.pageYOffset + offsetY) + 'px';
		}
		document.body.appendChild(this.base);
	};
	this.close = function(){
		if(popup.base){
			document.body.removeChild(popup.base);
		}
	};

	with(this.base){
		appendChild(this.title);
		appendChild(this.img);
		appendChild(this.closetxt);
		style.position='absolute';
		style.left=150;
	}

	if(document.all){	//IE
		this.img.onclick = this.close;
	}else if(document.implementation){	//NN
		this.img.addEventListener('click' ,this.close , true);
	}else{
		return false;
	}

	return this;
}
