/*
##################################################
#This javascript was made on January 31, 2003.
#It is responsible for a MEDAL Co,Ltd.
#Responsibility is not taken although use is free.
##################################################
#css branch method
##################################################
*/
var major = parseInt( navigator.appVersion );

if( navigator.platform.charAt(0)=="M" ){
	//***************MACINTOSH******************//
	if(navigator.appName.charAt(0)=="N"){
		if( major>=5 ){
			document.write("<link href='css/Mac_ns6.css' rel='styleSheet' type='text/css'>");
		}else{
			document.write("<link href='css/Mac_ns.css' rel='styleSheet' type='text/css'>");
		}
	}else{
		document.write("<link href='css/Mac_ie.css' rel='styleSheet' type='text/css'>");
	}
}else{
	//***************WINDOWS********************//
	if( navigator.appName.charAt(0)=="N" ){
		if( major>=5 ){
			document.write("<link href='css/Win_ns6.css' rel='styleSheet' type='text/css'>");
		}else{
			document.write("<link href='css/Win_ns.css' rel='styleSheet' type='text/css'>");
		}
	}else{
		document.write("<link href='css/Win_ie.css' rel='styleSheet' type='text/css'>");
	}
}

/*
###################################
#writing footer method
###################################
*/
function writefooter(){
	this_year = new Date();
	document.write("<font size=\"2\" class=\"t10h12\">Copyright 1997-"+this_year.getFullYear()+".&nbsp;&nbsp;medal Co,Ltd.　All rights reserved.</font>");
}


/*
###################################################################
#open window method
#The value of the argument of windowSize is 'width=***,height=***'
###################################################################
*/
function WindowFeaturesItem( foption ){ //features option.
	var wf = "";
	wf = "toolbar=" + (foption[0] ? "yes" : "no");
	wf += ",location=" + (foption[1] ? "yes" : "no");
	wf += ",directories=" + (foption[2] ? "yes" : "no");
	wf += ",status=" + (foption[3] ? "yes" : "no");
	wf += ",menubar=" + (foption[4] ? "yes" : "no");
	wf += ",scrollbars=" + (foption[5] ? "yes" : "no");
	wf += ",resizable=" + (foption[6] ? "yes" : "no");

	return wf;
}

function openWin( theUrl, windowName, features, windowSize, x, y ){
	var MAC  = (navigator.userAgent.indexOf("Mac")!=-1);
	var IE   = (navigator.appName.charAt(0)=="M");
	var IE45 = (navigator.userAgent.indexOf("MSIE 4.5")!=-1);

	// windowhight is adjusted at the time of Mac ie4.5.
	if( MAC && IE && IE45 ) var adjusth = 2;
	else var adjusth = 0;
	
	var H = parseInt(windowSize.substring(17,20)) + adjusth;
	var winSize = new String( windowSize.substring(0,17) + H ); //String constructor is set up.
	//alert( winSize );

	var f = new Array (); //window features setting.
	for(i=0; i<7; i++){
		f[i] = features;
	}
	var wfeatures = WindowFeaturesItem(f);
	//alert( wfeatures );

	var windowPos = ( "top=" + x + "," + "left=" + y );
	wfeatures += ( "," + winSize + "," + windowPos );
	//alert( wfeatures );

	new_window = window.open( theUrl, windowName, wfeatures ); //window open method.
	//new_window.moveTo( x, y );
}


/*
#################################
#closed window method
#################################
*/
function onErrMacWinClose(){
	closeWin();
	return true;
}

function closeWin(){
	var MAC = (navigator.userAgent.indexOf("Mac")!=-1);
	var IE = (navigator.appName.charAt(0)=="M");
	var COMPATI = (navigator.userAgent.indexOf("compatible") != -1);
	var major = parseInt( navigator.appVersion );
	var IE4X = (IE && COMPATI && (major<=4) && (navigator.userAgent.indexOf("MSIE 4") != -1));

	if( MAC && IE4X ) window.onerror = onErrMacWinClose;
	if( !new_window.closed ) new_window.close();
}

/*
#################################
#return to this file name method.
#################################
*/
///frame ****に表示されているfile名を返す////////////////////////////////
function myfilename(){
	var moji=location.href;
	var item="/"
	var spmoji=moji.split(item);
	var max=spmoji.length;
	//alert(spmoji[max-1]);
	return spmoji[max-1];
}

