/*****--popup window--*****/
/*--別ウィンドウのヘッドロゴから、トップページへのフォーカス--*/
function WinFocusHome(){
window.open('/index.html','home','scrollbars=1,resizable=1,menubar=0,toolbar=0,location=0,status=0,directories=0').focus(); 
}

var agent = navigator.userAgent;

/*--会員メニューログイン--*/
function WinOpenLogin(){
	var url = 'https://www.nanaco-net.jp/pc/emServlet';	
	if(agent.indexOf('Linux; U; Android ') == -1){
	    window.open(url,'Newwindow','width=810,height=800,scrollbars=1,resizable=1,menubar=1,toolbar=0,location=0,status=1,directories=0').focus(); 
	} else {
		window.open(url,null);
	}
}

/*--nanacoカード申込受付はこちら 入会する--*/
function WinOpenEnt(){
	var url = 'https://entry.nanaco-net.jp/entry_all/web_agr.html';
	if(agent.indexOf('Linux; U; Android ') == -1){	
		window.open(url,'Newwindow','width=810,height=800,scrollbars=1,resizable=1,menubar=1,toolbar=0,location=0,status=1,directories=0').focus(); 
	} else {
		window.open(url,null);
	}
}

/*--会員メニュー--*/
function WinOpenMember(){
window.open('/member/index.html','Newwindow',
'width=810,height=800,scrollbars=1,resizable=1,menubar=1,toolbar=0,location=0,status=1,directories=0').focus(); 
}

/*--郵便番号から住所検索--*/
function WinOpenAddressSearch(){
window.open('/entry/web_adr.html','addressSearch',
'width=300,height=360,scrollbars=0,resizable=1,menubar=0,toolbar=0,location=0,status=1,directories=0').focus(); 
}

/*--入力できない文字について--*/
function WinOpenNoInput(){
window.open('/entry/char_ng.html','addressSearch',
'width=800,height=550,scrollbars=1,resizable=1,menubar=0,toolbar=0,location=0,status=1,directories=0').focus(); 
}


/*--セブン-イレブン店舗検索--*/
function WinOpenShopSearch(){
	var url = 'http://gis.e-map.ne.jp/standard/13125010/index.htm?X_shop_id=40005&X_cancel_url=http://www.nanaco-net.jp/';
	if(agent.indexOf('Linux; U; Android ') == -1){	
			window.open(url,'Newwindow','width=620,height=650,scrollbars=1,resizable=1,menubar=0,toolbar=0,location=0,status=1,directories=0').focus(); 
	} else {
		window.open(url,null);
	}
}

/*--キリンのナナコ--*/
function WinOpenKirinNoNanaco(){
window.open('/character/index.html','Newwindow',
'width=868,height=800,scrollbars=1,resizable=1,menubar=0,toolbar=0,location=0,status=1,directories=0').focus(); 
}

/*--mailマガジン登録規約--*/
function WinOpenMailAgr(){
window.open('/mail/maillmgz_kojinjouhou.html','Newwindow',
'width=810,height=800,scrollbars=1,resizable=1,menubar=1,toolbar=0,location=0,status=1,directories=0').focus(); 
}

/*--mailマガジン登録--*/
function WinOpenMailReg(){
window.open('https://www.nanaco-mail.jp/apl/mail/mail_touroku.asp','Newwindow',
'width=810,height=800,scrollbars=1,resizable=1,menubar=1,toolbar=0,location=0,status=1,directories=0').focus(); 
}

/*--mailマガジンアドレス変更--*/
function WinOpenMailChg(){
	var url = 'https://www.nanaco-mail.jp/apl/mail/mail_henko.asp';
	if(agent.indexOf('Linux; U; Android ') == -1){		
		window.open(url,'Newwindow','width=810,height=800,scrollbars=1,resizable=1,menubar=1,toolbar=0,location=0,status=1,directories=0').focus(); 
	} else {
		window.open(url,null);
	}
}

/*--mailマガジン登録解除--*/
function WinOpenMailStop(){
window.open('https://www.nanaco-mail.jp/apl/mail/mail_teishi.asp','Newwindow',
'width=810,height=800,scrollbars=1,resizable=1,menubar=1,toolbar=0,location=0,status=1,directories=0').focus(); 
}

/*--mailマガジン個人情報--*/
function WinOpenMailReg(){
window.open('/mail/kokjinjouhou.html','Newwindow',
'width=810,height=800,scrollbars=1,resizable=1,menubar=1,toolbar=0,location=0,status=1,directories=0').focus(); 
}

/*--ポップアップ--*/
function WinOpenAttention(url){
	if(agent.indexOf('Linux; U; Android ') == -1){	
		window.open(url,'Newwindow', 'width=626,height=250,scrollbars=1,resizable=1,menubar=0,toolbar=0,location=0,status=1,directories=0').focus();
	} else {
		window.open(url,null);
	}
}

/*--自販機サービス開始 ポップアップ--*/
function WinOpenJihanki(){
	var url = '/service/jihanki_service.html';
	if(agent.indexOf('Linux; U; Android ') == -1){
		window.open(url,'Newwindow', 'width=606,height=490,scrollbars=0,resizable=1,menubar=0,toolbar=0,location=0,status=1,directories=0').focus();
	} else {
		window.open(url,null);
	}
}


/*--840px幅 ポップアップ-- class="popup"*/
/*--会員メニューログイン--*/
if (window.addEventListener) { /* Firefox */  
  window.addEventListener("load", getClassPopupElem, false);  
}    
else if (window.attachEvent) { /* IE */  
  window.attachEvent("onload", getClassPopupElem);  
}      
else {
  window.onload = getClassPopupElem;  
}  

/*--rss--*/
function WinOpenRss(url){
	if(agent.indexOf('Linux; U; Android ') == -1){
		window.open(url,'Newwindow', 'width=626,height=550,scrollbars=1,resizable=1,menubar=0,toolbar=0,location=0,status=1,directories=0').focus();
	} else {
		window.open(url,null);
	}
}
  
function getClassPopupElem() {
//document.getElementsByTagNameメソッドに対応していないブラウザは処理を終了
if (! document.getElementsByTagName ) return;

var elem = document.getElementsByTagName('a');
	for (var i=0; i<elem.length; i++){
	var className = elem[i].className;
		if(className == 'popup'){
		  if (elem[i].addEventListener) { /* Firefox */  
			elem[i].addEventListener('click',popupMsg, false);
		  } 	   
		  else if (elem[i].attachEvent) { /* IE */  
		    elem[i].attachEvent("onclick", popupMsg);  
		  }      
		  else {  
		    elem[i].onclick = popupMsg;  
		  }  
		}
	}
}
function popupMsg(evt) {  
  if (evt.target) {  /* Firefox */  
    evt.preventDefault();
    		window.open(evt.currentTarget.href,'Newwindow2', 'width=840,scrollbars=yes');
	}
  else if (window.event.srcElement) { /* IE */  
    window.event.returnValue = false;
		if(window.event.srcElement.tagName.toLowerCase()=='img')	{
			window.open(window.event.srcElement.parentElement.href,'Newwindow2','width=840,scrollbars=yes');
		}
		if(window.event.srcElement.tagName.toLowerCase()=='a'){
	 		window.open(window.event.srcElement.href,'Newwindow2', 'width=840,scrollbars=yes');
		}  
	}
}

