/*** 共通：【 ページが読み込まれたらウインドウにフォーカスを当てる 】 ***/
function _Front() {
	window.focus();
}

/*** 通常：【 CAST詳細の開き元を参照するためのウインドウネーム設定 】 ***/
function _WindowName(_id) {
	window.name='_s'+_id;
}

/*** 通常：【 CAST一覧からの詳細ウインドウを固定サイズで開く 】 ***/
function _WindowOpen(shop,num,version) {
	_html='details/cast' + num + '.php';
	_windowName='s' + shop + 'details';
	if(version=='platina') {
		_w = 716;
		_h = 804;
	} else {
		_w = 770;
		_h = 705;
	}
	window.open(_html,_windowName,'resizable=yes,scrollbars=yes,width='+_w+',height='+_h);
}

/*** 通常：【 グラビアページからグラビア詳細ウインドウを固定サイズで開く 】 ***/
function _gravureOpen(dir, shopId, num, makeMode) {
	if(makeMode=='full_order') {
		_file='/details/cast' + num + '.php?mode=gravure';
	} else {
		_file='/'+ dir +'/details/cast' + num + '.php?mode=gravure';
	}
	_windowName='s' + shopId + 'details';
	window.open(_file,_windowName,'resizable=yes,scrollbars=yes,width=830,height=2000');
}

/*** 通常：【 グラビアページからムービーウインドウを固定サイズで開く 】 ***/
function _movie(filename,num) {
	_file = './movie/?c=' + filename + '&p=' + num;
	_windowName='movie';
	window.open(_file,_windowName,'resizable=yes,scrollbars=yes,width=460,height=360');
}

/*** 詳細：【 キャスト詳細から店舗トップページを開く 】 ***/
function _ShopOpen(_shop_name,_id) {
//	_url='/'+_shop_name+'/';
	_url='../';
	window.open(_url,'_s'+_id);
}

/*** 詳細：【 キャスト詳細からキャストリストを開く 】 ***/
function _CastListOpen(_shop_name,_id) {
//	_url='/'+_shop_name+'/cast.html';
	_url='../cast.html';
	window.open(_url,'_s'+_id);
}

/*** 詳細：【 キャスト詳細 / グラビアページの ウインドウリサイズ 】 ***/
function _resize(page) {
	if(page=='details') {
		_w = 782;
		_h = 756;
	} else if(page=='gravure') {
		_w = 830;
		_h = 2000;
		moveTo(0,0);
	}
	resizeTo(_w,_h);
}

/*** 詳細：【 グラビアページからムービーウインドウを固定サイズで開く 】 ***/
function _castMovie(filename,num) {
	_file = '../movie/?c=' + filename + '&p=' + num;
	_windowName='movie';
	window.open(_file,_windowName,'resizable=yes,scrollbars=yes,width=460,height=360');
}

/*** 詳細：【 CAST詳細のBIG.jpgの切り替え 】 ***/
function _IMGchange(file,obj) {
	document.getElementById('mainPhoto').src=file;
}

/*** 詳細：【 CAST詳細の画像プレロード 】 ***/
function _preLoad(castNumber) {
	window.focus();
	var image = new Array();
	_fileName = new Array('a','b','c','d','e','f','g','h');
	
	for(i=0; i<_fileName.length; i++) {
		image[i] = new Image();
		image[i].src = 'photo_d/cast' + castNumber + '_'  + _fileName[i] + '_big.jpg';
	}
}

/*** 詳細：【 CAST詳細からWEB指名ウインドウを固定サイズで開く 】 ***/
function _WebNominate(num,mode) {
	html='ticket' + num + '.html';
	if(mode=='platina') {
		_w = 680;
		_h = 535;
	} else {
		_w = 540;
		_h = 630;
	}
	window.open(html,'mn','width='+_w+',height='+_h);
}

/*** 詳細：【 サムネイルをクリックした際に、フォーカスを余所へ移す 】 ***/
function focusControl() {
	document.getElementById('cast_details').focus();
}

/*  */
function ticket() {
	html='ticket.html';
	window.open(html,'ticket','width=680,height=480');
}

/*  */
function sendMagazine() {
	_window = window.open('blank.php','mailMagazine','resizable=no,scrollbars=no,width=500,height=500');
	if(_window) {
		document.getElementById('magazineForm').submit();
	}
}

/*  */
function sendMobileAccess() {
	_window = window.open('blank.php','mobileAccess','resizable=no,scrollbars=no,width=200,height=200');
	if(_window) {
		document.getElementById('mobileAccessForm').submit();
	}
}

/*  */
function flashVersion(dirName) {
	if (dirName == 'deeps') {
		window.open('http://img.premium.nightstyle.org/'+dirName+'/flash/index.swf','flash','resizable=no,width=1024,height=768,scrollbars=no');
	} else {
		window.open('http://img.premium.nightstyle.org/'+dirName+'/flash/index.swf','flash','resizable=yes,scrollbars=no');
	}
}

/*  */
function _pMovie(URL) {
	_window = window.open(URL,'pMovie','resizable=no,scrollbars=no,width=176,height=160,status=no');
}

