﻿function PreImg() {
 var d=document;
 if(d.images){
  if(!d.CCEp){
   d.CCEp=new Array();
  }
 }
 var i,j=d.CCEp.length;
 var a=PreImg.arguments;
 for(i=0; i<a.length; i++){
  if (a[i].indexOf("#")!=0){
   d.CCEp[j]=new Image;
   d.CCEp[j++].src=a[i];
  }
 }
}

function Obj(n, d) {
 var p,i,x;
 if(!d) d=document;
 if((p=n.indexOf("?"))>0&&parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document;
  n=n.substring(0,p);
 }
 if(!(x=d[n])&&d.all) x=d.all[n];
 for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=Obj(n,d.layers[i].document);
 if(!x && d.getElementById) x=d.getElementById(n);
 return x;
}

function SwapImg() {
 var i,j=0,x;
 var a=SwapImg.arguments;
 document.CCEsr=new Array;
 for(i=0;i<(a.length-1);i+=2){
  if ((x=Obj(a[i]))!=null){
   document.CCEsr[j++]=x;
   if(!x.oSrc) x.oSrc=x.src;
   x.src=a[i+1];
  }
 }
}

function Restore() {
 var i,x,a=document.CCEsr;
 for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++){
  x.src=x.oSrc;
 }
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload=externalLinks;

function openUri(uri){
	window.open(uri,"newopen");
}

function styleOpen(){
	newopen = window.open("prontostyle/","newopen","width=1000,height=600,titlebar=0,menubar=0,toolbar=0,location=0,scrollbars=0,status=0,directories=0,resizable=1");
	newopen.focus();
}
function styleOpen2(){
	newopen = window.open("./","newopen","width=1000,height=600,titlebar=0,menubar=0,toolbar=0,location=0,scrollbars=0,status=0,directories=0,resizable=1");
	newopen.focus();
}
function styleMorning(){
	newopen = window.open("prontostyle/#/morning/","newopen","width=1000,height=600,titlebar=0,menubar=0,toolbar=0,location=0,scrollbars=0,status=0,directories=0,resizable=1");
	newopen.focus();
}
function styleLunch(){
	newopen = window.open("prontostyle/#/lunch/","newopen","width=1000,height=600,titlebar=0,menubar=0,toolbar=0,location=0,scrollbars=0,status=0,directories=0,resizable=1");
	newopen.focus();
}
function styleAfternoon(){
	newopen = window.open("prontostyle/#/afternoon/","newopen","width=1000,height=600,titlebar=0,menubar=0,toolbar=0,location=0,scrollbars=0,status=0,directories=0,resizable=1");
	newopen.focus();
}
function styleBar(){
	newopen = window.open("prontostyle/#/bar/","newopen","width=1000,height=600,titlebar=0,menubar=0,toolbar=0,location=0,scrollbars=0,status=0,directories=0,resizable=1");
	newopen.focus();
}
function styleParty(){
	newopen = window.open("prontostyle/#/party/","newopen","width=1000,height=600,titlebar=0,menubar=0,toolbar=0,location=0,scrollbars=0,status=0,directories=0,resizable=1");
	newopen.focus();
}


function timeDisp1(){
	today = new Date();
	year = today.getYear();
	if (year < 1000) {
			year += 1900;
	}
	document.write(year);
}


function setFocus(that){
	that.style.backgroundImage='none';
	that.style.backgroundRepeat='no-repeat';
	that.style.backgroundColor='#FFFFFF';
	that.onblur = function() {
		if( that.value === '' ) {
			that.style.backgroundImage='url(img/img_input_sample.gif)';
			that.style.backgroundRepeat='no-repeat';
			that.style.backgroundColor='#FFFFFF';
		}
	}
	that.onfocus = function() {
		that.style.backgroundImage='none';
		that.style.backgroundRepeat='no-repeat';
		that.style.backgroundColor='#FFFFFF';
	}
}

function setFocus2(that,imgFile){
	that.style.backgroundImage='none';
	that.style.backgroundRepeat='no-repeat';
	that.style.backgroundColor='#FFFFFF';
	that.onblur = function() {
		if( that.value === '' ) {
			that.style.backgroundImage='url(' + imgFile + ')';
			that.style.backgroundRepeat='no-repeat';
			that.style.backgroundColor='#FFFFFF';
		}
	}
	that.onfocus = function() {
		that.style.backgroundImage='none';
		that.style.backgroundRepeat='no-repeat';
		that.style.backgroundColor='#FFFFFF';
	}
}

function showFaq(Num) {
 var ansName = "ans" + Num;
 subCategory = document.getElementById(ansName).style;
 if(subCategory.display == 'none') subCategory.display = "block"
 else subCategory.display = "none"
}

function convM(Mail){
 var a="",c="";
 for(i=0; i<Mail.length; i++){
  c=Mail.charCodeAt(i);
  a +=String.fromCharCode(c+1);
 }
 return a;
}
function mailText1(){
	var m=convM(String.fromCharCode(104,109,101,110,63) + String.fromCharCode(111,113,110,109,115,110,45,98,110,45,105,111));
 document.write('<a href="mai' + 'lto:' + m + '">' + m + '</a>');
}

function bnrAlt(){
	var partybnr = document.getElementById("party_bnr");
	if(partybnr){
		partybnr.alt="PRONTO PARTY!! ザ・プレミアムモルツもハイボールも飲み放題￥980　春の特別パーティプランご予約受付中！"
	}
}
function addEvent(){
	try {
		window.addEventListener('load', this.bnrAlt, false);
	} catch (e) {
		window.attachEvent('onload', this.bnrAlt);
	}
}
addEvent();