//このページのトップへ
var Mac = navigator.appVersion.indexOf('Mac',0) != -1;
var Win = navigator.appVersion.indexOf('Win',0) != -1;
var IE  = navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1;
var NN  = navigator.appName.indexOf("Netscape",0) != -1;
var Moz = navigator.userAgent.indexOf("Gecko") != -1;
var Vmajor = parseInt(navigator.appVersion);	// ex. 3
var Vminor = parseFloat(navigator.appVersion);	// ex. 3.01
var MacIE4 = ((Mac && navigator.appVersion.indexOf('MSIE 4.',0) != -1));
var MacIE3 = ((Mac && navigator.appVersion.indexOf('MSIE 3.',0) != -1));

function getScrollLeft() {
	if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
		return document.body.scrollLeft;
	} else if (window.pageXOffset) {
		return window.pageXOffset;
	}else{
		return 0;
	}
}

function getScrollTop() {
	if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
		return document.body.scrollTop;
	} else if (window.pageYOffset) {
		return window.pageYOffset;
	} else {
		return 0;
	}
}

function getScrollWidth() {
	if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
		return document.body.scrollWidth;
	} else if (window.innerWidth) {
		return window.innerWidth;
	}
	return 0;
}

function getScrollHeight() {
	if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
		return document.body.scrollHeight;
	} else if (window.innerHeight) {
		return window.innerHeight;
	}
	return 0;
}

var pageScrollTimer;

function pageScroll(toX,toY,frms,cuX,cuY) {
 if (pageScrollTimer) clearTimeout(pageScrollTimer);
 if (!toX || toX < 0) toX = 0;
 if (!toY || toY < 0) toY = 0;
 if (!cuX) cuX = 0 + getScrollLeft();
 if (!cuY) cuY = 0 + getScrollTop();
 if (!frms) frms = 6;

 cuX += (toX - getScrollLeft()) / frms; if (cuX < 0) cuX = 0;
 cuY += (toY - getScrollTop()) / frms;  if (cuY < 0) cuY = 0;
 var posX = Math.floor(cuX);
 var posY = Math.floor(cuY);
 window.scrollTo(posX, posY);
 if (posX != toX || posY != toY) {
  pageScrollTimer = setTimeout("pageScroll("+toX+","+toY+","+frms+","+cuX+","+cuY+")",16);
 }
}

function toTop(){
	if (!MacIE3 && !MacIE4 && !NN && window.scrollTo || NN && (Vminor >= 4.75) && window.scrollTo) {
		pageScroll(0,0,6);
	} else {
		location.hash = "top";
	}
}

function fp(){
var flashVer=0, res, error;
for (var i = 8; i>2; i--) {
  eval("try {res = new ActiveXObject('ShockwaveFlash.ShockwaveFlash."+i+"')} catch(e) {error = e};");
  if (res) {
    flashVer = i;
    break;
  }
  else{
  location.href="download.html"
  }
}
}

function WriteSearch(){
document.writeln("<form action='http://a.kensaku-kun.jp/cgi-bin/sk-sho00390/search.cgi' method='get' name='search'>");
document.writeln("<input name='query' type='text' maxlength='256' size='20' class='searchtext'>");
document.writeln("<input type='submit' name='Submit' value='検索'>");
document.writeln("<input type='hidden' name='idxname' value='sk-sho00390'>");
document.writeln("<input type='hidden' name='max' value='20'>");
document.writeln("<input type='hidden' name='result' value='normal'>");
document.writeln("<input type='hidden' name='sort' value='score'>");
document.writeln("</form>");
}


function TopImg(toku){
	if(toku=="load"){
		document.getElementById("title").innerHTML='<img src="images/main.jpg" alt="昭和薬科大学" width="850" height="430" />';
	}
	if(toku=="01"){
		var html='<img src="images/toku01.jpg" alt="昭和薬科大学" width="850" height="406" usemap="#tokucho" />';
		html += '<map name="tokucho">';
		html += '<area shape="rect" coords="552,240,748,265" href="about/faculty/character.html" alt="教育の特長" />';
		html += '<area shape="rect" coords="552,268,748,293" href="about/faculty/marianna.html" alt="聖マリアンナ医科大学と提携" />';
		html += '<area shape="rect" coords="552,298,748,321" href="about/faculty/curriculum2.html" alt="6年制カリキュラム" />';
		html += '</map>';
		document.getElementById("title").innerHTML=html;
	}
	if(toku=="02"){
		var html='<img src="images/toku02.jpg" alt="昭和薬科大学" width="850" height="406" usemap="#tokucho" />';
		html += '<map name="tokucho">';
		html += '<area shape="rect" coords="552,240,748,265" href="about/faculty/character.html" alt="教育の特長" />';
		html += '<area shape="rect" coords="552,268,748,293" href="about/faculty/curriculum.html" alt="6年制教育と卒業後の進路" />';
		html += '<area shape="rect" coords="552,298,748,321" href="about/faculty/marianna.html" alt="聖マリアンナ医科大学と提携" />';
		html += '<area shape="rect" coords="552,326,748,349" href="about/faculty/curriculum2.html" alt="6年制カリキュラム" />';
		html += '</map>';
		document.getElementById("title").innerHTML=html;
	}
	if(toku=="03"){
		var html='<img src="images/toku03.jpg" alt="昭和薬科大学" width="850" height="406" usemap="#tokucho" />';
		html += '<map name="tokucho">';
		html += '<area shape="rect" coords="552,260,748,285" href="about/history.html" alt="沿革" />';
		html += '<area shape="rect" coords="552,288,748,314" href="about/facilities/index.html" alt="大学施設" />';
		html += '<area shape="rect" coords="552,319,748,341" href="about/facilities/garden.html" alt="薬用植物園" />';
		html += '</map>';
		document.getElementById("title").innerHTML=html;
	}
	if(toku=="04"){
		var html='<img src="images/toku04.jpg" alt="昭和薬科大学" width="850" height="406" usemap="#tokucho" />';
		html += '<map name="tokucho">';
		html += '<area shape="rect" coords="552,260,748,285" href="about/history.html" alt="沿革" />';
		html += '<area shape="rect" coords="552,288,748,314" href="about/philosophy.html" alt="建学の精神・本学の理念" />';
		html += '</map>';
		document.getElementById("title").innerHTML=html;
	}
	if(toku=="05"){
		var html='<img src="images/toku05.jpg" alt="昭和薬科大学" width="850" height="406" usemap="#tokucho" />';
		html += '<map name="tokucho">';
		html += '<area shape="rect" coords="552,240,748,265" href="about/faculty/curriculum.html" alt="6年制教育と卒業後の進路" />';
		html += '<area shape="rect" coords="552,268,748,293" href="candidates/life\message.html" alt="在学生からのメッセージ" />';
		html += '<area shape="rect" coords="552,298,748,321" href="#" alt="卒業生からのメッセージ" />';
		html += '<area shape="rect" coords="552,326,748,349" href="#" alt="卒業生・修了生の進路" />';
		html += '</map>';
		document.getElementById("title").innerHTML=html;
	}
}

//コピーライトの年号自動カウント

//------------------------------------------------------------



function year() {  

var data = new Date();  

var now_year = data.getFullYear();  

document.write(now_year);  

}  


//アクセスマップ　印刷ボタン
/*
window.open機能拡張 020828版 + 030329fix
script written by Mugi (mugi@mugi.cc)
*/
_wopen=window.open
function wopen(url,name,opt){
var w,h,c=false,g=null,l,t,o,x=-1,i=0,a=["left","top","width","height","resizable","scrollbars","status","menubar","toolbar","location","directories"]
if(!name)name="";if(!opt)opt=""
if(opt.match(/^(\d+|\*)(,(\d+|\*))+$/)){
do opt=opt.substring(0,x+1)+a[i]+"="+opt.substring(x+1);while((x=opt.indexOf(',',x+a[i++].length))!=-1)
opt=opt.replace(/[^=]+=\*,/g,"")
}
if(opt.match(/image=(true|1)/)){
g=new Image();g.src=url;url="";opt+=",resizable=1"
if(g.width>0&&g.height>0)
opt+=",width="+(w=g.width)+",height="+(h=g.height)
}
if(
(w=opt.match(/width=(\d+)/))&&(w=RegExp.$1)&&
(h=opt.match(/height=(\d+)/))&&(h=RegExp.$1)&&
opt.match(/center=(true|1)/)&&!!(c=true)
)
opt+=",left="+(l=(screen.width-w)/2)+",top="+(t=(screen.height-h)/2)
o=_wopen(url,name,opt)
if(c&&navigator.platform.indexOf("Mac")!=-1)o.moveTo(l,t)
if(g){
o.document.open()
o.document.write(
'<html><head><title>'+g.src.substring(g.src.lastIndexOf('/')+1)+'</title><head><body style=overflow:hidden leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><center><img src="'+g.src+'"'+(w>0&&h>0?' width='+w+' height='+h:
' onload="if(self.innerWidth){self.innerWidth=this.width;self.innerHeight=this.height}else{self.resizeBy(this.width-document.body.clientWidth,this.height-document.body.clientHeight)}"')+'></center></body></html>')
o.document.close()
}
return o
}
window.open=wopen

function newopen(imgname){
	pwin=window.open(imgname,'img1','left=100,top=100,image=1');
	pwin.print();
	pwin.close();
	return false;
}

