/**
 * ポップアップウインドウ
 * 
 * 日付：2003/05/29
 * 作成：株式会社サーフボード MITSUJI Takamasa<mitsuji@surfboard.co.jp>
 * 
 */


/**
 * オブジェクトのコンストラクタ
 *
 * @input name		ウインドウ名
 * @input settings	ウインドウの設定文字列
 *
 */
/*function PopupWin(name, settings) {*/

function PopupWin() {

	var pwin;
	this.name	= name;
	this.settings	= settings;

	this.open	= PopupWin_open;

}
/**
 * オブジェクトのopenメソッド
 *
 * @input url		ウインドウのURL
 *
 */
function PopupWin_open(url) {

	//オブジェクトでないか、閉じているとき開く
	if(typeof(this.pwin) != "object" || this.pwin.closed )
		this.pwin = window.open(url, this.name, this.settings);
	//それ以外はURLの変更のみ
	else
		this.pwin.document.location.href = url;

	//フォーカスを当てる
	this.pwin.focus();

}

/*お問合せ用*/
function PopupWin_contact() {

	//オブジェクトでないか、閉じているとき開く
	if(typeof(this.pwin) != "object" || this.pwin.closed )
		this.pwin = window.open('/toi/index.htm', 'contact', 'width=600,height=770');
	//それ以外はURLの変更のみ
	else
		this.pwin.document.location.href = url;

	//フォーカスを当てる
	this.pwin.focus();

}
/*お問合せフォーム用*/
function PopupWin_toi() {

	this.pwin = window.open('https://www.kaiunya.jp/form_toi/form_toi.htm', 'toi', 'width=625,height=820,scrollbars=1');

	//フォーカスを当てる
	this.pwin.focus();

}

/*お任せ開運印鑑　ご依頼用*/
function PopupWin_omakase() {

	this.pwin = window.open('https://www.kaiunya.jp/form_omakase/form_omakase.htm', 'omakase', 'width=625,height=820,scrollbars=1');

	//フォーカスを当てる
	this.pwin.focus();

}


/*ケースについて用*/
function PopupWin_case() {

	//オブジェクトでないか、閉じているとき開く
	if(typeof(this.pwin) != "object" || this.pwin.closed )
		this.pwin = window.open('http://www.rosestone.co.jp/guide/case_popup.htm', 'case', 'width=640,height=720,scrollbars=1');
	//それ以外はURLの変更のみ
	else
		this.pwin.document.location.href = 'http://www.rosestone.co.jp/guide/case_popup.htm';

	//フォーカスを当てる
	this.pwin.focus();

}

/*ジルコニアポイントについて用*/
function PopupWin_zirconiapoint() {

	//オブジェクトでないか、閉じているとき開く
	if(typeof(this.pwin) != "object" || this.pwin.closed )
		this.pwin = window.open('http://www.rosestone.co.jp/gift/zirconiapoint_popup.htm', 'zirconiapoint', 'width=640,height=720,scrollbars=1');
	//それ以外はURLの変更のみ
	else
		this.pwin.document.location.href = url;

	//フォーカスを当てる
	this.pwin.focus();

}

/*お気に入りに追加*/
function Add_Favorite (url, name) {

	var url = "http://www.kaiunya.jp/" + url;
	var name = "開運印鑑/小林大伸堂 ｜ " + name;
	
	window.external. AddFavorite(url, name);
}