function goPanph(id){
	var i=0;
	var qs=location.search;
	var hst='x';
	var ref='x';
	var site='x';
	var gourl='';
	var serv='';
	var gw2ssl=false;

	if(qs.indexOf('hst=')>=0) hst=qs.charAt(qs.indexOf('hst=')+4);
	if(qs.indexOf('ref=')>=0) ref=qs.charAt(qs.indexOf('ref=')+4);
	if(qs.indexOf('site=')>=0) site=qs.charAt(qs.indexOf('site=')+5);

	while(document.links[i]){
		// パンフレット請求ボタンのhref(buttons.html)
		if(document.links[i].href=='http://www.anshinmy.com/webapp/guest/servlet/CatalogClaim'){
			break;
		}
		i++;
	}
	
	if(document.links[i]){
		switch(hst){
		case '3':
//			gourl='https://weidc003.anshinmy.com'+getEnv()+'/webapp';
			gourl=location.protocol+'//'+(location.host=='www.anshinmy.com'?'weidc003.anshinmy.com':location.host)+getEnv()+'/webapp';
			switch(ref){
			case 'g':
				gourl=gourl+'/guest';
				break;
			case 'm':
				gourl=gourl+'/member';
				break;
			default:
				gourl=gourl+'/guest';
			}
			break;
		case '4':
//			gourl='https://weidc004.anshinmy.com'+getEnv()+'/webapp';
			gourl=location.protocol+'//'+(location.host=='www.anshinmy.com'?'weidc004.anshinmy.com':location.host)+getEnv()+'/webapp';
			switch(ref){
			case 'g':
				gourl=gourl+'/guest';
				break;
			case 'm':
				gourl=gourl+'/member';
				break;
			default:
				gourl=gourl+'/guest';
			}
			break;
		case 'w':
//			gourl='http://www.anshinmy.com'+getEnv()+'/webapp/guest';
//			gourl=location.protocol+'//'+location.host+getEnv()+'/webapp/'+(ref=='g'?'guest':'member');
			if( location.protocol=='https:' ){
				gourl=location.protocol+'//'+location.host+getEnv()+'/webapp/guest';
			} else {
				gourl='https://'+location.host+'/cgi-bin/gw2ssl?uri=%2Fwebapp%2Fguest';
				gw2ssl=true;
			}
			break;
		default:
//			gourl='http://www.anshinmy.com'+getEnv()+'/webapp/guest';
//			gourl=location.protocol+'//'+location.host+getEnv()+'/webapp/'+(ref=='g'?'guest':'member');
			if( location.protocol=='https:' ){
				gourl=location.protocol+'//'+location.host+getEnv()+'/webapp/guest';
			} else {
				gourl='https://'+location.host+'/cgi-bin/gw2ssl?uri=%2Fwebapp%2Fguest';
				gw2ssl=true;
			}
			break;
		}

		if( site.indexOf('a')>=0 ){	// 安心My.com
			serv = 'CatalogClaim';
		} else {	// 会社HP
			serv='CatalogClaimNK';
			document.links[i].target="CatalogClaimNK";
		}
		
		if (gw2ssl) {
			document.links[i].href=gourl+'/servlet/'+serv;
		} else {
			document.links[i].href=gourl+'/servlet/'+serv+'?pid='+id;
		}
	}
}

function getEnv(){
	var rtn='';
	var lct=location.pathname;
	if(lct.indexOf('test',0)==1){
		rtn='/test';
	}
	return rtn;
}
