var noprint_msg = "";

function eprintJp(){
	var brows = brows_info();
	var pflg = 1;

	if( brows[0] == "IE" ) {
		if(navigator.appVersion.lastIndexOf('Macintosh') == -1) {
			pflg = ( brows[1] >= 5.0 ) ? 1 : 0;
		}
		else {
			pflg = 0;
		}
	}
	else if( brows[0] == "NN" ) {
		pflg = ( brows[1] >= 4.0 ) ? 1 : 0;
	}
	if(pflg) {
		self.print();
	}
	else {
		alert(noprint_msg);
	}
}

function brows_info(){
	var info = new Array(0); 
	var ua = navigator.userAgent;
	if(ua.match(/Opera[\/\s](\d\.\d+)/)){
		info[0] = "OP";
		info[1] = RegExp.$1;
	}
	else if(ua.match(/Safari/)){
		info[0] = "Safari";
		info[1] = 0;
	}
	else if(ua.match(/MSIE (\d\.\d+)/)){
		info[0] = "IE";
		info[1] = RegExp.$1;
	}
	else if(ua.match(/Mozilla\/(4\.\d+)/)){
		info[0] = "NN";
		info[1] = RegExp.$1;
	}
	else if(ua.match(/Netscape6\/(\d\.\d(\.\d)?)/)){
		info[0] = "NN";
		info[1] = RegExp.$1;
	}
	else if(ua.match(/Netscape\/(7[\.\d]+)/)){
		info[0] = "NN";
		info[1] = RegExp.$1;
	}
	else if(ua.match(/Gecko/)){
		info[0] = "Mozilla";
		info[1] = 0;
	}
	else{
		info[0] = "unknown";
		info[1] = 0;
	}
	
	info[1] = parseFloat(info[1]);

	return info;
}

function set_cookie(name,param) {

var c_data = name + "=" + escape(param);
	c_data += "; expires=" + "Thu, 31 Dec 2037 12:00:00 GMT";
	c_data += "; path=/";

	document.cookie = c_data ;
}

function get_cookie(name) {
	var c_data = document.cookie + ";";
	var c_name = name + "=";

	var id_st = c_data.indexOf(c_name);
	var id_en = -1;

	if (id_st != -1 ) {
		id_en = c_data.indexOf(";", id_st);
		c_data = unescape(c_data.substring(id_st + c_name.length, id_en));
	} else {
		c_data = "";
	}

	return c_data;
}

function set_cssType(mode) {
	var cssType = get_cookie("CSSTYPE");
	if ( cssType != mode ) {
		set_cookie("CSSTYPE",mode);
		set_css();
	}
}

var cssType;

function set_css() {
	cssType = get_cookie("CSSTYPE");
	if ( cssType == "" ) {
		cssType = "STANDARD"
	}
	var cssSrc;
	
	if (cssType=="STANDARD") {
		nm1 = 's_on.gif';
		nm2 = 'l_off.gif';
		cssSrc = "fSize.css";
	} else if (cssType=="BIG") {
		nm1 = 's_off.gif';
		nm2 = 'l_on.gif';
		cssSrc = "fSize_b.css";
	}
	var MSG = '/styles/' + cssSrc;
	var IMG1 = '/images/global/' + nm1;
	var IMG2 = '/images/global/' + nm2;
	
	document.getElementById("style").href = MSG;
	document.getElementById('BIGI').setAttribute('src', IMG2);
	document.getElementById('STDI').setAttribute('src', IMG1);

}

//-----------------------------------------------------
// flash
//-----------------------------------------------------

//version
var playerVer = 6;

var getPlayerVer = 0;
var playerFlag = 0;
var plugin = 0;

var win = (navigator.appVersion.indexOf("Win") != -1)? true : false;
var ie = (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0)? true : false;


function setFlash(targetObj){
	document.open();
	
	//check Flash Plugin
	plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

	//check Flash Active X Control
	//Win IE 
	if(navigator.userAgent && ie && win || navigator.userAgent && !plugin){
		//output html
		var htmlSource = "";
		htmlSource += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
		htmlSource +=  'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + playerVer + ',0,00,0"';
		htmlSource += 'width="' + targetObj.width + '" height="' + targetObj.height + '">';
		htmlSource += '<param name="allowScriptAccess" value="sameDomain" />';
		htmlSource += '<param name="movie" value="' + targetObj.data +'" />';
		htmlSource += '<param name="quality" value="high" />';
		htmlSource += '<param name="bgcolor" value="' + targetObj.bgcolor +'" />';
		htmlSource += '<embed src="' + targetObj.data + ' " ' ;
		htmlSource += 'quality="high"' ;
		htmlSource += 'bgcolor="' + targetObj.bgcolor +'"' ;
		htmlSource += 'width="' + targetObj.width +'"' ;
		htmlSource += 'height="' + targetObj.height +'"' ;
		htmlSource += 'allowScriptAccess="sameDomain"' ;
		htmlSource += 'type="application/x-shockwave-flash"' ;
		htmlSource += 'pluginspage="http://www.macromedia.com/go/getflashplayer" />' ;
		htmlSource += '<\/object>';
		document.write(htmlSource);
	}

	//Mac IE 5,NN 3,Safari,Opera
	else{
		getPlayerVer = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1));
		playerFlag = getPlayerVer >= playerVer;
			//output html
			if(playerFlag){
				var htmlSource = "";
				htmlSource += '<object data="' + targetObj.data +'" type="application/x-shockwave-flash" width="' + targetObj.width + '" height="' + targetObj.height + '">';
				htmlSource += '<param name="movie" value="' + targetObj.data +'" />';
				htmlSource += '<param name="quality" value="high" />';
				htmlSource += '<param name="bgcolor" value="' + targetObj.bgcolor +'" />';
				htmlSource += '<\/object>';
				document.write(htmlSource);
			}
			else{
			//output html
				var htmlSource = "";
				htmlSource += '<div style="width:764px; height:290px;">';
				htmlSource += 'This content requires the Adobe Flash Player.';
				htmlSource += '<a href="http://www.adobe.com/go/getflash/" target="_blank">Get Flash<\/a>';
				htmlSource += '<\/div>';
				document.write(htmlSource);
			}
	}
	document.close();
}

//-----------------------------------------------------
// Browser window
//-----------------------------------------------------

function openWindow(url, title, width, height, options, move) {

	if (!!window && url) {

		if (!title) title = "_blank";

		if (!options) options = "toolbar=yes,location=yes,directories=yes,status=no,menubar=yes,scrollbars=yes,resizable=yes,favorites=no";

		var whop = "width="+width+",height="+height+","+options;

		newWin = window.open(url, title, whop);

		newWin.focus();

		if (move != 1) newWin.moveTo(0, 0);

	}

}

function windowCloser(){

	window.close();

}

//-----------------------------------------------------
// Fund Offering (J¥E)
//-----------------------------------------------------
function checkDisplay(ch){
 var obj=document.all && document.all(ch) || document.getElementById && document.getElementById(ch);
     if(obj && obj.style) obj.style.display=
     "none" == obj.style.display ?"" : "none"
}
