
jQuery(function(){
	var $ = jQuery.noConflict();

	//▼ 女性詳細
	$("a.girlDetail").click(function(){
		girlProf($(this).attr('href'));
		return false;
	});

	//▼ ブックマーク
	$("a.bookMark").click(function(){
		bookmark($(this).attr('href'), $(this).attr('title'));
		return false;
	});

	/**
	 * @ 女性詳細ページ 開く(ColorBox)
	 * 記述方法
	 * <a href="URL" rel="memberLogin" title="タイトル"></a>
	 *----------------------------------------
	 */
	if($('a[rel^="memberLogin"]').size()){
		$('a[rel^="memberLogin"]').colorbox({
			iframe:true
			,top:"20px"
			,innerWidth:"600px"
			,innerHeight:"300px"
			,close:"閉じる"
			,overlayClose:false
		});
	}

	/**
	 * @ 写メ日記画像(ColorBox)
	 * 記述方法
	 * <a href="URL" rel="photoDiary" title="タイトル"></a>
	 *----------------------------------------
	 */
	if($('a[rel^="photoDiary"]').size()){
		$('a[rel^="photoDiary"]').colorbox({
			slideshow:false
			,slideshowAuto:false
			,previous:"前"
			,next:"次"
			,close:"閉じる"
			,current:"画像 {current} of {total}"
		});
	}

	/**
	 * @ プレゼント当選結果ページ 開く(ColorBox)
	 * 記述方法
	 * <a href="URL" rel="present" title="タイトル"></a>
	 *----------------------------------------
	 */
	if($('a[rel^="present"]').size()){
		$('a[rel^="present"]').colorbox({
			iframe:true
			,innerWidth:"700px"
			,innerHeight:"700px"
			,close:"閉じる"
			,overlayClose:true
		});
	}
});


/*
 * 女性詳細 ポップアップ
 *------------------------------
 */
function girlProf(url){
	// ウィンドゥ名
	var winName = 'girl';

	// ウィンドゥ幅
	var w = '800';

	// ウィンドゥ高さ
	var h = '771';

	// ウィンドゥ開く位置
	var Left = ',left=' + ((screen.width - w) / 2);
	var Top  = ',top='  + (((screen.height- h) / 2) / 2);

	if(url){
		winName = window.open(url, winName, 'width='+w+', height='+h+', left='+Left+', top='+Top+', status=1, menubar=0, scrollbars=1, resizable=0');
		if(window.focus){ winName.focus(); }
	}
}


/*
 * ブックマーク
 *------------------------------
 */
function bookmark(address,sitename) {
	if (window.sidebar) {
		window.sidebar.addPanel(sitename, address,"");
	} else if( document.all ) {
		window.external.AddFavorite(address, sitename);
	} else if( window.opera && window.print ) {
		return true;
	}
}


function Wopen(url,w,h,n) {
	var winName = n;
	var Width   = 'width='   + w;
	var Height  = ',height=' + h;
	var Left    = ',left='   + ((screen.width - w) / 2);
	var Top     = ',top='    + ((screen.height- h) / 2);
	var Option = ',status=1,menubar=0,scrollbars=1,resizable=0';
	var features = Width + Height + Left + Top + Option;
	winName = window.open(url,winName,features);
	if (window.focus) {
		winName.focus();
	}
}

function change(filename){
	document.picIMG.src = filename;
}

