//htmlソースを関数定義

function cfshtm(){
	document.write('<dt><img src="/rezept/common/img/header/label_fs.gif" alt="文字サイズ" width="74" height="32" /></dt><dd><a href="javascript:sho();"><img src="/rezept/common/img/header/fs_s.gif" alt="小" name="fs_s" width="24" height="32" border="0" id="fs_s" /></a><a href="javascript:chu();"><img src="/rezept/common/img/header/fs_m_on.gif" alt="中" name="fs_m" width="24" height="32" border="0" id="fs_m" /></a><a href="javascript:dai()"><img src="/rezept/common/img/header/fs_l.gif" alt="大" name="fs_l" width="31" height="32" border="0" id="fs_l" /></a></dd>');
}



//Browser Check
var browserType=new checkBrowserType();
var osType=new checkOsType();
function checkBrowserType(){
	this.IE=(navigator.userAgent.indexOf("MSIE")!=-1);
	this.Gecko=(navigator.userAgent.indexOf("Gecko")!=-1);
	this.IE6=(navigator.userAgent.indexOf("MSIE 6.")!=-1);
	this.IE5=(navigator.userAgent.indexOf("MSIE 5.")!=-1);
	this.Opera=(navigator.userAgent.indexOf("Opera")!=-1);
	this.Safari=(navigator.userAgent.indexOf("Safari")!=-1);
	this.NC71=(navigator.userAgent.indexOf("Netscape/7.1")!=-1);
	this.NC70=(navigator.userAgent.indexOf("Netscape/7.0")!=-1);
	this.NC6=(navigator.userAgent.indexOf("Netscape/6.")!=-1);
	this.NC7=(navigator.userAgent.indexOf("Netscape/7.")!=-1);
	this.NC4=(navigator.userAgent.indexOf("Netscape/4.")!=-1);
}
function checkOsType(){
	this.Win=(navigator.appVersion.indexOf("Win")!=-1);
	this.Mac=(navigator.appVersion.indexOf("Mac")!=-1);
	this.Unix=(navigator.appVersion.indexOf("X11")!=-1);
}




//UDSwitch
function writeUDSwitch(){
}

//GoPageTop
function goPageTop(){
}

function info(){
myBsr   = navigator.appName;
myAgent = navigator.userAgent;
myTop = myAgent.indexOf("Opera",0);
if (myTop == -1){
   myTop = myAgent.indexOf("MSIE",0);
   if (myTop == -1){
      myTop = myAgent.indexOf("Mozilla/",0);
      if (myTop == -1){
         myVersion = "";
      }else{
         myLast = myAgent.indexOf(" ",myTop);
         myVer = myAgent.substring(myTop+8,myLast); 
         myVersion = " Version " + myVer;
      }
   }else{
      myLast = myAgent.indexOf(";",myTop);
      myVer = myAgent.substring(myTop+5,myLast);
      myVersion = " Version " + myVer;
   }
}else{
   myBsr = "Opera";
   myLast = myAgent.indexOf(" ",myTop+6);
   myVer = myAgent.substring(myTop+6,myLast);
   myVersion = " Version " + myVer;
}
alert("ご利用のブラウザーは、"+myBsr+myVersion+" です");
}




/*--setfontsizecookie--*/

function checkCook(){
	fSize=nowSize();
	if(fSize==""){
		var sizeValue="mid";
		chu(1);
	}else{
		var sizeValue=fSize;
		if(fSize=="lrg"){
			dai(1);
		}else if(fSize=="mid"){
			chu(1);
		}else if(fSize=="sml"){
			sho(1);
		}else{}
	}
}
if(browserType.IE==true && osType.Win==true){
	checkCook();
	window.onload=chgBtn;
}else{
	window.onload=checkCook;
}

function chgBtn(){
	fSize=nowSize();
	if(fSize==""){
			document.images['fs_s'].src='/rezept/common/img/header/fs_s.gif';
			document.images['fs_m'].src='/rezept/common/img/header/fs_m_on.gif';
			document.images['fs_l'].src='/rezept/common/img/header/fs_l.gif';
	}else{
		var sizeValue=fSize;
		if(fSize=="lrg"){
			document.images['fs_s'].src='/rezept/common/img/header/fs_s.gif';
			document.images['fs_m'].src='/rezept/common/img/header/fs_m.gif';
			document.images['fs_l'].src='/rezept/common/img/header/fs_l_on.gif';
		}else if(fSize=="mid"){
			document.images['fs_s'].src='/rezept/common/img/header/fs_s.gif';
			document.images['fs_m'].src='/rezept/common/img/header/fs_m_on.gif';
			document.images['fs_l'].src='/rezept/common/img/header/fs_l.gif';
		}else if(fSize=="sml"){
			document.images['fs_s'].src='/rezept/common/img/header/fs_s_on.gif';
			document.images['fs_m'].src='/rezept/common/img/header/fs_m.gif';
			document.images['fs_l'].src='/rezept/common/img/header/fs_l.gif';
		}else{}
	}
}


function dai(i){
	if(browserType.IE==true && osType.Win==true){
		document.createStyleSheet('/rezept/common/css/fs/fsl.css');
		if(i!=1){
			document.images['fs_s'].src='/rezept/common/img/header/fs_s.gif';
			document.images['fs_m'].src='/rezept/common/img/header/fs_m.gif';
			document.images['fs_l'].src='/rezept/common/img/header/fs_l_on.gif';
		}
	}else{
		document.getElementById('container').style.fontSize='120%';
			document.images['fs_s'].src='/rezept/common/img/header/fs_s.gif';
			document.images['fs_m'].src='/rezept/common/img/header/fs_m.gif';
			document.images['fs_l'].src='/rezept/common/img/header/fs_l_on.gif';
	}
	setCok("lrg");
}

function chu(i){
	if(browserType.IE==true && osType.Win==true){
		document.createStyleSheet('/rezept/common/css/fs/fsm.css');
		if(i!=1){
			document.images['fs_s'].src='/rezept/common/img/header/fs_s.gif';
			document.images['fs_m'].src='/rezept/common/img/header/fs_m_on.gif';
			document.images['fs_l'].src='/rezept/common/img/header/fs_l.gif';
		}
	}else{
		document.getElementById('container').style.fontSize='100%';
		document.images['fs_s'].src='/rezept/common/img/header/fs_s.gif';
		document.images['fs_m'].src='/rezept/common/img/header/fs_m_on.gif';
		document.images['fs_l'].src='/rezept/common/img/header/fs_l.gif';
	}
	setCok("mid");
}
function sho(i){
	if(browserType.IE==true && osType.Win==true){
		document.createStyleSheet('/rezept/common/css/fs/fss.css');
		if(i!=1){
			document.images['fs_s'].src='/rezept/common/img/header/fs_s_on.gif';
			document.images['fs_m'].src='/rezept/common/img/header/fs_m.gif';
			document.images['fs_l'].src='/rezept/common/img/header/fs_l.gif';
		}
	}else{
		document.getElementById('container').style.fontSize='80%';
			document.images['fs_s'].src='/rezept/common/img/header/fs_s_on.gif';
			document.images['fs_m'].src='/rezept/common/img/header/fs_m.gif';
			document.images['fs_l'].src='/rezept/common/img/header/fs_l.gif';
	}
	setCok("sml");
}

function setCok(sizeValue){
	fontSetDate = new Date();
	/*fontSetDate.setTime(fontSetDate.getTime()+(1*24*60*60*1000));*/
	fontSetDate.setTime(fontSetDate.getTime()+(60*1000));
	items = "supfont"+ "=" + sizeValue +";";
	dates = "expires="+fontSetDate.toGMTString();
	document.cookie =  items + dates+";path=/";
}

function nowSize(){
	fCookie = document.cookie+";";
	fsNow =fCookie.indexOf("supfont",0);
	if(fsNow != -1){
		fCookie = fCookie.substring(fsNow,fCookie.length);
		start = fCookie.indexOf("=",0);
		end = fCookie.indexOf(";",start);
		return(fCookie.substring(start+1,end));
	}
	return("");
}

function supportOnSubmit(tmpnum){
	if(tmpnum=="2"){
		document.forms[0].select.value = "2";
	}else{
		document.forms[0].select.value = "55";
	}
	document.forms[0].submit();
}
