﻿
//▼lightbox用jsファイル読み込み-------------------------------
document.write('<script src="/pc/js/lightbox/prototype.js" type="text/javascript"></script>');
document.write('<script src="/pc/js/lightbox/scriptaculous.js?load=effects,builder" type="text/javascript"></script>');
document.write('<script src="/pc/js/lightbox/lightbox.js" type="text/javascript"></script>');


//▼ブラウザ判定-------------------------------

function checkGecko(){
	var ua = navigator.userAgent;
	if(ua.indexOf('Gecko')!=-1){
		return true;
	} else {
		return false;
	}
}


//▼親または子ウインドウの有無確認関数-------------------------------
function win_closed(winVar) {
	var ua = navigator.userAgent
	if(!!winVar ){
		if( ( ua.indexOf('Gecko')!=-1 || ua.indexOf('MSIE 4')!=-1 ) && ua.indexOf('Win')!=-1 ){
			return winVar.closed;
		} else if( ua.indexOf('Firefox')!=-1 && ua.indexOf('Mac')!=-1 ){
			return winVar.closed;
		} else if( ua.indexOf('Safari')!=-1 && ua.indexOf('Mac')!=-1 ){
			return true;
		} else {
			return typeof winVar.document != 'object';
		}
	} else {
		return true;
	}
}


//▼CSS分岐設定-------------------------------
if(checkGecko()){
	document.write('<link href="/pc/css/diverge_mozilla.css" rel="stylesheet" type="text/css">');
} else {
	document.write('<link href="/pc/css/diverge_ie.css" rel="stylesheet" type="text/css">');
}


//▼別窓で開く-------------------------------
function wo_r(_TGT){
	if(_TGT){
		_popWin = window.open(_TGT);
		_popWin.focus();
	}
}


//▼ポップアップウィンドウ-------------------------------

//汎用
function wo(_TGT,_WIDTH,_HEIGHT,_TOOLBAR){
	if(_TGT){
		_WIDTH = (_WIDTH)?_WIDTH:717;
		_HEIGHT = (_HEIGHT)?_HEIGHT:500;
		_TOOLBAR = (_TOOLBAR)?_TOOLBAR:0;
		_popWin = window.open(_TGT,'_popWin','width='+_WIDTH+',height='+_HEIGHT+',scrollbars=yes,resizable=yes,toolbar='+_TOOLBAR+',directories=no,location=no,menubar=no,status=yes');
		_popWin.focus();
	}
}

function wo_motif(){
	if(win_closed(window.motifWin)){
		motifWin = window.open("/pc/catalog/motif/","motifWin","width=830,height=625,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no");
		motifWin.focus();
	}else {
		window.motifWin.location.href ="/pc/catalog/motif/";
		motifWin.focus();
	}
}


//▼インラインフレーム操作-------------------------------
function iframeJump(_iframename, _htmlname, _anchorname){
	var ua = navigator.userAgent;
	if(ua.indexOf('Firefox')!=-1){
		window[_iframename].location.href =_htmlname + "#" + _anchorname;
	} else {
		document[_iframename].location.href =_htmlname + "#" + _anchorname;
	}
	window.scrollTo(0, 0);
}


//▼flash8をembedする（サイズ指定あり。fileNameはパス・拡張子とも要記述）-------------------------------

function embedFla8(fileName,_width,_height){

	sslFla8();

	//fileNameからファイル名を渡す場合;
	myURL = fileName; 
	
	//ディレクトリ部分を取り除く;
    myFileName = myURL.substring(myURL.lastIndexOf("/")+1,myURL.length)
    
    //拡張子を取り除く;
    myFileName2 = myFileName.substring(0,myFileName.indexOf("."));
    thisFileName = "thisFileName=" + myFileName2;

	_width = (_width)?_width:480;
	_height = (_height)?_height:360;
	var writeStr = '\
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'+ _codebase +' width="' + _width + '" height="' + _height + '" id="' + myFileName2 + '" align="middle">\
	<param name="allowScriptAccess" value="sameDomain" />\
	<param name="movie" value="' + fileName + '" />\
	<param name="flashvars" value="' + thisFileName + '" />\
	<param name="menu" value="false" />\
	<param name="quality" value="high" />\
	<embed src="' + fileName + '" FlashVars="' + thisFileName + '" menu="false" quality="high" width="' + _width + '" height="' + _height + '" name="' + myFileName2 + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"'+ _pluginspage +' />\
	</object>';
	document.write(writeStr);
}







//▼httpsの際の回避-------------------------------

function sslFla8(){
	
	if(location.protocol == 'http:'){
		_codebase = 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
		_pluginspage = 'pluginspage="http://www.macromedia.com/go/getflashplayer" '
		_path = ''
	} else {
		_codebase = 'codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
		_pluginspage = 'pluginspage="https://www.macromedia.com/go/getflashplayer" '
	}
}



//if(location.protocol == 'http:'){
//	document.write('<script src="http://routetrap.symphonic.jp/track.js?RLU-000000001-3" type="text/javascript" defer="true"></script>');
//}

//document.write('<script src="'+ location.protocol +'//routetrap.symphonic.jp/track.js?RLU-000000001-3" type="text/javascript"></script>');



/*
 * Urchin Tracer
 */
//document.write('<script src="/js/__utm.js" type="text/javascript"></script>');



//Google Analytics

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-872355-10']);
  _gaq.push(['_setLocalRemoteServerMode']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

